summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-23 01:53:01 +0000
committerChris Lattner <sabre@nondot.org>2001-10-23 01:53:01 +0000
commit61b665528e7cfaaefc8ca0dfe44e2f9bf482e346 (patch)
treee6237aa95c5ba55ef85f4341302ceb298978e229
parent4b9c7c23b28025f71ff46c1dfada2dc4ad9da385 (diff)
downloadbcm5719-llvm-61b665528e7cfaaefc8ca0dfe44e2f9bf482e346.tar.gz
bcm5719-llvm-61b665528e7cfaaefc8ca0dfe44e2f9bf482e346.zip
Fix another annoying bug that took forever to track down. This one involves abstract type resolution at a bad time that broke symbol tables.
llvm-svn: 958
-rw-r--r--llvm/include/llvm/SymbolTable.h17
-rw-r--r--llvm/lib/Bytecode/Reader/ConstantReader.cpp5
2 files changed, 17 insertions, 5 deletions
diff --git a/llvm/include/llvm/SymbolTable.h b/llvm/include/llvm/SymbolTable.h
index 0a958fded78..c53cb785fa6 100644
--- a/llvm/include/llvm/SymbolTable.h
+++ b/llvm/include/llvm/SymbolTable.h
@@ -55,10 +55,6 @@ public:
// lookup - Returns null on failure...
Value *lookup(const Type *Ty, const string &name);
- // find - returns end(Ty->getIDNumber()) on failure...
- type_iterator type_find(const Type *Ty, const string &name);
- type_iterator type_find(const Value *D);
-
// insert - Add named definition to the symbol table...
inline void insert(Value *N) {
assert(N->hasName() && "Value must be named to go into symbol table!");
@@ -76,7 +72,9 @@ public:
}
void remove(Value *N);
- Value *type_remove(const type_iterator &It);
+ Value *type_remove(const type_iterator &It) {
+ return removeEntry(find(It->second->getType()), It);
+ }
// getUniqueName - Given a base name, return a string that is either equal to
// it (or derived from it) that does not already occur in the symbol table for
@@ -108,11 +106,20 @@ public:
void dump() const; // Debug method, print out symbol table
private:
+ inline super::value_type operator[](const Type *Ty) {
+ assert(0 && "Should not use this operator to access symbol table!");
+ return super::value_type();
+ }
+
// insertEntry - Insert a value into the symbol table with the specified
// name...
//
void insertEntry(const string &Name, const Type *Ty, Value *V);
+ // removeEntry - Remove a value from the symbol table...
+ //
+ Value *removeEntry(iterator Plane, type_iterator Entry);
+
// This function is called when one of the types in the type plane are refined
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
};
diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp
index 6b69b361c1e..13f8747cb7d 100644
--- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/llvm/lib/Bytecode/Reader/ConstantReader.cpp
@@ -87,6 +87,11 @@ const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf,
break;
}
+ case Type::OpaqueTyID: {
+ Val = OpaqueType::get();
+ break;
+ }
+
default:
cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to deserialize"
<< " primitive Type " << PrimType << "\n";
OpenPOWER on IntegriCloud