llvm.org GIT mirror llvm / adb0ce8
[XCore] 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@292988 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Zelenko 3 years ago
5 changed file(s) with 53 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "XCoreMCTargetDesc.h"
1413 #include "InstPrinter/XCoreInstPrinter.h"
15 #include "XCoreMCAsmInfo.h"
14 #include "MCTargetDesc/XCoreMCAsmInfo.h"
15 #include "MCTargetDesc/XCoreMCTargetDesc.h"
1616 #include "XCoreTargetStreamer.h"
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/MC/MCDwarf.h"
1719 #include "llvm/MC/MCInstrInfo.h"
1820 #include "llvm/MC/MCRegisterInfo.h"
1921 #include "llvm/MC/MCSubtargetInfo.h"
22 #include "llvm/Support/CodeGen.h"
2023 #include "llvm/Support/ErrorHandling.h"
2124 #include "llvm/Support/FormattedStream.h"
25 #include "llvm/Support/raw_ostream.h"
2226 #include "llvm/Support/TargetRegistry.h"
2327
2428 using namespace llvm;
7882 }
7983
8084 XCoreTargetStreamer::XCoreTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
81 XCoreTargetStreamer::~XCoreTargetStreamer() {}
85
86 XCoreTargetStreamer::~XCoreTargetStreamer() = default;
8287
8388 namespace {
8489
8590 class XCoreTargetAsmStreamer : public XCoreTargetStreamer {
8691 formatted_raw_ostream &OS;
92
8793 public:
8894 XCoreTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
95
8996 void emitCCTopData(StringRef Name) override;
9097 void emitCCTopFunction(StringRef Name) override;
9198 void emitCCBottomData(StringRef Name) override;
9299 void emitCCBottomFunction(StringRef Name) override;
93100 };
101
102 } // end anonymous namespace
94103
95104 XCoreTargetAsmStreamer::XCoreTargetAsmStreamer(MCStreamer &S,
96105 formatted_raw_ostream &OS)
110119
111120 void XCoreTargetAsmStreamer::emitCCBottomFunction(StringRef Name) {
112121 OS << "\t.cc_bottom " << Name << ".function\n";
113 }
114122 }
115123
116124 static MCTargetStreamer *createTargetAsmStreamer(MCStreamer &S,
1313 #ifndef LLVM_LIB_TARGET_XCORE_MCTARGETDESC_XCOREMCTARGETDESC_H
1414 #define LLVM_LIB_TARGET_XCORE_MCTARGETDESC_XCOREMCTARGETDESC_H
1515
16 #include "llvm/Support/DataTypes.h"
16 namespace llvm {
1717
18 namespace llvm {
1918 class Target;
19
2020 Target &getTheXCoreTarget();
2121
22 } // End llvm namespace
22 } // end namespace llvm
2323
2424 // Defines symbolic names for XCore registers. This defines a mapping from
2525 // register name to register number.
3535 #define GET_SUBTARGETINFO_ENUM
3636 #include "XCoreGenSubtargetInfo.inc"
3737
38 #endif
38 #endif // LLVM_LIB_TARGET_XCORE_MCTARGETDESC_XCOREMCTARGETDESC_H
1313 #ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
1414 #define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
1515
16 #include "llvm/CodeGen/MachineBasicBlock.h"
1617 #include "llvm/CodeGen/MachineFrameInfo.h"
1718 #include "llvm/CodeGen/MachineFunction.h"
19 #include
20 #include
1821 #include
1922
2023 namespace llvm {
2124
22 // Forward declarations
23 class Function;
24
2525 /// XCoreFunctionInfo - This class is derived from MachineFunction private
2626 /// XCore target-specific information for each MachineFunction.
2727 class XCoreFunctionInfo : public MachineFunctionInfo {
28 virtual void anchor();
29 bool LRSpillSlotSet;
28 bool LRSpillSlotSet = false;
3029 int LRSpillSlot;
31 bool FPSpillSlotSet;
30 bool FPSpillSlotSet = false;
3231 int FPSpillSlot;
33 bool EHSpillSlotSet;
32 bool EHSpillSlotSet = false;
3433 int EHSpillSlot[2];
3534 unsigned ReturnStackOffset;
36 bool ReturnStackOffsetSet;
37 int VarArgsFrameIndex;
38 mutable int CachedEStackSize;
35 bool ReturnStackOffsetSet = false;
36 int VarArgsFrameIndex = 0;
37 mutable int CachedEStackSize = -1;
3938 std::vector>
4039 SpillLabels;
4140
41 virtual void anchor();
42
4243 public:
43 XCoreFunctionInfo() :
44 LRSpillSlotSet(false),
45 FPSpillSlotSet(false),
46 EHSpillSlotSet(false),
47 ReturnStackOffsetSet(false),
48 VarArgsFrameIndex(0),
49 CachedEStackSize(-1) {}
44 XCoreFunctionInfo() = default;
5045
51 explicit XCoreFunctionInfo(MachineFunction &MF) :
52 LRSpillSlotSet(false),
53 FPSpillSlotSet(false),
54 EHSpillSlotSet(false),
55 ReturnStackOffsetSet(false),
56 VarArgsFrameIndex(0),
57 CachedEStackSize(-1) {}
46 explicit XCoreFunctionInfo(MachineFunction &MF) {}
5847
59 ~XCoreFunctionInfo() {}
48 ~XCoreFunctionInfo() override = default;
6049
6150 void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
6251 int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
10089 return SpillLabels;
10190 }
10291 };
103 } // End llvm namespace
10492
105 #endif
93 } // end namespace llvm
94
95 #endif // LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
99 //
1010 //===----------------------------------------------------------------------===//
1111
12 #include "MCTargetDesc/XCoreMCTargetDesc.h"
13 #include "XCore.h"
1214 #include "XCoreTargetMachine.h"
1315 #include "XCoreTargetObjectFile.h"
1416 #include "XCoreTargetTransformInfo.h"
15 #include "XCore.h"
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/STLExtras.h"
19 #include "llvm/Analysis/TargetTransformInfo.h"
1620 #include "llvm/CodeGen/Passes.h"
1721 #include "llvm/CodeGen/TargetPassConfig.h"
18 #include "llvm/IR/Module.h"
19 #include "llvm/IR/LegacyPassManager.h"
22 #include "llvm/Support/CodeGen.h"
2023 #include "llvm/Support/TargetRegistry.h"
24
2125 using namespace llvm;
2226
2327 static Reloc::Model getEffectiveRelocModel(Optional RM) {
3741 : LLVMTargetMachine(
3842 T, "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32",
3943 TT, CPU, FS, Options, getEffectiveRelocModel(RM), CM, OL),
40 TLOF(make_unique()),
44 TLOF(llvm::make_unique()),
4145 Subtarget(TT, CPU, FS, *this) {
4246 initAsmInfo();
4347 }
4448
45 XCoreTargetMachine::~XCoreTargetMachine() {}
49 XCoreTargetMachine::~XCoreTargetMachine() = default;
4650
4751 namespace {
52
4853 /// XCore Code Generator Pass Configuration Options.
4954 class XCorePassConfig : public TargetPassConfig {
5055 public:
6065 bool addInstSelector() override;
6166 void addPreEmitPass() override;
6267 };
63 } // namespace
68
69 } // end anonymous namespace
6470
6571 TargetPassConfig *XCoreTargetMachine::createPassConfig(PassManagerBase &PM) {
6672 return new XCorePassConfig(this, PM);
1414 #define LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
1515
1616 #include "XCoreSubtarget.h"
17 #include "llvm/Analysis/TargetTransformInfo.h"
18 #include "llvm/ADT/Optional.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/CodeGen.h"
1721 #include "llvm/Target/TargetMachine.h"
22 #include
1823
1924 namespace llvm {
2025
2126 class XCoreTargetMachine : public LLVMTargetMachine {
2227 std::unique_ptr TLOF;
2328 XCoreSubtarget Subtarget;
29
2430 public:
2531 XCoreTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
2632 StringRef FS, const TargetOptions &Options,
3743 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
3844
3945 TargetIRAnalysis getTargetIRAnalysis() override;
46
4047 TargetLoweringObjectFile *getObjFileLowering() const override {
4148 return TLOF.get();
4249 }
4451
4552 } // end namespace llvm
4653
47 #endif
54 #endif // LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H