diff options
Diffstat (limited to 'lib/ExecutionEngine/TargetSelect.cpp')
-rw-r--r-- | lib/ExecutionEngine/TargetSelect.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/TargetSelect.cpp b/lib/ExecutionEngine/TargetSelect.cpp index 3937fe5..42364f9 100644 --- a/lib/ExecutionEngine/TargetSelect.cpp +++ b/lib/ExecutionEngine/TargetSelect.cpp @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ExecutionEngine/ExecutionEngine.h" +#include "llvm/Module.h" #include "llvm/ADT/Triple.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Target/TargetMachine.h" @@ -24,17 +25,21 @@ using namespace llvm; +TargetMachine *EngineBuilder::selectTarget() { + StringRef MArch = ""; + StringRef MCPU = ""; + SmallVector<std::string, 1> MAttrs; + Triple TT(M->getTargetTriple()); + + return selectTarget(TT, MArch, MCPU, MAttrs); +} + /// selectTarget - Pick a target either via -march or by guessing the native /// arch. Add any CPU features specified via -mcpu or -mattr. TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple, StringRef MArch, StringRef MCPU, - const SmallVectorImpl<std::string>& MAttrs, - const TargetOptions &Options, - Reloc::Model RM, - CodeModel::Model CM, - CodeGenOpt::Level OL, - std::string *ErrorStr) { + const SmallVectorImpl<std::string>& MAttrs) { Triple TheTriple(TargetTriple); if (TheTriple.getTriple().empty()) TheTriple.setTriple(sys::getDefaultTargetTriple()); @@ -84,7 +89,8 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple, TargetMachine *Target = TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr, Options, - RM, CM, OL); + RelocModel, CMModel, + OptLevel); assert(Target && "Could not allocate target machine!"); return Target; } |