summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-02 21:47:13 +0000
committerDevang Patel <dpatel@apple.com>2008-09-02 21:47:13 +0000
commitca9d93e62797493bde74c28bec61f25f2b9e5def (patch)
treed2ad6f44831d336e12df3410e4ce5b5a76d95288 /llvm/lib/Bitcode
parent805b37ca435a412de16b3ac640bf57c919bea558 (diff)
downloadbcm5719-llvm-ca9d93e62797493bde74c28bec61f25f2b9e5def.tar.gz
bcm5719-llvm-ca9d93e62797493bde74c28bec61f25f2b9e5def.zip
Read and write function notes.
llvm-svn: 55657
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp1
2 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 79d863833dd..0d6b6f2edbe 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1197,6 +1197,9 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) {
return Error("Invalid GC ID");
Func->setGC(GCTable[Record[8]-1].c_str());
}
+ if (!isProto && Record.size() > 9 && Record[9]) {
+ Func->setNotes(Record[9]);
+ }
ValueList.push_back(Func);
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index dd161bacfb3..b8aab5acc19 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -412,6 +412,7 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0);
Vals.push_back(getEncodedVisibility(F));
Vals.push_back(F->hasGC() ? GCMap[F->getGC()] : 0);
+ Vals.push_back(F->getNotes());
unsigned AbbrevToUse = 0;
Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
OpenPOWER on IntegriCloud