Fix bug where we couldn't print a function without a name
authorChris Lattner <sabre@nondot.org>
Wed, 3 Sep 2003 17:56:43 +0000 (17:56 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 3 Sep 2003 17:56:43 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8341 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index 4acf55bf89c952135d64a102510ecdffc2a2b689..b9b2e8fe9e70d5325281efe522fbe2747205c617 100644 (file)
@@ -658,7 +658,9 @@ void AssemblyWriter::printFunction(const Function *F) {
     case GlobalValue::ExternalLinkage: break;
     }
 
-  printType(F->getReturnType()) << " " << getLLVMName(F->getName()) << "(";
+  printType(F->getReturnType()) << " ";
+  if (!F->getName().empty()) Out << getLLVMName(F->getName());
+  Out << "(";
   Table.incorporateFunction(F);
 
   // Loop over the arguments, printing them...