Lines Matching refs:Loc
86 SourceLocation Loc, in getBuffer() argument
124 Diag.Report(Loc, diag::err_cannot_open_file) in getBuffer()
142 Diag.Report(Loc, diag::err_file_modified) in getBuffer()
168 Diag.Report(Loc, diag::err_unsupported_bom) in getBuffer()
291 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, in AddLineNote() argument
293 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in AddLineNote()
311 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, in AddLineNote() argument
320 return AddLineNote(Loc, LineNo, FilenameID); in AddLineNote()
323 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in AddLineNote()
889 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
897 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
898 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
900 return Loc; in getExpansionLocSlowCase()
903 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
905 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
906 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
907 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
908 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
909 return Loc; in getSpellingLocSlowCase()
912 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
914 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
915 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
917 Loc = getImmediateExpansionRange(Loc).first; in getFileLocSlowCase()
918 } while (!Loc.isFileID()); in getFileLocSlowCase()
919 return Loc; in getFileLocSlowCase()
928 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
931 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
933 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
935 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
936 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
946 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
948 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
949 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
951 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
953 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
954 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
963 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
964 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
965 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
966 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
967 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
974 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
975 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
976 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
983 SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
984 if (Loc.isFileID()) return std::make_pair(Loc, Loc); in getExpansionRange()
987 getImmediateExpansionRange(Loc); in getExpansionRange()
998 bool SourceManager::isMacroArgExpansion(SourceLocation Loc) const { in isMacroArgExpansion()
999 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1001 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1006 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1007 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1009 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1014 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1016 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1018 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1049 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1051 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1053 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1054 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1155 static bool isInvalid(SourceLocation Loc, bool *Invalid) { in isInvalid() argument
1156 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1162 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1164 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1165 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1169 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1171 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1172 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1176 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1178 if (isInvalid(Loc, Invalid)) return 0; in getPresumedColumnNumber()
1179 return getPresumedLoc(Loc).getColumn(); in getPresumedColumnNumber()
1369 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1371 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1372 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1375 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1377 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1378 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1381 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1383 if (isInvalid(Loc, Invalid)) return 0; in getPresumedLineNumber()
1384 return getPresumedLoc(Loc).getLine(); in getPresumedLineNumber()
1396 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1397 assert(!Loc.isInvalid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1398 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1426 const char *SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1428 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1430 return getBuffer(getFileID(Loc), Invalid)->getBufferIdentifier(); in getBufferName()
1441 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1443 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1446 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1512 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1513 if (Loc.isInvalid()) return false; in isInMainFile()
1516 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1919 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1920 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1921 return Loc; in getMacroArgExpandedLocation()
1925 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1927 return Loc; in getMacroArgExpandedLocation()
1942 return Loc; in getMacroArgExpandedLocation()
1980 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpIncludeHierarchy() argument
1982 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpIncludeHierarchy()
1986 Loc = UpperLoc; in MoveUpIncludeHierarchy()