Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 88afd08

Browse files
committed
[ARM] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293348 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bf98c57 commit 88afd08

11 files changed

+300
-173
lines changed

lib/Target/ARM/ARMConstantPoolValue.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313

1414
#include "ARMConstantPoolValue.h"
1515
#include "llvm/ADT/FoldingSet.h"
16+
#include "llvm/ADT/StringRef.h"
1617
#include "llvm/CodeGen/MachineBasicBlock.h"
1718
#include "llvm/IR/Constant.h"
1819
#include "llvm/IR/Constants.h"
1920
#include "llvm/IR/GlobalValue.h"
2021
#include "llvm/IR/Type.h"
22+
#include "llvm/Support/Casting.h"
23+
#include "llvm/Support/Compiler.h"
24+
#include "llvm/Support/ErrorHandling.h"
2125
#include "llvm/Support/raw_ostream.h"
22-
#include <cstdlib>
26+
2327
using namespace llvm;
2428

2529
//===----------------------------------------------------------------------===//
@@ -44,7 +48,7 @@ ARMConstantPoolValue::ARMConstantPoolValue(LLVMContext &C, unsigned id,
4448
LabelId(id), Kind(kind), PCAdjust(PCAdj), Modifier(modifier),
4549
AddCurrentAddress(addCurrentAddress) {}
4650

47-
ARMConstantPoolValue::~ARMConstantPoolValue() {}
51+
ARMConstantPoolValue::~ARMConstantPoolValue() = default;
4852

4953
StringRef ARMConstantPoolValue::getModifierText() const {
5054
switch (Modifier) {

lib/Target/ARM/ARMConstantPoolValue.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
#ifndef LLVM_LIB_TARGET_ARM_ARMCONSTANTPOOLVALUE_H
1515
#define LLVM_LIB_TARGET_ARM_ARMCONSTANTPOOLVALUE_H
1616

17+
#include "llvm/ADT/StringRef.h"
1718
#include "llvm/CodeGen/MachineConstantPool.h"
1819
#include "llvm/Support/Casting.h"
19-
#include "llvm/Support/ErrorHandling.h"
20-
#include <cstddef>
20+
#include <string>
21+
#include <vector>
2122

2223
namespace llvm {
2324

@@ -29,6 +30,7 @@ class LLVMContext;
2930
class MachineBasicBlock;
3031

3132
namespace ARMCP {
33+
3234
enum ARMCPKind {
3335
CPValue,
3436
CPExtSymbol,
@@ -47,7 +49,8 @@ namespace ARMCP {
4749
SECREL, /// Section Relative (Windows TLS)
4850
SBREL, /// Static Base Relative (RWPI)
4951
};
50-
}
52+
53+
} // end namespace ARMCP
5154

5255
/// ARMConstantPoolValue - ARM specific constantpool value. This is used to
5356
/// represent PC-relative displacement between the address of the load
@@ -169,9 +172,11 @@ class ARMConstantPoolConstant : public ARMConstantPoolValue {
169172

170173
const GlobalValue *getGV() const;
171174
const BlockAddress *getBlockAddress() const;
175+
172176
const GlobalVariable *getPromotedGlobal() const {
173177
return dyn_cast_or_null<GlobalVariable>(GVar);
174178
}
179+
175180
const Constant *getPromotedGlobalInit() const {
176181
return CVal;
177182
}
@@ -186,6 +191,7 @@ class ARMConstantPoolConstant : public ARMConstantPoolValue {
186191
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override;
187192

188193
void print(raw_ostream &O) const override;
194+
189195
static bool classof(const ARMConstantPoolValue *APV) {
190196
return APV->isGlobalValue() || APV->isBlockAddress() || APV->isLSDA() ||
191197
APV->isPromotedGlobal();
@@ -267,6 +273,6 @@ class ARMConstantPoolMBB : public ARMConstantPoolValue {
267273
}
268274
};
269275

270-
} // End llvm namespace
276+
} // end namespace llvm
271277

272-
#endif
278+
#endif // LLVM_LIB_TARGET_ARM_ARMCONSTANTPOOLVALUE_H

0 commit comments

Comments
 (0)