[llvm-commits] [llvm-gcc-4.2] r135588 - in /llvm-gcc-4.2/trunk/gcc: config/i386/i386.h llvm-backend.cpp
Evan Cheng
evan.cheng at apple.com
Wed Jul 20 09:03:49 PDT 2011
Author: evancheng
Date: Wed Jul 20 11:03:49 2011
New Revision: 135588
URL: http://llvm.org/viewvc/llvm-project?rev=135588&view=rev
Log:
Unbreak llvm-c build.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=135588&r1=135587&r2=135588&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Wed Jul 20 11:03:49 2011
@@ -3938,28 +3938,30 @@
#define LLVM_CANONICAL_ADDRESS_CONSTRAINTS "im"
/* Propagate code model setting to backend */
+#define LLVM_SET_CODE_MODEL(CMModel) \
+ switch (ix86_cmodel) { \
+ default: \
+ sorry ("code model %<%s%> not supported yet", \
+ ix86_cmodel_string); \
+ break; \
+ case CM_SMALL: \
+ case CM_SMALL_PIC: \
+ CMModel = llvm::CodeModel::Small; \
+ break; \
+ case CM_KERNEL: \
+ CMModel = llvm::CodeModel::Kernel; \
+ break; \
+ case CM_MEDIUM: \
+ case CM_MEDIUM_PIC: \
+ CMModel = llvm::CodeModel::Medium; \
+ break; \
+ case CM_32: \
+ CMModel = llvm::CodeModel::Large; \
+ break; \
+ }
+
#define LLVM_SET_MACHINE_OPTIONS(argvec) \
do { \
- switch (ix86_cmodel) { \
- default: \
- sorry ("code model %<%s%> not supported yet", \
- ix86_cmodel_string); \
- break; \
- case CM_SMALL: \
- case CM_SMALL_PIC: \
- argvec.push_back("--code-model=small"); \
- break; \
- case CM_KERNEL: \
- argvec.push_back("--code-model=kernel"); \
- break; \
- case CM_MEDIUM: \
- case CM_MEDIUM_PIC: \
- argvec.push_back("--code-model=medium"); \
- break; \
- case CM_32: \
- argvec.push_back("--code-model=default"); \
- break; \
- } \
/* A value of 3 in flag_omit_frame_pointer implies \
omitting leaf frame pointers only. */ \
if (flag_omit_frame_pointer == 3) \
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=135588&r1=135587&r2=135588&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Wed Jul 20 11:03:49 2011
@@ -414,6 +414,7 @@
#undef DoInit2
Reloc::Model RelocModel = Reloc::Default;
+ CodeModel::Model CMModel = CodeModel::Default;
// Initialize LLVM options.
std::vector<const char*> Args;
@@ -436,6 +437,9 @@
#ifdef LLVM_SET_RELOC_MODEL
LLVM_SET_RELOC_MODEL(RelocModel);
#endif
+#ifdef LLVM_SET_CODE_MODEL
+ LLVM_SET_CODE_MODEL(CMModel);
+#endif
if (time_report)
Args.push_back("--time-passes");
@@ -561,7 +565,7 @@
FeatureStr = Features.getString();
TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr,
- RelocModel);
+ RelocModel, CMModel);
TheTarget->setMCUseLoc(false);
TheTarget->setMCUseCFI(false);
assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN);
More information about the llvm-commits
mailing list