Home | History | Annotate | Download | only in Basic

Lines Matching refs:Loc

86                                             SourceLocation Loc,
125 Diag.Report(Loc, diag::err_cannot_open_file)
141 Diag.Report(Loc, diag::err_file_modified)
167 Diag.Report(Loc, diag::err_unsupported_bom)
246 // Get the include loc of the last entries' include loc as our include loc.
294 /// specified by Loc. If FilenameID is -1, it is considered to be
296 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
298 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
316 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
325 return AddLineNote(Loc, LineNo, FilenameID);
328 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
750 // Neither loc prunes our search.
898 getExpansionLocSlowCase(SourceLocation Loc) const {
900 // Note: If Loc indicates an offset into a token that came from a macro
904 // with. This is unlike when we get the spelling loc, because the offset
906 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart();
907 } while (!Loc.isFileID());
909 return Loc;
912 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {
914 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
915 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
916 Loc = Loc.getLocWithOffset(LocInfo.second);
917 } while (!Loc.isFileID());
918 return Loc;
921 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
923 if (isMacroArgExpansion(Loc))
924 Loc = getImmediateSpellingLoc(Loc);
926 Loc = getImmediateExpansionRange(Loc).first;
927 } while (!Loc.isFileID());
928 return Loc;
937 SourceLocation Loc;
940 Loc = E->getExpansion().getExpansionLocStart();
942 FID = getFileID(Loc);
944 Offset = Loc.getOffset()-E->getOffset();
945 } while (!Loc.isFileID());
955 SourceLocation Loc;
957 Loc = E->getExpansion().getSpellingLoc();
958 Loc = Loc.getLocWithOffset(Offset);
960 FID = getFileID(Loc);
962 Offset = Loc.getOffset()-E->getOffset();
963 } while (!Loc.isFileID());
972 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
973 if (Loc.isFileID()) return Loc;
974 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
975 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
976 return Loc.getLocWithOffset(LocInfo.second);
980 /// getImmediateExpansionRange - Loc is required to be an expansion location.
983 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
984 assert(Loc.isMacroID() && "Not a macro expansion loc!");
985 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion();
992 SourceManager::getExpansionRange(SourceLocation Loc) const {
993 if (Loc.isFileID()) return std::make_pair(Loc, Loc);
996 getImmediateExpansionRange(Loc);
1007 bool SourceManager::isMacroArgExpansion(SourceLocation Loc) const {
1008 if (!Loc.isMacroID()) return false;
1010 FileID FID = getFileID(Loc);
1015 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const {
1016 if (!Loc.isMacroID()) return false;
1018 FileID FID = getFileID(Loc);
1023 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
1025 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc");
1027 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc);
1040 // the same argument expansion, in which case this Loc is not at the
1058 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
1060 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc");
1062 FileID FID = getFileID(Loc);
1063 SourceLocation NextLoc = Loc.getLocWithOffset(1);
1075 // same argument expansion, in which case this Loc is not at the end of the
1162 // isInvalid - Return the result of calling loc.isInvalid(), and
1164 static bool isInvalid(SourceLocation Loc, bool *Invalid) {
1165 bool MyInvalid = Loc.isInvalid();
1171 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc,
1173 if (isInvalid(Loc, Invalid)) return 0;
1174 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1178 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc,
1180 if (isInvalid(Loc, Invalid)) return 0;
1181 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1185 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
1187 if (isInvalid(Loc, Invalid)) return 0;
1188 return getPresumedLoc(Loc).getColumn();
1378 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc,
1380 if (isInvalid(Loc, Invalid)) return 0;
1381 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1384 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
1386 if (isInvalid(Loc, Invalid)) return 0;
1387 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1390 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
1392 if (isInvalid(Loc, Invalid)) return 0;
1393 return getPresumedLoc(Loc).getLine();
1405 SourceManager::getFileCharacteristic(SourceLocation Loc) const {
1406 assert(!Loc.isInvalid() && "Can't get file characteristic of invalid loc!");
1407 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1435 const char *SourceManager::getBufferName(SourceLocation Loc,
1437 if (isInvalid(Loc, Invalid)) return "<invalid loc>";
1439 return getBuffer(getFileID(Loc), Invalid)->getBufferIdentifier();
1450 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc,
1452 if (Loc.isInvalid()) return PresumedLoc();
1455 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1521 bool SourceManager::isInMainFile(SourceLocation Loc) const {
1522 if (Loc.isInvalid()) return false;
1525 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1897 // 100 -> Expanded loc #1
1902 // 100 -> Expanded loc #1
1903 // 105 -> Expanded loc #2
1904 // 108 -> Expanded loc #1
1918 /// \brief If \arg Loc points inside a function macro argument, the returned
1928 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
1929 if (Loc.isInvalid() || !Loc.isFileID())
1930 return Loc;
1934 std::tie(FID, Offset) = getDecomposedLoc(Loc);
1936 return Loc;
1951 return Loc;
1959 // Uses IncludedLocMap to retrieve/cache the decomposed loc.
1987 /// version of the parent in Loc and return false. If Loc is the top-level
1989 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc,
1991 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first);
1995 Loc = UpperLoc;