aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-30 18:54:06 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-30 18:54:06 +0000
commit6753fe3ac4ed5f4ec062ccf15a0eeb2724bc6d4d (patch)
treeee03b16bf16e2ac8cb6b347201795e65f2da358a
parent6c751c2d7b5b27ee0432097bfcb82efccbca82cd (diff)
Minor cosmetic cleanups: replaced some integer literals with constants and
more cleanups with pretty-printing of analysis results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46564 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Analysis/GRConstants.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Analysis/GRConstants.cpp b/Analysis/GRConstants.cpp
index ad00b608c8..f2676a0e6e 100644
--- a/Analysis/GRConstants.cpp
+++ b/Analysis/GRConstants.cpp
@@ -289,7 +289,9 @@ namespace {
class VISIBILITY_HIDDEN RValue {
public:
enum BaseKind { LValueKind=0x0, NonLValueKind=0x1,
- UninitializedKind=0x2, InvalidKind=0x3, BaseFlags = 0x3 };
+ UninitializedKind=0x2, InvalidKind=0x3 };
+
+ enum { BaseBits = 2, BaseMask = 0x3 };
private:
void* Data;
@@ -298,7 +300,7 @@ private:
protected:
RValue(const void* d, bool isLValue, unsigned ValKind)
: Data(const_cast<void*>(d)),
- Kind((isLValue ? LValueKind : NonLValueKind) | (ValKind << 2)) {}
+ Kind((isLValue ? LValueKind : NonLValueKind) | (ValKind << BaseBits)) {}
explicit RValue(BaseKind k)
: Data(0), Kind(k) {}
@@ -313,8 +315,8 @@ public:
RValue Cast(ValueManager& ValMgr, Expr* CastExpr) const;
unsigned getRawKind() const { return Kind; }
- BaseKind getBaseKind() const { return (BaseKind) (Kind & 0x3); }
- unsigned getSubKind() const { return (Kind & ~0x3) >> 2; }
+ BaseKind getBaseKind() const { return (BaseKind) (Kind & BaseMask); }
+ unsigned getSubKind() const { return (Kind & ~BaseMask) >> BaseBits; }
void Profile(llvm::FoldingSetNodeID& ID) const {
ID.AddInteger((unsigned) getRawKind());
@@ -693,7 +695,7 @@ void NonLValue::print(std::ostream& Out) const {
break;
case SymbolicNonLValueKind:
- Out << "sym-" << cast<SymbolicNonLValue>(this)->getSymbolID();
+ Out << '$' << cast<SymbolicNonLValue>(this)->getSymbolID();
break;
default: