diff options
author | Reid Kleckner <rnk@google.com> | 2019-11-06 15:04:52 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-11-07 13:58:01 -0800 |
commit | d91ed80e97ac9bfcfb02440874ed8b9a51c9491e (patch) | |
tree | 1bde59eb5403487367706c59f443b866e5ed301f /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | |
parent | 01b10bc7b14963902405d202ac78cd88d44adbc5 (diff) | |
download | bcm5719-llvm-d91ed80e97ac9bfcfb02440874ed8b9a51c9491e.tar.gz bcm5719-llvm-d91ed80e97ac9bfcfb02440874ed8b9a51c9491e.zip |
[codeview] Reference types in type parent scopes
Without this change, when a nested tag type of any kind (enum, class,
struct, union) is used as a variable type, it is emitted without
emitting the parent type. In CodeView, parent types point to their inner
types, and inner types do not point back to their parents. We already
walk over all of the parent scopes to build the fully qualified name.
This change simply requests their type indices as we go along to enusre
they are all emitted.
Fixes PR43905
Reviewers: akhuang, amccarth
Differential Revision: https://reviews.llvm.org/D69924
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h index b56b9047e1a..e32d6267430 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h @@ -443,6 +443,19 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase { codeview::TypeIndex TI, const DIType *ClassTy = nullptr); + /// Collect the names of parent scopes, innermost to outermost. Return the + /// innermost subprogram scope if present. Ensure that parent type scopes are + /// inserted into the type table. + const DISubprogram * + collectParentScopeNames(const DIScope *Scope, + SmallVectorImpl<StringRef> &ParentScopeNames); + + std::string formatNestedName(ArrayRef<StringRef> ParentScopeNames, + StringRef TypeName); + + std::string getFullyQualifiedName(const DIScope *Scope, StringRef Name); + std::string getFullyQualifiedName(const DIScope *Scope); + unsigned getPointerSizeInBytes(); protected: |