mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Macros] Remove ModuleDecl::isInGeneratedBuffer.
This method was misleading. The majority of callers (all but one!) don't want to unconditionally treat all locations in any macro expansion buffer the same way, because the code also must handle nested macro expansions. There is one part of SourceKit (and possibly others) that really do want to ignore all macro expansions, but those can be handled within SourceKit / IDE code, because I don't believe this utility is useful in the frontend.
This commit is contained in:
@@ -816,13 +816,6 @@ SourceFile *ModuleDecl::getSourceFileContainingLocation(SourceLoc loc) {
|
||||
return foundSourceFile;
|
||||
}
|
||||
|
||||
bool ModuleDecl::isInGeneratedBuffer(SourceLoc loc) {
|
||||
SourceFile *file = getSourceFileContainingLocation(loc);
|
||||
if (!file)
|
||||
return false;
|
||||
return file->Kind == SourceFileKind::MacroExpansion;
|
||||
}
|
||||
|
||||
std::pair<unsigned, SourceLoc>
|
||||
ModuleDecl::getOriginalLocation(SourceLoc loc) const {
|
||||
assert(loc.isValid());
|
||||
|
||||
Reference in New Issue
Block a user