diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-14 05:33:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-14 05:33:52 +0000 |
commit | 73920ce565fc54aea2bd0b8370567e8de3e4d71b (patch) | |
tree | 51bf19d4186e7c73d2a75d62b8990050ebd40176 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 6a0f907a5ec0d2af3378c7f79667240858d4906d (diff) | |
download | bcm5719-llvm-73920ce565fc54aea2bd0b8370567e8de3e4d71b.tar.gz bcm5719-llvm-73920ce565fc54aea2bd0b8370567e8de3e4d71b.zip |
reduce indentation, no functionality change.
llvm-svn: 69026
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 2bcd65e7b6d..7dacc3bfce0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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<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, |