diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-02-05 05:57:38 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-02-05 05:57:38 +0000 |
commit | 27e7ef326ab25027c74638bc33aaff7429527573 (patch) | |
tree | 9d36f48c58765f649cf3eba6a97370c22d3aabd9 /llvm/lib/Bitcode | |
parent | 9ca910111c4bd3f3c4dac79beca65fe77661e84c (diff) | |
download | bcm5719-llvm-27e7ef326ab25027c74638bc33aaff7429527573.tar.gz bcm5719-llvm-27e7ef326ab25027c74638bc33aaff7429527573.zip |
Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.
llvm-svn: 174340
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 6ab70111871..e10e6d6476b 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1596,9 +1596,13 @@ bool BitcodeReader::ParseModule(bool Resume) { if (Record.size() > 8) UnnamedAddr = Record[8]; + bool ExternallyInitialized = false; + if (Record.size() > 9) + ExternallyInitialized = Record[9]; + GlobalVariable *NewGV = new GlobalVariable(*TheModule, Ty, isConstant, Linkage, 0, "", 0, - TLM, AddressSpace); + TLM, AddressSpace, ExternallyInitialized); NewGV->setAlignment(Alignment); if (!Section.empty()) NewGV->setSection(Section); diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index c6d0371de70..74bbaf2f874 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -514,10 +514,11 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE, Vals.push_back(GV->hasSection() ? SectionMap[GV->getSection()] : 0); if (GV->isThreadLocal() || GV->getVisibility() != GlobalValue::DefaultVisibility || - GV->hasUnnamedAddr()) { + GV->hasUnnamedAddr() || GV->isExternallyInitialized()) { Vals.push_back(getEncodedVisibility(GV)); Vals.push_back(getEncodedThreadLocalMode(GV)); Vals.push_back(GV->hasUnnamedAddr()); + Vals.push_back(GV->isExternallyInitialized()); } else { AbbrevToUse = SimpleGVarAbbrev; } |