From: Ted Kremenek Date: Wed, 30 Jan 2008 18:54:06 +0000 (+0000) Subject: Minor cosmetic cleanups: replaced some integer literals with constants and X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6753fe3ac4ed5f4ec062ccf15a0eeb2724bc6d4d;p=clang 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 --- 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(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(this)->getSymbolID(); + Out << '$' << cast(this)->getSymbolID(); break; default: