Emit a stop point before a call expression so that debugger has some chance of gettin...
authorDevang Patel <dpatel@apple.com>
Fri, 4 Mar 2011 18:54:42 +0000 (18:54 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 4 Mar 2011 18:54:42 +0000 (18:54 +0000)
  = bar() + ... + bar() + ...

clang keeps track of column numbers, so we could put location entries for all subexpressions but that will significantly bloat debug info in general, but a location for call expression is helpful here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127018 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index 0f9abc7c351807634ec9c04a2222721ce8b2d68a..e23d6107c0be99b00c73beeca7ba205f7c5bbf95 100644 (file)
@@ -15,6 +15,7 @@
 #include "CodeGenModule.h"
 #include "CGCall.h"
 #include "CGCXXABI.h"
+#include "CGDebugInfo.h"
 #include "CGRecordLayout.h"
 #include "CGObjCRuntime.h"
 #include "clang/AST/ASTContext.h"
@@ -1936,6 +1937,12 @@ LValue CodeGenFunction::EmitOpaqueValueLValue(const OpaqueValueExpr *e) {
 
 RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, 
                                      ReturnValueSlot ReturnValue) {
+  if (CGDebugInfo *DI = getDebugInfo()) {
+    DI->setLocation(E->getLocStart());
+    DI->UpdateLineDirectiveRegion(Builder);
+    DI->EmitStopPoint(Builder);
+  }
+
   // Builtins never have block type.
   if (E->getCallee()->getType()->isBlockPointerType())
     return EmitBlockCallExpr(E, ReturnValue);