diff options
author | John McCall <rjmccall@apple.com> | 2011-01-19 06:33:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-19 06:33:43 +0000 |
commit | 424cec97bdff219cd976dce85a405140069c57f9 (patch) | |
tree | 2398a9d0ab79460797b9e343d9e163f6b2b15a13 /clang/lib/Analysis/CFG.cpp | |
parent | 0c49533039cba8214ada637dd313f54c6a5a8364 (diff) | |
download | bcm5719-llvm-424cec97bdff219cd976dce85a405140069c57f9.tar.gz bcm5719-llvm-424cec97bdff219cd976dce85a405140069c57f9.zip |
Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.
llvm-svn: 123814
Diffstat (limited to 'clang/lib/Analysis/CFG.cpp')
-rw-r--r-- | clang/lib/Analysis/CFG.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index f1b9d4c076a..2cf2751879b 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/lib/Analysis/CFG.cpp @@ -419,9 +419,9 @@ private: // FIXME: Add support for dependent-sized array types in C++? // Does it even make sense to build a CFG for an uninstantiated template? -static VariableArrayType* FindVA(Type* t) { - while (ArrayType* vt = dyn_cast<ArrayType>(t)) { - if (VariableArrayType* vat = dyn_cast<VariableArrayType>(vt)) +static const VariableArrayType *FindVA(const Type *t) { + while (const ArrayType *vt = dyn_cast<ArrayType>(t)) { + if (const VariableArrayType *vat = dyn_cast<VariableArrayType>(vt)) if (vat->getSizeExpr()) return vat; @@ -1309,8 +1309,8 @@ CFGBlock *CFGBuilder::VisitDeclSubExpr(DeclStmt* DS) { } // If the type of VD is a VLA, then we must process its size expressions. - for (VariableArrayType* VA = FindVA(VD->getType().getTypePtr()); VA != 0; - VA = FindVA(VA->getElementType().getTypePtr())) + for (const VariableArrayType* VA = FindVA(VD->getType().getTypePtr()); + VA != 0; VA = FindVA(VA->getElementType().getTypePtr())) Block = addStmt(VA->getSizeExpr()); // Remove variable from local scope. @@ -2100,7 +2100,7 @@ CFGBlock *CFGBuilder::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E, // VLA types have expressions that must be evaluated. if (E->isArgumentType()) { - for (VariableArrayType* VA = FindVA(E->getArgumentType().getTypePtr()); + for (const VariableArrayType *VA =FindVA(E->getArgumentType().getTypePtr()); VA != 0; VA = FindVA(VA->getElementType().getTypePtr())) addStmt(VA->getSizeExpr()); } |