summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-01-09 23:00:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-01-09 23:00:28 +0000
commitf353d3ecd0329884110a8bd39f28b5cc111c9a69 (patch)
tree070b18a0745ca81118c1a5e32351cdcadcceb79e /clang/lib/CodeGen/CGDecl.cpp
parenta10379ad49b9a102d9f6ab1bdafba67dc42f430b (diff)
downloadbcm5719-llvm-f353d3ecd0329884110a8bd39f28b5cc111c9a69.tar.gz
bcm5719-llvm-f353d3ecd0329884110a8bd39f28b5cc111c9a69.zip
Revert "DebugInfo: Generalize debug info location handling" and related commits
This reverts commit r225000, r225021, r225083, r225086, r225090. The root change (r225000) still has several issues where it's caused calls to be emitted without debug locations. This causes assertion failures if/when those calls are inlined. I'll work up some test cases and fixes before recommitting this. llvm-svn: 225555
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 15a1a7fb5f1..4a612c9bedf 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -597,13 +597,14 @@ static void drillIntoBlockVariable(CodeGenFunction &CGF,
}
void CodeGenFunction::EmitScalarInit(const Expr *init, const ValueDecl *D,
- LValue lvalue, bool capturedByInit) {
+ LValue lvalue, bool capturedByInit,
+ SourceLocation DbgLoc) {
Qualifiers::ObjCLifetime lifetime = lvalue.getObjCLifetime();
if (!lifetime) {
llvm::Value *value = EmitScalarExpr(init);
if (capturedByInit)
drillIntoBlockVariable(*this, lvalue, cast<VarDecl>(D));
- EmitStoreThroughLValue(RValue::get(value), lvalue, true);
+ EmitStoreThroughLValue(RValue::get(value), lvalue, true, DbgLoc);
return;
}
@@ -1087,7 +1088,6 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
if (emission.wasEmittedAsGlobal()) return;
const VarDecl &D = *emission.Variable;
- ApplyDebugLocation DL(*this, D.getLocation());
QualType type = D.getType();
// If this local has an initializer, emit it now.
@@ -1126,7 +1126,7 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
if (!constant) {
LValue lv = MakeAddrLValue(Loc, type, alignment);
lv.setNonGC(true);
- return EmitExprAsInit(Init, &D, lv, capturedByInit);
+ return EmitExprAsInit(Init, &D, lv, capturedByInit, D.getLocation());
}
if (!emission.IsConstantAggregate) {
@@ -1192,25 +1192,26 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) {
/// \param capturedByInit true if the variable is a __block variable
/// whose address is potentially changed by the initializer
void CodeGenFunction::EmitExprAsInit(const Expr *init, const ValueDecl *D,
- LValue lvalue, bool capturedByInit) {
+ LValue lvalue, bool capturedByInit,
+ SourceLocation DbgLoc) {
QualType type = D->getType();
if (type->isReferenceType()) {
RValue rvalue = EmitReferenceBindingToExpr(init);
if (capturedByInit)
drillIntoBlockVariable(*this, lvalue, cast<VarDecl>(D));
- EmitStoreThroughLValue(rvalue, lvalue, true);
+ EmitStoreThroughLValue(rvalue, lvalue, true, DbgLoc);
return;
}
switch (getEvaluationKind(type)) {
case TEK_Scalar:
- EmitScalarInit(init, D, lvalue, capturedByInit);
+ EmitScalarInit(init, D, lvalue, capturedByInit, DbgLoc);
return;
case TEK_Complex: {
ComplexPairTy complex = EmitComplexExpr(init);
if (capturedByInit)
drillIntoBlockVariable(*this, lvalue, cast<VarDecl>(D));
- EmitStoreOfComplex(complex, lvalue, /*init*/ true);
+ EmitStoreOfComplex(complex, lvalue, /*init*/ true, DbgLoc);
return;
}
case TEK_Aggregate:
OpenPOWER on IntegriCloud