summaryrefslogtreecommitdiff
path: root/lib/Bitcode/Reader/BitcodeReader.h
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2013-07-26 04:16:55 +0000
committerTobias Grosser <tobias@grosser.es>2013-07-26 04:16:55 +0000
commite7bc5bb8622123b4a1507e7d219ab570a43e5bdf (patch)
tree31bf0371d5d0601560856c0f43498648c72456cf /lib/Bitcode/Reader/BitcodeReader.h
parentb3053c528a570d20a4562e00dbecd1947f4848e7 (diff)
downloadllvm-e7bc5bb8622123b4a1507e7d219ab570a43e5bdf.tar.gz
llvm-e7bc5bb8622123b4a1507e7d219ab570a43e5bdf.tar.bz2
llvm-e7bc5bb8622123b4a1507e7d219ab570a43e5bdf.tar.xz
Make .bc en/decoding of AttrKind stable
The bitcode representation attribute kinds are encoded into / decoded from should be independent of the current set of LLVM attributes and their position in the AttrKind enum. This patch explicitly encodes attributes to fixed bitcode values. With this patch applied, LLVM does not silently misread attributes written by LLVM 3.3. We also enhance the decoding slightly such that an error message is printed if an unknown AttrKind encoding was dected. Bonus: Dropping bitcode attributes from AttrKind is now easy, as old AttrKinds do not need to be kept to support the Bitcode reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index e4de4ab7c7..b095447675 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -321,6 +321,7 @@ private:
return getFnValueByID(ValNo, Ty);
}
+ bool ParseAttrKind(uint64_t Code, Attribute::AttrKind *Kind);
bool ParseModule(bool Resume);
bool ParseAttributeBlock();
bool ParseAttributeGroupBlock();