diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-06 20:03:09 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-06 20:03:09 +0000 |
| commit | df88c54f8d468f7a2880cf018639f9be8a636aea (patch) | |
| tree | e7abf5e212df2fe487d21653a8f5dc34ea3a231d /clang | |
| parent | a3d90a9467bca7c1e3d8195ecbbc35f9213b1cff (diff) | |
| download | bcm5719-llvm-df88c54f8d468f7a2880cf018639f9be8a636aea.tar.gz bcm5719-llvm-df88c54f8d468f7a2880cf018639f9be8a636aea.zip | |
Revert r147655; it's breaking the compiler_rt build on OSX.
llvm-svn: 147677
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 3 | ||||
| -rw-r--r-- | clang/test/CodeGen/no-builtin.c | 20 |
2 files changed, 1 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index f462ee62ad6..3e5a6772ebb 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -175,8 +175,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, unsigned BuiltinID, const CallExpr *E) { // See if we can constant fold this builtin. If so, don't emit it at all. Expr::EvalResult Result; - if (!getContext().getLangOptions().NoBuiltin && - E->EvaluateAsRValue(Result, CGM.getContext()) && + if (E->EvaluateAsRValue(Result, CGM.getContext()) && !Result.hasSideEffects()) { if (Result.Val.isInt()) return RValue::get(llvm::ConstantInt::get(getLLVMContext(), diff --git a/clang/test/CodeGen/no-builtin.c b/clang/test/CodeGen/no-builtin.c deleted file mode 100644 index ff1c1924817..00000000000 --- a/clang/test/CodeGen/no-builtin.c +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: %clang_cc1 -fno-builtin -emit-llvm %s -o - | FileCheck %s -// -// Check that -fno-builtin prevents us from constant-folding through builtins -// (PR11711) - -double -cos(double x) -{ - printf("ok\n"); - exit(0); -} - -int -main(int argc, char *argv[]) -{ - cos(1); // CHECK: cos - printf("not ok\n"); - abort(); -} - |

