[cfe-commits] r46564 - /cfe/trunk/Analysis/GRConstants.cpp

Ted Kremenek kremenek at apple.com
Wed Jan 30 10:54:06 PST 2008


Author: kremenek
Date: Wed Jan 30 12:54:06 2008
New Revision: 46564

URL: http://llvm.org/viewvc/llvm-project?rev=46564&view=rev
Log:
Minor cosmetic cleanups: replaced some integer literals with constants and
more cleanups with pretty-printing of analysis results.

Modified:
    cfe/trunk/Analysis/GRConstants.cpp

Modified: cfe/trunk/Analysis/GRConstants.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/GRConstants.cpp?rev=46564&r1=46563&r2=46564&view=diff

==============================================================================
--- cfe/trunk/Analysis/GRConstants.cpp (original)
+++ cfe/trunk/Analysis/GRConstants.cpp Wed Jan 30 12:54:06 2008
@@ -289,7 +289,9 @@
 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 @@
 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 @@
   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 @@
       break;
       
     case SymbolicNonLValueKind:
-      Out << "sym-" << cast<SymbolicNonLValue>(this)->getSymbolID();
+      Out << '$' << cast<SymbolicNonLValue>(this)->getSymbolID();
       break;
       
     default:





More information about the cfe-commits mailing list