Lines Matching refs:Loc

111                               SourceLocation Loc) const {  in getBufferOrNone()
138 Diag.Report(Loc, diag::err_cannot_open_file) in getBufferOrNone()
160 Diag.Report(Loc, diag::err_file_too_large) in getBufferOrNone()
175 Diag.Report(Loc, diag::err_file_modified) in getBufferOrNone()
188 Diag.Report(Loc, diag::err_unsupported_bom) in getBufferOrNone()
280 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, in AddLineNote() argument
284 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in AddLineNote()
888 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
896 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
897 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
899 return Loc; in getExpansionLocSlowCase()
902 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
904 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
905 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
906 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
907 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
908 return Loc; in getSpellingLocSlowCase()
911 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
913 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
914 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
916 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
917 } while (!Loc.isFileID()); in getFileLocSlowCase()
918 return Loc; in getFileLocSlowCase()
927 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
930 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
932 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
934 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
935 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
945 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
947 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
948 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
950 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
952 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
953 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
962 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
963 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
964 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
965 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
966 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
979 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
980 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
981 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
985 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const { in getTopMacroCallerLoc()
986 while (isMacroArgExpansion(Loc)) in getTopMacroCallerLoc()
987 Loc = getImmediateSpellingLoc(Loc); in getTopMacroCallerLoc()
988 return Loc; in getTopMacroCallerLoc()
993 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
994 if (Loc.isFileID()) in getExpansionRange()
995 return CharSourceRange(SourceRange(Loc, Loc), true); in getExpansionRange()
997 CharSourceRange Res = getImmediateExpansionRange(Loc); in getExpansionRange()
1011 bool SourceManager::isMacroArgExpansion(SourceLocation Loc, in isMacroArgExpansion() argument
1013 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1015 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1024 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1025 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1027 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1032 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1034 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1036 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1067 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1069 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1071 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1072 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1182 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1183 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1189 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1191 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1192 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1196 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1198 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1199 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1203 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1205 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1397 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1399 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1400 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1403 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1405 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1406 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1409 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1411 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1425 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1426 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1427 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1454 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1456 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1458 auto B = getBufferOrNone(getFileID(Loc)); in getBufferName()
1471 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1473 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1476 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1547 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1548 if (Loc.isInvalid()) return false; in isInMainFile()
1551 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1873 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1874 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1875 return Loc; in getMacroArgExpandedLocation()
1879 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1881 return Loc; in getMacroArgExpandedLocation()
1894 return Loc; in getMacroArgExpandedLocation()
1903 return Loc; in getMacroArgExpandedLocation()
1935 FileID SourceManager::getUniqueLoadedASTFileID(SourceLocation Loc) const { in getUniqueLoadedASTFileID()
1936 assert(isLoadedSourceLocation(Loc) && in getUniqueLoadedASTFileID()
1939 auto [FID, Ignore] = getDecomposedLoc(Loc); in getUniqueLoadedASTFileID()
1981 MoveUpTranslationUnitIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpTranslationUnitIncludeHierarchy() argument
1983 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpTranslationUnitIncludeHierarchy()
1985 !SM.isInTheSameTranslationUnitImpl(UpperLoc, Loc)) in MoveUpTranslationUnitIncludeHierarchy()
1988 Loc = UpperLoc; in MoveUpTranslationUnitIncludeHierarchy()
2249 SourceLocation Loc; in noteSLocAddressSpaceUsage() member
2274 if (EntryInfo.Loc.isInvalid()) in noteSLocAddressSpaceUsage()
2275 EntryInfo.Loc = FileStart; in noteSLocAddressSpaceUsage()
2299 A.second.Loc < B.second.Loc); in noteSLocAddressSpaceUsage()
2320 Diag.Report(FileInfo.Loc, diag::note_file_sloc_usage) in noteSLocAddressSpaceUsage()