Lines Matching refs:SourceLocation

40 #include "clang/Basic/SourceLocation.h"
178 SourceLocation Loc = SourceLocation(),
246 unsigned IncludeLoc; // Really a SourceLocation
264 static FileInfo get(SourceLocation IL, const ContentCache *Con,
276 SourceLocation getIncludeLoc() const {
277 return SourceLocation::getFromRawEncoding(IncludeLoc);
311 /// macro-argument instantiations, the end will be 'SourceLocation()', an
316 SourceLocation getSpellingLoc() const {
317 return SourceLocation::getFromRawEncoding(SpellingLoc);
319 SourceLocation getExpansionLocStart() const {
320 return SourceLocation::getFromRawEncoding(ExpansionLocStart);
322 SourceLocation getExpansionLocEnd() const {
323 SourceLocation EndLoc =
324 SourceLocation::getFromRawEncoding(ExpansionLocEnd);
328 std::pair<SourceLocation,SourceLocation> getExpansionLocRange() const {
335 SourceLocation::getFromRawEncoding(ExpansionLocEnd).isInvalid();
340 SourceLocation::getFromRawEncoding(ExpansionLocEnd).isValid();
354 static ExpansionInfo create(SourceLocation SpellingLoc,
355 SourceLocation Start, SourceLocation End) {
382 static ExpansionInfo createForMacroArg(SourceLocation SpellingLoc,
383 SourceLocation ExpansionLoc) {
387 return create(SpellingLoc, ExpansionLoc, SourceLocation());
453 virtual std::pair<SourceLocation, StringRef> getModuleImportLoc(int ID) = 0;
542 /// The SourceManager can be queried for information about SourceLocation
695 typedef std::map<unsigned, SourceLocation> MacroArgsMap;
778 FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos,
795 SourceLocation IncludeLoc = SourceLocation()) {
805 return ID.isValid() ? ID : createFileID(SourceFile, SourceLocation(),
809 /// \brief Return a new SourceLocation that encodes the
813 SourceLocation createMacroArgExpansionLoc(SourceLocation Loc,
814 SourceLocation ExpansionLoc,
817 /// \brief Return a new SourceLocation that encodes the fact
820 SourceLocation createExpansionLoc(SourceLocation Loc,
821 SourceLocation ExpansionLocStart,
822 SourceLocation ExpansionLocEnd,
895 llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc,
921 SourceLocation(),
978 // SourceLocation manipulation methods.
981 /// \brief Return the FileID for a SourceLocation.
984 /// that start with a SourceLocation object. It is responsible for finding
987 FileID getFileID(SourceLocation SpellingLoc) const {
997 /// \brief Return the filename of the file containing a SourceLocation.
998 StringRef getFilename(SourceLocation SpellingLoc) const {
1006 SourceLocation getLocForStartOfFile(FileID FID) const {
1010 return SourceLocation();
1013 return SourceLocation::getFileLoc(FileOffset);
1018 SourceLocation getLocForEndOfFile(FileID FID) const {
1022 return SourceLocation();
1025 return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID));
1030 SourceLocation getIncludeLoc(FileID FID) const {
1034 return SourceLocation();
1042 std::pair<SourceLocation, StringRef>
1043 getModuleImportLoc(SourceLocation Loc) const {
1049 return std::make_pair(SourceLocation(), "");
1054 /// \brief Given a SourceLocation object \p Loc, return the expansion
1056 SourceLocation getExpansionLoc(SourceLocation Loc) const {
1066 SourceLocation getFileLoc(SourceLocation Loc) const {
1075 std::pair<SourceLocation,SourceLocation>
1076 getImmediateExpansionRange(SourceLocation Loc) const;
1078 /// \brief Given a SourceLocation object, return the range of
1080 std::pair<SourceLocation,SourceLocation>
1081 getExpansionRange(SourceLocation Loc) const;
1090 /// \brief Given a SourceLocation object, return the spelling
1095 SourceLocation getSpellingLoc(SourceLocation Loc) const {
1102 /// \brief Given a SourceLocation object, return the spelling location
1108 SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const;
1114 std::pair<FileID, unsigned> getDecomposedLoc(SourceLocation Loc) const {
1128 getDecomposedExpansionLoc(SourceLocation Loc) const {
1147 getDecomposedSpellingLoc(SourceLocation Loc) const {
1165 /// specified SourceLocation represents.
1168 unsigned getFileOffset(SourceLocation SpellingLoc) const {
1181 bool isMacroArgExpansion(SourceLocation Loc,
1182 SourceLocation *StartLoc = nullptr) const;
1189 bool isMacroBodyExpansion(SourceLocation Loc) const;
1196 bool isAtStartOfImmediateMacroExpansion(SourceLocation Loc,
1197 SourceLocation *MacroBegin = nullptr) const;
1205 isAtEndOfImmediateMacroExpansion(SourceLocation Loc,
1206 SourceLocation *MacroEnd = nullptr) const;
1213 bool isInSLocAddrSpace(SourceLocation Loc,
1214 SourceLocation Start, unsigned Length,
1238 bool isInSameSLocAddrSpace(SourceLocation LHS, SourceLocation RHS,
1254 // Queries about the code at a SourceLocation.
1261 const char *getCharacterData(SourceLocation SL,
1272 unsigned getSpellingColumnNumber(SourceLocation Loc,
1274 unsigned getExpansionColumnNumber(SourceLocation Loc,
1276 unsigned getPresumedColumnNumber(SourceLocation Loc,
1279 /// \brief Given a SourceLocation, return the spelling line number
1286 unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1287 unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1288 unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const;
1295 const char *getBufferName(SourceLocation Loc, bool *Invalid = nullptr) const;
1307 SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const;
1309 /// \brief Returns the "presumed" location of a SourceLocation specifies.
1318 /// \returns The presumed location of the specified SourceLocation. If the
1322 PresumedLoc getPresumedLoc(SourceLocation Loc,
1325 /// \brief Returns whether the PresumedLoc for a given SourceLocation is
1328 /// This computes the "presumed" location for a SourceLocation, then checks
1332 bool isInMainFile(SourceLocation Loc) const;
1338 bool isWrittenInSameFile(SourceLocation Loc1, SourceLocation Loc2) const {
1346 bool isWrittenInMainFile(SourceLocation Loc) const {
1350 /// \brief Returns if a SourceLocation is in a system header.
1351 bool isInSystemHeader(SourceLocation Loc) const {
1355 /// \brief Returns if a SourceLocation is in an "extern C" system header.
1356 bool isInExternCSystemHeader(SourceLocation Loc) const {
1361 bool isInSystemMacro(SourceLocation loc) {
1371 bool isInFileID(SourceLocation Loc, FileID FID,
1395 void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID);
1396 void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID,
1440 SourceLocation translateFileLineCol(const FileEntry *SourceFile,
1451 SourceLocation translateLineCol(FileID FID,
1463 SourceLocation getMacroArgExpandedLocation(SourceLocation Loc) const;
1468 bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const;
1472 bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const {
1480 bool isBeforeInSLocAddrSpace(SourceLocation LHS, unsigned RHS) const {
1554 bool isLoadedSourceLocation(SourceLocation Loc) const {
1559 bool isLocalSourceLocation(SourceLocation Loc) const {
1576 SourceLocation getImmediateMacroCallerLoc(SourceLocation Loc) const {
1612 SourceLocation createExpansionLocImpl(const SrcMgr::ExpansionInfo &Expansion,
1618 /// specified SourceLocation offset. This is a very hot method.
1651 SourceLocation IncludePos,
1667 SourceLocation getExpansionLocSlowCase(SourceLocation Loc) const;
1668 SourceLocation getSpellingLocSlowCase(SourceLocation Loc) const;
1669 SourceLocation getFileLocSlowCase(SourceLocation Loc) const;
1679 SourceLocation SpellLoc,
1680 SourceLocation ExpansionLoc,
1692 class BeforeThanCompare<SourceLocation> {
1698 bool operator()(SourceLocation LHS, SourceLocation RHS) const {