diff options
Diffstat (limited to 'tools/llvm-lto/llvm-lto.cpp')
-rw-r--r-- | tools/llvm-lto/llvm-lto.cpp | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp index 0fc68ae..ec3f0fa 100644 --- a/tools/llvm-lto/llvm-lto.cpp +++ b/tools/llvm-lto/llvm-lto.cpp @@ -20,8 +20,8 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/TargetSelect.h" +#include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -77,26 +77,7 @@ int main(int argc, char **argv) { InitializeAllAsmParsers(); // set up the TargetOptions for the machine - TargetOptions Options; - Options.LessPreciseFPMADOption = EnableFPMAD; - Options.NoFramePointerElim = DisableFPElim; - Options.AllowFPOpFusion = FuseFPOps; - Options.UnsafeFPMath = EnableUnsafeFPMath; - Options.NoInfsFPMath = EnableNoInfsFPMath; - Options.NoNaNsFPMath = EnableNoNaNsFPMath; - Options.HonorSignDependentRoundingFPMathOption = - EnableHonorSignDependentRoundingFPMath; - Options.UseSoftFloat = GenerateSoftFloatCalls; - if (FloatABIForCalls != FloatABI::Default) - Options.FloatABIType = FloatABIForCalls; - Options.NoZerosInBSS = DontPlaceZerosInBSS; - Options.GuaranteedTailCallOpt = EnableGuaranteedTailCallOpt; - Options.DisableTailCalls = DisableTailCalls; - Options.StackAlignmentOverride = OverrideStackAlignment; - Options.TrapFuncName = TrapFuncName; - Options.PositionIndependentExecutable = EnablePIE; - Options.EnableSegmentedStacks = SegmentedStacks; - Options.UseInitArray = UseInitArray; + TargetOptions Options = InitTargetOptionsFromCodeGenFlags(); unsigned BaseArg = 0; @@ -114,8 +95,8 @@ int main(int argc, char **argv) { for (unsigned i = BaseArg; i < InputFilenames.size(); ++i) { std::string error; - OwningPtr<LTOModule> Module(LTOModule::makeLTOModule(InputFilenames[i].c_str(), - Options, error)); + std::unique_ptr<LTOModule> Module( + LTOModule::makeLTOModule(InputFilenames[i].c_str(), Options, error)); if (!error.empty()) { errs() << argv[0] << ": error loading file '" << InputFilenames[i] << "': " << error << "\n"; @@ -161,7 +142,7 @@ int main(int argc, char **argv) { } raw_fd_ostream FileStream(OutputFilename.c_str(), ErrorInfo, - sys::fs::F_Binary); + sys::fs::F_None); if (!ErrorInfo.empty()) { errs() << argv[0] << ": error opening the file '" << OutputFilename << "': " << ErrorInfo << "\n"; |