[llvm-commits] [llvm] r120649 - /llvm/trunk/utils/TableGen/NeonEmitter.cpp
Bob Wilson
bob.wilson at apple.com
Wed Dec 1 18:42:51 PST 2010
Author: bwilson
Date: Wed Dec 1 20:42:51 2010
New Revision: 120649
URL: http://llvm.org/viewvc/llvm-project?rev=120649&view=rev
Log:
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.
Modified:
llvm/trunk/utils/TableGen/NeonEmitter.cpp
Modified: llvm/trunk/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/NeonEmitter.cpp?rev=120649&r1=120648&r2=120649&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/NeonEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/NeonEmitter.cpp Wed Dec 1 20:42:51 2010
@@ -729,7 +729,7 @@
if (define) {
if (sret)
- s += "({ " + ts + " r; ";
+ s += ts + " r; ";
else
s += "(" + ts + ")";
} else if (sret) {
@@ -813,15 +813,12 @@
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 @@
// Definition.
if (define)
- OS << " ";
+ OS << " __extension__ ({ \\\n ";
else
- OS << " { ";
+ OS << " { \\\n ";
if (k != OpNone) {
OS << GenOpString(k, Proto, TypeVec[ti]);
@@ -969,7 +966,9 @@
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";
}
More information about the llvm-commits
mailing list