diff options
Diffstat (limited to 'lib/Target/CBackend')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 4 | ||||
-rw-r--r-- | lib/Target/CBackend/CTargetMachine.h | 3 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 1f6b900597..2cdf30f0d6 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -27,6 +27,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" +#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GetElementPtrTypeIterator.h" @@ -40,6 +41,9 @@ using namespace llvm; namespace { + // Register the target. + RegisterTarget<CTargetMachine> X("c", "C backend"); + /// NameAllUsedStructs - This pass inserts names for any unnamed structure /// types that are used by the program. /// diff --git a/lib/Target/CBackend/CTargetMachine.h b/lib/Target/CBackend/CTargetMachine.h index 97f880d2fd..aa672fc6ca 100644 --- a/lib/Target/CBackend/CTargetMachine.h +++ b/lib/Target/CBackend/CTargetMachine.h @@ -25,6 +25,9 @@ struct CTargetMachine : public TargetMachine { // This is the only thing that actually does anything here. virtual bool addPassesToEmitAssembly(PassManager &PM, std::ostream &Out); + + // This class always works, but shouldn't be the default in most cases. + static unsigned getModuleMatchQuality(const Module &M) { return 1; } }; } // End llvm namespace diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 1f6b900597..2cdf30f0d6 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -27,6 +27,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Transforms/Scalar.h" +#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/CFG.h" #include "llvm/Support/GetElementPtrTypeIterator.h" @@ -40,6 +41,9 @@ using namespace llvm; namespace { + // Register the target. + RegisterTarget<CTargetMachine> X("c", "C backend"); + /// NameAllUsedStructs - This pass inserts names for any unnamed structure /// types that are used by the program. /// |