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 {
193
193
return nullptr ;
194
194
}
195
195
196
+ bool DebugTypeInfo::isForwardDecl () const {
197
+ return isNull () || (!FragmentStorageType && !isa<TypeAliasType>(getType ()));
198
+ }
199
+
196
200
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
197
201
LLVM_DUMP_METHOD void DebugTypeInfo::dump () const {
198
202
llvm::errs () << " [" ;
@@ -203,7 +207,8 @@ LLVM_DUMP_METHOD void DebugTypeInfo::dump() const {
203
207
if (FragmentStorageType) {
204
208
llvm::errs () << " FragmentStorageType=" ;
205
209
FragmentStorageType->dump ();
206
- } else
210
+ }
211
+ if (isForwardDecl ())
207
212
llvm::errs () << " forward-declared\n " ;
208
213
}
209
214
#endif
Original file line number Diff line number Diff line change @@ -102,8 +102,8 @@ class DebugTypeInfo {
102
102
103
103
llvm::Type *getFragmentStorageType () const { return FragmentStorageType; }
104
104
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 ;
107
107
bool isMetadataType () const { return IsMetadataType; }
108
108
bool hasDefaultAlignment () const { return DefaultAlignment; }
109
109
bool isFixedBuffer () const { return IsFixedBuffer; }
Original file line number Diff line number Diff line change @@ -2511,7 +2511,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
2511
2511
2512
2512
// If this is a forward decl, create one for this mangled name and don't
2513
2513
// cache it.
2514
- if (DbgTy.isForwardDecl () && !isa<TypeAliasType>(DbgTy. getType ()) ) {
2514
+ if (DbgTy.isForwardDecl ()) {
2515
2515
// In LTO type uniquing is performed based on the UID. Forward
2516
2516
// declarations may not have a unique ID to avoid a forward declaration
2517
2517
// winning over a full definition.
You can’t perform that action at this time.
0 commit comments