diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-09-26 16:26:36 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-09-26 16:26:36 +0000 |
commit | 61a625ff702c7d174b302b0db032dc5568ebc054 (patch) | |
tree | 834c9e8dad8138aa9ffaac2df1937c2a32febd65 /clang/lib/Analysis/LiveVariables.cpp | |
parent | ba756cb3fc5538f193d1143bfbd116744954b029 (diff) | |
download | bcm5719-llvm-61a625ff702c7d174b302b0db032dc5568ebc054.tar.gz bcm5719-llvm-61a625ff702c7d174b302b0db032dc5568ebc054.zip |
Move VLA processing logic from LiveVariables to CFG construction. This way all dataflow analyses "see" the VLA size expressions.
llvm-svn: 56655
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index e82c1e0bc01..58affbfcda5 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -226,18 +226,6 @@ void TransferFuncs::VisitAssign(BinaryOperator* B) { Visit(B->getRHS()); } -static VariableArrayType* FindVA(Type* t) { - while (ArrayType* vt = dyn_cast<ArrayType>(t)) { - if (VariableArrayType* vat = dyn_cast<VariableArrayType>(vt)) - if (vat->getSizeExpr()) - return vat; - - t = vt->getElementType().getTypePtr(); - } - - return NULL; -} - void TransferFuncs::VisitDeclStmt(DeclStmt* DS) { // Declarations effectively "kill" a variable since they cannot // possibly be live before they are declared. @@ -253,14 +241,6 @@ void TransferFuncs::VisitDeclStmt(DeclStmt* DS) { // Update liveness information by killing the VarDecl. unsigned bit = AD.getIdx(VD); LiveState.getDeclBit(bit) = Dead | AD.AlwaysLive.getDeclBit(bit); - - // If the type of VD is a VLA, then we must process its size expressions. - // These expressions are evaluated before the variable comes into scope, - // so in a reverse dataflow analysis we evaluate them last. - for (VariableArrayType* VA = FindVA(VD->getType().getTypePtr()); VA != 0; - VA = FindVA(VA->getElementType().getTypePtr())) - Visit(VA->getSizeExpr()); - } } |