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

Daniel Dunbar daniel at zuster.org
Tue Apr 14 00:02:18 PDT 2009


Author: ddunbar
Date: Tue Apr 14 02:02:17 2009
New Revision: 69033

URL: http://llvm.org/viewvc/llvm-project?rev=69033&view=rev
Log:
Reduce indentation, no functionality change.

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=69033&r1=69032&r2=69033&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Apr 14 02:02:17 2009
@@ -324,20 +324,21 @@
 
 static CodeGenModule::GVALinkage 
 GetLinkageForFunctionOrMethodDecl(const Decl *D) {
-  if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
-    // "static" and attr(always_inline) functions get internal linkage.
-    if (FD->getStorageClass() == FunctionDecl::Static ||
-        FD->hasAttr<AlwaysInlineAttr>())
-      return CodeGenModule::GVA_Internal;
-    if (FD->isInline()) {
-      if (FD->getStorageClass() == FunctionDecl::Extern)
-        return CodeGenModule::GVA_ExternInline;
-      return CodeGenModule::GVA_Inline;
-    }
-  } else {
-    assert(isa<ObjCMethodDecl>(D));
+  if (isa<ObjCMethodDecl>(D))
     return CodeGenModule::GVA_Internal;
+
+  const FunctionDecl *FD = cast<FunctionDecl>(D);
+  // "static" and attr(always_inline) functions get internal linkage.
+  if (FD->getStorageClass() == FunctionDecl::Static ||
+      FD->hasAttr<AlwaysInlineAttr>())
+    return CodeGenModule::GVA_Internal;
+
+  if (FD->isInline()) {
+    if (FD->getStorageClass() == FunctionDecl::Extern)
+      return CodeGenModule::GVA_ExternInline;
+    return CodeGenModule::GVA_Inline;
   }
+
   return CodeGenModule::GVA_Normal;
 }
 





More information about the cfe-commits mailing list