Lines Matching refs: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)
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);
864 getExpansionLocSlowCase(SourceLocation Loc) const {
866 // Note: If Loc indicates an offset into a token that came from a macro
872 Loc = getSLocEntry(getFileID(Loc)).getExpansion().getExpansionLocStart();
873 } while (!Loc.isFileID());
875 return Loc;
878 SourceLocation SourceManager::getSpellingLocSlowCase(SourceLocation Loc) const {
880 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
881 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
882 Loc = Loc.getLocWithOffset(LocInfo.second);
883 } while (!Loc.isFileID());
884 return Loc;
887 SourceLocation SourceManager::getFileLocSlowCase(SourceLocation Loc) const {
889 if (isMacroArgExpansion(Loc))
890 Loc = getImmediateSpellingLoc(Loc);
892 Loc = getImmediateExpansionRange(Loc).first;
893 } while (!Loc.isFileID());
894 return Loc;
903 SourceLocation Loc;
906 Loc = E->getExpansion().getExpansionLocStart();
908 FID = getFileID(Loc);
910 Offset = Loc.getOffset()-E->getOffset();
911 } while (!Loc.isFileID());
921 SourceLocation Loc;
923 Loc = E->getExpansion().getSpellingLoc();
924 Loc = Loc.getLocWithOffset(Offset);
926 FID = getFileID(Loc);
928 Offset = Loc.getOffset()-E->getOffset();
929 } while (!Loc.isFileID());
938 SourceLocation SourceManager::getImmediateSpellingLoc(SourceLocation Loc) const{
939 if (Loc.isFileID()) return Loc;
940 std::pair<FileID, unsigned> LocInfo = getDecomposedLoc(Loc);
941 Loc = getSLocEntry(LocInfo.first).getExpansion().getSpellingLoc();
942 return Loc.getLocWithOffset(LocInfo.second);
946 /// getImmediateExpansionRange - Loc is required to be an expansion location.
949 SourceManager::getImmediateExpansionRange(SourceLocation Loc) const {
950 assert(Loc.isMacroID() && "Not a macro expansion loc!");
951 const ExpansionInfo &Expansion = getSLocEntry(getFileID(Loc)).getExpansion();
958 SourceManager::getExpansionRange(SourceLocation Loc) const {
959 if (Loc.isFileID()) return std::make_pair(Loc, Loc);
962 getImmediateExpansionRange(Loc);
973 bool SourceManager::isMacroArgExpansion(SourceLocation Loc) const {
974 if (!Loc.isMacroID()) return false;
976 FileID FID = getFileID(Loc);
1041 static bool isInvalid(SourceLocation Loc, bool *Invalid) {
1042 bool MyInvalid = Loc.isInvalid();
1048 unsigned SourceManager::getSpellingColumnNumber(SourceLocation Loc,
1050 if (isInvalid(Loc, Invalid)) return 0;
1051 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1055 unsigned SourceManager::getExpansionColumnNumber(SourceLocation Loc,
1057 if (isInvalid(Loc, Invalid)) return 0;
1058 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1062 unsigned SourceManager::getPresumedColumnNumber(SourceLocation Loc,
1064 if (isInvalid(Loc, Invalid)) return 0;
1065 return getPresumedLoc(Loc).getColumn();
1281 unsigned SourceManager::getSpellingLineNumber(SourceLocation Loc,
1283 if (isInvalid(Loc, Invalid)) return 0;
1284 std::pair<FileID, unsigned> LocInfo = getDecomposedSpellingLoc(Loc);
1287 unsigned SourceManager::getExpansionLineNumber(SourceLocation Loc,
1289 if (isInvalid(Loc, Invalid)) return 0;
1290 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1293 unsigned SourceManager::getPresumedLineNumber(SourceLocation Loc,
1295 if (isInvalid(Loc, Invalid)) return 0;
1296 return getPresumedLoc(Loc).getLine();
1308 SourceManager::getFileCharacteristic(SourceLocation Loc) const {
1309 assert(!Loc.isInvalid() && "Can't get file characteristic of invalid loc!");
1310 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1338 const char *SourceManager::getBufferName(SourceLocation Loc,
1340 if (isInvalid(Loc, Invalid)) return "<invalid loc>";
1342 return getBuffer(getFileID(Loc), Invalid)->getBufferIdentifier();
1353 PresumedLoc SourceManager::getPresumedLoc(SourceLocation Loc) const {
1354 if (Loc.isInvalid()) return PresumedLoc();
1357 std::pair<FileID, unsigned> LocInfo = getDecomposedExpansionLoc(Loc);
1738 /// \brief If \arg Loc points inside a function macro argument, the returned
1748 SourceManager::getMacroArgExpandedLocation(SourceLocation Loc) const {
1749 if (Loc.isInvalid() || !Loc.isFileID())
1750 return Loc;
1754 llvm::tie(FID, Offset) = getDecomposedLoc(Loc);
1756 return Loc;
1771 return Loc;
1776 /// version of the parent in Loc and return false. If Loc is the top-level
1778 static bool MoveUpIncludeHierarchy(std::pair<FileID, unsigned> &Loc,
1781 const SrcMgr::SLocEntry &Entry = SM.getSLocEntry(Loc.first);
1790 Loc = SM.getDecomposedLoc(UpperLoc);