summaryrefslogtreecommitdiff
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-20 07:51:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-20 07:51:56 +0000
commit34ad6db8b958fdc0d38e122edf753b5326e69b03 (patch)
treec129b78e36733ba161a2e687349a0eb40d2ec807 /include/llvm/MC
parent4c8164813c1be51f6797fda6826bdf3665f2a7d1 (diff)
downloadllvm-34ad6db8b958fdc0d38e122edf753b5326e69b03.tar.gz
llvm-34ad6db8b958fdc0d38e122edf753b5326e69b03.tar.bz2
llvm-34ad6db8b958fdc0d38e122edf753b5326e69b03.tar.xz
- 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 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCCodeGenInfo.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/MC/MCCodeGenInfo.h b/include/llvm/MC/MCCodeGenInfo.h
index 908922a253..9e72ece6e3 100644
--- a/include/llvm/MC/MCCodeGenInfo.h
+++ b/include/llvm/MC/MCCodeGenInfo.h
@@ -16,20 +16,33 @@
#define LLVM_MC_MCCODEGENINFO_H
namespace llvm {
+
// Relocation model types.
namespace Reloc {
enum Model { Default, Static, PIC_, DynamicNoPIC };
}
+ // Code model types.
+ namespace CodeModel {
+ enum Model { Default, JITDefault, Small, Kernel, Medium, Large };
+ }
+
class MCCodeGenInfo {
/// RelocationModel - Relocation model: statcic, pic, etc.
///
Reloc::Model RelocationModel;
+ /// CMModel - Code model.
+ ///
+ CodeModel::Model CMModel;
+
public:
- void InitMCCodeGenInfo(Reloc::Model RM = Reloc::Default);
+ void InitMCCodeGenInfo(Reloc::Model RM = Reloc::Default,
+ CodeModel::Model CM = CodeModel::Default);
Reloc::Model getRelocationModel() const { return RelocationModel; }
+
+ CodeModel::Model getCodeModel() const { return CMModel; }
};
} // namespace llvm