summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit0a8e12fdbbf54e81954b091ac9fb11cd5f5148e1 (patch)
treee73051e3c61bbe3d9dbd725f92c111e6f6cc4782 /llvm/lib/Bitcode/Reader/BitcodeReader.h
parentad9a53c510343b65e30700ef2126734ca90ab0b0 (diff)
downloadbcm5719-llvm-0a8e12fdbbf54e81954b091ac9fb11cd5f5148e1.tar.gz
bcm5719-llvm-0a8e12fdbbf54e81954b091ac9fb11cd5f5148e1.zip
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. llvm-svn: 187186
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h
index e4de4ab7c7c..b095447675a 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.h
+++ b/llvm/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();
OpenPOWER on IntegriCloud