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()
936 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
944 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
945 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
947 return Loc; in getExpansionLocSlowCase()
950 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
952 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
953 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
954 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
955 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
956 return Loc; in getSpellingLocSlowCase()
959 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
961 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
962 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
964 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
965 } while (!Loc.isFileID()); in getFileLocSlowCase()
966 return Loc; in getFileLocSlowCase()
975 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
978 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
980 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
982 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
983 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
993 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
995 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
996 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
998 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
1000 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
1001 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
1010 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
1011 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
1012 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
1013 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
1014 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
1027 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
1028 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
1029 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
1033 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const { in getTopMacroCallerLoc()
1034 while (isMacroArgExpansion(Loc)) in getTopMacroCallerLoc()
1035 Loc = getImmediateSpellingLoc(Loc); in getTopMacroCallerLoc()
1036 return Loc; in getTopMacroCallerLoc()
1041 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
1042 if (Loc.isFileID()) in getExpansionRange()
1043 return CharSourceRange(SourceRange(Loc, Loc), true); in getExpansionRange()
1045 CharSourceRange Res = getImmediateExpansionRange(Loc); in getExpansionRange()
1059 bool SourceManager::isMacroArgExpansion(SourceLocation Loc, in isMacroArgExpansion() argument
1061 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1063 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1072 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1073 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1075 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1080 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1082 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1084 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1115 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1117 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1119 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1120 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1230 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1231 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1237 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1239 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1240 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1244 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1246 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1247 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1251 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1253 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1444 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1446 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1447 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1450 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1452 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1453 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1456 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1458 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1472 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1473 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1474 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1501 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1503 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1505 auto B = getBufferOrNone(getFileID(Loc)); in getBufferName()
1518 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1520 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1523 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1594 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1595 if (Loc.isInvalid()) return false; in isInMainFile()
1598 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1914 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1915 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1916 return Loc; in getMacroArgExpandedLocation()
1920 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1922 return Loc; in getMacroArgExpandedLocation()
1935 return Loc; in getMacroArgExpandedLocation()
1944 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()