aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-05-26 21:46:18 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-05-26 21:46:18 +0000
commit9b41dcfa60b9fe436ee68bcd5a9e401f58aac872 (patch)
tree20310528d4bbacbf1d28e21e5c01aaba19863dfe
parente5828f1fa7c2691f747f5060ce11b8e55cea03ab (diff)
Tighten up checking on SymbolTable interface to make it illegal to pass a
Type* where a Value* is expected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13794 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/SymbolTable.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h
index b8fd2e9d69..33b026ea25 100644
--- a/include/llvm/SymbolTable.h
+++ b/include/llvm/SymbolTable.h
@@ -165,8 +165,9 @@ public:
/// @brief Insert a constant or type.
inline void insert(const std::string &Name, Value *Val) {
assert(Val && "Can't insert null type into symbol table!");
- assert((isa<Type>(Val) || isa<Constant>(Val)) &&
- "Can only insert types and constants into a symbol table!");
+ assert(!isa<Type>(Val) && "Cannot insert types with this interface!");
+ assert(isa<Constant>(Val) &&
+ "Can only insert constants into a symbol table!");
insertEntry(Name, Val->getType(), Val);
}
@@ -201,6 +202,7 @@ public:
/// @brief Remove a constant or type from the symbol table.
inline Value* remove(const std::string &Name, Value *Val) {
assert(Val && "Can't remove null value from symbol table!");
+ assert(!isa<Type>(Val) && "Can't remove types with this interface!");
plane_iterator PI = pmap.find(Val->getType());
return removeEntry(PI, PI->second.find(Name));
}