Fixed regression in SymbolManager introduced in r48272.

llvm-svn: 48273
This commit is contained in:
Ted Kremenek 2008-03-12 02:00:37 +00:00
parent 68d73d19f1
commit 48a3410e25
1 changed files with 11 additions and 12 deletions

View File

@ -24,24 +24,23 @@
namespace clang {
class SymbolManager;
class SymbolID {
unsigned Data;
public:
SymbolID() : Data(~0U - 2) {}
SymbolID(unsigned x) : Data(x) {}
operator unsigned() const { return Data; }
unsigned getNumber() const { return Data; }
bool isInitialized() const { return Data != (unsigned) (~0U - 2); }
operator unsigned() const { return getNumber(); }
unsigned getNumber() const { assert (isInitialized()); return Data; }
void Profile(llvm::FoldingSetNodeID& ID) const {
assert (isInitialized());
ID.AddInteger(Data);
}
static inline void Profile(llvm::FoldingSetNodeID& ID, SymbolID X) {
X.Profile(ID);
}
};
} // end clang namespace
@ -208,11 +207,11 @@ public:
Op(op), Val(V) {}
BinaryOperator::Opcode getOpcode() const { return Op; }
SymbolID getSymbol() const { return Symbol; }
const SymbolID& getSymbol() const { return Symbol; }
const llvm::APSInt& getInt() const { return Val; }
static inline void Profile(llvm::FoldingSetNodeID& ID,
const SymbolID& Symbol,
SymbolID Symbol,
BinaryOperator::Opcode Op,
const llvm::APSInt& Val) {
Symbol.Profile(ID);