summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2010-07-22 05:58:53 +0000
committerReid Kleckner <reid@kleckner.net>2010-07-22 05:58:53 +0000
commitd85e3c5a86a65bb19e7484db1e4cd905c48dd2f3 (patch)
tree23e271048f98d946a26a67c842d86d2acc80fb97 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parentbd81bff672ceddacc20a1794edac59eea8bf2af3 (diff)
downloadbcm5719-llvm-d85e3c5a86a65bb19e7484db1e4cd905c48dd2f3.tar.gz
bcm5719-llvm-d85e3c5a86a65bb19e7484db1e4cd905c48dd2f3.zip
Initial modifications to MCAssembler and TargetMachine for the MCJIT.
Patch by Olivier Meurant! llvm-svn: 109080
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index bf3137e4953..fd102416d89 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -216,6 +216,24 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM,
return false; // success!
}
+/// addPassesToEmitMC - Add passes to the specified pass manager to get
+/// machine code emitted with the MCJIT. This method returns true if machine
+/// code is not supported. It fills the MCContext Ctx pointer which can be
+/// used to build custom MCStreamer.
+///
+bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
+ MCContext *&Ctx,
+ CodeGenOpt::Level OptLevel,
+ bool DisableVerify) {
+ // Add common CodeGen passes.
+ if (addCommonCodeGenPasses(PM, OptLevel, DisableVerify, Ctx))
+ return true;
+ // Make sure the code model is set.
+ setCodeModelForJIT();
+
+ return false; // success!
+}
+
static void printNoVerify(PassManagerBase &PM, const char *Banner) {
if (PrintMachineCode)
PM.add(createMachineFunctionPrinterPass(dbgs(), Banner));
OpenPOWER on IntegriCloud