Home | History | Annotate | Download | only in Basic

Lines Matching full:loc

88                                                   SourceLocation Loc,
127 Diag.Report(Loc, diag::err_cannot_open_file)
143 Diag.Report(Loc, diag::err_file_modified)
169 Diag.Report(Loc, diag::err_unsupported_bom)
248 // Get the include loc of the last entries' include loc as our include loc.
296 /// specified by Loc. If FilenameID is -1, it is considered to be
298 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
300 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
318 void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo,
327 return AddLineNote(Loc, LineNo, FilenameID);
330 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
765 // Neither loc prunes our search.
913 getExpansionLocSlowCase(SourceLocation Loc) const {
915 // Note: If Loc indicates an offset into a token that came from a macro
919 // with. This is unlike when we get the spelling loc, because the offset
921 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart();
922 } while (!Loc.isFileID());
924 return Loc;
927 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {
929 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
930 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
931 Loc = Loc.getLocWithOffset(LocInfo.second);
932 } while (!Loc.isFileID());
933 return Loc;
936 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
938 if (isMacroArgExpansion(Loc))
939 Loc = getImmediateSpellingLoc(Loc);
941 Loc = getImmediateExpansionRange(Loc).first;
942 } while (!Loc.isFileID());
943 return Loc;
952 SourceLocation Loc;
955 Loc = E->getExpansion().getExpansionLocStart();
957 FID = getFileID(Loc);
959 Offset = Loc.getOffset()-E->getOffset();
960 } while (!Loc.isFileID());
970 SourceLocation Loc;
972 Loc = E->getExpansion().getSpellingLoc();
973 Loc = Loc.getLocWithOffset(Offset);
975 FID = getFileID(Loc);
977 Offset = Loc.getOffset()-E->getOffset();
978 } while (!Loc.isFileID());
987 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
988 if (Loc.isFileID()) return Loc;
989 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
990 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
991 return Loc.getLocWithOffset(LocInfo.second);
995 /// getImmediateExpansionRange - Loc is required to be an expansion location.
998 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
999 assert(Loc.isMacroID() && "Not a macro expansion loc!");
1000 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion();
1007 SourceManager::getExpansionRange(SourceLocation Loc) const {
1008 if (Loc.isFileID()) return std::make_pair(Loc, Loc);
1011 getImmediateExpansionRange(Loc);
1022 bool SourceManager::isMacroArgExpansion(SourceLocation Loc) const {
1023 if (!Loc.isMacroID()) return false;
1025 FileID FID = getFileID(Loc);
1030 bool SourceManager::isMacroBodyExpansion(SourceLocation Loc) const {
1031 if (!Loc.isMacroID()) return false;
1033 FileID FID = getFileID(Loc);
1038 bool SourceManager::isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
1040 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc");
1042 std::pair<FileID, unsigned> DecompLoc = getDecomposedLoc(Loc);
1055 // the same argument expansion, in which case this Loc is not at the
1073 bool SourceManager::isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
1075 assert(Loc.isValid() && Loc.isMacroID() && "Expected a valid macro loc");
1077 FileID FID = getFileID(Loc);
1078 SourceLocation NextLoc = Loc.getLocWithOffset(1);
1090 // same argument expansion, in which case this Loc is not at the end of the
1178 // isInvalid - Return the result of calling loc.isInvalid(), and
1180 static bool isInvalid(SourceLocation Loc, bool *Invalid) {
1181 bool MyInvalid = Loc.isInvalid();
1187 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc,
1189 if (isInvalid(Loc, Invalid)) return 0;
1190 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1194 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc,
1196 if (isInvalid(Loc, Invalid)) return 0;
1197 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1201 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
1203 if (isInvalid(Loc, Invalid)) return 0;
1204 return getPresumedLoc(Loc).getColumn();
1420 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc,
1422 if (isInvalid(Loc, Invalid)) return 0;
1423 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1426 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
1428 if (isInvalid(Loc, Invalid)) return 0;
1429 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1432 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
1434 if (isInvalid(Loc, Invalid)) return 0;
1435 return getPresumedLoc(Loc).getLine();
1447 SourceManager::getFileCharacteristic(SourceLocation Loc) const {
1448 assert(!Loc.isInvalid() && "Can't get file characteristic of invalid loc!");
1449 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1477 const char *SourceManager::getBufferName(SourceLocation Loc,
1479 if (isInvalid(Loc, Invalid)) return "<invalid loc>";
1481 return getBuffer(getFileID(Loc), Invalid)->getBufferIdentifier();
1492 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc,
1494 if (Loc.isInvalid()) return PresumedLoc();
1497 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1904 // 100 -> Expanded loc #1
1909 // 100 -> Expanded loc #1
1910 // 105 -> Expanded loc #2
1911 // 108 -> Expanded loc #1
1925 /// \brief If \arg Loc points inside a function macro argument, the returned
1935 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
1936 if (Loc.isInvalid() || !Loc.isFileID())
1937 return Loc;
1941 llvm::tie(FID, Offset) = getDecomposedLoc(Loc);
1943 return Loc;
1958 return Loc;
1966 // Uses IncludedLocMap to retrieve/cache the decomposed loc.
1994 /// version of the parent in Loc and return false. If Loc is the top-level
1996 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc,
1998 std::pair<FileID, unsigned> UpperLoc = SM.getDecomposedIncludedLoc(Loc.first);
2002 Loc = UpperLoc;