[cfe-commits] r140871 - in /cfe/trunk: lib/Sema/TargetAttributesSema.cpp test/Sema/dllimport-dllexport.c
Eli Friedman
eli.friedman at gmail.com
Fri Sep 30 11:53:25 PDT 2011
Author: efriedma
Date: Fri Sep 30 13:53:25 2011
New Revision: 140871
URL: http://llvm.org/viewvc/llvm-project?rev=140871&view=rev
Log:
Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben Van Boxem.
Modified:
cfe/trunk/lib/Sema/TargetAttributesSema.cpp
cfe/trunk/test/Sema/dllimport-dllexport.c
Modified: cfe/trunk/lib/Sema/TargetAttributesSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.cpp?rev=140871&r1=140870&r2=140871&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.cpp Fri Sep 30 13:53:25 2011
@@ -248,7 +248,8 @@
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 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);
}
}
Modified: cfe/trunk/test/Sema/dllimport-dllexport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/dllimport-dllexport.c?rev=140871&r1=140870&r2=140871&view=diff
==============================================================================
--- cfe/trunk/test/Sema/dllimport-dllexport.c (original)
+++ cfe/trunk/test/Sema/dllimport-dllexport.c Fri Sep 30 13:53:25 2011
@@ -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}}
More information about the cfe-commits
mailing list