summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-20 08:59:34 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-20 08:59:34 +0000
commit53e38bd6b6982770224b5e934a02a747d3e8f67a (patch)
tree6dfe3489fd92c92e08ef7aea9709c0ee69420abb /clang/lib
parent503731aa220c45c8f9b26be063558931c8be753d (diff)
downloadbcm5719-llvm-53e38bd6b6982770224b5e934a02a747d3e8f67a.tar.gz
bcm5719-llvm-53e38bd6b6982770224b5e934a02a747d3e8f67a.zip
Add codegen support for stack address intrinsics.
llvm-svn: 51309
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index e29a1742293..a43649dc4bd 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -262,6 +262,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
Builder.CreateCall(CGM.getMemCpyFn(), MemCpyOps, MemCpyOps+4);
return RValue::get(MemCpyOps[0]);
}
+ case Builtin::BI__builtin_return_address: {
+ Value *F = CGM.getIntrinsic(Intrinsic::returnaddress, 0, 0);
+ return RValue::get(Builder.CreateCall(F, EmitScalarExpr(E->getArg(0))));
+ }
+ case Builtin::BI__builtin_frame_address: {
+ Value *F = CGM.getIntrinsic(Intrinsic::frameaddress, 0, 0);
+ return RValue::get(Builder.CreateCall(F, EmitScalarExpr(E->getArg(0))));
+ }
case Builtin::BI__sync_fetch_and_add:
return EmitBinaryAtomic(*this, Intrinsic::atomic_las, E);
case Builtin::BI__sync_fetch_and_sub:
OpenPOWER on IntegriCloud