[cfe-commits] r58182 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/BasicConstraintManager.cpp lib/Analysis/BasicStore.cpp lib/Analysis/GRSimpleVals.cpp lib/Analysis/RegionStore.cpp lib/Analysis/SVals.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Sat Oct 25 19:27:21 PDT 2008
Author: zhongxingxu
Date: Sat Oct 25 21:27:21 2008
New Revision: 58182
URL: http://llvm.org/viewvc/llvm-project?rev=58182&view=rev
Log:
Remove loc::StringLiteralVal. Now we allocate regions for string literals in the Store.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
cfe/trunk/lib/Analysis/BasicConstraintManager.cpp
cfe/trunk/lib/Analysis/BasicStore.cpp
cfe/trunk/lib/Analysis/GRSimpleVals.cpp
cfe/trunk/lib/Analysis/RegionStore.cpp
cfe/trunk/lib/Analysis/SVals.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Sat Oct 25 21:27:21 2008
@@ -290,7 +290,7 @@
namespace loc {
enum Kind { SymbolValKind, GotoLabelKind, MemRegionKind, FuncValKind,
- ConcreteIntKind, StringLiteralValKind };
+ ConcreteIntKind };
class SymbolVal : public Loc {
public:
@@ -412,23 +412,6 @@
}
};
-class StringLiteralVal : public Loc {
-public:
- StringLiteralVal(StringLiteral* L) : Loc(StringLiteralValKind, L) {}
-
- StringLiteral* getLiteral() const { return (StringLiteral*) Data; }
-
- // Implement isa<T> support.
- static inline bool classof(const SVal* V) {
- return V->getBaseKind() == LocKind &&
- V->getSubKind() == StringLiteralValKind;
- }
-
- static inline bool classof(const Loc* V) {
- return V->getSubKind() == StringLiteralValKind;
- }
-};
-
} // end clang::loc namespace
} // end clang namespace
Modified: cfe/trunk/lib/Analysis/BasicConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicConstraintManager.cpp?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BasicConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicConstraintManager.cpp Sat Oct 25 21:27:21 2008
@@ -151,7 +151,6 @@
case loc::FuncValKind:
case loc::GotoLabelKind:
- case loc::StringLiteralValKind:
isFeasible = Assumption;
return St;
Modified: cfe/trunk/lib/Analysis/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicStore.cpp?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Sat Oct 25 21:27:21 2008
@@ -125,7 +125,6 @@
break;
case loc::ConcreteIntKind:
- case loc::StringLiteralValKind:
// While these seem funny, this can happen through casts.
// FIXME: What we should return is the field offset. For example,
// add the field offset to the integer value. That way funny things
@@ -178,10 +177,6 @@
case loc::FuncValKind:
return LV;
- case loc::StringLiteralValKind:
- // FIXME: Implement better support for fetching characters from strings.
- return UnknownVal();
-
default:
assert (false && "Invalid Loc.");
break;
Modified: cfe/trunk/lib/Analysis/GRSimpleVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.cpp?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Sat Oct 25 21:27:21 2008
@@ -285,7 +285,6 @@
case loc::MemRegionKind:
case loc::FuncValKind:
case loc::GotoLabelKind:
- case loc::StringLiteralValKind:
return NonLoc::MakeIntTruthVal(BasicVals, L == R);
}
@@ -344,7 +343,6 @@
case loc::MemRegionKind:
case loc::FuncValKind:
case loc::GotoLabelKind:
- case loc::StringLiteralValKind:
return NonLoc::MakeIntTruthVal(BasicVals, L != R);
}
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Sat Oct 25 21:27:21 2008
@@ -149,7 +149,6 @@
return UndefinedVal();
case loc::ConcreteIntKind:
- case loc::StringLiteralValKind:
// While these seem funny, this can happen through casts.
// FIXME: What we should return is the field offset. For example,
// add the field offset to the integer value. That way funny things
@@ -227,9 +226,6 @@
case loc::FuncValKind:
return L;
- case loc::StringLiteralValKind:
- return UnknownVal();
-
default:
assert(false && "Invalid Location");
break;
Modified: cfe/trunk/lib/Analysis/SVals.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SVals.cpp?rev=58182&r1=58181&r2=58182&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Sat Oct 25 21:27:21 2008
@@ -261,10 +261,6 @@
Loc Loc::MakeVal(AddrLabelExpr* E) { return loc::GotoLabel(E->getLabel()); }
-Loc Loc::MakeVal(StringLiteral* S) {
- return loc::StringLiteralVal(S);
-}
-
//===----------------------------------------------------------------------===//
// Pretty-Printing.
//===----------------------------------------------------------------------===//
@@ -386,12 +382,6 @@
<< cast<loc::FuncVal>(this)->getDecl()->getIdentifier()->getName();
break;
- case loc::StringLiteralValKind:
- Out << "literal \""
- << cast<loc::StringLiteralVal>(this)->getLiteral()->getStrData()
- << "\"";
- break;
-
default:
assert (false && "Pretty-printing not implemented for this Loc.");
break;
@@ -517,12 +507,6 @@
<< cast<loc::FuncVal>(this)->getDecl()->getIdentifier()->getName();
break;
- case loc::StringLiteralValKind:
- Out << "literal \""
- << cast<loc::StringLiteralVal>(this)->getLiteral()->getStrData()
- << "\"";
- break;
-
default:
assert (false && "Pretty-printing not implemented for this Loc.");
break;
More information about the cfe-commits
mailing list