From: Eric Christopher Date: Mon, 4 Aug 2014 16:40:55 +0000 (+0000) Subject: Add a dummy subtarget to the CPP backend target machine. This will X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=986a9fa1b91d2ab0e0e11fb1dc5d05fa2e1a4a0d 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 --- diff --git a/lib/Target/CppBackend/CPPTargetMachine.h b/lib/Target/CppBackend/CPPTargetMachine.h index 673ade78a94..2d58e528d7d 100644 --- a/lib/Target/CppBackend/CPPTargetMachine.h +++ b/lib/Target/CppBackend/CPPTargetMachine.h @@ -16,24 +16,30 @@ #include "llvm/IR/DataLayout.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetSubtargetInfo.h" namespace llvm { class formatted_raw_ostream; +class CPPSubtarget : public TargetSubtargetInfo { +}; + struct CPPTargetMachine : public TargetMachine { CPPTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) - : TargetMachine(T, TT, CPU, FS, Options) {} + : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {} +private: + CPPSubtarget Subtarget; +public: + const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; } bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out, CodeGenFileType FileType, bool DisableVerify, AnalysisID StartAfter, AnalysisID StopAfter) override; - - const DataLayout *getDataLayout() const override { return nullptr; } }; extern Target TheCppBackendTarget;