summaryrefslogtreecommitdiffstats
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
commitebb1569d385d12bc7138f268dbd1bfb0a5fa9d8a (patch)
tree962b08047481b004c189530bbff8d47568e0adb2
parent9f0fdf748243844ae04aa3561b591edb2d9283e4 (diff)
downloadbcm5719-llvm-ebb1569d385d12bc7138f268dbd1bfb0a5fa9d8a.tar.gz
bcm5719-llvm-ebb1569d385d12bc7138f268dbd1bfb0a5fa9d8a.zip
Tighten up checking on SymbolTable interface to make it illegal to pass a
Type* where a Value* is expected. llvm-svn: 13794
-rw-r--r--llvm/include/llvm/SymbolTable.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/include/llvm/SymbolTable.h b/llvm/include/llvm/SymbolTable.h
index b8fd2e9d691..33b026ea257 100644
--- a/llvm/include/llvm/SymbolTable.h
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud