diff options
| author | Jim Grosbach <grosbach@apple.com> | 2012-05-09 18:17:30 +0000 |
|---|---|---|
| committer | Jim Grosbach <grosbach@apple.com> | 2012-05-09 18:17:30 +0000 |
| commit | 6f855e3024ac9b3ad3277668664074b47e3c866d (patch) | |
| tree | 0331f2d8ee20ed24d6cd8db147f86278779bce00 /clang/utils | |
| parent | f761fe9d238894b8cefd79c380308b94ee021903 (diff) | |
| download | bcm5719-llvm-6f855e3024ac9b3ad3277668664074b47e3c866d.tar.gz bcm5719-llvm-6f855e3024ac9b3ad3277668664074b47e3c866d.zip | |
ARM: Support marking intrinsic definitions as 'unavailable'
llvm-svn: 156490
Diffstat (limited to 'clang/utils')
| -rw-r--r-- | clang/utils/TableGen/NeonEmitter.cpp | 12 | ||||
| -rw-r--r-- | clang/utils/TableGen/NeonEmitter.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp index e6f2e53aa70..658890cb1e8 100644 --- a/clang/utils/TableGen/NeonEmitter.cpp +++ b/clang/utils/TableGen/NeonEmitter.cpp @@ -1012,7 +1012,7 @@ static std::string GenIntrinsic(const std::string &name, 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 @@ static std::string GenIntrinsic(const std::string &name, 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 @@ static unsigned RangeFromType(const char mod, StringRef typestr) { /// 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 @@ void NeonEmitter::runTests(raw_ostream &OS) { 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; diff --git a/clang/utils/TableGen/NeonEmitter.h b/clang/utils/TableGen/NeonEmitter.h index dec74511116..7a703feb18b 100644 --- a/clang/utils/TableGen/NeonEmitter.h +++ b/clang/utils/TableGen/NeonEmitter.h @@ -23,6 +23,7 @@ enum OpKind { OpNone, + OpUnavailable, OpAdd, OpAddl, OpAddw, @@ -130,6 +131,7 @@ namespace llvm { 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; |

