From: Chris Lattner Date: Tue, 14 Apr 2009 05:33:52 +0000 (+0000) Subject: reduce indentation, no functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f9427999cf69b3b89cd0ed3be16ed27a1c282c7;p=clang reduce indentation, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69026 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 2bcd65e7b6..7dacc3bfce 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -239,39 +239,35 @@ void CodeGenModule::SetGlobalValueAttributes(const Decl *D, // approximation of what we really want. if (!ForDefinition) { // Only a few attributes are set on declarations. - if (D->hasAttr()) { - // The dllimport attribute is overridden by a subsequent declaration as - // dllexport. - if (!D->hasAttr()) { - // dllimport attribute can be applied only to function decls, not to - // definitions. - if (const FunctionDecl *FD = dyn_cast(D)) { - if (!FD->getBody()) - GV->setLinkage(llvm::Function::DLLImportLinkage); - } else + + // The dllimport attribute is overridden by a subsequent declaration as + // dllexport. + if (D->hasAttr() && !D->hasAttr()) { + // dllimport attribute can be applied only to function decls, not to + // definitions. + if (const FunctionDecl *FD = dyn_cast(D)) { + if (!FD->getBody()) GV->setLinkage(llvm::Function::DLLImportLinkage); - } - } else if (D->hasAttr() || - D->hasAttr()) { + } else + GV->setLinkage(llvm::Function::DLLImportLinkage); + } else if (D->hasAttr() || D->hasAttr()) { // "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()) { + if (const FunctionDecl *FD = dyn_cast(D)) { + // The dllexport attribute is ignored for undefined symbols. + if (FD->getBody()) + GV->setLinkage(llvm::Function::DLLExportLinkage); } else { - if (D->hasAttr()) { - if (const FunctionDecl *FD = dyn_cast(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() || D->hasAttr() || - IsInline) - GV->setLinkage(llvm::Function::WeakAnyLinkage); + GV->setLinkage(llvm::Function::DLLExportLinkage); } + } else if (D->hasAttr() || D->hasAttr() || + IsInline) { + GV->setLinkage(llvm::Function::WeakAnyLinkage); } // FIXME: Figure out the relative priority of the attribute,