summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-26 02:46:40 +0000
committerChris Lattner <sabre@nondot.org>2007-04-26 02:46:40 +0000
commit44c17072078bbc252db56eff7c2eb2da15aabf2f (patch)
tree920cd65ab2207184a4d2327d20806ef241cd3811 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent6337d7b7c767d7e766d163bbf9cc967e3946b115 (diff)
downloadbcm5719-llvm-44c17072078bbc252db56eff7c2eb2da15aabf2f.tar.gz
bcm5719-llvm-44c17072078bbc252db56eff7c2eb2da15aabf2f.zip
add bitcode alias support
llvm-svn: 36461
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index bfb1815f129..b4f3f69b554 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -309,6 +309,18 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
Vals.clear();
}
+
+
+ // Emit the alias information.
+ for (Module::const_alias_iterator AI = M->alias_begin(), E = M->alias_end();
+ AI != E; ++AI) {
+ Vals.push_back(VE.getTypeID(AI->getType()));
+ Vals.push_back(VE.getValueID(AI->getAliasee()));
+ Vals.push_back(getEncodedLinkage(AI));
+ unsigned AbbrevToUse = 0;
+ Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse);
+ Vals.clear();
+ }
}
OpenPOWER on IntegriCloud