[cfe-commits] patch for review

Dmitri Gribenko gribozavr at gmail.com
Sat Jan 12 06:44:49 PST 2013


On Sat, Jan 12, 2013 at 4:32 PM, Reed Kotler <rkotler at mips.com> 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

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list