From bbd9fa4b4a0fea47f94ac3eb4eaf5cc8079defe1 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 6 Oct 2009 18:36:08 +0000 Subject: Add support to attach debug info to an instruction. This is not yet enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83399 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d89da3224f..7a124b6d13 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -31,7 +31,11 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(const llvm::Type *Ty, const char *Name) { if (!Builder.isNamePreserving()) Name = ""; - return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt); + llvm::AllocaInst *AI = new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt); +#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN + Builder.SetDebugLocation(AI); +#endif + return AI; } /// EvaluateExprAsBool - Perform the usual unary conversions on the specified -- cgit v1.2.3