Okay. Thanks.

The reason why I added the

-triple x86_64-unknown-linux-gnu

is because it's possible to run make check on a Mips platform. We even have a build bot connected to llvm what runs make-check on a mips board. This is why I had two different test cases.

mips16, nomips16 should emit warnings except when it is a mips target.

I will add Subjects=. I had that originally but it seemed to be causing problems. There might have been some other reason for that. I will try adding it back in. It might have been some kind of make bug for clang. Long story... but I will recheck.

On 01/12/2013 06:44 AM, Dmitri Gribenko wrote:
On Sat, Jan 12, 2013 at 4:32 PM, Reed Kotler <[email protected]> wrote:
I don't have commit access to the clang list (as far as I know; just llvm).

Please commit if you approve the patch.
Since you have commit access to llvm, you have commit access to clang,
and every other repository.

This patch is the first step to adding function attributes mips16 and
nomips16 to the mips
target.
Please add
let Subjects = [Function];
just for documentation purposes now.  Somebody will come along in
future and will write the necessary TableGen magic to make
lib/Sema/SemaDeclAttr.cpp autogenerated.  (We hope!)

+    bool ProcessDeclAttribute(Scope *scope, Decl *D, const AttributeList &Attr,
+                              Sema &S) const {

1. scope -> Scope

2. Please add checks to ensure that there are no parameters passed to
the attributes.

3. Please add tests for (2), like:

void __attribute__((mips16(foo))) foo32(); // expected-error {{whatever}}
void __attribute__((mips16(10))) foo32(); // expected-error {{whatever}}

and same for nomips16.

+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s

Triple is not needed in a target-independent test.

+int main() {
+  foo32();
+  foo16();
+}

That is not needed.

Another suggestion: should we reject these attributes when we are not
targeting mips?

Dmitri


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to