Use 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any

layered regions.

llvm-svn: 69686
This commit is contained in:
Ted Kremenek 2009-04-21 17:37:26 +00:00
parent 55f84db7ea
commit 30fb341f4f
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ using llvm::APSInt;
const FunctionDecl* SVal::getAsFunctionDecl() const {
if (const loc::MemRegionVal* X = dyn_cast<loc::MemRegionVal>(this)) {
const MemRegion* R = X->getRegion();
if (const CodeTextRegion* CTR = dyn_cast<CodeTextRegion>(R)) {
if (const CodeTextRegion* CTR = R->getAs<CodeTextRegion>()) {
if (CTR->isDeclared())
return CTR->getDecl();
}