The function should be more like this:

+    const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
+    if (!FD) return;
+    llvm::Function *Fn = cast<llvm::Function>(GV);
+    if (FD->hasAttr<Mips16Attr>()) {
+      Fn->addFnAttr("mips16");
+    }
+    else if (FD->hasAttr<NoMips16Attr>()) {
+      Fn->addFnAttr("nomips16");
+    }

With that change, LGTM.

-bw

On Mar 12, 2013, at 11:31 PM, Reed Kotler <[email protected]> wrote:

> This patch will make clang put the mips16/nomips16 attribute in function 
> bitcode for functions
> which contain that attribute
> <mips16_attrn.txt>

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

Reply via email to