aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.h
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-11-20 14:51:27 +0000
committerTeresa Johnson <tejohnson@google.com>2015-11-20 14:51:27 +0000
commitd4d3dfd8ef1c58b5ec900ce8c349ccf35dcd2912 (patch)
treede6683a8ad44e5959fd94dd8ff7912500acca507 /llvm/lib/Bitcode/Writer/ValueEnumerator.h
parentd8d9839ae67dacb569dcc3e1fcabdbeefb62fe8b (diff)
downloadllvm-d4d3dfd8ef1c58b5ec900ce8c349ccf35dcd2912.zip
llvm-d4d3dfd8ef1c58b5ec900ce8c349ccf35dcd2912.tar.gz
llvm-d4d3dfd8ef1c58b5ec900ce8c349ccf35dcd2912.tar.bz2
[ThinLTO] Add MODULE_CODE_METADATA_VALUES record
Summary: This is split out from the ThinLTO metadata mapping patch http://reviews.llvm.org/D14752. To avoid needing to parse the module level metadata during function importing, a new module-level record is added which holds the number of module-level metadata values. This is required because metadata value ids are assigned implicitly during parsing, and the function-level metadata ids start after the module-level metadata ids. I made a change to this version of the code compared to D14752 in order to add more consistent and thorough assertion checking of the new record value. We now unconditionally use the record value to initialize the MDValueList size, and handle it the same in parseMetadata for all module level metadata cases (lazy loading or not). Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14825 llvm-svn: 253668
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index 92d166e..abe383d 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
@@ -119,6 +119,7 @@ public:
unsigned getMetadataOrNullID(const Metadata *MD) const {
return MDValueMap.lookup(MD);
}
+ unsigned numMDs() const { return MDs.size(); }
bool hasMDString() const { return HasMDString; }
bool hasDILocation() const { return HasDILocation; }