summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-23 02:20:07 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-23 02:20:07 +0000
commit70a9cd4cbe20dfdd26051c3683c5d0bf3b8a2ec0 (patch)
tree6a917dd3815de865e2c312ffc6609ade2e9fc980 /llvm/lib/Bitcode/Reader/MetadataLoader.cpp
parentec68dd49bfa3a0e7e68e272e4331d27340b1f639 (diff)
downloadbcm5719-llvm-70a9cd4cbe20dfdd26051c3683c5d0bf3b8a2ec0.tar.gz
bcm5719-llvm-70a9cd4cbe20dfdd26051c3683c5d0bf3b8a2ec0.zip
MetadataLoader: Make sure every member of MetadataLoader are initialized (NFC)
llvm-svn: 290407
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/MetadataLoader.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 695b2b09e6e..1cfa1a82182 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -97,10 +97,18 @@ namespace {
static int64_t unrotateSign(uint64_t U) { return U & 1 ? ~(U >> 1) : U >> 1; }
class BitcodeReaderMetadataList {
- unsigned NumFwdRefs;
- bool AnyFwdRefs;
- unsigned MinFwdRef;
- unsigned MaxFwdRef;
+ /// Keep track of the current number of ForwardReference in the list.
+ unsigned NumFwdRefs = 0;
+ /// Maintain the range [min-max] that needs to be inspected to resolve cycles.
+ /// This is the range of Metadata that have involved forward reference during
+ /// loading and that needs to be inspected to resolve cycles. It is purely an
+ /// optimization to avoid spending time resolving cycles outside of this
+ /// range, i.e. where there hasn't been any forward reference.
+ unsigned MinFwdRef = 0;
+ unsigned MaxFwdRef = 0;
+ /// Set to true if there was any FwdRef encountered. This is used to track if
+ /// we need to resolve cycles after loading metadatas.
+ bool AnyFwdRefs = false;
/// Array of metadata references.
///
@@ -119,8 +127,7 @@ class BitcodeReaderMetadataList {
LLVMContext &Context;
public:
- BitcodeReaderMetadataList(LLVMContext &C)
- : NumFwdRefs(0), AnyFwdRefs(false), Context(C) {}
+ BitcodeReaderMetadataList(LLVMContext &C) : Context(C) {}
// vector compatibility methods
unsigned size() const { return MetadataPtrs.size(); }
OpenPOWER on IntegriCloud