@@ -163,16 +163,16 @@ DeclName SILGenModule::getMagicFunctionName(SILDeclRef ref) {
163163
164164void SILGenFunction::enterDebugScope (SILLocation Loc, bool isBindingScope,
165165 Optional<SILLocation> MacroExpansion,
166- DeclNameRef MacroName,
167- DeclNameLoc MacroNameLoc ) {
166+ StringRef MacroName,
167+ Optional<SILLocation> MacroLoc ) {
168168 auto *Parent = DebugScopeStack.size () ? DebugScopeStack.back ().getPointer ()
169169 : F.getDebugScope ();
170170 auto *Scope = Parent;
171171 // Don't nest a scope for Loc under Parent unless it's actually different.
172172 if (RegularLocation (Parent->getLoc ()) != RegularLocation (Loc)) {
173173 SILDebugScope *InlinedAt = nullptr ;
174174 // Create an inline scope for a macro expansion.
175- if (MacroExpansion && MacroName && MacroNameLoc. isValid () ) {
175+ if (MacroExpansion && ! MacroName. empty () && MacroLoc ) {
176176 InlinedAt = new (SGM.M ) SILDebugScope (RegularLocation (*MacroExpansion),
177177 &getFunction (), Parent);
178178 SILGenFunctionBuilder B (SGM);
@@ -183,10 +183,9 @@ void SILGenFunction::enterDebugScope(SILLocation Loc, bool isBindingScope,
183183 /* Results*/ {}, None, SubstitutionMap (), SubstitutionMap (),
184184 SGM.M .getASTContext ());
185185 SILFunction *MacroFn = B.getOrCreateFunction (
186- Loc, MacroName.getBaseIdentifier ().str (),
187- SILLinkage::DefaultForDeclaration, FunctionType, IsNotBare,
188- IsNotTransparent, IsNotSerialized, IsNotDynamic, IsNotDistributed,
189- IsNotRuntimeAccessible);
186+ *MacroLoc, MacroName, SILLinkage::DefaultForDeclaration, FunctionType,
187+ IsNotBare, IsNotTransparent, IsNotSerialized, IsNotDynamic,
188+ IsNotDistributed, IsNotRuntimeAccessible);
190189 auto MacroScope = new (SGM.M ) SILDebugScope (Loc, MacroFn);
191190 Parent = MacroScope;
192191 }
0 commit comments