File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ TypeDecl *DebugTypeInfo::getDecl() const {
193193 return nullptr ;
194194}
195195
196+ bool DebugTypeInfo::isForwardDecl () const {
197+ return isNull () || (!FragmentStorageType && !isa<TypeAliasType>(getType ()));
198+ }
199+
196200#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
197201LLVM_DUMP_METHOD void DebugTypeInfo::dump () const {
198202 llvm::errs () << " [" ;
@@ -203,7 +207,8 @@ LLVM_DUMP_METHOD void DebugTypeInfo::dump() const {
203207 if (FragmentStorageType) {
204208 llvm::errs () << " FragmentStorageType=" ;
205209 FragmentStorageType->dump ();
206- } else
210+ }
211+ if (isForwardDecl ())
207212 llvm::errs () << " forward-declared\n " ;
208213}
209214#endif
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ class DebugTypeInfo {
102102
103103 llvm::Type *getFragmentStorageType () const { return FragmentStorageType; }
104104 Alignment getAlignment () const { return Align; }
105- bool isNull () const { return Type == nullptr ; }
106- bool isForwardDecl () const { return FragmentStorageType == nullptr ; }
105+ bool isNull () const { return ! Type; }
106+ bool isForwardDecl () const ;
107107 bool isMetadataType () const { return IsMetadataType; }
108108 bool hasDefaultAlignment () const { return DefaultAlignment; }
109109 bool isFixedBuffer () const { return IsFixedBuffer; }
Original file line number Diff line number Diff line change @@ -2511,7 +2511,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
25112511
25122512 // If this is a forward decl, create one for this mangled name and don't
25132513 // cache it.
2514- if (DbgTy.isForwardDecl () && !isa<TypeAliasType>(DbgTy. getType ()) ) {
2514+ if (DbgTy.isForwardDecl ()) {
25152515 // In LTO type uniquing is performed based on the UID. Forward
25162516 // declarations may not have a unique ID to avoid a forward declaration
25172517 // winning over a full definition.
You can’t perform that action at this time.
0 commit comments