[llvm] r209680 - DebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters.
David Blaikie
dblaikie at gmail.com
Tue May 27 12:34:32 PDT 2014
Author: dblaikie
Date: Tue May 27 14:34:32 2014
New Revision: 209680
URL: http://llvm.org/viewvc/llvm-project?rev=209680&view=rev
Log:
DebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters.
Originally committed in r207717, I clearly didn't look very closely at
the code to understand how existing things were working...
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=209680&r1=209679&r2=209680&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue May 27 14:34:32 2014
@@ -448,12 +448,7 @@ static std::unique_ptr<DIE> constructVar
DbgVariable &DV,
const LexicalScope &Scope,
DIE *&ObjectPointer) {
- AbstractOrInlined AOI = AOI_None;
- if (Scope.isAbstractScope())
- AOI = AOI_Abstract;
- else if (Scope.getInlinedAt())
- AOI = AOI_Inlined;
- auto Var = TheCU.constructVariableDIE(DV, AOI);
+ auto Var = TheCU.constructVariableDIE(DV, Scope.isAbstractScope());
if (DV.isObjectPointer())
ObjectPointer = Var.get();
return Var;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=209680&r1=209679&r2=209680&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue May 27 14:34:32 2014
@@ -1769,34 +1769,30 @@ void DwarfUnit::constructContainingTypeD
/// constructVariableDIE - Construct a DIE for the given DbgVariable.
std::unique_ptr<DIE> DwarfUnit::constructVariableDIE(DbgVariable &DV,
- AbstractOrInlined AbsIn) {
- auto D = constructVariableDIEImpl(DV, AbsIn);
+ bool Abstract) {
+ auto D = constructVariableDIEImpl(DV, Abstract);
DV.setDIE(*D);
return D;
}
-std::unique_ptr<DIE>
-DwarfUnit::constructVariableDIEImpl(const DbgVariable &DV,
- AbstractOrInlined AbsIn) {
+std::unique_ptr<DIE> DwarfUnit::constructVariableDIEImpl(const DbgVariable &DV,
+ bool Abstract) {
StringRef Name = DV.getName();
// Define variable debug information entry.
auto VariableDie = make_unique<DIE>(DV.getTag());
- DbgVariable *AbsVar = DV.getAbstractVariable();
- DIE *AbsDIE = AbsVar ? AbsVar->getDIE() : nullptr;
- if (AbsDIE)
- addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin, *AbsDIE);
+ if (DbgVariable *AbsVar = DV.getAbstractVariable())
+ addDIEEntry(*VariableDie, dwarf::DW_AT_abstract_origin, *AbsVar->getDIE());
else {
if (!Name.empty())
addString(*VariableDie, dwarf::DW_AT_name, Name);
addSourceLine(*VariableDie, DV.getVariable());
addType(*VariableDie, DV.getType());
+ if (DV.isArtificial())
+ addFlag(*VariableDie, dwarf::DW_AT_artificial);
}
- if (AbsIn != AOI_Inlined && DV.isArtificial())
- addFlag(*VariableDie, dwarf::DW_AT_artificial);
-
- if (AbsIn == AOI_Abstract)
+ if (Abstract)
return VariableDie;
// Add variable address.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=209680&r1=209679&r2=209680&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Tue May 27 14:34:32 2014
@@ -61,8 +61,6 @@ public:
void addRange(RangeSpan Range) { Ranges.push_back(Range); }
};
-enum AbstractOrInlined { AOI_None, AOI_Inlined, AOI_Abstract };
-
//===----------------------------------------------------------------------===//
/// Unit - This dwarf writer support class manages information associated
/// with a source file.
@@ -419,7 +417,7 @@ public:
/// constructVariableDIE - Construct a DIE for the given DbgVariable.
std::unique_ptr<DIE> constructVariableDIE(DbgVariable &DV,
- AbstractOrInlined AbsIn = AOI_None);
+ bool Abstract = false);
/// constructSubprogramArguments - Construct function argument DIEs.
void constructSubprogramArguments(DIE &Buffer, DIArray Args);
@@ -457,7 +455,7 @@ private:
/// \brief Construct a DIE for the given DbgVariable without initializing the
/// DbgVariable's DIE reference.
std::unique_ptr<DIE> constructVariableDIEImpl(const DbgVariable &DV,
- AbstractOrInlined AbsIn);
+ bool Abstract);
/// constructTypeDIE - Construct basic type die from DIBasicType.
void constructTypeDIE(DIE &Buffer, DIBasicType BTy);
More information about the llvm-commits
mailing list