lto/addAsmGlobalSymbols: fast path when no module level asm is present.
[oota-llvm.git] / tools / lto / LTOModule.cpp
index 6b4e2d2a65913fba1941fada7d18d3aea7c61ba2..4ba8985e72a824526ad3e2cad79475b7b0647c40 100644 (file)
@@ -615,6 +615,8 @@ namespace {
 
 bool LTOModule::addAsmGlobalSymbols(MCContext &Context, std::string &errMsg) {
   const std::string &inlineAsm = _module->getModuleInlineAsm();
+  if (inlineAsm.empty())
+    return false;
 
   OwningPtr<RecordStreamer> Streamer(new RecordStreamer(Context));
   MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm);