llvm.org GIT mirror llvm / b1e1180
1. Use SubtargetFeatures in llc/lli. 2. Propagate feature "string" to all targets. 3. Implement use of SubtargetFeatures in PowerPCTargetSubtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23192 91177308-0d34-0410-b5e6-96231b3b80d8 Jim Laskey 13 years ago
27 changed file(s) with 192 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
3232 /* End PBXBuildStyle section */
3333
3434 /* Begin PBXFileReference section */
35 CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtargetFeature.h; sourceTree = ""; };
36 CF9BCD1508C75070001E7011 /* SubtargetFeature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtargetFeature.cpp; sourceTree = ""; };
3537 DE66EC5B08ABE86900323D32 /* AsmWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = AsmWriter.cpp; path = ../lib/VMCore/AsmWriter.cpp; sourceTree = SOURCE_ROOT; };
3638 DE66EC5C08ABE86A00323D32 /* BasicBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = BasicBlock.cpp; path = ../lib/VMCore/BasicBlock.cpp; sourceTree = SOURCE_ROOT; };
3739 DE66EC5D08ABE86A00323D32 /* ConstantFolding.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ConstantFolding.cpp; path = ../lib/VMCore/ConstantFolding.cpp; sourceTree = SOURCE_ROOT; };
12481250 DE66EFC908ABEE5F00323D32 /* SparcV9 */,
12491251 DE66F09308ABEE6000323D32 /* X86 */,
12501252 DE66EF1008ABEE5E00323D32 /* MRegisterInfo.cpp */,
1253 CF9BCD1508C75070001E7011 /* SubtargetFeature.cpp */,
12511254 DE66F08A08ABEE6000323D32 /* Target.td */,
12521255 DE66F08B08ABEE6000323D32 /* TargetData.cpp */,
12531256 DE66F08C08ABEE6000323D32 /* TargetFrameInfo.cpp */,
19571960 isa = PBXGroup;
19581961 children = (
19591962 DE66F2A008ABF03200323D32 /* MRegisterInfo.h */,
1963 CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */,
19601964 DE66F2A108ABF03200323D32 /* TargetData.h */,
19611965 DE66F2A208ABF03200323D32 /* TargetFrameInfo.h */,
19621966 DE66F2A308ABF03200323D32 /* TargetInstrInfo.h */,
22172221 PRODUCT_NAME = LLVM;
22182222 };
22192223 buildToolPath = /usr/bin/make;
2220 buildWorkingDirectory = /llvm/obj;
2224 buildWorkingDirectory = /llvm/obj/;
22212225 dependencies = (
22222226 );
22232227 name = LLVM;
4848 struct Entry {
4949 const char *Name;
5050 const char *ShortDesc;
51 TargetMachine *(*CtorFn)(const Module &, IntrinsicLowering*);
51 TargetMachine *(*CtorFn)(const Module &, IntrinsicLowering*,
52 const std::string &);
5253 unsigned (*ModuleMatchQualityFn)(const Module &M);
5354 unsigned (*JITMatchQualityFn)();
5455
5657
5758 protected:
5859 Entry(const char *N, const char *SD,
59 TargetMachine *(*CF)(const Module &, IntrinsicLowering*),
60 TargetMachine *(*CF)(const Module &, IntrinsicLowering*,
61 const std::string &),
6062 unsigned (*MMF)(const Module &M), unsigned (*JMF)());
6163 private:
6264 const Entry *Next; // Next entry in the linked list.
7981 &TargetMachineImpl::getJITMatchQuality) {
8082 }
8183 private:
82 static TargetMachine *Allocator(const Module &M, IntrinsicLowering *IL) {
83 return new TargetMachineImpl(M, IL);
84 static TargetMachine *Allocator(const Module &M, IntrinsicLowering *IL,
85 const std::string &FS) {
86 return new TargetMachineImpl(M, IL, FS);
8487 }
8588 };
8689
1414 #include "JIT.h"
1515 #include "llvm/Module.h"
1616 #include "llvm/ModuleProvider.h"
17 #include "llvm/Target/SubtargetFeature.h"
1718 #include "llvm/Target/TargetMachine.h"
1819 #include "llvm/Target/TargetMachineRegistry.h"
1920 #include
2122
2223 static cl::opt
2324 MArch("march", cl::desc("Architecture to generate assembly for:"));
25
26 static cl::opt
27 MCPU("mcpu",
28 cl::desc("Target a specific cpu type"),
29 cl::value_desc("cpu-name"),
30 cl::init(""));
31
32 static cl::list
33 MAttrs("mattr",
34 cl::CommaSeparated,
35 cl::desc("Target specific attributes:"),
36 cl::value_desc("attributes"));
2437
2538 /// create - Create an return a new JIT compiler if there is one available
2639 /// for the current target. Otherwise, return null.
3649 << "-march switch.\n";
3750 }
3851
52 // Package up features to be passed to target/subtarget
53 std::string FeaturesStr;
54 if (MCPU.size() || MAttrs.size()) {
55 SubtargetFeatures Features;
56 Features.setCPU(MCPU);
57 for (unsigned i = 0; i != MAttrs.size(); ++i)
58 Features.AddFeature(MAttrs[i]);
59 FeaturesStr = Features.getString();
60 }
61
3962 // Allocate a target...
40 TargetMachine *Target = MArch->CtorFn(*MP->getModule(), IL);
63 TargetMachine *Target = MArch->CtorFn(*MP->getModule(), IL, FeaturesStr);
4164 assert(Target && "Could not allocate target machine!");
4265
4366 // If the target supports JIT code generation, return a new JIT now.
5757 #endif
5858 }
5959
60 AlphaTargetMachine::AlphaTargetMachine( const Module &M, IntrinsicLowering *IL)
60 AlphaTargetMachine::AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
61 const std::string &FS)
6162 : TargetMachine("alpha", IL, true),
6263 FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
6364 JITInfo(*this)
3030 AlphaJITInfo JITInfo;
3131
3232 public:
33 AlphaTargetMachine(const Module &M, IntrinsicLowering *IL);
33 AlphaTargetMachine(const Module &M, IntrinsicLowering *IL,
34 const std::string &FS);
3435
3536 virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
3637 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
1919 class IntrinsicLowering;
2020
2121 struct CTargetMachine : public TargetMachine {
22 CTargetMachine(const Module &M, IntrinsicLowering *IL) :
22 CTargetMachine(const Module &M, IntrinsicLowering *IL,
23 const std::string &FS) :
2324 TargetMachine("CBackend", IL, M) {}
2425
2526 // This is the only thing that actually does anything here.
7171
7272 /// IA64TargetMachine ctor - Create an LP64 architecture model
7373 ///
74 IA64TargetMachine::IA64TargetMachine(const Module &M, IntrinsicLowering *IL)
74 IA64TargetMachine::IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
75 const std::string &FS)
7576 : TargetMachine("IA64", IL, true),
7677 FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0) { // FIXME? check this stuff
7778 }
2626 TargetFrameInfo FrameInfo;
2727 //IA64JITInfo JITInfo;
2828 public:
29 IA64TargetMachine(const Module &M, IntrinsicLowering *IL);
29 IA64TargetMachine(const Module &M, IntrinsicLowering *IL,
30 const std::string &FS);
3031
3132 virtual const IA64InstrInfo *getInstrInfo() const { return &InstrInfo; }
3233 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
1414 #include "PowerPC.h"
1515 #include "llvm/Module.h"
1616 #include "llvm/Support/CommandLine.h"
17 #include "llvm/Target/SubtargetFeature.h"
18
1719 using namespace llvm;
1820 PPCTargetEnum llvm::PPCTarget = TargetDefault;
1921
2931 cl::desc("Enable optimizations for GP cpus"));
3032 }
3133
34 enum PowerPCFeature {
35 PowerPCFeature64Bit = 1 << 0,
36 PowerPCFeatureAltivec = 1 << 1,
37 PowerPCFeatureFSqrt = 1 << 2,
38 PowerPCFeatureGPUL = 1 << 3,
39 };
40
41 /// Sorted (by key) array of values for CPU subtype.
42 static const SubtargetFeatureKV PowerPCSubTypeKV[] = {
43 { "601" , 0 },
44 { "602" , 0 },
45 { "603" , 0 },
46 { "603e" , 0 },
47 { "603ev" , 0 },
48 { "604" , 0 },
49 { "604e" , 0 },
50 { "620" , 0 },
51 { "7400" , PowerPCFeatureAltivec },
52 { "7450" , PowerPCFeatureAltivec },
53 { "750" , 0 },
54 { "970" , PowerPCFeature64Bit | PowerPCFeatureAltivec |
55 PowerPCFeatureFSqrt | PowerPCFeatureGPUL },
56 { "g3" , 0 },
57 { "g4" , PowerPCFeatureAltivec },
58 { "g4+" , PowerPCFeatureAltivec },
59 { "g5" , PowerPCFeature64Bit | PowerPCFeatureAltivec |
60 PowerPCFeatureFSqrt | PowerPCFeatureGPUL },
61 { "generic", 0 }
62 };
63 /// Length of PowerPCSubTypeKV.
64 static const unsigned PowerPCSubTypeKVSize = sizeof(PowerPCSubTypeKV)
65 / sizeof(SubtargetFeatureKV);
66
67 /// Sorted (by key) array of values for CPU features.
68 static SubtargetFeatureKV PowerPCFeatureKV[] = {
69 { "64bit" , PowerPCFeature64Bit },
70 { "altivec", PowerPCFeatureAltivec },
71 { "fsqrt" , PowerPCFeatureFSqrt },
72 { "gpul" , PowerPCFeatureGPUL }
73 };
74 /// Length of PowerPCFeatureKV.
75 static const unsigned PowerPCFeatureKVSize = sizeof(PowerPCFeatureKV)
76 / sizeof(SubtargetFeatureKV);
77
78
3279 #if defined(__APPLE__)
3380 #include
3481 #include
3582 #include
3683 #include
3784
38 static boolean_t IsGP() {
85 /// GetCurrentPowerPCFeatures - Returns the current CPUs features.
86 static const char *GetCurrentPowerPCCPU() {
3987 host_basic_info_data_t hostInfo;
4088 mach_msg_type_number_t infoCount;
4189
4290 infoCount = HOST_BASIC_INFO_COUNT;
4391 host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo,
4492 &infoCount);
93
94 if (hostInfo.cpu_type != CPU_TYPE_POWERPC) return "generic";
95
96 switch(hostInfo.cpu_subtype) {
97 case CPU_SUBTYPE_POWERPC_601: return "601";
98 case CPU_SUBTYPE_POWERPC_602: return "602";
99 case CPU_SUBTYPE_POWERPC_603: return "603";
100 case CPU_SUBTYPE_POWERPC_603e: return "603e";
101 case CPU_SUBTYPE_POWERPC_603ev: return "603ev";
102 case CPU_SUBTYPE_POWERPC_604: return "604";
103 case CPU_SUBTYPE_POWERPC_604e: return "604e";
104 case CPU_SUBTYPE_POWERPC_620: return "620";
105 case CPU_SUBTYPE_POWERPC_750: return "750";
106 case CPU_SUBTYPE_POWERPC_7400: return "7400";
107 case CPU_SUBTYPE_POWERPC_7450: return "7450";
108 case CPU_SUBTYPE_POWERPC_970: return "970";
109 default: ;
110 }
45111
46 return ((hostInfo.cpu_type == CPU_TYPE_POWERPC) &&
47 (hostInfo.cpu_subtype == CPU_SUBTYPE_POWERPC_970));
48 }
112 return "generic";
113 }
49114 #endif
50115
51 PPCSubtarget::PPCSubtarget(const Module &M)
116 PPCSubtarget::PPCSubtarget(const Module &M, const std::string &FS)
52117 : StackAlignment(16), IsGigaProcessor(false), IsAIX(false), IsDarwin(false) {
53118
54 // Set the boolean corresponding to the current target triple, or the default
119 // Determine default and user specified characteristics
120 std::string CPU;
121 #if defined(__APPLE__)
122 CPU = GetCurrentPowerPCCPU();
123 #endif
124 uint32_t Bits =
125 SubtargetFeatures::Parse(FS, CPU,
126 PowerPCSubTypeKV, PowerPCSubTypeKVSize,
127 PowerPCFeatureKV, PowerPCFeatureKVSize);
128 IsGigaProcessor = (Bits & PowerPCFeatureGPUL) != 0;
129
130 // Set the boolean corresponding to the current target triple, or the default
55131 // if one cannot be determined, to true.
56132 const std::string& TT = M.getTargetTriple();
57133 if (TT.length() > 5) {
58134 IsDarwin = TT.find("darwin") != std::string::npos;
59 #if defined(__APPLE__)
60 IsGigaProcessor = IsGP();
61 #endif
62135 } else if (TT.empty()) {
63136 #if defined(_POWER)
64137 IsAIX = true;
65138 #elif defined(__APPLE__)
66139 IsDarwin = true;
67 IsGigaProcessor = IsGP();
68140 #endif
69141 }
70142
1515
1616 #include "llvm/Target/TargetSubtarget.h"
1717
18 #include
19
1820 namespace llvm {
1921 class Module;
2022
3234 /// This constructor initializes the data members to match that
3335 /// of the specified module.
3436 ///
35 PPCSubtarget(const Module &M);
37 PPCSubtarget(const Module &M, const std::string &FS);
3638
3739 /// getStackAlignment - Returns the minimum alignment known to hold of the
3840 /// stack frame on entry to the function and which must be maintained by every
4242 PowerPCTargetMachine::PowerPCTargetMachine(const std::string &name,
4343 IntrinsicLowering *IL,
4444 const Module &M,
45 const std::string &FS,
4546 const TargetData &TD,
4647 const PowerPCFrameInfo &TFI)
47 : TargetMachine(name, IL, TD), FrameInfo(TFI), Subtarget(M) {
48 : TargetMachine(name, IL, TD), FrameInfo(TFI), Subtarget(M, FS) {
4849 if (TargetDefault == PPCTarget) {
4950 if (Subtarget.isAIX()) PPCTarget = TargetAIX;
5051 if (Subtarget.isDarwin()) PPCTarget = TargetDarwin;
153154
154155 /// PowerPCTargetMachine ctor - Create an ILP32 architecture model
155156 ///
156 PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL)
157 : PowerPCTargetMachine(PPC32ID, IL, M,
157 PPC32TargetMachine::PPC32TargetMachine(const Module &M, IntrinsicLowering *IL,
158 const std::string &FS)
159 : PowerPCTargetMachine(PPC32ID, IL, M, FS,
158160 TargetData(PPC32ID,false,4,4,4,4,4,4,2,1,1),
159161 PowerPCFrameInfo(*this, false)), JITInfo(*this) {}
160162
2727 PPC32JITInfo JITInfo;
2828
2929 public:
30 PPC32TargetMachine(const Module &M, IntrinsicLowering *IL);
30 PPC32TargetMachine(const Module &M, IntrinsicLowering *IL,
31 const std::string &FS);
3132 virtual const PPC32InstrInfo *getInstrInfo() const { return &InstrInfo; }
3233 virtual const MRegisterInfo *getRegisterInfo() const {
3334 return &InstrInfo.getRegisterInfo();
2929 PPCSubtarget Subtarget;
3030 protected:
3131 PowerPCTargetMachine(const std::string &name, IntrinsicLowering *IL,
32 const Module &M, const TargetData &TD,
32 const Module &M, const std::string &FS,
33 const TargetData &TD,
3334 const PowerPCFrameInfo &TFI);
3435 public:
3536 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
2828 /// SkeletonTargetMachine ctor - Create an ILP32 architecture model
2929 ///
3030 SkeletonTargetMachine::SkeletonTargetMachine(const Module &M,
31 IntrinsicLowering *IL)
31 IntrinsicLowering *IL,
32 const std::string &FS)
3233 : TargetMachine("Skeleton", IL, true, 4, 4, 4, 4, 4),
3334 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -4), JITInfo(*this) {
3435 }
2727 TargetFrameInfo FrameInfo;
2828 SkeletonJITInfo JITInfo;
2929 public:
30 SkeletonTargetMachine(const Module &M, IntrinsicLowering *IL);
30 SkeletonTargetMachine(const Module &M, IntrinsicLowering *IL,
31 const std::string &FS);
3132
3233 virtual const SkeletonInstrInfo *getInstrInfo() const { return &InstrInfo; }
3334 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
3030 /// SparcV8TargetMachine ctor - Create an ILP32 architecture model
3131 ///
3232 SparcV8TargetMachine::SparcV8TargetMachine(const Module &M,
33 IntrinsicLowering *IL)
33 IntrinsicLowering *IL,
34 const std::string &FS)
3435 : TargetMachine("SparcV8", IL, false, 4, 4),
3536 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), JITInfo(*this) {
3637 }
2929 TargetFrameInfo FrameInfo;
3030 SparcV8JITInfo JITInfo;
3131 public:
32 SparcV8TargetMachine(const Module &M, IntrinsicLowering *IL);
32 SparcV8TargetMachine(const Module &M, IntrinsicLowering *IL,
33 const std::string &FS);
3334
3435 virtual const SparcV8InstrInfo *getInstrInfo() const { return &InstrInfo; }
3536 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
3030 /// SparcV8TargetMachine ctor - Create an ILP32 architecture model
3131 ///
3232 SparcV8TargetMachine::SparcV8TargetMachine(const Module &M,
33 IntrinsicLowering *IL)
33 IntrinsicLowering *IL,
34 const std::string &FS)
3435 : TargetMachine("SparcV8", IL, false, 4, 4),
3536 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0), JITInfo(*this) {
3637 }
2929 TargetFrameInfo FrameInfo;
3030 SparcV8JITInfo JITInfo;
3131 public:
32 SparcV8TargetMachine(const Module &M, IntrinsicLowering *IL);
32 SparcV8TargetMachine(const Module &M, IntrinsicLowering *IL,
33 const std::string &FS);
3334
3435 virtual const SparcV8InstrInfo *getInstrInfo() const { return &InstrInfo; }
3536 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
147147
148148
149149 SparcV9TargetMachine::SparcV9TargetMachine(const Module &M,
150 IntrinsicLowering *il)
150 IntrinsicLowering *il,
151 const std::string &FS)
151152 : TargetMachine("UltraSparcV9-Native", il, false),
152153 schedInfo(*this),
153154 regInfo(*this),
3131 SparcV9FrameInfo frameInfo;
3232 SparcV9JITInfo jitInfo;
3333 public:
34 SparcV9TargetMachine(const Module &M, IntrinsicLowering *IL);
34 SparcV9TargetMachine(const Module &M, IntrinsicLowering *IL,
35 const std::string &FS);
3536
3637 virtual const TargetInstrInfo *getInstrInfo() const { return &instrInfo; }
3738 virtual const TargetSchedInfo *getSchedInfo() const { return &schedInfo; }
2525 static TargetRegistrationListener *Listeners = 0;
2626
2727 TargetMachineRegistry::Entry::Entry(const char *N, const char *SD,
28 TargetMachine *(*CF)(const Module &, IntrinsicLowering*),
28 TargetMachine *(*CF)(const Module &, IntrinsicLowering*,
29 const std::string &),
2930 unsigned (*MMF)(const Module &M), unsigned (*JMF)())
3031 : Name(N), ShortDesc(SD), CtorFn(CF), ModuleMatchQualityFn(MMF),
3132 JITMatchQualityFn(JMF), Next(List) {
1414 #include "llvm/Module.h"
1515 using namespace llvm;
1616
17 X86Subtarget::X86Subtarget(const Module &M)
17 X86Subtarget::X86Subtarget(const Module &M, const std::string &FS)
1818 : TargetSubtarget(), stackAlignment(8),
1919 indirectExternAndWeakGlobals(false), asmDarwinLinkerStubs(false),
2020 asmLeadingUnderscore(false), asmAlignmentIsInBytes(false),
1414 #define X86SUBTARGET_H
1515
1616 #include "llvm/Target/TargetSubtarget.h"
17
18 #include
1719
1820 namespace llvm {
1921 class Module;
3840 /// This constructor initializes the data members to match that
3941 /// of the specified module.
4042 ///
41 X86Subtarget(const Module &M);
43 X86Subtarget(const Module &M, const std::string &FS);
4244
4345 /// getStackAlignment - Returns the minimum alignment known to hold of the
4446 /// stack frame on entry to the function and which must be maintained by every
8989
9090 /// X86TargetMachine ctor - Create an ILP32 architecture model
9191 ///
92 X86TargetMachine::X86TargetMachine(const Module &M, IntrinsicLowering *IL)
92 X86TargetMachine::X86TargetMachine(const Module &M,
93 IntrinsicLowering *IL,
94 const std::string &FS)
9395 : TargetMachine("X86", IL, true, 4, 4, 4, 4, 4),
94 Subtarget(M),
96 Subtarget(M, FS),
9597 FrameInfo(TargetFrameInfo::StackGrowsDown,
9698 Subtarget.getStackAlignment(), -4),
9799 JITInfo(*this) {
2929 TargetFrameInfo FrameInfo;
3030 X86JITInfo JITInfo;
3131 public:
32 X86TargetMachine(const Module &M, IntrinsicLowering *IL);
32 X86TargetMachine(const Module &M, IntrinsicLowering *IL,
33 const std::string &FS);
3334
3435 virtual const X86InstrInfo *getInstrInfo() const { return &InstrInfo; }
3536 virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
1313 //===----------------------------------------------------------------------===//
1414
1515 #include "llvm/Bytecode/Reader.h"
16 #include "llvm/Target/SubtargetFeature.h"
1617 #include "llvm/Target/TargetMachine.h"
1718 #include "llvm/Target/TargetMachineRegistry.h"
1819 #include "llvm/Transforms/Scalar.h"
4647 static cl::opt
4748 MArch("march", cl::desc("Architecture to generate code for:"));
4849
50 static cl::opt
51 MCPU("mcpu",
52 cl::desc("Target a specific cpu type"),
53 cl::value_desc("cpu-name"),
54 cl::init(""));
55
56 static cl::list
57 MAttrs("mattr",
58 cl::CommaSeparated,
59 cl::desc("Target specific attributes:"),
60 cl::value_desc("attributes"));
61
4962 cl::opt
5063 FileType("filetype", cl::init(TargetMachine::AssemblyFile),
5164 cl::desc("Choose a file type (not all types are supported by all targets):"),
113126 }
114127 }
115128
116 std::auto_ptr target(MArch->CtorFn(mod, 0));
129 // Package up features to be passed to target/subtarget
130 std::string FeaturesStr;
131 if (MCPU.size() || MAttrs.size()) {
132 SubtargetFeatures Features;
133 Features.setCPU(MCPU);
134 for (unsigned i = 0; i != MAttrs.size(); ++i)
135 Features.AddFeature(MAttrs[i]);
136 FeaturesStr = Features.getString();
137 }
138
139 std::auto_ptr target(MArch->CtorFn(mod, 0, FeaturesStr));
117140 assert(target.get() && "Could not allocate target machine!");
118141 TargetMachine &Target = *target.get();
119142 const TargetData &TD = Target.getTargetData();