[cfe-commits] r156490 - in /cfe/trunk: include/clang/Basic/arm_neon.td utils/TableGen/NeonEmitter.cpp utils/TableGen/NeonEmitter.h

Jim Grosbach grosbach at apple.com
Wed May 9 11:17:31 PDT 2012


Author: grosbach
Date: Wed May  9 13:17:30 2012
New Revision: 156490

URL: http://llvm.org/viewvc/llvm-project?rev=156490&view=rev
Log:
ARM: Support marking intrinsic definitions as 'unavailable'

Modified:
    cfe/trunk/include/clang/Basic/arm_neon.td
    cfe/trunk/utils/TableGen/NeonEmitter.cpp
    cfe/trunk/utils/TableGen/NeonEmitter.h

Modified: cfe/trunk/include/clang/Basic/arm_neon.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/arm_neon.td?rev=156490&r1=156489&r2=156490&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/arm_neon.td (original)
+++ cfe/trunk/include/clang/Basic/arm_neon.td Wed May  9 13:17:30 2012
@@ -15,6 +15,7 @@
 class Op;
 
 def OP_NONE  : Op;
+def OP_UNAVAILABLE : Op;
 def OP_ADD   : Op;
 def OP_ADDL  : Op;
 def OP_ADDW  : Op;

Modified: cfe/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.cpp?rev=156490&r1=156489&r2=156490&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ cfe/trunk/utils/TableGen/NeonEmitter.cpp Wed May  9 13:17:30 2012
@@ -1012,7 +1012,7 @@
                                 StringRef outTypeStr, StringRef inTypeStr,
                                 OpKind kind, ClassKind classKind) {
   assert(!proto.empty() && "");
-  bool define = UseMacro(proto);
+  bool define = UseMacro(proto) && kind != OpUnavailable;
   std::string s;
 
   // static always inline + return type
@@ -1040,9 +1040,11 @@
   if (define) {
     s += " __extension__ ({ \\\n  ";
     s += GenMacroLocals(proto, inTypeStr);
-  } else {
+  } else if (kind == OpUnavailable) {
+    s += " __attribute__((unavailable));\n";
+    return s;
+  } else
     s += " { \\\n  ";
-  }
 
   if (kind != OpNone)
     s += GenOpString(kind, proto, outTypeStr);
@@ -1238,7 +1240,7 @@
 /// runHeader - Emit a file with sections defining:
 /// 1. the NEON section of BuiltinsARM.def.
 /// 2. the SemaChecking code for the type overload checking.
-/// 3. the SemaChecking code for validation of intrinsic immedate arguments.
+/// 3. the SemaChecking code for validation of intrinsic immediate arguments.
 void NeonEmitter::runHeader(raw_ostream &OS) {
   std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
 
@@ -1551,6 +1553,8 @@
     ParseTypes(R, Types, TypeVec);
 
     OpKind kind = OpMap[R->getValueAsDef("Operand")->getName()];
+    if (kind == OpUnavailable)
+      continue;
     for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
       if (kind == OpReinterpret) {
         bool outQuad = false;

Modified: cfe/trunk/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/NeonEmitter.h?rev=156490&r1=156489&r2=156490&view=diff
==============================================================================
--- cfe/trunk/utils/TableGen/NeonEmitter.h (original)
+++ cfe/trunk/utils/TableGen/NeonEmitter.h Wed May  9 13:17:30 2012
@@ -23,6 +23,7 @@
 
 enum OpKind {
   OpNone,
+  OpUnavailable,
   OpAdd,
   OpAddl,
   OpAddw,
@@ -130,6 +131,7 @@
   public:
     NeonEmitter(RecordKeeper &R) : Records(R) {
       OpMap["OP_NONE"]  = OpNone;
+      OpMap["OP_UNAVAILABLE"] = OpUnavailable;
       OpMap["OP_ADD"]   = OpAdd;
       OpMap["OP_ADDL"]  = OpAddl;
       OpMap["OP_ADDW"]  = OpAddw;





More information about the cfe-commits mailing list