From fcfbcc6d103802e15e03d10d5bdec4d4dfa8b371 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 8 Oct 2014 00:00:09 +0000 Subject: Avoid code duplication by calling setAliasAttributes in EmitAliasDefinition. llvm-svn: 219258 --- clang/lib/CodeGen/CodeGenModule.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 6e7da49a44d4..a7a65b88c916 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2362,21 +2362,12 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { // Set attributes which are particular to an alias; this is a // specialization of the attributes which may be set on a global // variable/function. - if (D->hasAttr()) { - if (const auto *FD = dyn_cast(D)) { - // The dllexport attribute is ignored for undefined symbols. - if (FD->hasBody()) - GA->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass); - } else { - GA->setDLLStorageClass(llvm::GlobalValue::DLLExportStorageClass); - } - } else if (D->hasAttr() || - D->hasAttr() || - D->isWeakImported()) { + if (D->hasAttr() || D->hasAttr() || + D->isWeakImported()) { GA->setLinkage(llvm::Function::WeakAnyLinkage); } - SetCommonAttributes(D, GA); + setAliasAttributes(D, GA); } llvm::Function *CodeGenModule::getIntrinsic(unsigned IID, -- cgit v1.2.3