[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Nov 15 13:46:52 PST 2004



Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.87 -> 1.88
---
Log message:

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.


---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.87 llvm/lib/Bytecode/Writer/Writer.cpp:1.88
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.87	Sun Nov 14 16:01:41 2004
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Mon Nov 15 15:46:40 2004
@@ -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);
 






More information about the llvm-commits mailing list