@@ -163,16 +163,16 @@ DeclName SILGenModule::getMagicFunctionName(SILDeclRef ref) {
163
163
164
164
void SILGenFunction::enterDebugScope (SILLocation Loc, bool isBindingScope,
165
165
Optional<SILLocation> MacroExpansion,
166
- DeclNameRef MacroName,
167
- DeclNameLoc MacroNameLoc ) {
166
+ StringRef MacroName,
167
+ Optional<SILLocation> MacroLoc ) {
168
168
auto *Parent = DebugScopeStack.size () ? DebugScopeStack.back ().getPointer ()
169
169
: F.getDebugScope ();
170
170
auto *Scope = Parent;
171
171
// Don't nest a scope for Loc under Parent unless it's actually different.
172
172
if (RegularLocation (Parent->getLoc ()) != RegularLocation (Loc)) {
173
173
SILDebugScope *InlinedAt = nullptr ;
174
174
// Create an inline scope for a macro expansion.
175
- if (MacroExpansion && MacroName && MacroNameLoc. isValid () ) {
175
+ if (MacroExpansion && ! MacroName. empty () && MacroLoc ) {
176
176
InlinedAt = new (SGM.M ) SILDebugScope (RegularLocation (*MacroExpansion),
177
177
&getFunction (), Parent);
178
178
SILGenFunctionBuilder B (SGM);
@@ -183,10 +183,9 @@ void SILGenFunction::enterDebugScope(SILLocation Loc, bool isBindingScope,
183
183
/* Results*/ {}, None, SubstitutionMap (), SubstitutionMap (),
184
184
SGM.M .getASTContext ());
185
185
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);
190
189
auto MacroScope = new (SGM.M ) SILDebugScope (Loc, MacroFn);
191
190
Parent = MacroScope;
192
191
}
0 commit comments