[cfe-commits] r147401 - /cfe/trunk/lib/AST/Decl.cpp

Rafael Espindola rafael.espindola at gmail.com
Sun Jan 1 09:48:19 PST 2012


Author: rafael
Date: Sun Jan  1 11:48:19 2012
New Revision: 147401

URL: http://llvm.org/viewvc/llvm-project?rev=147401&view=rev
Log:
Replace a isa+cast with a dyn_cast.

Modified:
    cfe/trunk/lib/AST/Decl.cpp

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=147401&r1=147400&r2=147401&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Sun Jan  1 11:48:19 2012
@@ -297,9 +297,9 @@
       for (const DeclContext *DC = D->getDeclContext();
            !isa<TranslationUnitDecl>(DC);
            DC = DC->getParent()) {
-        if (!isa<NamespaceDecl>(DC)) continue;
-        if (llvm::Optional<Visibility> Vis
-                           = cast<NamespaceDecl>(DC)->getExplicitVisibility()) {
+        const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(DC);
+        if (!ND) continue;
+        if (llvm::Optional<Visibility> Vis = ND->getExplicitVisibility()) {
           LV.setVisibility(*Vis, false);
           F.ConsiderGlobalVisibility = false;
           break;





More information about the cfe-commits mailing list