Lines Matching refs:Loc
58 void setStartLoc(SourceLocation Loc) { LocStart = Loc; } in setStartLoc() argument
67 void setEndLoc(SourceLocation Loc) { LocEnd = Loc; } in setEndLoc() argument
99 SourceLocation getPreciseTokenLocEnd(SourceLocation Loc) { in getPreciseTokenLocEnd() argument
103 Lexer::MeasureTokenLength(SM.getSpellingLoc(Loc), SM, LangOpts); in getPreciseTokenLocEnd()
104 return Loc.getLocWithOffset(TokLen); in getPreciseTokenLocEnd()
108 SourceLocation getStartOfFileOrMacro(SourceLocation Loc) { in getStartOfFileOrMacro() argument
109 if (Loc.isMacroID()) in getStartOfFileOrMacro()
110 return Loc.getLocWithOffset(-SM.getFileOffset(Loc)); in getStartOfFileOrMacro()
111 return SM.getLocForStartOfFile(SM.getFileID(Loc)); in getStartOfFileOrMacro()
115 SourceLocation getEndOfFileOrMacro(SourceLocation Loc) { in getEndOfFileOrMacro() argument
116 if (Loc.isMacroID()) in getEndOfFileOrMacro()
117 return Loc.getLocWithOffset(SM.getFileIDSize(SM.getFileID(Loc)) - in getEndOfFileOrMacro()
118 SM.getFileOffset(Loc)); in getEndOfFileOrMacro()
119 return SM.getLocForEndOfFile(SM.getFileID(Loc)); in getEndOfFileOrMacro()
123 SourceLocation getIncludeOrExpansionLoc(SourceLocation Loc) { in getIncludeOrExpansionLoc() argument
124 return Loc.isMacroID() ? SM.getImmediateExpansionRange(Loc).first in getIncludeOrExpansionLoc()
125 : SM.getIncludeLoc(SM.getFileID(Loc)); in getIncludeOrExpansionLoc()
129 bool isInBuiltin(SourceLocation Loc) { in isInBuiltin() argument
130 return strcmp(SM.getBufferName(SM.getSpellingLoc(Loc)), "<built-in>") == 0; in isInBuiltin()
134 bool isNestedIn(SourceLocation Loc, FileID Parent) { in isNestedIn() argument
136 Loc = getIncludeOrExpansionLoc(Loc); in isNestedIn()
137 if (Loc.isInvalid()) in isNestedIn()
139 } while (!SM.isInFileID(Loc, Parent)); in isNestedIn()
145 SourceLocation Loc = S->getLocStart(); in getStart() local
146 while (SM.isMacroArgExpansion(Loc) || isInBuiltin(Loc)) in getStart()
147 Loc = SM.getImmediateExpansionRange(Loc).first; in getStart()
148 return Loc; in getStart()
153 SourceLocation Loc = S->getLocEnd(); in getEnd() local
154 while (SM.isMacroArgExpansion(Loc) || isInBuiltin(Loc)) in getEnd()
155 Loc = SM.getImmediateExpansionRange(Loc).first; in getEnd()
156 return getPreciseTokenLocEnd(Loc); in getEnd()
170 SourceLocation Loc = Region.getStartLoc(); in gatherFileIDs() local
171 FileID File = SM.getFileID(Loc); in gatherFileIDs()
176 if (SM.isInSystemHeader(SM.getSpellingLoc(Loc))) in gatherFileIDs()
180 for (SourceLocation Parent = getIncludeOrExpansionLoc(Loc); in gatherFileIDs()
183 FileLocs.push_back(std::make_pair(Loc, Depth)); in gatherFileIDs()
188 SourceLocation Loc = FL.first; in gatherFileIDs() local
189 FileID SpellingFile = SM.getDecomposedSpellingLoc(Loc).first; in gatherFileIDs()
194 FileIDMapping[SM.getFileID(Loc)] = std::make_pair(Mapping.size(), Loc); in gatherFileIDs()
202 Optional<unsigned> getCoverageFileID(SourceLocation Loc) { in getCoverageFileID() argument
203 auto Mapping = FileIDMapping.find(SM.getFileID(Loc)); in getCoverageFileID()
532 SourceLocation Loc = I.getStartLoc(); in handleFileExit() local
533 if (!isNestedIn(Loc, ParentFile)) { in handleFileExit()
538 while (!SM.isInFileID(Loc, ParentFile)) { in handleFileExit()
542 if (StartLocs.insert(Loc).second) in handleFileExit()
543 SourceRegions.emplace_back(I.getCounter(), Loc, in handleFileExit()
544 getEndOfFileOrMacro(Loc)); in handleFileExit()
545 Loc = getIncludeOrExpansionLoc(Loc); in handleFileExit()
547 I.setStartLoc(getPreciseTokenLocEnd(Loc)); in handleFileExit()
554 SourceLocation Loc = MostRecentLocation; in handleFileExit() local
555 while (isNestedIn(Loc, ParentFile)) { in handleFileExit()
556 SourceLocation FileStart = getStartOfFileOrMacro(Loc); in handleFileExit()
559 getEndOfFileOrMacro(Loc)); in handleFileExit()
560 Loc = getIncludeOrExpansionLoc(Loc); in handleFileExit()