diff options
Diffstat (limited to 'tools/llc/llc.cpp')
-rw-r--r-- | tools/llc/llc.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 162d6c8..b36e941 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/Config/config.h" +#include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FormattedStream.h" @@ -31,7 +32,6 @@ #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/Host.h" #include "llvm/Support/Signals.h" -#include "llvm/Target/SubtargetFeature.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetRegistry.h" @@ -201,6 +201,9 @@ int main(int argc, char **argv) { // Initialize targets first, so that --version shows registered targets. InitializeAllTargets(); + InitializeAllMCAsmInfos(); + InitializeAllMCInstrInfos(); + InitializeAllMCSubtargetInfos(); InitializeAllAsmPrinters(); InitializeAllAsmParsers(); @@ -261,16 +264,16 @@ int main(int argc, char **argv) { // Package up features to be passed to target/subtarget std::string FeaturesStr; - if (MCPU.size() || MAttrs.size()) { + if (MAttrs.size()) { SubtargetFeatures Features; - Features.setCPU(MCPU); for (unsigned i = 0; i != MAttrs.size(); ++i) Features.AddFeature(MAttrs[i]); FeaturesStr = Features.getString(); } std::auto_ptr<TargetMachine> - target(TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr)); + target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, + FeaturesStr)); assert(target.get() && "Could not allocate target machine!"); TargetMachine &Target = *target.get(); |