From 7b553f1b19221fceb3d90a1a010e0f59e14c2fa7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 29 Oct 2011 00:50:52 +0000 Subject: Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263 --- clang/lib/CodeGen/CGDebugInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index b7107d5883a..920eb5578e4 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1112,7 +1112,8 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) { if (const VarDecl *V = dyn_cast(*I)) { if (const Expr *Init = V->getInit()) { Expr::EvalResult Result; - if (Init->Evaluate(Result, CGM.getContext()) && Result.Val.isInt()) { + if (Init->EvaluateAsRValue(Result, CGM.getContext()) && + Result.Val.isInt()) { llvm::ConstantInt *CI = llvm::ConstantInt::get(CGM.getLLVMContext(), Result.Val.getInt()); -- cgit v1.2.3