Lines Matching refs:Loc
101 SourceLocation Loc, in getBuffer() argument
140 Diag.Report(Loc, diag::err_cannot_open_file) in getBuffer()
158 Diag.Report(Loc, diag::err_file_modified) in getBuffer()
186 Diag.Report(Loc, diag::err_unsupported_bom) in getBuffer()
277 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, in AddLineNote() argument
281 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in AddLineNote()
880 getExpansionLocSlowCase(SourceLocation Loc) const { in getExpansionLocSlowCase()
888 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart(); in getExpansionLocSlowCase()
889 } while (!Loc.isFileID()); in getExpansionLocSlowCase()
891 return Loc; in getExpansionLocSlowCase()
894 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const { in getSpellingLocSlowCase()
896 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getSpellingLocSlowCase()
897 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getSpellingLocSlowCase()
898 Loc = Loc.getLocWithOffset(LocInfo.second); in getSpellingLocSlowCase()
899 } while (!Loc.isFileID()); in getSpellingLocSlowCase()
900 return Loc; in getSpellingLocSlowCase()
903 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const { in getFileLocSlowCase()
905 if (isMacroArgExpansion(Loc)) in getFileLocSlowCase()
906 Loc = getImmediateSpellingLoc(Loc); in getFileLocSlowCase()
908 Loc = getImmediateExpansionRange(Loc).getBegin(); in getFileLocSlowCase()
909 } while (!Loc.isFileID()); in getFileLocSlowCase()
910 return Loc; in getFileLocSlowCase()
919 SourceLocation Loc; in getDecomposedExpansionLocSlowCase() local
922 Loc = E->getExpansion().getExpansionLocStart(); in getDecomposedExpansionLocSlowCase()
924 FID = getFileID(Loc); in getDecomposedExpansionLocSlowCase()
926 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedExpansionLocSlowCase()
927 } while (!Loc.isFileID()); in getDecomposedExpansionLocSlowCase()
937 SourceLocation Loc; in getDecomposedSpellingLocSlowCase() local
939 Loc = E->getExpansion().getSpellingLoc(); in getDecomposedSpellingLocSlowCase()
940 Loc = Loc.getLocWithOffset(Offset); in getDecomposedSpellingLocSlowCase()
942 FID = getFileID(Loc); in getDecomposedSpellingLocSlowCase()
944 Offset = Loc.getOffset()-E->getOffset(); in getDecomposedSpellingLocSlowCase()
945 } while (!Loc.isFileID()); in getDecomposedSpellingLocSlowCase()
954 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{ in getImmediateSpellingLoc()
955 if (Loc.isFileID()) return Loc; in getImmediateSpellingLoc()
956 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc); in getImmediateSpellingLoc()
957 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc(); in getImmediateSpellingLoc()
958 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()
1166 static bool isInvalid(LocType Loc, bool *Invalid) { in isInvalid() argument
1167 bool MyInvalid = Loc.isInvalid(); in isInvalid()
1173 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc, in getSpellingColumnNumber() argument
1175 if (isInvalid(Loc, Invalid)) return 0; in getSpellingColumnNumber()
1176 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingColumnNumber()
1180 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc, in getExpansionColumnNumber() argument
1182 if (isInvalid(Loc, Invalid)) return 0; in getExpansionColumnNumber()
1183 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionColumnNumber()
1187 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc, in getPresumedColumnNumber() argument
1189 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedColumnNumber()
1342 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc, in getSpellingLineNumber() argument
1344 if (isInvalid(Loc, Invalid)) return 0; in getSpellingLineNumber()
1345 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc); in getSpellingLineNumber()
1348 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc, in getExpansionLineNumber() argument
1350 if (isInvalid(Loc, Invalid)) return 0; in getExpansionLineNumber()
1351 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getExpansionLineNumber()
1354 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc, in getPresumedLineNumber() argument
1356 PresumedLoc PLoc = getPresumedLoc(Loc); in getPresumedLineNumber()
1370 SourceManager::getFileCharacteristic(SourceLocation Loc) const { in getFileCharacteristic()
1371 assert(Loc.isValid() && "Can't get file characteristic of invalid loc!"); in getFileCharacteristic()
1372 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getFileCharacteristic()
1400 StringRef SourceManager::getBufferName(SourceLocation Loc, in getBufferName() argument
1402 if (isInvalid(Loc, Invalid)) return "<invalid loc>"; in getBufferName()
1404 return getBuffer(getFileID(Loc), Invalid)->getBufferIdentifier(); in getBufferName()
1414 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc, in getPresumedLoc() argument
1416 if (Loc.isInvalid()) return PresumedLoc(); in getPresumedLoc()
1419 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in getPresumedLoc()
1485 bool SourceManager::isInMainFile(SourceLocation Loc) const { in isInMainFile()
1486 if (Loc.isInvalid()) return false; in isInMainFile()
1489 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc); in isInMainFile()
1888 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const { in getMacroArgExpandedLocation()
1889 if (Loc.isInvalid() || !Loc.isFileID()) in getMacroArgExpandedLocation()
1890 return Loc; in getMacroArgExpandedLocation()
1894 std::tie(FID, Offset) = getDecomposedLoc(Loc); in getMacroArgExpandedLocation()
1896 return Loc; in getMacroArgExpandedLocation()
1913 return Loc; in getMacroArgExpandedLocation()
1949 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc, in MoveUpIncludeHierarchy() argument
1951 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first); in MoveUpIncludeHierarchy()
1955 Loc = UpperLoc; in MoveUpIncludeHierarchy()