diff options
author | Bob Haarman <llvm@inglorion.net> | 2017-08-29 20:59:25 +0000 |
---|---|---|
committer | Bob Haarman <llvm@inglorion.net> | 2017-08-29 20:59:25 +0000 |
commit | 223303c5a39b232bd3d6f4b207e6e0b01febf4c5 (patch) | |
tree | 573984cc1df9510343aee9fed7a06bc3f9754302 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | |
parent | 4faeb87ebe8942dc7b997f763ed8899a0bcfb963 (diff) | |
download | bcm5719-llvm-223303c5a39b232bd3d6f4b207e6e0b01febf4c5.tar.gz bcm5719-llvm-223303c5a39b232bd3d6f4b207e6e0b01febf4c5.zip |
Reland r311957 [codeview] support more DW_OPs for more complete debug info
Summary:
Some variables show up in Visual Studio as "optimized out" even in -O0
-Od builds. This change fixes two issues that would cause this to
happen. The first issue is that not all DIExpressions we generate were
recognized by the CodeView writer. This has been addressed by adding
support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second
issue is that we had no way to encode DW_OP_deref in CodeView. We get
around that by changinge the type we encode in the debug info to be
a reference to the type in the source code.
This fixes PR34261.
The reland adds two extra checks to the original: It checks if the
DbgVariableLocation is valid before checking any of its fields, and
it only emits ranges with nonzero registers.
Reviewers: aprantl, rnk, zturner
Reviewed By: rnk
Subscribers: mgorny, llvm-commits, aprantl, hiraditya
Differential Revision: https://reviews.llvm.org/D36907
llvm-svn: 312034
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h index 91f691c635e..4345bb4d1c2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -94,6 +94,7 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { struct LocalVariable { const DILocalVariable *DIVar = nullptr; SmallVector<LocalVarDefRange, 1> DefRanges; + bool Deref = false; }; struct InlineSite { @@ -147,6 +148,9 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { codeview::TypeIndex getFuncIdForSubprogram(const DISubprogram *SP); + void calculateRanges(LocalVariable &Var, + const DbgValueHistoryMap::InstrRanges &Ranges); + static void collectInlineSiteChildren(SmallVectorImpl<unsigned> &Children, const FunctionInfo &FI, const InlineSite &Site); @@ -259,6 +263,8 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { codeview::TypeIndex getTypeIndex(DITypeRef TypeRef, DITypeRef ClassTyRef = DITypeRef()); + codeview::TypeIndex getTypeIndexForReferenceTo(DITypeRef TypeRef); + codeview::TypeIndex getMemberFunctionType(const DISubprogram *SP, const DICompositeType *Class); |