aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-02 02:42:51 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-02 02:42:51 +0000
commit052008bc3d288b44eae5c2e9abe8d78ffd891e2a (patch)
treead18291a66c4ab8e28c3ada2467236d0b609e2f4 /utils
parentec99c90ea54806ae59eb8ea7686e201ed7eb0d29 (diff)
downloadexternal_llvm-052008bc3d288b44eae5c2e9abe8d78ffd891e2a.zip
external_llvm-052008bc3d288b44eae5c2e9abe8d78ffd891e2a.tar.gz
external_llvm-052008bc3d288b44eae5c2e9abe8d78ffd891e2a.tar.bz2
Use statement expressions in Neon intrinsics defined as macros.
This is in preparation for adding assignments to temporaries to ensure that the proper type checking is done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/NeonEmitter.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index eda76b3..41c55fa 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -729,7 +729,7 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
if (define) {
if (sret)
- s += "({ " + ts + " r; ";
+ s += ts + " r; ";
else
s += "(" + ts + ")";
} else if (sret) {
@@ -813,15 +813,12 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
if (ck == ClassB)
s += ", " + utostr(GetNeonEnum(proto, typestr));
- if (define)
- s += ")";
- else
- s += ");";
+ s += ");";
if (proto[0] != 'v') {
if (define) {
if (sret)
- s += "; r; })";
+ s += " r;";
} else {
s += " return r;";
}
@@ -953,9 +950,9 @@ void NeonEmitter::run(raw_ostream &OS) {
// Definition.
if (define)
- OS << " ";
+ OS << " __extension__ ({ \\\n ";
else
- OS << " { ";
+ OS << " { \\\n ";
if (k != OpNone) {
OS << GenOpString(k, Proto, TypeVec[ti]);
@@ -969,7 +966,9 @@ void NeonEmitter::run(raw_ostream &OS) {
throw TGError(R->getLoc(), "Builtin has no class kind");
OS << GenBuiltin(name, Proto, TypeVec[ti], ck);
}
- if (!define)
+ if (define)
+ OS << " })";
+ else
OS << " }";
OS << "\n";
}