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

Chris Lattner sabre at nondot.org
Mon Apr 13 22:33:52 PDT 2009


Author: lattner
Date: Tue Apr 14 00:33:52 2009
New Revision: 69026

URL: http://llvm.org/viewvc/llvm-project?rev=69026&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=69026&r1=69025&r2=69026&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Tue Apr 14 00:33:52 2009
@@ -239,39 +239,35 @@
   // approximation of what we really want.
   if (!ForDefinition) {
     // Only a few attributes are set on declarations.
-    if (D->hasAttr<DLLImportAttr>()) {
-      // The dllimport attribute is overridden by a subsequent declaration as
-      // dllexport.
-      if (!D->hasAttr<DLLExportAttr>()) {
-        // dllimport attribute can be applied only to function decls, not to
-        // definitions.
-        if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
-          if (!FD->getBody())
-            GV->setLinkage(llvm::Function::DLLImportLinkage);
-        } else
+    
+    // The dllimport attribute is overridden by a subsequent declaration as
+    // dllexport.
+    if (D->hasAttr<DLLImportAttr>() && !D->hasAttr<DLLExportAttr>()) {
+      // dllimport attribute can be applied only to function decls, not to
+      // definitions.
+      if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
+        if (!FD->getBody())
           GV->setLinkage(llvm::Function::DLLImportLinkage);
-      }
-    } else if (D->hasAttr<WeakAttr>() || 
-               D->hasAttr<WeakImportAttr>()) {
+      } else
+        GV->setLinkage(llvm::Function::DLLImportLinkage);
+    } else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>()) {
       // "extern_weak" is overloaded in LLVM; we probably should have
       // separate linkage types for this. 
       GV->setLinkage(llvm::Function::ExternalWeakLinkage);
-   }
-  } else {
-    if (IsInternal) {
-      GV->setLinkage(llvm::Function::InternalLinkage);
+    }
+  } else if (IsInternal) {
+    GV->setLinkage(llvm::Function::InternalLinkage);
+  } else if (D->hasAttr<DLLExportAttr>()) {
+    if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
+      // The dllexport attribute is ignored for undefined symbols.
+      if (FD->getBody())
+        GV->setLinkage(llvm::Function::DLLExportLinkage);
     } else {
-      if (D->hasAttr<DLLExportAttr>()) {
-        if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
-          // The dllexport attribute is ignored for undefined symbols.
-          if (FD->getBody())
-            GV->setLinkage(llvm::Function::DLLExportLinkage);
-        } else
-          GV->setLinkage(llvm::Function::DLLExportLinkage);
-      } else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>() || 
-                 IsInline)
-        GV->setLinkage(llvm::Function::WeakAnyLinkage);
+      GV->setLinkage(llvm::Function::DLLExportLinkage);
     }
+  } else if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>() ||
+             IsInline) {
+    GV->setLinkage(llvm::Function::WeakAnyLinkage);
   }
 
   // FIXME: Figure out the relative priority of the attribute,





More information about the cfe-commits mailing list