diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/ValueList.h')
-rw-r--r-- | llvm/lib/Bitcode/Reader/ValueList.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Reader/ValueList.h b/llvm/lib/Bitcode/Reader/ValueList.h index 72775a3cf3b..5ad7899347a 100644 --- a/llvm/lib/Bitcode/Reader/ValueList.h +++ b/llvm/lib/Bitcode/Reader/ValueList.h @@ -1,4 +1,4 @@ -//===-- Bitcode/Reader/ValueEnumerator.h - Number values --------*- C++ -*-===// +//===-- Bitcode/Reader/ValueList.h - Number values --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,13 +11,20 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/ValueHandle.h" +#ifndef LLVM_LIB_BITCODE_READER_VALUELIST_H +#define LLVM_LIB_BITCODE_READER_VALUELIST_H +#include "llvm/IR/ValueHandle.h" +#include <cassert> +#include <utility> #include <vector> namespace llvm { + class Constant; +class LLVMContext; +class Type; +class Value; class BitcodeReaderValueList { std::vector<WeakTrackingVH> ValuePtrs; @@ -29,12 +36,13 @@ class BitcodeReaderValueList { /// /// The key of this vector is the placeholder constant, the value is the slot /// number that holds the resolved value. - typedef std::vector<std::pair<Constant *, unsigned>> ResolveConstantsTy; + using ResolveConstantsTy = std::vector<std::pair<Constant *, unsigned>>; ResolveConstantsTy ResolveConstants; LLVMContext &Context; public: BitcodeReaderValueList(LLVMContext &C) : Context(C) {} + ~BitcodeReaderValueList() { assert(ResolveConstants.empty() && "Constants not resolved?"); } @@ -73,4 +81,6 @@ public: void resolveConstantForwardRefs(); }; -} // namespace llvm +} // end namespace llvm + +#endif // LLVM_LIB_BITCODE_READER_VALUELIST_H |