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 | f4c7371fb1d3cebcfb40abad4537bb82515704ea (patch) | |
tree | 1ef9169970f5c94e0694b1b1b1c6d9acffc96c74 /lib/Analysis/CFG.cpp | |
parent | f7e22d86167a9fbb42c5ab5b349a34d123a2e2b5 (diff) |
Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CFG.cpp')
-rw-r--r-- | lib/Analysis/CFG.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index f1b9d4c076..2cf2751879 100644 --- a/lib/Analysis/CFG.cpp +++ b/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()); } |