llvm.org GIT mirror llvm / 986a9fa
Add a dummy subtarget to the CPP backend target machine. This will allow us to forward all of the standard TargetMachine calls to the subtarget and still return null as we were before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214727 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 6 years ago
1 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
1515
1616 #include "llvm/IR/DataLayout.h"
1717 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetSubtargetInfo.h"
1819
1920 namespace llvm {
2021
2122 class formatted_raw_ostream;
23
24 class CPPSubtarget : public TargetSubtargetInfo {
25 };
2226
2327 struct CPPTargetMachine : public TargetMachine {
2428 CPPTargetMachine(const Target &T, StringRef TT,
2529 StringRef CPU, StringRef FS, const TargetOptions &Options,
2630 Reloc::Model RM, CodeModel::Model CM,
2731 CodeGenOpt::Level OL)
28 : TargetMachine(T, TT, CPU, FS, Options) {}
32 : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {}
33 private:
34 CPPSubtarget Subtarget;
2935
36 public:
37 const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; }
3038 bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
3139 CodeGenFileType FileType, bool DisableVerify,
3240 AnalysisID StartAfter,
3341 AnalysisID StopAfter) override;
34
35 const DataLayout *getDataLayout() const override { return nullptr; }
3642 };
3743
3844 extern Target TheCppBackendTarget;