[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-commits
Subject: Re: [cfe-commits] Fix for Bug 10978
From: Ruben Van Boxem <vanboxem.ruben () gmail ! com>
Date: 2011-09-30 18:51:23
Message-ID: CALc40c_ZSGF5VZk=-qb2HA4CAH=4g7rD1q6vxL7-WxwAk_EgXA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
2011/9/30 Eli Friedman <eli.friedman@gmail.com>
> On Fri, Sep 30, 2011 at 2:44 AM, Ruben Van Boxem
> <vanboxem.ruben@gmail.com> wrote:
> > http://llvm.org/bugs/show_bug.cgi?id=10978
> >
> > Attached is a revised patch that also uses X86AttributesSema for x86_64,
> and
> > rejects the force_align_arg_pointer attribute for x86_64.
> >
> > The testcase is just a copy of the existing dllimport-dllexport test, but
> I
> > modified the triple used. I hope this is correct, otherwise, please show
> me
> > how cause I don't know how to set the test options.
>
> You can just run the existing test with multiple triples; multiple RUN
> lines work the way you would expect.
>
Fixed.
>
> @@ -257,21 +258,20 @@ namespace {
> }
> };
> }
> -
> const TargetAttributesSema &Sema::getTargetAttributesSema() const {
> if (TheTargetAttributesSema)
> return *TheTargetAttributesSema;
>
> Random whitespace change?
>
Yes it is, fixed.
Ruben
[Attachment #5 (text/html)]
<div class="gmail_quote">2011/9/30 Eli Friedman <span dir="ltr"><<a \
href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"> <div><div></div><div class="h5">On Fri, Sep 30, 2011 at \
2:44 AM, Ruben Van Boxem<br> <<a \
href="mailto:vanboxem.ruben@gmail.com">vanboxem.ruben@gmail.com</a>> wrote:<br> \
> <a href="http://llvm.org/bugs/show_bug.cgi?id=10978" \
target="_blank">http://llvm.org/bugs/show_bug.cgi?id=10978</a><br> ><br>
> Attached is a revised patch that also uses X86AttributesSema for x86_64, and<br>
> rejects the force_align_arg_pointer attribute for x86_64.<br>
><br>
> The testcase is just a copy of the existing dllimport-dllexport test, but I<br>
> modified the triple used. I hope this is correct, otherwise, please show me<br>
> how cause I don't know how to set the test options.<br>
<br>
</div></div>You can just run the existing test with multiple triples; multiple \
RUN<br> lines work the way you would expect.<br></blockquote><div><br>Fixed.<br> \
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <br>
@@ -257,21 +258,20 @@ namespace {<br>
}<br>
};<br>
}<br>
-<br>
const TargetAttributesSema &Sema::getTargetAttributesSema() const {<br>
if (TheTargetAttributesSema)<br>
return *TheTargetAttributesSema;<br>
<br>
Random whitespace change?<br></blockquote><div><br>Yes it is, \
fixed.<br><br>Ruben<br></div></div>
--0016363b92889b9e2304ae2d1cc1--
["x86_64.patch" (application/octet-stream)]
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp
index 877bc32..3a065ce 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 f09e3cf..610059e 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}}
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic