From 21fb98ee003e992b0c4e204d98a19e0ef544cae3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Sep 2009 06:06:36 +0000 Subject: implement support for __builtin_eh_return_data_regno on x86-32 and x86-64. This implements PR5034 and rdar://6836445. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ExprConstant.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/AST/ExprConstant.cpp') diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 9c34547db1..5123aaa7ca 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -870,6 +870,12 @@ bool IntExprEvaluator::VisitCallExpr(const CallExpr *E) { // __builtin_constant_p always has one operand: it returns true if that // operand can be folded, false otherwise. return Success(E->getArg(0)->isEvaluatable(Info.Ctx), E); + + case Builtin::BI__builtin_eh_return_data_regno: { + int Operand = E->getArg(0)->EvaluateAsInt(Info.Ctx).getZExtValue(); + Operand = Info.Ctx.Target.getEHDataRegisterNumber(Operand); + return Success(Operand, E); + } } } -- cgit v1.2.3-18-g5258