diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-06 14:42:22 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-06 14:42:22 +0000 |
| commit | a801f4a81dc22cccb7b9a6f2cceae124e0f80176 (patch) | |
| tree | ccfbe255a0a2bbed4201cd29863ba75604926b0c /clang/lib | |
| parent | 68e2c7bee3ab337cc3134ff99fdd1ce2ddb33c2f (diff) | |
| download | bcm5719-llvm-a801f4a81dc22cccb7b9a6f2cceae124e0f80176.tar.gz bcm5719-llvm-a801f4a81dc22cccb7b9a6f2cceae124e0f80176.zip | |
Expose __builtin_bswap16.
GCC has always supported this on PowerPC and 4.8 supports it on all platforms,
so it's a good idea to expose it in clang too. LLVM supports this on all targets.
llvm-svn: 165362
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index e21c83b64f6..323a1746bfb 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -4296,6 +4296,7 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { return Error(E); } + case Builtin::BI__builtin_bswap16: case Builtin::BI__builtin_bswap32: case Builtin::BI__builtin_bswap64: { APSInt Val; diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index a084be1f71e..b83e75ad238 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -356,6 +356,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, "expval"); return RValue::get(Result); } + case Builtin::BI__builtin_bswap16: case Builtin::BI__builtin_bswap32: case Builtin::BI__builtin_bswap64: { Value *ArgValue = EmitScalarExpr(E->getArg(0)); |

