X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllc%2Fllc.cpp;h=bcabafc4675ca7645266303a396770b49ea5c90c;hb=71857ccdb83b6374f7a791c2dae45ce9934a85af;hp=41ec815719ecf062f73b25e9adc174ae70c945d8;hpb=882092808b7179e49ee5c52c07ce9c97e3128a81;p=oota-llvm.git diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 41ec815719e..bcabafc4675 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -13,29 +13,31 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/DataLayout.h" -#include "llvm/Module.h" -#include "llvm/PassManager.h" -#include "llvm/Pass.h" + +#include "llvm/IR/LLVMContext.h" #include "llvm/ADT/Triple.h" #include "llvm/Assembly/PrintModulePass.h" -#include "llvm/Support/IRReader.h" #include "llvm/CodeGen/CommandFlags.h" #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" +#include "llvm/IR/DataLayout.h" +#include "llvm/IR/Module.h" +#include "llvm/IRReader/IRReader.h" #include "llvm/MC/SubtargetFeature.h" +#include "llvm/Pass.h" +#include "llvm/PassManager.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Host.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PluginLoader.h" #include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/ToolOutputFile.h" -#include "llvm/Support/Host.h" #include "llvm/Support/Signals.h" +#include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Support/ToolOutputFile.h" #include "llvm/Target/TargetLibraryInfo.h" #include "llvm/Target/TargetMachine.h" #include @@ -199,7 +201,7 @@ int main(int argc, char **argv) { static int compileModule(char **argv, LLVMContext &Context) { // Load the module to be compiled... SMDiagnostic Err; - std::auto_ptr M; + OwningPtr M; Module *mod = 0; Triple TheTriple; @@ -280,7 +282,7 @@ static int compileModule(char **argv, LLVMContext &Context) { Options.UseInitArray = UseInitArray; Options.SSPBufferSize = SSPBufferSize; - std::auto_ptr + OwningPtr target(TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr, Options, RelocModel, CMModel, OLvl)); @@ -319,10 +321,8 @@ static int compileModule(char **argv, LLVMContext &Context) { TLI->disableAllFunctions(); PM.add(TLI); - if (target.get()) { - PM.add(new TargetTransformInfo(target->getScalarTargetTransformInfo(), - target->getVectorTargetTransformInfo())); - } + // Add intenal analysis passes from the target machine. + Target.addAnalysisPasses(PM); // Add the target data from the target machine, if it exists, or the module. if (const DataLayout *TD = Target.getDataLayout())