diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-04-28 13:45:00 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-04-28 13:45:00 +0000 |
commit | b18f8f85e9151195a81833d6862063323338854e (patch) | |
tree | 3bbb4f5593defb3935aa086ffccc1edb0f2c606a /llvm/lib/Bytecode/Writer/Writer.cpp | |
parent | 1deacd61f4a93742e3e12bac91026158bdb1aaf0 (diff) | |
download | bcm5719-llvm-b18f8f85e9151195a81833d6862063323338854e.tar.gz bcm5719-llvm-b18f8f85e9151195a81833d6862063323338854e.zip |
Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.
llvm-svn: 36537
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Writer/Writer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp index 7295239fdd0..f1c6f6c5619 100644 --- a/llvm/lib/Bytecode/Writer/Writer.cpp +++ b/llvm/lib/Bytecode/Writer/Writer.cpp @@ -1095,9 +1095,11 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) { // Output aliases for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) { - unsigned Slot = Table.getTypeSlot(I->getType()); - assert(((Slot << 2) >> 2) == Slot && "Slot # too big!"); + unsigned TypeSlotNo = Table.getTypeSlot(I->getType()); + unsigned AliaseeSlotNo = Table.getSlot(I->getAliasee()); + assert(((TypeSlotNo << 3) >> 3) == TypeSlotNo && "Slot # too big!"); unsigned aliasLinkage = 0; + unsigned isConstantAliasee = ((!isa<GlobalValue>(I->getAliasee())) << 2); switch (I->getLinkage()) { case GlobalValue::ExternalLinkage: aliasLinkage = 0; @@ -1111,9 +1113,8 @@ void BytecodeWriter::outputModuleInfoBlock(const Module *M) { default: assert(0 && "Invalid alias linkage"); } - output_vbr((Slot << 2) | aliasLinkage); - output_vbr(Table.getTypeSlot(I->getAliasee()->getType())); - output_vbr(Table.getSlot(I->getAliasee())); + output_vbr((TypeSlotNo << 3) | isConstantAliasee | aliasLinkage); + output_vbr(AliaseeSlotNo); } output_typeid(Table.getTypeSlot(Type::VoidTy)); } |