Lines Matching refs:Loc

103                               SourceLocation Loc) const {  in getBufferOrNone()
130 Diag.Report(Loc, diag::err_cannot_open_file) in getBufferOrNone()
152 Diag.Report(Loc, diag::err_file_too_large) in getBufferOrNone()
167 Diag.Report(Loc, diag::err_file_modified) in getBufferOrNone()
180 Diag.Report(Loc, diag::err_unsupported_bom) in getBufferOrNone()
272 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, in AddLineNote() argument
276 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in AddLineNote()
873 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
881 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
882 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
884 return Loc; in getExpansionLocSlowCase()
887 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
889 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
890 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
891 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
892 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
893 return Loc; in getSpellingLocSlowCase()
896 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
898 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
899 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
901 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
902 } while (!Loc.isFileID()); in getFileLocSlowCase()
903 return Loc; in getFileLocSlowCase()
912 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
915 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
917 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
919 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
920 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
930 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
932 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
933 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
935 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
937 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
938 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
947 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
948 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
949 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
950 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
951 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
964 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
965 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
966 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
970 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const { in getTopMacroCallerLoc()
971 while (isMacroArgExpansion(Loc)) in getTopMacroCallerLoc()
972 Loc = getImmediateSpellingLoc(Loc); in getTopMacroCallerLoc()
973 return Loc; in getTopMacroCallerLoc()
978 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
979 if (Loc.isFileID()) in getExpansionRange()
980 return CharSourceRange(SourceRange(Loc, Loc), true); in getExpansionRange()
982 CharSourceRange Res = getImmediateExpansionRange(Loc); in getExpansionRange()
996 bool SourceManager::isMacroArgExpansion(SourceLocation Loc, in isMacroArgExpansion() argument
998 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1000 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1009 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1010 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1012 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1017 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1019 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1021 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1052 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1054 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1056 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1057 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1167 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1168 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1174 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1176 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1177 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1181 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1183 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1184 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1188 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1190 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1382 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1384 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1385 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1388 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1390 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1391 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1394 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1396 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1410 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1411 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1412 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1439 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1441 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1443 auto B = getBufferOrNone(getFileID(Loc)); in getBufferName()
1456 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1458 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1461 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1532 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1533 if (Loc.isInvalid()) return false; in isInMainFile()
1536 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1852 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1853 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1854 return Loc; in getMacroArgExpandedLocation()
1858 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1860 return Loc; in getMacroArgExpandedLocation()
1873 return Loc; in getMacroArgExpandedLocation()
1882 return Loc; in getMacroArgExpandedLocation()
1942 MoveUpTranslationUnitIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpTranslationUnitIncludeHierarchy() argument
1944 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpTranslationUnitIncludeHierarchy()
1946 !SM.isInTheSameTranslationUnitImpl(UpperLoc, Loc)) in MoveUpTranslationUnitIncludeHierarchy()
1949 Loc = UpperLoc; in MoveUpTranslationUnitIncludeHierarchy()
2210 SourceLocation Loc; in noteSLocAddressSpaceUsage() member
2235 if (EntryInfo.Loc.isInvalid()) in noteSLocAddressSpaceUsage()
2236 EntryInfo.Loc = FileStart; in noteSLocAddressSpaceUsage()
2260 A.second.Loc < B.second.Loc); in noteSLocAddressSpaceUsage()
2281 Diag.Report(FileInfo.Loc, diag::note_file_sloc_usage) in noteSLocAddressSpaceUsage()