Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions clang/lib/Basic/SourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,14 @@ SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {

SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
do {
if (isMacroArgExpansion(Loc))
Loc = getImmediateSpellingLoc(Loc);
else
Loc = getImmediateExpansionRange(Loc).getBegin();
const SLocEntry &Entry = getSLocEntry(getFileID(Loc));
const ExpansionInfo &ExpInfo = Entry.getExpansion();
if (ExpInfo.isMacroArgExpansion()) {
Loc = ExpInfo.getSpellingLoc().getLocWithOffset(Loc.getOffset() -
Entry.getOffset());
} else {
Loc = ExpInfo.getExpansionLocStart();
}
} while (!Loc.isFileID());
return Loc;
}
Expand Down
Loading