diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-03-02 04:14:42 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-03-02 04:14:42 +0000 |
| commit | 1e49a6d9bc3db451941b021f77a7c3551648bc58 (patch) | |
| tree | 56598694cbd950c66efc61bf8b1bbaa0a5ce76f8 /llvm/lib/VMCore | |
| parent | daed6f6c39f163ce83bf049fd625c1d8e3233348 (diff) | |
| download | bcm5719-llvm-1e49a6d9bc3db451941b021f77a7c3551648bc58.tar.gz bcm5719-llvm-1e49a6d9bc3db451941b021f77a7c3551648bc58.zip | |
Add a special streamer to libLTO that just records symbols definitions and
uses.
The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)
llvm-svn: 126830
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index cbc874a53f6..ff6084d8a8b 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -1338,9 +1338,12 @@ void AssemblyWriter::printModule(const Module *M) { CurPos = NewLine+1; NewLine = Asm.find_first_of('\n', CurPos); } - Out << "module asm \""; - PrintEscapedString(std::string(Asm.begin()+CurPos, Asm.end()), Out); - Out << "\"\n"; + std::string rest(Asm.begin()+CurPos, Asm.end()); + if (!rest.empty()) { + Out << "module asm \""; + PrintEscapedString(rest, Out); + Out << "\"\n"; + } } // Loop over the dependent libraries and emit them. |

