Lines Matching refs:Loc

169     /// \param Loc If specified, is the location that invalid file diagnostics
175 SourceLocation Loc = SourceLocation(),
747 SourceLocation createMacroArgExpansionLoc(SourceLocation Loc,
754 SourceLocation createExpansionLoc(SourceLocation Loc,
817 const llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc,
828 return Entry.getFile().getContentCache()->getBuffer(Diag, *this, Loc,
961 /// \brief Given a SourceLocation object \p Loc, return the expansion
963 SourceLocation getExpansionLoc(SourceLocation Loc) const {
966 if (Loc.isFileID()) return Loc;
967 return getExpansionLocSlowCase(Loc);
970 /// \brief Given \p Loc, if it is a macro location return the expansion
973 SourceLocation getFileLoc(SourceLocation Loc) const {
974 if (Loc.isFileID()) return Loc;
975 return getFileLocSlowCase(Loc);
981 /// \pre \p Loc is required to be an expansion location.
983 getImmediateExpansionRange(SourceLocation Loc) const;
988 getExpansionRange(SourceLocation Loc) const;
996 SourceLocation getSpellingLoc(SourceLocation Loc) const {
999 if (Loc.isFileID()) return Loc;
1000 return getSpellingLocSlowCase(Loc);
1009 SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const;
1015 std::pair<FileID, unsigned> getDecomposedLoc(SourceLocation Loc) const {
1016 FileID FID = getFileID(Loc);
1021 return std::make_pair(FID, Loc.getOffset()-E.getOffset());
1029 getDecomposedExpansionLoc(SourceLocation Loc) const {
1030 FileID FID = getFileID(Loc);
1036 unsigned Offset = Loc.getOffset()-E->getOffset();
1037 if (Loc.isFileID())
1048 getDecomposedSpellingLoc(SourceLocation Loc) const {
1049 FileID FID = getFileID(Loc);
1055 unsigned Offset = Loc.getOffset()-E->getOffset();
1056 if (Loc.isFileID())
1075 bool isMacroArgExpansion(SourceLocation Loc) const;
1077 /// \brief Returns true if \p Loc is inside the [\p Start, +\p Length)
1081 /// relative offset of \p Loc inside the chunk.
1082 bool isInSLocAddrSpace(SourceLocation Loc,
1090 unsigned LocOffs = Loc.getOffset();
1140 unsigned getSpellingColumnNumber(SourceLocation Loc, bool *Invalid = 0) const;
1141 unsigned getExpansionColumnNumber(SourceLocation Loc,
1143 unsigned getPresumedColumnNumber(SourceLocation Loc, bool *Invalid = 0) const;
1153 unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
1154 unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
1155 unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = 0) const;
1162 const char *getBufferName(SourceLocation Loc, bool *Invalid = 0) const;
1174 SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const;
1186 /// presumed location cannot be calculate (e.g., because \p Loc is invalid
1187 /// or the file containing \p Loc has changed on disk), returns an invalid
1189 PresumedLoc getPresumedLoc(SourceLocation Loc) const;
1198 bool isFromMainFile(SourceLocation Loc) const {
1199 return getFileID(Loc) == getMainFileID();
1203 bool isInSystemHeader(SourceLocation Loc) const {
1204 return getFileCharacteristic(Loc) != SrcMgr::C_User;
1208 bool isInExternCSystemHeader(SourceLocation Loc) const {
1209 return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem;
1212 /// \brief Returns whether \p Loc is expanded from a macro in a system header.
1220 /// \brief Given a specific FileID, returns true if \p Loc is inside that
1221 /// FileID chunk and sets relative offset (offset of \p Loc from beginning
1223 bool isInFileID(SourceLocation Loc, FileID FID,
1225 unsigned Offs = Loc.getOffset();
1244 /// specified by Loc.
1247 void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID);
1248 void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID,
1306 /// \brief If \p Loc points inside a function macro argument, the returned
1315 SourceLocation getMacroArgExpandedLocation(SourceLocation Loc) const;
1402 /// \brief Returns true if \p Loc came from a PCH/Module.
1403 bool isLoadedSourceLocation(SourceLocation Loc) const {
1404 return Loc.getOffset() >= CurrentLoadedOffset;
1407 /// \brief Returns true if \p Loc did not come from a PCH/Module.
1408 bool isLocalSourceLocation(SourceLocation Loc) const {
1409 return Loc.getOffset() < NextLocalOffset;
1425 PresumedLoc getPresumedLocForDisplay(SourceLocation Loc) const {
1428 while (Loc.isMacroID()) {
1429 Loc = skipToMacroArgExpansion(Loc);
1430 Loc = getImmediateMacroCallerLoc(Loc);
1433 return getPresumedLoc(Loc);
1452 SourceLocation getImmediateMacroCallerLoc(SourceLocation Loc) const {
1453 if (!Loc.isMacroID()) return Loc;
1458 if (isMacroArgExpansion(Loc))
1459 return getImmediateSpellingLoc(Loc);
1463 return getImmediateExpansionRange(Loc).first;
1468 SourceLocation getImmediateMacroCalleeLoc(SourceLocation Loc) const {
1469 if (!Loc.isMacroID()) return Loc;
1474 if (isMacroArgExpansion(Loc))
1475 return getImmediateExpansionRange(Loc).first;
1479 return getImmediateSpellingLoc(Loc);
1550 SourceLocation getExpansionLocSlowCase(SourceLocation Loc) const;
1551 SourceLocation getSpellingLocSlowCase(SourceLocation Loc) const;
1552 SourceLocation getFileLocSlowCase(SourceLocation Loc) const;