Mark an unmaterialized function as having GhostLinkage
authorMisha Brukman <brukman+llvm@gmail.com>
Sun, 14 Nov 2004 21:02:55 +0000 (21:02 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Sun, 14 Nov 2004 21:02:55 +0000 (21:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17748 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/Reader.cpp

index 18399c1db39f1ff88342adb45f3d232a28cbd383..0984e8e07360b7ce782d1837c7c2b43d2d970e2e 100644 (file)
@@ -1735,6 +1735,10 @@ void BytecodeReader::ParseFunctionLazily() {
   // Save the information for future reading of the function
   LazyFunctionLoadMap[Func] = LazyFunctionInfo(BlockStart, BlockEnd);
 
+  // This function has a body but it's not loaded so it appears `External'.
+  // Mark it as a `Ghost' instead to notify the users that it has a body.
+  Func->setLinkage(GlobalValue::GhostLinkage);
+
   // Pretend we've `parsed' this function
   At = BlockEnd;
 }