<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 10, 2014, at 4:33 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p dir="ltr">Uh did you look at the code that added this stuff explicitly?</p></blockquote><div>Which stuff specifically are you referring to?</div><div><br></div><div>-- adrian</div><br><blockquote type="cite">
<div class="gmail_quote">On Apr 10, 2014 4:31 PM, "Adrian Prantl" <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: adrian<br>
Date: Thu Apr 10 18:21:53 2014<br>
New Revision: 205999<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=205999&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=205999&view=rev</a><br>
Log:<br>
Debug info: (Bugfix) Make sure artificial functions like _GLOBAL__I_a<br>
are not associated with any source lines.<br>
<br>
Previously, if the Location of a Decl was empty, EmitFunctionStart would<br>
just keep using CurLoc, which would sometimes be correct (e.g., thunks)<br>
but in other cases would just point to a hilariously random location.<br>
<br>
This patch fixes this by completely eliminating all uses of CurLoc from<br>
EmitFunctionStart and rather have clients explicitly pass in a<br>
SourceLocation for the function header and the function body.<br>
<br>
<a href="rdar://problem/14985269">rdar://problem/14985269</a><br>
<br>
Added:<br>
    cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGBlocks.cpp<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.h<br>
    cfe/trunk/lib/CodeGen/CGDeclCXX.cpp<br>
    cfe/trunk/lib/CodeGen/CGObjC.cpp<br>
    cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
    cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
    cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Apr 10 18:21:53 2014<br>
@@ -1135,6 +1135,7 @@ CodeGenFunction::GenerateBlockFunction(G<br>
<br>
   // Begin generating the function.<br>
   StartFunction(blockDecl, fnType->getReturnType(), fn, fnInfo, args,<br>
+                blockDecl->getLocation(),<br>
                 blockInfo.getBlockExpr()->getBody()->getLocStart());<br>
<br>
   // Okay.  Undo some of what StartFunction did.<br>
@@ -1306,7 +1307,7 @@ CodeGenFunction::GenerateCopyHelperFunct<br>
                                           false);<br>
   // Create a scope with an artificial location for the body of this function.<br>
   ArtificialLocation AL(*this, Builder);<br>
-  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation());<br>
+  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());<br>
   AL.Emit();<br>
<br>
   llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();<br>
@@ -1476,7 +1477,7 @@ CodeGenFunction::GenerateDestroyHelperFu<br>
                                           false, false);<br>
   // Create a scope with an artificial location for the body of this function.<br>
   ArtificialLocation AL(*this, Builder);<br>
-  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation());<br>
+  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());<br>
   AL.Emit();<br>
<br>
   llvm::Type *structPtrTy = blockInfo.StructureType->getPointerTo();<br>
@@ -1765,7 +1766,7 @@ generateByrefCopyHelper(CodeGenFunction<br>
                                           SC_Static,<br>
                                           false, false);<br>
<br>
-  CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation());<br>
+  CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation(), SourceLocation());<br>
<br>
   if (byrefInfo.needsCopy()) {<br>
     llvm::Type *byrefPtrType = byrefType.getPointerTo(0);<br>
@@ -1834,7 +1835,7 @@ generateByrefDisposeHelper(CodeGenFuncti<br>
                                           SourceLocation(), II, R, 0,<br>
                                           SC_Static,<br>
                                           false, false);<br>
-  CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation());<br>
+  CGF.StartFunction(FD, R, Fn, FI, args, SourceLocation(), SourceLocation());<br>
<br>
   if (byrefInfo.needsDispose()) {<br>
     llvm::Value *V = CGF.GetAddrOfLocalVar(&src);<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Apr 10 18:21:53 2014<br>
@@ -2504,7 +2504,10 @@ llvm::DICompositeType CGDebugInfo::getOr<br>
 }<br>
<br>
 /// EmitFunctionStart - Constructs the debug code for entering a function.<br>
-void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,<br>
+void CGDebugInfo::EmitFunctionStart(GlobalDecl GD,<br>
+                                    SourceLocation Loc,<br>
+                                    SourceLocation ScopeLoc,<br>
+                                    QualType FnType,<br>
                                     llvm::Function *Fn,<br>
                                     CGBuilderTy &Builder) {<br>
<br>
@@ -2514,24 +2517,7 @@ void CGDebugInfo::EmitFunctionStart(Glob<br>
   FnBeginRegionCount.push_back(LexicalBlockStack.size());<br>
<br>
   const Decl *D = GD.getDecl();<br>
-<br>
-  // Use the location of the start of the function to determine where<br>
-  // the function definition is located. By default use the location<br>
-  // of the declaration as the location for the subprogram. A function<br>
-  // may lack a declaration in the source code if it is created by code<br>
-  // gen. (examples: _GLOBAL__I_a, __cxx_global_array_dtor, thunk).<br>
   bool HasDecl = (D != 0);<br>
-  SourceLocation Loc;<br>
-  if (HasDecl) {<br>
-    Loc = D->getLocation();<br>
-<br>
-    // If this is a function specialization then use the pattern body<br>
-    // as the location for the function.<br>
-    if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))<br>
-      if (const FunctionDecl *SpecDecl = FD->getTemplateInstantiationPattern())<br>
-        if (SpecDecl->hasBody(SpecDecl))<br>
-          Loc = SpecDecl->getLocation();<br>
-  }<br>
<br>
   unsigned Flags = 0;<br>
   llvm::DIFile Unit = getOrCreateFile(Loc);<br>
@@ -2591,9 +2577,14 @@ void CGDebugInfo::EmitFunctionStart(Glob<br>
   if (!Name.empty() && Name[0] == '\01')<br>
     Name = Name.substr(1);<br>
<br>
-  unsigned LineNo = getLineNumber(Loc);<br>
-  if (!HasDecl || D->isImplicit())<br>
+  if (!HasDecl || D->isImplicit()) {<br>
     Flags |= llvm::DIDescriptor::FlagArtificial;<br>
+    // Artificial functions without a location should not silently reuse CurLoc.<br>
+    if (Loc.isInvalid())<br>
+      CurLoc = SourceLocation();<br>
+  }<br>
+  unsigned LineNo = getLineNumber(Loc);<br>
+  unsigned ScopeLine = getLineNumber(ScopeLoc);<br>
<br>
   // FIXME: The function declaration we're constructing here is mostly reusing<br>
   // declarations from CXXMethodDecl and not constructing new ones for arbitrary<br>
@@ -2604,7 +2595,7 @@ void CGDebugInfo::EmitFunctionStart(Glob<br>
       DBuilder.createFunction(FDContext, Name, LinkageName, Unit, LineNo,<br>
                               getOrCreateFunctionType(D, FnType, Unit),<br>
                               Fn->hasInternalLinkage(), true /*definition*/,<br>
-                              getLineNumber(CurLoc), Flags,<br>
+                              ScopeLine, Flags,<br>
                               CGM.getLangOpts().Optimize, Fn, TParamsArray,<br>
                               getFunctionDeclaration(D));<br>
   if (HasDecl)<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Thu Apr 10 18:21:53 2014<br>
@@ -220,8 +220,12 @@ public:<br>
<br>
   /// EmitFunctionStart - Emit a call to llvm.dbg.function.start to indicate<br>
   /// start of a new function.<br>
-  void EmitFunctionStart(GlobalDecl GD, QualType FnType,<br>
-                         llvm::Function *Fn, CGBuilderTy &Builder);<br>
+  /// \param Loc       The location of the function header.<br>
+  /// \param ScopeLoc  The location of the function body.<br>
+  void EmitFunctionStart(GlobalDecl GD,<br>
+                         SourceLocation Loc, SourceLocation ScopeLoc,<br>
+                         QualType FnType, llvm::Function *Fn,<br>
+                         CGBuilderTy &Builder);<br>
<br>
   /// EmitFunctionEnd - Constructs the debug code for exiting a function.<br>
   void EmitFunctionEnd(CGBuilderTy &Builder);<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Thu Apr 10 18:21:53 2014<br>
@@ -179,7 +179,7 @@ static llvm::Constant *createAtExitStub(<br>
<br>
   CGF.StartFunction(&VD, CGM.getContext().VoidTy, fn,<br>
                     CGM.getTypes().arrangeNullaryFunction(), FunctionArgList(),<br>
-                    SourceLocation());<br>
+                    SourceLocation(), SourceLocation());<br>
<br>
   llvm::CallInst *call = CGF.Builder.CreateCall(dtor, addr);<br>
<br>
@@ -412,7 +412,8 @@ void CodeGenFunction::GenerateCXXGlobalV<br>
<br>
   StartFunction(GlobalDecl(D), getContext().VoidTy, Fn,<br>
                 getTypes().arrangeNullaryFunction(),<br>
-                FunctionArgList(), D->getInit()->getExprLoc());<br>
+                FunctionArgList(), D->getLocation(),<br>
+                D->getInit()->getExprLoc());<br>
<br>
   // Use guarded initialization if the global variable is weak. This<br>
   // occurs for, e.g., instantiated static data members and<br>
@@ -433,7 +434,7 @@ CodeGenFunction::GenerateCXXGlobalInitFu<br>
                                            llvm::GlobalVariable *Guard) {<br>
   StartFunction(GlobalDecl(), getContext().VoidTy, Fn,<br>
                 getTypes().arrangeNullaryFunction(),<br>
-                FunctionArgList(), SourceLocation());<br>
+                FunctionArgList(), SourceLocation(), SourceLocation());<br>
<br>
   llvm::BasicBlock *ExitBlock = 0;<br>
   if (Guard) {<br>
@@ -479,7 +480,7 @@ void CodeGenFunction::GenerateCXXGlobalD<br>
                                                 &DtorsAndObjects) {<br>
   StartFunction(GlobalDecl(), getContext().VoidTy, Fn,<br>
                 getTypes().arrangeNullaryFunction(),<br>
-                FunctionArgList(), SourceLocation());<br>
+                FunctionArgList(), SourceLocation(), SourceLocation());<br>
<br>
   // Emit the dtors, in reverse order from construction.<br>
   for (unsigned i = 0, e = DtorsAndObjects.size(); i != e; ++i) {<br>
@@ -509,7 +510,8 @@ llvm::Function *CodeGenFunction::generat<br>
   llvm::Function *fn =<br>
     CreateGlobalInitOrDestructFunction(CGM, FTy, "__cxx_global_array_dtor");<br>
<br>
-  StartFunction(VD, getContext().VoidTy, fn, FI, args, SourceLocation());<br>
+  StartFunction(VD, getContext().VoidTy, fn, FI, args,<br>
+                SourceLocation(), SourceLocation());<br>
<br>
   emitDestroy(addr, type, destroyer, useEHCleanupForArray);<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Thu Apr 10 18:21:53 2014<br>
@@ -481,7 +481,8 @@ void CodeGenFunction::StartObjCMethod(co<br>
<br>
   CurGD = OMD;<br>
<br>
-  StartFunction(OMD, OMD->getReturnType(), Fn, FI, args, StartLoc);<br>
+  StartFunction(OMD, OMD->getReturnType(), Fn, FI, args,<br>
+                OMD->getLocation(), StartLoc);<br>
<br>
   // In ARC, certain methods get an extra cleanup.<br>
   if (CGM.getLangOpts().ObjCAutoRefCount &&<br>
@@ -2915,7 +2916,7 @@ CodeGenFunction::GenerateObjCAtomicSette<br>
                            "__assign_helper_atomic_property_",<br>
                            &CGM.getModule());<br>
<br>
-  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation());<br>
+  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());<br>
<br>
   DeclRefExpr DstExpr(&dstDecl, false, DestTy,<br>
                       VK_RValue, SourceLocation());<br>
@@ -2993,7 +2994,7 @@ CodeGenFunction::GenerateObjCAtomicGette<br>
   llvm::Function::Create(LTy, llvm::GlobalValue::InternalLinkage,<br>
                          "__copy_helper_atomic_property_", &CGM.getModule());<br>
<br>
-  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation());<br>
+  StartFunction(FD, C.VoidTy, Fn, FI, args, SourceLocation(), SourceLocation());<br>
<br>
   DeclRefExpr SrcExpr(&srcDecl, false, SrcTy,<br>
                       VK_RValue, SourceLocation());<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Thu Apr 10 18:21:53 2014<br>
@@ -1944,7 +1944,9 @@ CodeGenFunction::GenerateCapturedStmtFun<br>
   CGM.SetInternalFunctionAttributes(CD, F, FuncInfo);<br>
<br>
   // Generate the function.<br>
-  StartFunction(CD, Ctx.VoidTy, F, FuncInfo, Args, CD->getBody()->getLocStart());<br>
+  StartFunction(CD, Ctx.VoidTy, F, FuncInfo, Args,<br>
+                CD->getLocation(),<br>
+                CD->getBody()->getLocStart());<br>
<br>
   // Set the context parameter in CapturedStmtInfo.<br>
   llvm::Value *DeclPtr = LocalDeclMap[CD->getContextParam()];<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Thu Apr 10 18:21:53 2014<br>
@@ -217,7 +217,7 @@ void CodeGenFunction::StartThunk(llvm::F<br>
<br>
   // Start defining the function.<br>
   StartFunction(GlobalDecl(), ResultType, Fn, FnInfo, FunctionArgs,<br>
-                SourceLocation());<br>
+                MD->getLocation(), SourceLocation());<br>
<br>
   // Since we didn't pass a GlobalDecl to StartFunction, do this ourselves.<br>
   CGM.getCXXABI().EmitInstanceFunctionProlog(*this);<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Apr 10 18:21:53 2014<br>
@@ -503,6 +503,7 @@ void CodeGenFunction::StartFunction(Glob<br>
                                     llvm::Function *Fn,<br>
                                     const CGFunctionInfo &FnInfo,<br>
                                     const FunctionArgList &Args,<br>
+                                    SourceLocation Loc,<br>
                                     SourceLocation StartLoc) {<br>
   const Decl *D = GD.getDecl();<br>
<br>
@@ -580,9 +581,7 @@ void CodeGenFunction::StartFunction(Glob<br>
     QualType FnType =<br>
       getContext().getFunctionType(RetTy, ArgTypes,<br>
                                    FunctionProtoType::ExtProtoInfo());<br>
-<br>
-    DI->setLocation(StartLoc);<br>
-    DI->EmitFunctionStart(GD, FnType, CurFn, Builder);<br>
+    DI->EmitFunctionStart(GD, Loc, StartLoc, FnType, CurFn, Builder);<br>
   }<br>
<br>
   if (ShouldInstrumentFunction())<br>
@@ -759,8 +758,24 @@ void CodeGenFunction::GenerateCode(Globa<br>
   if (Stmt *Body = FD->getBody()) BodyRange = Body->getSourceRange();<br>
   CurEHLocation = BodyRange.getEnd();<br>
<br>
+  // Use the location of the start of the function to determine where<br>
+  // the function definition is located. By default use the location<br>
+  // of the declaration as the location for the subprogram. A function<br>
+  // may lack a declaration in the source code if it is created by code<br>
+  // gen. (examples: _GLOBAL__I_a, __cxx_global_array_dtor, thunk).<br>
+  SourceLocation Loc;<br>
+  if (FD) {<br>
+    Loc = FD->getLocation();<br>
+<br>
+    // If this is a function specialization then use the pattern body<br>
+    // as the location for the function.<br>
+    if (const FunctionDecl *SpecDecl = FD->getTemplateInstantiationPattern())<br>
+      if (SpecDecl->hasBody(SpecDecl))<br>
+        Loc = SpecDecl->getLocation();<br>
+  }<br>
+<br>
   // Emit the standard function prologue.<br>
-  StartFunction(GD, ResTy, Fn, FnInfo, Args, BodyRange.getBegin());<br>
+  StartFunction(GD, ResTy, Fn, FnInfo, Args, Loc, BodyRange.getBegin());<br>
<br>
   // Generate the body of the function.<br>
   PGO.assignRegionCounters(GD.getDecl(), CurFn);<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=205999&r1=205998&r2=205999&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=205999&r1=205998&r2=205999&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Thu Apr 10 18:21:53 2014<br>
@@ -1140,11 +1140,15 @@ public:<br>
<br>
   void GenerateCode(GlobalDecl GD, llvm::Function *Fn,<br>
                     const CGFunctionInfo &FnInfo);<br>
+  /// \brief Emit code for the start of a function.<br>
+  /// \param Loc       The location to be associated with the function.<br>
+  /// \param StartLoc  The location of the function body.<br>
   void StartFunction(GlobalDecl GD,<br>
                      QualType RetTy,<br>
                      llvm::Function *Fn,<br>
                      const CGFunctionInfo &FnInfo,<br>
                      const FunctionArgList &Args,<br>
+                     SourceLocation Loc,<br>
                      SourceLocation StartLoc);<br>
<br>
   void EmitConstructorBody(FunctionArgList &Args);<br>
<br>
Added: cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp?rev=205999&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp?rev=205999&view=auto</a><br>

==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp (added)<br>
+++ cfe/trunk/test/CodeGenCXX/globalinit-loc.cpp Thu Apr 10 18:21:53 2014<br>
@@ -0,0 +1,22 @@<br>
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s<br>
+// <a href="rdar://problem/14985269">rdar://problem/14985269</a>.<br>
+//<br>
+// Verify that the global init helper function does not get associated<br>
+// with any source location.<br>
+//<br>
+// CHECK: define internal void @_GLOBAL__I_a<br>
+// CHECK-NOT: !dbg<br>
+// CHECK: "_GLOBAL__I_a", i32 0, {{.*}}, i32 0} ; [ DW_TAG_subprogram ] [line 0] [local] [def]<br>
+# 99 "someheader.h"<br>
+class A {<br>
+public:<br>
+  A();<br>
+  int foo() { return 0; }<br>
+};<br>
+# 5 "main.cpp"<br>
+A a;<br>
+<br>
+int f() {<br>
+  return a.foo();<br>
+}<br>
+<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>
</blockquote></div><br></body></html>