PR4134: Implement __builtin_extract_return_addr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70794 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 2b9a178..d14bb53 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -310,7 +310,10 @@
Value *F = CGM.getIntrinsic(Intrinsic::frameaddress, 0, 0);
return RValue::get(Builder.CreateCall(F, EmitScalarExpr(E->getArg(0))));
}
-
+ case Builtin::BI__builtin_extract_return_addr: {
+ // FIXME: There should be a target hook for this
+ return RValue::get(EmitScalarExpr(E->getArg(0)));
+ }
case Builtin::BI__sync_fetch_and_add:
return EmitBinaryAtomic(*this, Intrinsic::atomic_load_add, E);
case Builtin::BI__sync_fetch_and_sub: