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()
938 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
946 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
947 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
949 return Loc; in getExpansionLocSlowCase()
952 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
954 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
955 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
956 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
957 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
958 return Loc; in getSpellingLocSlowCase()
961 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
963 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
964 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
966 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
967 } while (!Loc.isFileID()); in getFileLocSlowCase()
968 return Loc; in getFileLocSlowCase()
977 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
980 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
982 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
984 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
985 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
995 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
997 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
998 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
1000 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
1002 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
1003 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
1012 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
1013 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
1014 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
1015 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
1016 return Loc.getLocWithOffset(LocInfo.second); in getImmediateSpellingLoc()
1029 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const { in getImmediateExpansionRange()
1030 assert(Loc.isMacroID() && "Not a macro expansion loc!"); in getImmediateExpansionRange()
1031 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion(); in getImmediateExpansionRange()
1035 SourceLocation SourceManager::getTopMacroCallerLoc(SourceLocation Loc) const { in getTopMacroCallerLoc()
1036 while (isMacroArgExpansion(Loc)) in getTopMacroCallerLoc()
1037 Loc = getImmediateSpellingLoc(Loc); in getTopMacroCallerLoc()
1038 return Loc; in getTopMacroCallerLoc()
1043 CharSourceRange SourceManager::getExpansionRange(SourceLocation Loc) const { in getExpansionRange()
1044 if (Loc.isFileID()) in getExpansionRange()
1045 return CharSourceRange(SourceRange(Loc, Loc), true); in getExpansionRange()
1047 CharSourceRange Res = getImmediateExpansionRange(Loc); in getExpansionRange()
1061 bool SourceManager::isMacroArgExpansion(SourceLocation Loc, in isMacroArgExpansion() argument
1063 if (!Loc.isMacroID()) return false; in isMacroArgExpansion()
1065 FileID FID = getFileID(Loc); in isMacroArgExpansion()
1074 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const { in isMacroBodyExpansion()
1075 if (!Loc.isMacroID()) return false; in isMacroBodyExpansion()
1077 FileID FID = getFileID(Loc); in isMacroBodyExpansion()
1082 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc, in isAtStartOfImmediateMacroExpansion() argument
1084 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtStartOfImmediateMacroExpansion()
1086 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc); in isAtStartOfImmediateMacroExpansion()
1117 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc, in isAtEndOfImmediateMacroExpansion() argument
1119 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc"); in isAtEndOfImmediateMacroExpansion()
1121 FileID FID = getFileID(Loc); in isAtEndOfImmediateMacroExpansion()
1122 SourceLocation NextLoc = Loc.getLocWithOffset(1); in isAtEndOfImmediateMacroExpansion()
1232 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1233 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1239 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1241 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1242 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1246 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1248 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1249 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1253 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1255 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1448 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1450 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1451 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1454 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1456 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1457 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1460 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1462 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1476 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1477 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1478 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1505 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1507 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1509 auto B = getBufferOrNone(getFileID(Loc)); in getBufferName()
1522 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1524 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1527 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1598 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1599 if (Loc.isInvalid()) return false; in isInMainFile()
1602 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1918 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1919 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1920 return Loc; in getMacroArgExpandedLocation()
1924 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1926 return Loc; in getMacroArgExpandedLocation()
1939 return Loc; in getMacroArgExpandedLocation()
1948 return Loc; in getMacroArgExpandedLocation()
1984 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpIncludeHierarchy() argument
1986 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpIncludeHierarchy()
1990 Loc = UpperLoc; in MoveUpIncludeHierarchy()
2241 SourceLocation Loc; in noteSLocAddressSpaceUsage() member
2266 if (EntryInfo.Loc.isInvalid()) in noteSLocAddressSpaceUsage()
2267 EntryInfo.Loc = FileStart; in noteSLocAddressSpaceUsage()
2291 A.second.Loc < B.second.Loc); in noteSLocAddressSpaceUsage()
2312 Diag.Report(FileInfo.Loc, diag::note_file_sloc_usage) in noteSLocAddressSpaceUsage()