On 19 September 2014 14:06, Reid Kleckner <[email protected]> wrote:
> lgtm, as a follow up we should make EmitAliasDefinition call this to avoid
> duplicate code
Like this?
Cheers,
Rafael
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 6e7da49..a7a65b8 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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<DLLExportAttr>()) {
- if (const auto *FD = dyn_cast<FunctionDecl>(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<WeakAttr>() ||
- D->hasAttr<WeakRefAttr>() ||
- D->isWeakImported()) {
+ if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakRefAttr>() ||
+ D->isWeakImported()) {
GA->setLinkage(llvm::Function::WeakAnyLinkage);
}
- SetCommonAttributes(D, GA);
+ setAliasAttributes(D, GA);
}
llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits