Commit 00ba96ec authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r228411:

------------------------------------------------------------------------
r228411 | rnk | 2015-02-06 09:59:49 -0800 (Fri, 06 Feb 2015) | 3 lines

Don't dllexport declarations

Fixes PR22488
------------------------------------------------------------------------

llvm-svn: 228480
parent 768133b3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -688,11 +688,11 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
    std::vector<const MCSymbol*> DLLExportedFns, DLLExportedGlobals;

    for (const auto &Function : M)
      if (Function.hasDLLExportStorageClass())
      if (Function.hasDLLExportStorageClass() && !Function.isDeclaration())
        DLLExportedFns.push_back(getSymbol(&Function));

    for (const auto &Global : M.globals())
      if (Global.hasDLLExportStorageClass())
      if (Global.hasDLLExportStorageClass() && !Global.isDeclaration())
        DLLExportedGlobals.push_back(getSymbol(&Global));

    for (const auto &Alias : M.aliases()) {
+4 −1
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ define dllexport void @f2() unnamed_addr {
	ret void
}

declare dllexport void @not_defined()

; CHECK: .globl _stdfun@0
define dllexport x86_stdcallcc void @stdfun() nounwind {
	ret void
@@ -91,7 +93,6 @@ define weak_odr dllexport void @weak1() {
; CHECK: _weak_alias = _f1
@weak_alias = weak_odr dllexport alias void()* @f1


; CHECK: .section .drectve
; CHECK-CL: " /EXPORT:_Var1,DATA"
; CHECK-CL: " /EXPORT:_Var2,DATA"
@@ -100,6 +101,7 @@ define weak_odr dllexport void @weak1() {
; CHECK-CL: " /EXPORT:_WeakVar2,DATA"
; CHECK-CL: " /EXPORT:_f1"
; CHECK-CL: " /EXPORT:_f2"
; CHECK-CL-NOT: not_exported
; CHECK-CL: " /EXPORT:_stdfun@0"
; CHECK-CL: " /EXPORT:@fastfun@0"
; CHECK-CL: " /EXPORT:_thisfun"
@@ -117,6 +119,7 @@ define weak_odr dllexport void @weak1() {
; CHECK-GCC: " -export:WeakVar2,data"
; CHECK-GCC: " -export:f1"
; CHECK-GCC: " -export:f2"
; CHECK-CL-NOT: not_exported
; CHECK-GCC: " -export:stdfun@0"
; CHECK-GCC: " -export:@fastfun@0"
; CHECK-GCC: " -export:thisfun"