Skip to content

Commit 24a12eb

Browse files
committed
Renable GeneratedSourceInfo::Attribute to GeneratedSourceInfo::AttributeFromClang
1 parent e9b89e9 commit 24a12eb

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class GeneratedSourceInfo {
6767
DefaultArgument,
6868

6969
/// A Swift attribute expressed in C headers.
70-
Attribute,
70+
AttributeFromClang,
7171
} kind;
7272

7373
static StringRef kindToString(GeneratedSourceInfo::Kind kind) {
@@ -83,8 +83,8 @@ class GeneratedSourceInfo {
8383
return "PrettyPrinted";
8484
case DefaultArgument:
8585
return "DefaultArgument";
86-
case Attribute:
87-
return "Attribute";
86+
case AttributeFromClang:
87+
return "AttributeFromClang";
8888
}
8989
llvm_unreachable("Invalid kind");
9090
}

lib/AST/ASTMangler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4535,7 +4535,7 @@ void ASTMangler::appendMacroExpansionContext(
45354535
case GeneratedSourceInfo::PrettyPrinted:
45364536
case GeneratedSourceInfo::ReplacedFunctionBody:
45374537
case GeneratedSourceInfo::DefaultArgument:
4538-
case GeneratedSourceInfo::Attribute:
4538+
case GeneratedSourceInfo::AttributeFromClang:
45394539
return appendMacroExpansionLoc();
45404540
}
45414541

@@ -4587,7 +4587,7 @@ void ASTMangler::appendMacroExpansionContext(
45874587
case GeneratedSourceInfo::PrettyPrinted:
45884588
case GeneratedSourceInfo::ReplacedFunctionBody:
45894589
case GeneratedSourceInfo::DefaultArgument:
4590-
case GeneratedSourceInfo::Attribute:
4590+
case GeneratedSourceInfo::AttributeFromClang:
45914591
llvm_unreachable("Exited above");
45924592
}
45934593

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12075,7 +12075,7 @@ MacroDiscriminatorContext MacroDiscriminatorContext::getParentOf(
1207512075
case GeneratedSourceInfo::PrettyPrinted:
1207612076
case GeneratedSourceInfo::ReplacedFunctionBody:
1207712077
case GeneratedSourceInfo::DefaultArgument:
12078-
case GeneratedSourceInfo::Attribute:
12078+
case GeneratedSourceInfo::AttributeFromClang:
1207912079
return origDC;
1208012080
}
1208112081
}

lib/AST/DiagnosticEngine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ DiagnosticEngine::diagnosticInfoForDiagnostic(const Diagnostic &diagnostic) {
13361336
#include "swift/Basic/MacroRoles.def"
13371337
case GeneratedSourceInfo::PrettyPrinted:
13381338
case GeneratedSourceInfo::DefaultArgument:
1339-
case GeneratedSourceInfo::Attribute:
1339+
case GeneratedSourceInfo::AttributeFromClang:
13401340
fixIts = {};
13411341
break;
13421342
case GeneratedSourceInfo::ReplacedFunctionBody:
@@ -1382,7 +1382,7 @@ getGeneratedSourceInfoMacroName(const GeneratedSourceInfo &info) {
13821382
case GeneratedSourceInfo::PrettyPrinted:
13831383
case GeneratedSourceInfo::ReplacedFunctionBody:
13841384
case GeneratedSourceInfo::DefaultArgument:
1385-
case GeneratedSourceInfo::Attribute:
1385+
case GeneratedSourceInfo::AttributeFromClang:
13861386
return DeclName();
13871387
}
13881388
}
@@ -1444,7 +1444,7 @@ DiagnosticEngine::getGeneratedSourceBufferNotes(SourceLoc loc) {
14441444

14451445
case GeneratedSourceInfo::DefaultArgument:
14461446
case GeneratedSourceInfo::ReplacedFunctionBody:
1447-
case GeneratedSourceInfo::Attribute:
1447+
case GeneratedSourceInfo::AttributeFromClang:
14481448
return childNotes;
14491449
}
14501450

lib/AST/Module.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ ModuleDecl::getOriginalLocation(SourceLoc loc) const {
862862
// replaced function bodies. The body is actually different code to the
863863
// original file.
864864
case GeneratedSourceInfo::PrettyPrinted:
865-
case GeneratedSourceInfo::Attribute:
865+
case GeneratedSourceInfo::AttributeFromClang:
866866
// No original location, return the original buffer/location
867867
return {startBufferID, startLoc};
868868
}
@@ -1149,7 +1149,7 @@ std::optional<MacroRole> SourceFile::getFulfilledMacroRole() const {
11491149
case GeneratedSourceInfo::ReplacedFunctionBody:
11501150
case GeneratedSourceInfo::PrettyPrinted:
11511151
case GeneratedSourceInfo::DefaultArgument:
1152-
case GeneratedSourceInfo::Attribute:
1152+
case GeneratedSourceInfo::AttributeFromClang:
11531153
return std::nullopt;
11541154
}
11551155
}

lib/Basic/SourceLoc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ StringRef SourceManager::getIdentifierForBuffer(
307307
if (generatedInfo->kind == GeneratedSourceInfo::ReplacedFunctionBody ||
308308
generatedInfo->kind == GeneratedSourceInfo::PrettyPrinted ||
309309
generatedInfo->kind == GeneratedSourceInfo::DefaultArgument ||
310-
generatedInfo->kind == GeneratedSourceInfo::Attribute)
310+
generatedInfo->kind == GeneratedSourceInfo::AttributeFromClang)
311311
return buffer->getBufferIdentifier();
312312

313313
if (generatedInfo->onDiskBufferCopyFileName.empty()) {
@@ -401,7 +401,7 @@ void SourceManager::setGeneratedSourceInfo(
401401
#include "swift/Basic/MacroRoles.def"
402402
case GeneratedSourceInfo::PrettyPrinted:
403403
case GeneratedSourceInfo::DefaultArgument:
404-
case GeneratedSourceInfo::Attribute:
404+
case GeneratedSourceInfo::AttributeFromClang:
405405
break;
406406

407407
case GeneratedSourceInfo::ReplacedFunctionBody:

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8214,7 +8214,7 @@ SourceFile &ClangImporter::Implementation::getClangSwiftAttrSourceFile(
82148214
sourceMgr.setGeneratedSourceInfo(
82158215
bufferID,
82168216
{
8217-
GeneratedSourceInfo::Attribute,
8217+
GeneratedSourceInfo::AttributeFromClang,
82188218
CharSourceRange(),
82198219
sourceMgr.getRangeForBuffer(bufferID),
82208220
&module

lib/IDE/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ adjustMacroExpansionWhitespace(GeneratedSourceInfo::Kind kind,
661661
case GeneratedSourceInfo::ReplacedFunctionBody:
662662
case GeneratedSourceInfo::PrettyPrinted:
663663
case GeneratedSourceInfo::DefaultArgument:
664-
case GeneratedSourceInfo::Attribute:
664+
case GeneratedSourceInfo::AttributeFromClang:
665665
return expandedCode;
666666
}
667667
}

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
301301
if (generatedInfo->kind != GeneratedSourceInfo::ReplacedFunctionBody &&
302302
generatedInfo->kind != GeneratedSourceInfo::PrettyPrinted &&
303303
generatedInfo->kind != GeneratedSourceInfo::DefaultArgument &&
304-
generatedInfo->kind != GeneratedSourceInfo::Attribute)
304+
generatedInfo->kind != GeneratedSourceInfo::AttributeFromClang)
305305
if (auto *MemBuf = SM.getLLVMSourceMgr().getMemoryBuffer(BufferID)) {
306306
Source = MemBuf->getBuffer();
307307
// This is copying the buffer twice, but Xcode depends on this

lib/Parse/ParseRequests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ getBridgedGeneratedSourceFileKind(const GeneratedSourceInfo *genInfo) {
162162
return BridgedGeneratedSourceFileKindPrettyPrinted;
163163
case GeneratedSourceInfo::Kind::DefaultArgument:
164164
return BridgedGeneratedSourceFileKindDefaultArgument;
165-
case GeneratedSourceInfo::Attribute:
165+
case GeneratedSourceInfo::AttributeFromClang:
166166
return BridgedGeneratedSourceFileKindAttribute;
167167
}
168168
}
@@ -382,7 +382,7 @@ SourceFileParsingResult parseSourceFile(SourceFile &SF) {
382382
parser.parseExpandedAttributeList(items, /*isFromClangAttribute=*/false);
383383
break;
384384

385-
case GeneratedSourceInfo::Attribute:
385+
case GeneratedSourceInfo::AttributeFromClang:
386386
parser.parseExpandedAttributeList(items, /*isFromClangAttribute=*/true);
387387
break;
388388

lib/SILGen/SILGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static MacroInfo getMacroInfo(const GeneratedSourceInfo &Info,
348348
case GeneratedSourceInfo::PrettyPrinted:
349349
case GeneratedSourceInfo::ReplacedFunctionBody:
350350
case GeneratedSourceInfo::DefaultArgument:
351-
case GeneratedSourceInfo::Attribute:
351+
case GeneratedSourceInfo::AttributeFromClang:
352352
break;
353353
}
354354
return Result;

tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ class SemanticAnnotator : public SourceEntityWalker {
972972
case GeneratedSourceInfo::DefaultArgument:
973973
case GeneratedSourceInfo::ReplacedFunctionBody:
974974
case GeneratedSourceInfo::PrettyPrinted:
975-
case GeneratedSourceInfo::Attribute:
975+
case GeneratedSourceInfo::AttributeFromClang:
976976
break;
977977
}
978978
}

0 commit comments

Comments
 (0)