[llvm-commits] [llvm-gcc-4.2] r135470 - in /llvm-gcc-4.2/trunk/gcc: Makefile.in config/darwin.h config/linux.h config/netbsd-elf.h config/openbsd.h config/sol2.h llvm-backend.cpp
Evan Cheng
evan.cheng at apple.com
Mon Jul 18 23:38:44 PDT 2011
Author: evancheng
Date: Tue Jul 19 01:38:44 2011
New Revision: 135470
URL: http://llvm.org/viewvc/llvm-project?rev=135470&view=rev
Log:
Match createTargetMachine API change.
Modified:
llvm-gcc-4.2/trunk/gcc/Makefile.in
llvm-gcc-4.2/trunk/gcc/config/darwin.h
llvm-gcc-4.2/trunk/gcc/config/linux.h
llvm-gcc-4.2/trunk/gcc/config/netbsd-elf.h
llvm-gcc-4.2/trunk/gcc/config/openbsd.h
llvm-gcc-4.2/trunk/gcc/config/sol2.h
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
Modified: llvm-gcc-4.2/trunk/gcc/Makefile.in
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/Makefile.in?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/Makefile.in (original)
+++ llvm-gcc-4.2/trunk/gcc/Makefile.in Tue Jul 19 01:38:44 2011
@@ -1188,9 +1188,9 @@
## and asm printers actually get linked into libllvmgcc<stage>.dylib.
LLVMTARGETSYMBOLS := \
_LLVMInitializeARMTarget _LLVMInitializeARMAsmPrinter \
- _LLVMInitializeARMMCAsmInfo \
+ _LLVMInitializeARMMCAsmInfo _LLVMInitializeARMMCRegisterInfo \
_LLVMInitializeX86Target _LLVMInitializeX86AsmPrinter \
- _LLVMInitializeX86MCAsmInfo \
+ _LLVMInitializeX86MCAsmInfo _LLVMInitializeX86MCRegisterInfo \
endif
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Tue Jul 19 01:38:44 2011
@@ -1486,17 +1486,27 @@
/* Darwin X86-64 only supports PIC code generation. */
#if defined (TARGET_386)
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if ((TARGET_64BIT) || flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else if (!MACHO_DYNAMIC_NO_PIC_P) \
- argvec.push_back ("--relocation-model=static")
+ RelocModel = Reloc::Static;
#elif defined (TARGET_ARM)
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else if (!MACHO_DYNAMIC_NO_PIC_P) \
- argvec.push_back ("--relocation-model=static"); \
+ RelocModel = Reloc::Static;
+#else /* !TARGET_386 && !TARGET_ARM */
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
+ if (flag_pic) \
+ RelocModel = Reloc::PIC_; \
+ else if (!MACHO_DYNAMIC_NO_PIC_P) \
+ RelocModel = Reloc::Static;
+#endif /* !TARGET_386 && !TARGET_ARM */
+
+#if defined (TARGET_ARM)
+#define LLVM_SET_TARGET_OPTIONS(argvec) \
if (darwin_iphoneos_version_min) \
{ \
const char *p = darwin_iphoneos_version_min; \
@@ -1507,13 +1517,7 @@
argvec.push_back("--arm-reserve-r9"); \
} \
}
-#else /* !TARGET_386 && !TARGET_ARM */
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
- if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
- else if (!MACHO_DYNAMIC_NO_PIC_P) \
- argvec.push_back ("--relocation-model=static")
-#endif /* !TARGET_386 && !TARGET_ARM */
+#endif /* TARGET_ARM */
#endif
/* LLVM LOCAL end */
Modified: llvm-gcc-4.2/trunk/gcc/config/linux.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/linux.h?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/linux.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/linux.h Tue Jul 19 01:38:44 2011
@@ -130,11 +130,11 @@
#ifdef ENABLE_LLVM
/* Yes, we're supporting PIC codegen for linux targets! */
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else \
- argvec.push_back ("--relocation-model=static");
+ RelocModel = Reloc::Static;
#endif
/* LLVM LOCAL end */
Modified: llvm-gcc-4.2/trunk/gcc/config/netbsd-elf.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/netbsd-elf.h?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/netbsd-elf.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/netbsd-elf.h Tue Jul 19 01:38:44 2011
@@ -97,11 +97,11 @@
#ifdef ENABLE_LLVM
/* Yes, we're supporting PIC codegen for NetBSD targets! */
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else \
- argvec.push_back ("--relocation-model=static");
+ RelocModel = Reloc::Static;
#endif
/* LLVM LOCAL end */
Modified: llvm-gcc-4.2/trunk/gcc/config/openbsd.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/openbsd.h?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/openbsd.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/openbsd.h Tue Jul 19 01:38:44 2011
@@ -343,11 +343,11 @@
#ifdef ENABLE_LLVM
/* Yes, we're supporting PIC codegen for OpenBSD targets! */
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else \
- argvec.push_back ("--relocation-model=static");
+ RelocModel = Reloc::Static;
#endif
Modified: llvm-gcc-4.2/trunk/gcc/config/sol2.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/sol2.h?rev=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/sol2.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/sol2.h Tue Jul 19 01:38:44 2011
@@ -248,10 +248,11 @@
#ifdef ENABLE_LLVM
/* Supporting PIC codegen for solaris targets */
-#define LLVM_SET_TARGET_OPTIONS(argvec) \
+#define LLVM_SET_RELOC_MODEL(RelocModel) \
if (flag_pic) \
- argvec.push_back ("--relocation-model=pic"); \
+ RelocModel = Reloc::PIC_; \
else \
- argvec.push_back ("--relocation-model=static");
+ RelocModel = Reloc::Static;
+
#endif
/* LLVM LOCAL end */
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=135470&r1=135469&r2=135470&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Jul 19 01:38:44 2011
@@ -35,6 +35,7 @@
#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/CodeGen/RegAllocRegistry.h"
+#include "llvm/MC/MCCodeGenInfo.h"
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetLibraryInfo.h"
@@ -381,6 +382,7 @@
Declare(LLVM_TARGET_NAME, TargetInfo);
Declare(LLVM_TARGET_NAME, Target);
Declare(LLVM_TARGET_NAME, MCAsmInfo);
+ Declare(LLVM_TARGET_NAME, MCRegisterInfo);
Declare(LLVM_TARGET_NAME, AsmPrinter);
#undef Declare
#undef Declare2
@@ -406,10 +408,13 @@
DoInit(LLVM_TARGET_NAME, TargetInfo);
DoInit(LLVM_TARGET_NAME, Target);
DoInit(LLVM_TARGET_NAME, MCAsmInfo);
+ DoInit(LLVM_TARGET_NAME, MCRegisterInfo);
DoInit(LLVM_TARGET_NAME, AsmPrinter);
#undef DoInit
#undef DoInit2
+ Reloc::Model RelocModel = Reloc::Default;
+
// Initialize LLVM options.
std::vector<const char*> Args;
Args.push_back(progname); // program name
@@ -428,6 +433,9 @@
#ifdef LLVM_SET_IMPLICIT_FLOAT
LLVM_SET_IMPLICIT_FLOAT(flag_no_implicit_float)
#endif
+#ifdef LLVM_SET_RELOC_MODEL
+ LLVM_SET_RELOC_MODEL(RelocModel);
+#endif
if (time_report)
Args.push_back("--time-passes");
@@ -552,7 +560,8 @@
Features.AddFeature(MAttrs[i]);
FeatureStr = Features.getString();
- TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr);
+ TheTarget = TME->createTargetMachine(TargetTriple, CPU, FeatureStr,
+ RelocModel);
TheTarget->setMCUseLoc(false);
TheTarget->setMCUseCFI(false);
assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN);
More information about the llvm-commits
mailing list