Revert "DebugInfo: Generalize debug info location handling"
Fails an ASan bootstrap - I'll try to reproduce locally & sort that out before recommitting. This reverts commit r224385. llvm-svn: 224441
This commit is contained in:
@@ -544,7 +544,6 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
|
||||
CXXCtorInitializer *MemberInit,
|
||||
const CXXConstructorDecl *Constructor,
|
||||
FunctionArgList &Args) {
|
||||
ApplyDebugLocation Loc(CGF, MemberInit->getMemberLocation());
|
||||
assert(MemberInit->isAnyMemberInitializer() &&
|
||||
"Must have member initializer!");
|
||||
assert(MemberInit->getInit() && "Must have initializer!");
|
||||
@@ -598,25 +597,26 @@ static void EmitMemberInitializer(CodeGenFunction &CGF,
|
||||
ArrayRef<VarDecl *> ArrayIndexes;
|
||||
if (MemberInit->getNumArrayIndices())
|
||||
ArrayIndexes = MemberInit->getArrayIndexes();
|
||||
ApplyDebugLocation DL(CGF, MemberInit->getMemberLocation());
|
||||
CGF.EmitInitializerForField(Field, LHS, MemberInit->getInit(), ArrayIndexes);
|
||||
CGF.EmitInitializerForField(Field, LHS, MemberInit->getInit(), ArrayIndexes,
|
||||
MemberInit->getMemberLocation());
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitInitializerForField(
|
||||
FieldDecl *Field, LValue LHS, Expr *Init,
|
||||
ArrayRef<VarDecl *> ArrayIndexes) {
|
||||
void CodeGenFunction::EmitInitializerForField(FieldDecl *Field, LValue LHS,
|
||||
Expr *Init,
|
||||
ArrayRef<VarDecl *> ArrayIndexes,
|
||||
SourceLocation DbgLoc) {
|
||||
QualType FieldType = Field->getType();
|
||||
switch (getEvaluationKind(FieldType)) {
|
||||
case TEK_Scalar:
|
||||
if (LHS.isSimple()) {
|
||||
EmitExprAsInit(Init, Field, LHS, false);
|
||||
EmitExprAsInit(Init, Field, LHS, false, DbgLoc);
|
||||
} else {
|
||||
RValue RHS = RValue::get(EmitScalarExpr(Init));
|
||||
EmitStoreThroughLValue(RHS, LHS);
|
||||
}
|
||||
break;
|
||||
case TEK_Complex:
|
||||
EmitComplexExprIntoLValue(Init, LHS, /*isInit*/ true);
|
||||
EmitComplexExprIntoLValue(Init, LHS, /*isInit*/ true, DbgLoc);
|
||||
break;
|
||||
case TEK_Aggregate: {
|
||||
llvm::Value *ArrayIndexVar = nullptr;
|
||||
@@ -783,6 +783,8 @@ void CodeGenFunction::EmitConstructorBody(FunctionArgList &Args) {
|
||||
// delegation optimization.
|
||||
if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor) &&
|
||||
CGM.getTarget().getCXXABI().hasConstructorVariants()) {
|
||||
if (CGDebugInfo *DI = getDebugInfo())
|
||||
DI->EmitLocation(Builder, Ctor->getLocEnd());
|
||||
EmitDelegateCXXConstructorCall(Ctor, Ctor_Base, Args, Ctor->getLocEnd());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user