diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-02-26 21:04:29 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-02-26 21:04:29 +0000 |
| commit | c7ba873dc729aaaad9d65b2264d11dcf7aacb1d4 (patch) | |
| tree | 5ef0f8675878ddc4da96702df485d9b3402c9f09 | |
| parent | fa6b3668922773e8d446c5755728f64d0b19dc95 (diff) | |
| download | bcm5719-llvm-c7ba873dc729aaaad9d65b2264d11dcf7aacb1d4.tar.gz bcm5719-llvm-c7ba873dc729aaaad9d65b2264d11dcf7aacb1d4.zip | |
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
llvm-svn: 47624
| -rw-r--r-- | clang/Analysis/ValueState.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/Analysis/ValueState.cpp b/clang/Analysis/ValueState.cpp index b892fd68524..7be59ce5f5f 100644 --- a/clang/Analysis/ValueState.cpp +++ b/clang/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); |

