summaryrefslogtreecommitdiff
path: root/lib/Bitcode/Reader/BitcodeReader.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-21 01:54:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-21 01:54:58 +0000
commit44925966abca7b3106a6ff5d7b6160216b204407 (patch)
tree3a54b6fe0ba331e597c9c46be0fc7d5cdf6af32e /lib/Bitcode/Reader/BitcodeReader.h
parentd5fe57d2f980c6bd1a61450f99c254a76d0f1683 (diff)
downloadllvm-44925966abca7b3106a6ff5d7b6160216b204407.tar.gz
llvm-44925966abca7b3106a6ff5d7b6160216b204407.tar.bz2
llvm-44925966abca7b3106a6ff5d7b6160216b204407.tar.xz
Revert 55090, regressions in:
- Postgres - llvm-test/SingleSource/UnitTests/{2006-01-23-InitializedBitField, 2004-11-28-GlobalBoolLayout, 2003-05-02-DependentPHI} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h36
1 files changed, 5 insertions, 31 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index 7bd05cfd2d..9f62efec29 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -32,22 +32,9 @@ namespace llvm {
class BitcodeReaderValueList : public User {
unsigned Capacity;
-
- /// ResolveConstants - As we resolve forward-referenced constants, we add
- /// information about them to this vector. This allows us to resolve them in
- /// bulk instead of resolving each reference at a time. See the code in
- /// ResolveConstantForwardRefs for more information about this.
- ///
- /// 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;
- ResolveConstantsTy ResolveConstants;
public:
BitcodeReaderValueList() : User(Type::VoidTy, Value::ArgumentVal, 0, 0)
, Capacity(0) {}
- ~BitcodeReaderValueList() {
- assert(ResolveConstants.empty() && "Constants not resolved?");
- }
/// Provide fast operand accessors
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -63,7 +50,6 @@ public:
}
void clear() {
- assert(ResolveConstants.empty() && "Constants not resolved?");
if (OperandList) dropHungoffUses(OperandList);
Capacity = 0;
}
@@ -87,26 +73,15 @@ public:
if (Idx == size()) {
push_back(V);
} else if (Value *OldV = getOperand(Idx)) {
- // Handle constants and non-constants (e.g. instrs) differently for
- // efficiency.
- if (Constant *PHC = dyn_cast<Constant>(OldV)) {
- ResolveConstants.push_back(std::make_pair(PHC, Idx));
- setOperand(Idx, V);
- } else {
- // If there was a forward reference to this value, replace it.
- setOperand(Idx, V);
- OldV->replaceAllUsesWith(V);
- delete OldV;
- }
+ // If there was a forward reference to this value, replace it.
+ setOperand(Idx, V);
+ OldV->replaceAllUsesWith(V);
+ delete OldV;
} else {
initVal(Idx, V);
}
}
- /// ResolveConstantForwardRefs - Once all constants are read, this method bulk
- /// resolves any forward references.
- void ResolveConstantForwardRefs();
-
private:
void initVal(unsigned Idx, Value *V) {
if (Idx >= size()) {
@@ -119,8 +94,7 @@ private:
};
template <>
-struct OperandTraits<BitcodeReaderValueList>
- : HungoffOperandTraits</*16 FIXME*/> {
+struct OperandTraits<BitcodeReaderValueList> : HungoffOperandTraits</*16 FIXME*/> {
};
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BitcodeReaderValueList, Value)