aboutsummaryrefslogtreecommitdiff
path: root/Analysis/ValueState.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-26 21:04:29 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-26 21:04:29 +0000
commitebd6610f9b92342b79401cab324bb8c28b0dfa69 (patch)
treec380b9ceab755d34c8ed392cc88cd6e6ccd0bd12 /Analysis/ValueState.cpp
parent58b3321009b3f750fb4587b12c2024bb77e6ebf0 (diff)
Removed hack with toggling the signedness flag of the APSInt stored
in an EnumConstantDecl. This was made possible because of a recent fix in the parser: http://llvm.org/viewvc/llvm-project?rev=47581&view=rev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Analysis/ValueState.cpp')
-rw-r--r--Analysis/ValueState.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index b892fd6852..7be59ce5f5 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -246,15 +246,8 @@ RVal ValueStateManager::GetRVal(ValueState St, Expr* E) {
// already has persistent storage? We do this because we
// are comparing states using pointer equality. Perhaps there is
// a better way, since APInts are fairly lightweight.
- llvm::APSInt X = ED->getInitVal();
-
- // FIXME: This is a hack. The APSInt inside the EnumConstantDecl
- // might not match the signedness of the DeclRefExpr. We hack
- // a workaround here. Should be fixed elsewhere.
- if (E->getType()->isUnsignedIntegerType() != X.isUnsigned())
- X.setIsUnsigned(!X.isUnsigned());
-
- return nonlval::ConcreteInt(ValMgr.getValue(X));
+
+ return nonlval::ConcreteInt(ValMgr.getValue(ED->getInitVal()));
}
else if (FunctionDecl* FD = dyn_cast<FunctionDecl>(D))
return lval::FuncVal(FD);