Lines Matching refs:Loc
105 SourceLocation Loc) const { in getBufferOrNone()
132 Diag.Report(Loc, diag::err_cannot_open_file) in getBufferOrNone()
154 Diag.Report(Loc, diag::err_file_too_large) in getBufferOrNone()
169 Diag.Report(Loc, diag::err_file_modified) in getBufferOrNone()
182 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()
934 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
942 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
943 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
945 return Loc; in getExpansionLocSlowCase()
948 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
950 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
951 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
952 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
953 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
954 return Loc; in getSpellingLocSlowCase()
957 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
959 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
960 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
962 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
963 } while (!Loc.isFileID()); in getFileLocSlowCase()
964 return Loc; in getFileLocSlowCase()
973 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
976 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
978 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
980 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
981 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
991 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
993 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
994 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
996 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
998 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
999 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
1008 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
1009 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
1010 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
1011 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
1012 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
1025 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
1026 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
1027 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
1031 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const { in getTopMacroCallerLoc()
1032 while (isMacroArgExpansion(Loc)) in getTopMacroCallerLoc()
1033 Loc = getImmediateSpellingLoc(Loc); in getTopMacroCallerLoc()
1034 return Loc; in getTopMacroCallerLoc()
1039 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
1040 if (Loc.isFileID()) in getExpansionRange()
1041 return CharSourceRange(SourceRange(Loc, Loc), true); in getExpansionRange()
1043 CharSourceRange Res = getImmediateExpansionRange(Loc); in getExpansionRange()
1057 bool SourceManager::isMacroArgExpansion(SourceLocation Loc, in isMacroArgExpansion() argument
1059 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1061 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1070 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1071 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1073 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1078 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1080 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1082 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1113 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1115 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1117 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1118 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1228 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1229 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1235 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1237 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1238 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1242 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1244 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1245 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1249 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1251 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1442 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1444 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1445 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1448 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1450 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1451 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1454 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1456 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1470 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1471 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1472 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1499 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1501 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1503 auto B = getBufferOrNone(getFileID(Loc)); in getBufferName()
1516 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1518 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1521 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1592 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1593 if (Loc.isInvalid()) return false; in isInMainFile()
1596 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1912 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1913 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1914 return Loc; in getMacroArgExpandedLocation()
1918 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1920 return Loc; in getMacroArgExpandedLocation()
1933 return Loc; in getMacroArgExpandedLocation()
1942 return Loc; in getMacroArgExpandedLocation()
1978 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpIncludeHierarchy() argument
1980 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpIncludeHierarchy()
1984 Loc = UpperLoc; in MoveUpIncludeHierarchy()