summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-01-01 10:31:22 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-01-01 10:31:22 +0000
commita16c51cee9225a354c999dd1076d5dba2aa79807 (patch)
treedba00119388b84f9f44e6ec5e9129f807fd79ca3 /lib/CodeGen/LLVMTargetMachine.cpp
parent40a6fcdb85efd93fe0e36c9552cfb0b18b5eacd6 (diff)
downloadFreeBSD-src-a16c51cee9225a354c999dd1076d5dba2aa79807.zip
FreeBSD-src-a16c51cee9225a354c999dd1076d5dba2aa79807.tar.gz
Update LLVM to 92395.
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index 297dd31..d5fd051 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -83,7 +83,18 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T,
AsmInfo = T.createAsmInfo(TargetTriple);
}
+// Set the default code model for the JIT for a generic target.
+// FIXME: Is small right here? or .is64Bit() ? Large : Small?
+void
+LLVMTargetMachine::setCodeModelForJIT() {
+ setCodeModel(CodeModel::Small);
+}
+// Set the default code model for static compilation for a generic target.
+void
+LLVMTargetMachine::setCodeModelForStatic() {
+ setCodeModel(CodeModel::Small);
+}
FileModel::Model
LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
@@ -130,6 +141,9 @@ bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
MachineCodeEmitter *MCE,
CodeGenOpt::Level OptLevel) {
+ // Make sure the code model is set.
+ setCodeModelForStatic();
+
if (MCE)
addSimpleCodeEmitter(PM, OptLevel, *MCE);
if (PrintEmittedAsm)
@@ -146,6 +160,9 @@ bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
JITCodeEmitter *JCE,
CodeGenOpt::Level OptLevel) {
+ // Make sure the code model is set.
+ setCodeModelForJIT();
+
if (JCE)
addSimpleCodeEmitter(PM, OptLevel, *JCE);
if (PrintEmittedAsm)
@@ -162,6 +179,9 @@ bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
ObjectCodeEmitter *OCE,
CodeGenOpt::Level OptLevel) {
+ // Make sure the code model is set.
+ setCodeModelForStatic();
+
if (OCE)
addSimpleCodeEmitter(PM, OptLevel, *OCE);
if (PrintEmittedAsm)
@@ -181,6 +201,9 @@ bool LLVMTargetMachine::addPassesToEmitFileFinish(PassManagerBase &PM,
bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM,
MachineCodeEmitter &MCE,
CodeGenOpt::Level OptLevel) {
+ // Make sure the code model is set.
+ setCodeModelForJIT();
+
// Add common CodeGen passes.
if (addCommonCodeGenPasses(PM, OptLevel))
return true;
@@ -203,6 +226,9 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM,
bool LLVMTargetMachine::addPassesToEmitMachineCode(PassManagerBase &PM,
JITCodeEmitter &JCE,
CodeGenOpt::Level OptLevel) {
+ // Make sure the code model is set.
+ setCodeModelForJIT();
+
// Add common CodeGen passes.
if (addCommonCodeGenPasses(PM, OptLevel))
return true;
OpenPOWER on IntegriCloud