diff options
author | Bill Wendling <isanbard@gmail.com> | 2007-02-08 01:48:28 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2007-02-08 01:48:28 +0000 |
commit | 62062b59df4e59d8c08044634c2bb7ef25f964ed (patch) | |
tree | 9c7c26f8e39a16dcc8b8105b41c95839bf15d2c4 /tools/lto | |
parent | 546d0fbd9718ea5ad422faaeffea939fe7312408 (diff) | |
download | external_llvm-62062b59df4e59d8c08044634c2bb7ef25f964ed.zip external_llvm-62062b59df4e59d8c08044634c2bb7ef25f964ed.tar.gz external_llvm-62062b59df4e59d8c08044634c2bb7ef25f964ed.tar.bz2 |
Avoid assert() in lto. Let linker handle all failures. Use LTO_WRITE_FAILURE
instead of LTO_UNKNOWN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/lto.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index 816b1d8..730e7c2 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -313,13 +313,10 @@ LTO::optimize(Module *M, std::ostream &Out, MachineCodeEmitter *MCE = 0; switch (Target->addPassesToEmitFile(*CodeGenPasses, Out, - TargetMachine::AssemblyFile, true)) { + TargetMachine::AssemblyFile, true)) { default: - assert(0 && "Invalid file model!"); - return LTO_UNKNOWN; case FileModel::Error: - // FIXME: Error... - return LTO_UNKNOWN; + return LTO_WRITE_FAILURE; case FileModel::AsmFile: break; case FileModel::MachOFile: @@ -330,10 +327,8 @@ LTO::optimize(Module *M, std::ostream &Out, break; } - if (Target->addPassesToEmitFileFinish(*CodeGenPasses, MCE, true)) { - // FIXME: Error... - return LTO_UNKNOWN; - } + if (Target->addPassesToEmitFileFinish(*CodeGenPasses, MCE, true)) + return LTO_WRITE_FAILURE; // Run our queue of passes all at once now, efficiently. Passes.run(*M); |