[cfe-commits] r48273 - /cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
Ted Kremenek
kremenek at apple.com
Tue Mar 11 19:00:37 PDT 2008
Author: kremenek
Date: Tue Mar 11 21:00:37 2008
New Revision: 48273
URL: http://llvm.org/viewvc/llvm-project?rev=48273&view=rev
Log:
Fixed regression in SymbolManager introduced in r48272.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h?rev=48273&r1=48272&r2=48273&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h Tue Mar 11 21:00:37 2008
@@ -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 @@
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);
More information about the cfe-commits
mailing list