File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 4848#include " IRGenDebugInfo.h"
4949#include " IRGenFunction.h"
5050#include " IRGenModule.h"
51+ #include " LocalTypeData.h"
5152#include " MetadataRequest.h"
5253#include " Outlining.h"
5354#include " ProtocolInfo.h"
@@ -75,6 +76,25 @@ irgen::emitArchetypeTypeMetadataRef(IRGenFunction &IGF,
7576 return emitOpaqueTypeMetadataRef (IGF, opaque, request);
7677 }
7778
79+ #ifndef NDEBUG
80+ if (!archetype->getParent ()) {
81+ llvm::errs () << " Metadata for archetype not bound in function.\n "
82+ << " The metadata could be missing entirely because it needs "
83+ " to be passed to the function.\n "
84+ << " Or the metadata is present and not bound in which case "
85+ " setScopedLocalTypeMetadata or similar must be called.\n " ;
86+ llvm::errs () << " Archetype without metadata: " << archetype << " \n " ;
87+ archetype->dump (llvm::errs ());
88+ llvm::errs () << " Function:\n " ;
89+ IGF.CurFn ->print (llvm::errs ());
90+ if (auto localTypeData = IGF.getLocalTypeData ()) {
91+ llvm::errs () << " LocalTypeData:\n " ;
92+ localTypeData->dump ();
93+ } else {
94+ llvm::errs () << " No LocalTypeDataCache for this function!\n " ;
95+ }
96+ }
97+ #endif
7898 // If there's no local or opaque metadata, it must be a nested type.
7999 assert (archetype->getParent () && " Not a nested archetype" );
80100
Original file line number Diff line number Diff line change @@ -792,6 +792,9 @@ class IRGenFunction {
792792 llvm::Value *getDynamicSelfMetadata ();
793793 void setDynamicSelfMetadata (CanType selfBaseTy, bool selfIsExact,
794794 llvm::Value *value, DynamicSelfKind kind);
795+ #ifndef NDEBUG
796+ LocalTypeDataCache const *getLocalTypeData () { return LocalTypeData; }
797+ #endif
795798
796799private:
797800 LocalTypeDataCache &getOrCreateLocalTypeData ();
You can’t perform that action at this time.
0 commit comments