[llvm-branch-commits] [cfe-branch] r227859 - Merging r226382:
Hans Wennborg
hans at hanshq.net
Mon Feb 2 13:02:01 PST 2015
Author: hans
Date: Mon Feb 2 15:02:01 2015
New Revision: 227859
URL: http://llvm.org/viewvc/llvm-project?rev=227859&view=rev
Log:
Merging r226382:
------------------------------------------------------------------------
r226382 | dblaikie | 2015-01-17 16:12:58 -0800 (Sat, 17 Jan 2015) | 7 lines
DebugInfo: Correct the debug location of non-static data member initializers
This was causing some trouble for otherwise dead code removed in r225085
(reverted in r225361). The location being set for function arguments was
leaking out to the call which wasn't setting its own location (so a
quality bug turned into a crasher with r225085). Fix this so r225085 can
be recommitted.
------------------------------------------------------------------------
Modified:
cfe/branches/release_36/ (props changed)
cfe/branches/release_36/lib/AST/DeclCXX.cpp
cfe/branches/release_36/lib/CodeGen/CGClass.cpp
cfe/branches/release_36/test/CodeGenCXX/debug-info-line.cpp
Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb 2 15:02:01 2015
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393
+/cfe/trunk:226008,226049,226136,226282,226382,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_36/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/AST/DeclCXX.cpp?rev=227859&r1=227858&r2=227859&view=diff
==============================================================================
--- cfe/branches/release_36/lib/AST/DeclCXX.cpp (original)
+++ cfe/branches/release_36/lib/AST/DeclCXX.cpp Mon Feb 2 15:02:01 2015
@@ -1693,12 +1693,12 @@ const Type *CXXCtorInitializer::getBaseC
}
SourceLocation CXXCtorInitializer::getSourceLocation() const {
- if (isAnyMemberInitializer())
- return getMemberLocation();
-
if (isInClassMemberInitializer())
return getAnyMember()->getLocation();
+ if (isAnyMemberInitializer())
+ return getMemberLocation();
+
if (TypeSourceInfo *TSInfo = Initializee.get<TypeSourceInfo*>())
return TSInfo->getTypeLoc().getLocalSourceRange().getBegin();
Modified: cfe/branches/release_36/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CGClass.cpp?rev=227859&r1=227858&r2=227859&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CGClass.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CGClass.cpp Mon Feb 2 15:02:01 2015
@@ -544,7 +544,7 @@ static void EmitMemberInitializer(CodeGe
CXXCtorInitializer *MemberInit,
const CXXConstructorDecl *Constructor,
FunctionArgList &Args) {
- ApplyDebugLocation Loc(CGF, MemberInit->getMemberLocation());
+ ApplyDebugLocation Loc(CGF, MemberInit->getSourceLocation());
assert(MemberInit->isAnyMemberInitializer() &&
"Must have member initializer!");
assert(MemberInit->getInit() && "Must have initializer!");
@@ -598,7 +598,6 @@ static void EmitMemberInitializer(CodeGe
ArrayRef<VarDecl *> ArrayIndexes;
if (MemberInit->getNumArrayIndices())
ArrayIndexes = MemberInit->getArrayIndexes();
- ApplyDebugLocation DL(CGF, MemberInit->getMemberLocation());
CGF.EmitInitializerForField(Field, LHS, MemberInit->getInit(), ArrayIndexes);
}
Modified: cfe/branches/release_36/test/CodeGenCXX/debug-info-line.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/CodeGenCXX/debug-info-line.cpp?rev=227859&r1=227858&r2=227859&view=diff
==============================================================================
--- cfe/branches/release_36/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/branches/release_36/test/CodeGenCXX/debug-info-line.cpp Mon Feb 2 15:02:01 2015
@@ -166,6 +166,23 @@ void f13() {
F13_IMPL;
}
+struct f14 {
+ f14(int);
+};
+
+// CHECK-LABEL: define
+// CHECK-LABEL: define
+// CHECK-LABEL: define
+struct {
+// CHECK: call {{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]]
+#line 1600
+ f14 v
+ =
+ 1;
+} f14_inst;
+
+// CHECK-LABEL: define
+
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
// CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
More information about the llvm-branch-commits
mailing list