]> granicus.if.org Git - clang/commitdiff
Use 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any
authorTed Kremenek <kremenek@apple.com>
Tue, 21 Apr 2009 17:37:26 +0000 (17:37 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 21 Apr 2009 17:37:26 +0000 (17:37 +0000)
layered regions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69686 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/SVals.cpp

index 8eaeda4b7d575e07d37b4c6809cc71d28a83d60b..71f09d2dfcda66b23a3f591f962e9ced6ea1d4f8 100644 (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();
     }