From f7c1088a361f6a032294b30e048501a4b3971855 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 14 Feb 2004 02:55:36 +0000 Subject: [PATCH] Add support for the returnaddress and frameaddress intrinsics llvm-svn: 11433 --- llvm/lib/Target/CBackend/Writer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp index 493e7ec5fcc1..74ed208f0780 100644 --- a/llvm/lib/Target/CBackend/Writer.cpp +++ b/llvm/lib/Target/CBackend/Writer.cpp @@ -1157,6 +1157,8 @@ void CWriter::lowerIntrinsics(Module &M) { case Intrinsic::va_start: case Intrinsic::va_copy: case Intrinsic::va_end: + case Intrinsic::returnaddress: + case Intrinsic::frameaddress: // We directly implement these intrinsics break; default: @@ -1205,6 +1207,16 @@ void CWriter::visitCallInst(CallInst &I) { writeOperand(I.getOperand(1)); Out << ")"; return; + case Intrinsic::returnaddress: + Out << "__builtin_return_address("; + writeOperand(I.getOperand(1)); + Out << ")"; + return; + case Intrinsic::frameaddress: + Out << "__builtin_frame_address("; + writeOperand(I.getOperand(1)); + Out << ")"; + return; } } visitCallSite(&I);