From 9afbfbe71c8e69e2643d468a041473d07d2635d4 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 30 Sep 2011 18:53:25 +0000 Subject: [PATCH] Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben Van Boxem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140871 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/TargetAttributesSema.cpp | 9 +++++---- test/Sema/dllimport-dllexport.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp index 877bc32521..3a065cead5 100644 --- a/lib/Sema/TargetAttributesSema.cpp +++ b/lib/Sema/TargetAttributesSema.cpp @@ -248,7 +248,8 @@ namespace { default: break; } } - if (Attr.getName()->getName() == "force_align_arg_pointer" || + if (Triple.getArch() != llvm::Triple::x86_64 && + Attr.getName()->getName() == "force_align_arg_pointer" || Attr.getName()->getName() == "__force_align_arg_pointer__") { HandleX86ForceAlignArgPointerAttr(D, Attr, S); return true; @@ -264,14 +265,14 @@ const TargetAttributesSema &Sema::getTargetAttributesSema() const { const llvm::Triple &Triple(Context.getTargetInfo().getTriple()); switch (Triple.getArch()) { - default: - return *(TheTargetAttributesSema = new TargetAttributesSema); - case llvm::Triple::msp430: return *(TheTargetAttributesSema = new MSP430AttributesSema); case llvm::Triple::mblaze: return *(TheTargetAttributesSema = new MBlazeAttributesSema); case llvm::Triple::x86: + case llvm::Triple::x86_64: return *(TheTargetAttributesSema = new X86AttributesSema); + default: + return *(TheTargetAttributesSema = new TargetAttributesSema); } } diff --git a/test/Sema/dllimport-dllexport.c b/test/Sema/dllimport-dllexport.c index f09e3cf69a..610059ec9f 100644 --- a/test/Sema/dllimport-dllexport.c +++ b/test/Sema/dllimport-dllexport.c @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple x86_64-mingw32 -fsyntax-only -verify %s inline void __attribute__((dllexport)) foo1(){} // expected-warning{{dllexport attribute ignored}} inline void __attribute__((dllimport)) foo2(){} // expected-warning{{dllimport attribute ignored}} -- 2.40.0