summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 95ce098)
raw | patch | inline | side by side (parent: 95ce098)
author | David Blaikie <dblaikie@gmail.com> | |
Tue, 27 May 2014 19:34:32 +0000 (19:34 +0000) | ||
committer | David Blaikie <dblaikie@gmail.com> | |
Tue, 27 May 2014 19:34:32 +0000 (19:34 +0000) |
Originally committed in r207717, I clearly didn't look very closely at
the code to understand how existing things were working...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209680 91177308-0d34-0410-b5e6-96231b3b80d8
the code to understand how existing things were working...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209680 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | patch | blob | history | |
lib/CodeGen/AsmPrinter/DwarfUnit.cpp | patch | blob | history | |
lib/CodeGen/AsmPrinter/DwarfUnit.h | patch | blob | history |
index c0badde3685ac24e3d8aeec090b5378f8b026533..967c7b1b5964228e04983602962e33e1201eb909 100644 (file)
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;
index 2707f8b73d84b2c82837111264edc196194e1b70..4bf0b1878473dacd2dca69599ec31031a76e4070 100644 (file)
/// 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.
index 7025b712f0e7cf982c8f4e5d6ca19612fdc42f29..acb75283530f281b9e909fc33f8402d09d97a65f 100644 (file)
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.
/// 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);
/// \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);