If a function is external, do not output a FunctionBlock for the function
AT ALL. This saves 11 bytes per external function from the bytecode file,
and is also required to make GhostLinkage work.
llvm-svn: 17854
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 7d578f9..2550d10 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -942,12 +942,12 @@
}
void BytecodeWriter::outputFunction(const Function *F) {
- BytecodeBlock FunctionBlock(BytecodeFormat::FunctionBlockID, *this);
- output_vbr(getEncodedLinkage(F));
-
// If this is an external function, there is nothing else to emit!
if (F->isExternal()) return;
+ BytecodeBlock FunctionBlock(BytecodeFormat::FunctionBlockID, *this);
+ output_vbr(getEncodedLinkage(F));
+
// Get slot information about the function...
Table.incorporateFunction(F);