diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 07:51:56 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 07:51:56 +0000 |
commit | 34ad6db8b958fdc0d38e122edf753b5326e69b03 (patch) | |
tree | c129b78e36733ba161a2e687349a0eb40d2ec807 /tools/llc/llc.cpp | |
parent | 4c8164813c1be51f6797fda6826bdf3665f2a7d1 (diff) |
- Move CodeModel from a TargetMachine global option to MCCodeGenInfo.
- Introduce JITDefault code model. This tells targets to set different default
code model for JIT. This eliminates the ugly hack in TargetMachine where
code model is changed after construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc/llc.cpp')
-rw-r--r-- | tools/llc/llc.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index f1d4dbcad5..f2c4c27f7d 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -91,6 +91,22 @@ RelocModel("relocation-model", "Relocatable external references, non-relocatable code"), clEnumValEnd)); +static cl::opt<llvm::CodeModel::Model> +CMModel("code-model", + cl::desc("Choose code model"), + cl::init(CodeModel::Default), + cl::values(clEnumValN(CodeModel::Default, "default", + "Target default code model"), + clEnumValN(CodeModel::Small, "small", + "Small code model"), + clEnumValN(CodeModel::Kernel, "kernel", + "Kernel code model"), + clEnumValN(CodeModel::Medium, "medium", + "Medium code model"), + clEnumValN(CodeModel::Large, "large", + "Large code model"), + clEnumValEnd)); + static cl::opt<bool> RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, " @@ -287,8 +303,9 @@ int main(int argc, char **argv) { } std::auto_ptr<TargetMachine> - target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, - FeaturesStr, RelocModel)); + target(TheTarget->createTargetMachine(TheTriple.getTriple(), + MCPU, FeaturesStr, + RelocModel, CMModel)); assert(target.get() && "Could not allocate target machine!"); TargetMachine &Target = *target.get(); |