]> granicus.if.org Git - clang/commitdiff
Further tweak nonloc::ConcreteInt pretty printing
authorTed Kremenek <kremenek@apple.com>
Thu, 23 Dec 2010 02:42:46 +0000 (02:42 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 23 Dec 2010 02:42:46 +0000 (02:42 +0000)
to correctly print out negative values for
signed integers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122470 91177308-0d34-0410-b5e6-96231b3b80d8

lib/GR/SVals.cpp

index 1e583128ffcc1f919811f571436eeda5a9ff9198..0484b62f8aaf3f7facaf74766ab4ad84f49a9ccc 100644 (file)
@@ -292,8 +292,11 @@ void NonLoc::dumpToStream(llvm::raw_ostream& os) const {
   switch (getSubKind()) {
     case nonloc::ConcreteIntKind: {
       const nonloc::ConcreteInt& C = *cast<nonloc::ConcreteInt>(this);
-      os << C.getValue().getZExtValue()
-         << ' ' << ((C.getValue().isUnsigned()) ? 'U' : 'S')
+      if (C.getValue().isUnsigned())
+        os << C.getValue().getZExtValue();
+      else
+        os << C.getValue().getSExtValue();
+      os << ' ' << (C.getValue().isUnsigned() ? 'U' : 'S')
          << C.getValue().getBitWidth() << 'b';
       break;
     }