Do not emit FunctionBlock blocks for external functions. This shrinks
bytecode files by about 8 bytes per external function llvm-svn: 17859
This commit is contained in:
parent
642f8c5ed4
commit
3b6bb48c16
|
@ -919,6 +919,8 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) {
|
||||||
assert(Slot >= Type::FirstDerivedTyID && "Derived type not in range!");
|
assert(Slot >= Type::FirstDerivedTyID && "Derived type not in range!");
|
||||||
assert(((Slot << 5) >> 5) == Slot && "Slot # too big!");
|
assert(((Slot << 5) >> 5) == Slot && "Slot # too big!");
|
||||||
unsigned ID = (Slot << 5) + 1;
|
unsigned ID = (Slot << 5) + 1;
|
||||||
|
if (I->isExternal()) // If external, we don't have an FunctionInfo block.
|
||||||
|
ID |= 1 << 4;
|
||||||
output_vbr(ID);
|
output_vbr(ID);
|
||||||
}
|
}
|
||||||
output_vbr((unsigned)Table.getSlot(Type::VoidTy) << 5);
|
output_vbr((unsigned)Table.getSlot(Type::VoidTy) << 5);
|
||||||
|
@ -942,12 +944,12 @@ void BytecodeWriter::outputInstructions(const Function *F) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BytecodeWriter::outputFunction(const Function *F) {
|
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 this is an external function, there is nothing else to emit!
|
||||||
if (F->isExternal()) return;
|
if (F->isExternal()) return;
|
||||||
|
|
||||||
|
BytecodeBlock FunctionBlock(BytecodeFormat::FunctionBlockID, *this);
|
||||||
|
output_vbr(getEncodedLinkage(F));
|
||||||
|
|
||||||
// Get slot information about the function...
|
// Get slot information about the function...
|
||||||
Table.incorporateFunction(F);
|
Table.incorporateFunction(F);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue