[cfe-commits] r124542 - /cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Anders Carlsson andersca at mac.com
Sat Jan 29 11:41:00 PST 2011


Author: andersca
Date: Sat Jan 29 13:41:00 2011
New Revision: 124542

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

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=124542&r1=124541&r2=124542&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Jan 29 13:41:00 2011
@@ -457,8 +457,8 @@
 
 void CodeGenModule::SetCommonAttributes(const Decl *D,
                                         llvm::GlobalValue *GV) {
-  if (isa<NamedDecl>(D))
-    setGlobalVisibility(GV, cast<NamedDecl>(D));
+  if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
+    setGlobalVisibility(GV, ND);
   else
     GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
 





More information about the cfe-commits mailing list