clang 23.0.0git
SourceLocation.h
Go to the documentation of this file.
1//===- SourceLocation.h - Compact identifier for Source Files ---*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// Defines the clang::SourceLocation class and associated facilities.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_BASIC_SOURCELOCATION_H
15#define LLVM_CLANG_BASIC_SOURCELOCATION_H
16
18#include "clang/Basic/LLVM.h"
19#include "llvm/ADT/StringRef.h"
20#include <cassert>
21#include <cstdint>
22#include <string>
23#include <utility>
24
25namespace llvm {
26
27class FoldingSetNodeID;
28template <typename T, typename Enable> struct FoldingSetTrait;
29
30} // namespace llvm
31
32namespace clang {
33
34class SourceManager;
35
36/// An opaque identifier used by SourceManager which refers to a
37/// source file (MemoryBuffer) along with its \#include path and \#line data.
38///
39class FileID {
40 /// A mostly-opaque identifier, where 0 is "invalid", >0 is
41 /// this module, and <-1 is something loaded from another module.
42 int ID = 0;
43
44public:
45 bool isValid() const { return ID != 0; }
46 bool isInvalid() const { return ID == 0; }
47
48 bool operator==(const FileID &RHS) const { return ID == RHS.ID; }
49 bool operator<(const FileID &RHS) const { return ID < RHS.ID; }
50 bool operator<=(const FileID &RHS) const { return ID <= RHS.ID; }
51 bool operator!=(const FileID &RHS) const { return !(*this == RHS); }
52 bool operator>(const FileID &RHS) const { return RHS < *this; }
53 bool operator>=(const FileID &RHS) const { return RHS <= *this; }
54
55 static FileID getSentinel() { return get(-1); }
56 unsigned getHashValue() const { return static_cast<unsigned>(ID); }
57
58private:
59 friend class ASTWriter;
60 friend class ASTReader;
61 friend class SourceManager;
63
64 static FileID get(int V) {
65 FileID F;
66 F.ID = V;
67 return F;
68 }
69
70 int getOpaqueValue() const { return ID; }
71};
72
73using FileIDAndOffset = std::pair<FileID, unsigned>;
74
75/// Encodes a location in the source. The SourceManager can decode this
76/// to get at the full include stack, line and column information.
77///
78/// Technically, a source location is simply an offset into the manager's view
79/// of the input source, which is all input buffers (including macro
80/// expansions) concatenated in an effectively arbitrary order. The manager
81/// actually maintains two blocks of input buffers. One, starting at offset
82/// 0 and growing upwards, contains all buffers from this module. The other,
83/// starting at the highest possible offset and growing downwards, contains
84/// buffers of loaded modules.
85///
86/// In addition, one bit of SourceLocation is used for quick access to the
87/// information whether the location is in a file or a macro expansion.
88///
89/// SourceLocation operates on a byte level, i.e. offsets describe
90/// byte distances, but in most cases, they are used on a token level,
91/// where a SourceLocation points to the first byte of a lexer token.
92///
93/// It is important that this type remains small. It is currently 32 bits wide.
95 friend class ASTReader;
96 friend class ASTWriter;
97 friend class SourceManager;
98 friend struct llvm::FoldingSetTrait<SourceLocation, void>;
100
101public:
102 using UIntTy = uint32_t;
103 using IntTy = int32_t;
104
105private:
106 UIntTy ID = 0;
107
108 enum : UIntTy { MacroIDBit = 1ULL << (8 * sizeof(UIntTy) - 1) };
109
110public:
111 bool isFileID() const { return (ID & MacroIDBit) == 0; }
112 bool isMacroID() const { return (ID & MacroIDBit) != 0; }
113
114 /// Return true if this is a valid SourceLocation object.
115 ///
116 /// Invalid SourceLocations are often used when events have no corresponding
117 /// location in the source (e.g. a diagnostic is required for a command line
118 /// option).
119 bool isValid() const { return ID != 0; }
120 bool isInvalid() const { return ID == 0; }
121
122private:
123 /// Return the offset into the manager's global input view.
124 UIntTy getOffset() const { return ID & ~MacroIDBit; }
125
126 static SourceLocation getFileLoc(UIntTy ID) {
127 assert((ID & MacroIDBit) == 0 && "Ran out of source locations!");
128 SourceLocation L;
129 L.ID = ID;
130 return L;
131 }
132
133 static SourceLocation getMacroLoc(UIntTy ID) {
134 assert((ID & MacroIDBit) == 0 && "Ran out of source locations!");
135 SourceLocation L;
136 L.ID = MacroIDBit | ID;
137 return L;
138 }
139
140public:
141 /// Return a source location with the specified offset from this
142 /// SourceLocation.
144 assert(((getOffset()+Offset) & MacroIDBit) == 0 && "offset overflow");
146 L.ID = ID+Offset;
147 return L;
148 }
149
150 /// When a SourceLocation itself cannot be used, this returns
151 /// an (opaque) 32-bit integer encoding for it.
152 ///
153 /// This should only be passed to SourceLocation::getFromRawEncoding, it
154 /// should not be inspected directly.
155 UIntTy getRawEncoding() const { return ID; }
156
157 /// Turn a raw encoding of a SourceLocation object into
158 /// a real SourceLocation.
159 ///
160 /// \see getRawEncoding.
163 X.ID = Encoding;
164 return X;
165 }
166
167 /// When a SourceLocation itself cannot be used, this returns
168 /// an (opaque) pointer encoding for it.
169 ///
170 /// This should only be passed to SourceLocation::getFromPtrEncoding, it
171 /// should not be inspected directly.
172 void* getPtrEncoding() const {
173 // Double cast to avoid a warning "cast to pointer from integer of different
174 // size".
175 return (void*)(uintptr_t)getRawEncoding();
176 }
177
178 /// Turn a pointer encoding of a SourceLocation object back
179 /// into a real SourceLocation.
180 static SourceLocation getFromPtrEncoding(const void *Encoding) {
182 }
183
185 return Start.isValid() && Start.isFileID() && End.isValid() &&
186 End.isFileID();
187 }
188
189 unsigned getHashValue() const;
190 void print(raw_ostream &OS, const SourceManager &SM) const;
191 std::string printToString(const SourceManager &SM) const;
192 void dump(const SourceManager &SM) const;
193};
194
195inline bool operator==(const SourceLocation &LHS, const SourceLocation &RHS) {
196 return LHS.getRawEncoding() == RHS.getRawEncoding();
197}
198
199inline bool operator!=(const SourceLocation &LHS, const SourceLocation &RHS) {
200 return !(LHS == RHS);
201}
202
203// Ordering is meaningful only if LHS and RHS have the same FileID!
204// Otherwise use SourceManager::isBeforeInTranslationUnit().
205inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) {
206 return LHS.getRawEncoding() < RHS.getRawEncoding();
207}
208inline bool operator>(const SourceLocation &LHS, const SourceLocation &RHS) {
209 return LHS.getRawEncoding() > RHS.getRawEncoding();
210}
211inline bool operator<=(const SourceLocation &LHS, const SourceLocation &RHS) {
212 return LHS.getRawEncoding() <= RHS.getRawEncoding();
213}
214inline bool operator>=(const SourceLocation &LHS, const SourceLocation &RHS) {
215 return LHS.getRawEncoding() >= RHS.getRawEncoding();
216}
217
218/// A trivial tuple used to represent a source range.
219///
220/// When referring to tokens, a SourceRange is an inclusive range [begin, end]
221/// that contains its endpoints, its begin SourceLocation points to the first
222/// byte of the first token and its end SourceLocation points to the first byte
223/// of the last token.
227
228public:
229 SourceRange() = default;
230 SourceRange(SourceLocation loc) : B(loc), E(loc) {}
231 SourceRange(SourceLocation begin, SourceLocation end) : B(begin), E(end) {}
232
233 SourceLocation getBegin() const { return B; }
234 SourceLocation getEnd() const { return E; }
235
236 void setBegin(SourceLocation b) { B = b; }
237 void setEnd(SourceLocation e) { E = e; }
238
239 bool isValid() const { return B.isValid() && E.isValid(); }
240 bool isInvalid() const { return !isValid(); }
241
242 bool operator==(const SourceRange &X) const {
243 return B == X.B && E == X.E;
244 }
245
246 bool operator!=(const SourceRange &X) const {
247 return B != X.B || E != X.E;
248 }
249
250 // Returns true iff other is wholly contained within this range.
251 bool fullyContains(const SourceRange &other) const {
252 return B <= other.B && E >= other.E;
253 }
254
255 void print(raw_ostream &OS, const SourceManager &SM) const;
256 std::string printToString(const SourceManager &SM) const;
257 void dump(const SourceManager &SM) const;
258};
259
260/// Represents a byte-granular source range.
261///
262/// The underlying SourceRange can either specify the starting/ending byte
263/// of the range, or it can specify the start of the range and the start of the
264/// last token of the range (a "token range"). In the token range case, the
265/// size of the last token must be measured to determine the actual end of the
266/// range.
267///
268/// CharSourceRange is interpreted differently depending on whether it is a
269/// TokenRange or a CharRange.
270/// For a TokenRange, the range contains the endpoint, i.e. the token containing
271/// the end SourceLocation.
272/// For a CharRange, the range doesn't contain the endpoint, i.e. it ends at the
273/// byte before the end SourceLocation. This allows representing a point
274/// CharRange [begin, begin) that points at the empty range right in front of
275/// the begin SourceLocation.
277 SourceRange Range;
278 bool IsTokenRange = false;
279
280public:
281 CharSourceRange() = default;
282 CharSourceRange(SourceRange R, bool ITR) : Range(R), IsTokenRange(ITR) {}
283
285 return CharSourceRange(R, true);
286 }
287
289 return CharSourceRange(R, false);
290 }
291
295
299
300 /// Return true if the end of this range specifies the start of
301 /// the last token. Return false if the end of this range specifies the first
302 /// byte after the range.
303 bool isTokenRange() const { return IsTokenRange; }
304 bool isCharRange() const { return !IsTokenRange; }
305
306 SourceLocation getBegin() const { return Range.getBegin(); }
307 SourceLocation getEnd() const { return Range.getEnd(); }
308 SourceRange getAsRange() const { return Range; }
309
310 void setBegin(SourceLocation b) { Range.setBegin(b); }
311 void setEnd(SourceLocation e) { Range.setEnd(e); }
312 void setTokenRange(bool TR) { IsTokenRange = TR; }
313
314 bool isValid() const { return Range.isValid(); }
315 bool isInvalid() const { return !isValid(); }
316};
317
318/// Represents an unpacked "presumed" location which can be presented
319/// to the user.
320///
321/// A 'presumed' location can be modified by \#line and GNU line marker
322/// directives and is always the expansion point of a normal location.
323///
324/// You can get a PresumedLoc from a SourceLocation with SourceManager.
326 const char *Filename = nullptr;
327 FileID ID;
328 unsigned Line, Col;
329 SourceLocation IncludeLoc;
330
331public:
332 PresumedLoc() = default;
333 PresumedLoc(const char *FN, FileID FID, unsigned Ln, unsigned Co,
335 : Filename(FN), ID(FID), Line(Ln), Col(Co), IncludeLoc(IL) {}
336
337 /// Return true if this object is invalid or uninitialized.
338 ///
339 /// This occurs when created with invalid source locations or when walking
340 /// off the top of a \#include stack.
341 bool isInvalid() const { return Filename == nullptr; }
342 bool isValid() const { return Filename != nullptr; }
343
344 /// Return the presumed filename of this location.
345 ///
346 /// This can be affected by \#line etc.
347 const char *getFilename() const {
348 assert(isValid());
349 return Filename;
350 }
351
353 assert(isValid());
354 return ID;
355 }
356
357 /// Return the presumed line number of this location.
358 ///
359 /// This can be affected by \#line etc.
360 unsigned getLine() const {
361 assert(isValid());
362 return Line;
363 }
364
365 /// Return the presumed column number of this location.
366 ///
367 /// This cannot be affected by \#line, but is packaged here for convenience.
368 unsigned getColumn() const {
369 assert(isValid());
370 return Col;
371 }
372
373 /// Return the presumed include location of this location.
374 ///
375 /// This can be affected by GNU linemarker directives.
377 assert(isValid());
378 return IncludeLoc;
379 }
380};
381
382/// A SourceLocation and its associated SourceManager.
383///
384/// This is useful for argument passing to functions that expect both objects.
385///
386/// This class does not guarantee the presence of either the SourceManager or
387/// a valid SourceLocation. Clients should use `isValid()` and `hasManager()`
388/// before calling the member functions.
390 const SourceManager *SrcMgr = nullptr;
391
392public:
393 /// Creates a FullSourceLoc where isValid() returns \c false.
394 FullSourceLoc() = default;
395
397 : SourceLocation(Loc), SrcMgr(&SM) {}
398
399 /// Checks whether the SourceManager is present.
400 bool hasManager() const { return SrcMgr != nullptr; }
401
402 /// \pre hasManager()
403 const SourceManager &getManager() const {
404 assert(SrcMgr && "SourceManager is NULL.");
405 return *SrcMgr;
406 }
407
408 FileID getFileID() const;
409
413 PresumedLoc getPresumedLoc(bool UseLineDirectives = true) const;
414 bool isMacroArgExpansion(FullSourceLoc *StartLoc = nullptr) const;
416 std::pair<FullSourceLoc, StringRef> getModuleImportLoc() const;
417 unsigned getFileOffset() const;
418
419 unsigned getExpansionLineNumber(bool *Invalid = nullptr) const;
420 unsigned getExpansionColumnNumber(bool *Invalid = nullptr) const;
421
422 /// Decompose the underlying \c SourceLocation into a raw (FileID + Offset)
423 /// pair, after walking through all expansion records.
424 ///
425 /// \see SourceManager::getDecomposedExpansionLoc
427
428 unsigned getSpellingLineNumber(bool *Invalid = nullptr) const;
429 unsigned getSpellingColumnNumber(bool *Invalid = nullptr) const;
430
431 const char *getCharacterData(bool *Invalid = nullptr) const;
432
433 unsigned getLineNumber(bool *Invalid = nullptr) const;
434 unsigned getColumnNumber(bool *Invalid = nullptr) const;
435
436 const FileEntry *getFileEntry() const;
438
439 /// Return a StringRef to the source buffer data for the
440 /// specified FileID.
441 StringRef getBufferData(bool *Invalid = nullptr) const;
442
443 /// Decompose the specified location into a raw FileID + Offset pair.
444 ///
445 /// The first element is the FileID, the second is the offset from the
446 /// start of the buffer of the location.
448
449 bool isInSystemHeader() const;
450
451 /// Determines the order of 2 source locations in the translation unit.
452 ///
453 /// \returns true if this source location comes before 'Loc', false otherwise.
455
456 /// Determines the order of 2 source locations in the translation unit.
457 ///
458 /// \returns true if this source location comes before 'Loc', false otherwise.
460 assert(Loc.isValid());
461 assert(SrcMgr == Loc.SrcMgr && "Loc comes from another SourceManager!");
463 }
464
465 /// Comparison function class, useful for sorting FullSourceLocs.
467 bool operator()(const FullSourceLoc& lhs, const FullSourceLoc& rhs) const {
468 return lhs.isBeforeInTranslationUnitThan(rhs);
469 }
470 };
471
472 /// Prints information about this FullSourceLoc to stderr.
473 ///
474 /// This is useful for debugging.
475 void dump() const;
476
477 friend bool
478 operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
479 return LHS.getRawEncoding() == RHS.getRawEncoding() &&
480 LHS.SrcMgr == RHS.SrcMgr;
481 }
482
483 friend bool
484 operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) {
485 return !(LHS == RHS);
486 }
487};
488
489} // namespace clang
490
491namespace llvm {
492
493 /// Define DenseMapInfo so that FileID's can be used as keys in DenseMap and
494 /// DenseSets.
495 template <>
496 struct DenseMapInfo<clang::FileID, void> {
498 return {};
499 }
500
504
505 static unsigned getHashValue(clang::FileID S) {
506 return S.getHashValue();
507 }
508
509 static bool isEqual(clang::FileID LHS, clang::FileID RHS) {
510 return LHS == RHS;
511 }
512 };
513
514 /// Define DenseMapInfo so that SourceLocation's can be used as keys in
515 /// DenseMap and DenseSet. This trait class is eqivalent to
516 /// DenseMapInfo<unsigned> which uses SourceLocation::ID is used as a key.
517 template <> struct DenseMapInfo<clang::SourceLocation, void> {
522
527
528 static unsigned getHashValue(clang::SourceLocation Loc) {
529 return Loc.getHashValue();
530 }
531
533 return LHS == RHS;
534 }
535 };
536
537 // Allow calling FoldingSetNodeID::Add with SourceLocation object as parameter
538 template <> struct FoldingSetTrait<clang::SourceLocation, void> {
539 static void Profile(const clang::SourceLocation &X, FoldingSetNodeID &ID);
540 };
541
542 template <> struct DenseMapInfo<clang::SourceRange> {
544 return DenseMapInfo<clang::SourceLocation>::getEmptyKey();
545 }
546
548 return DenseMapInfo<clang::SourceLocation>::getTombstoneKey();
549 }
550
551 static unsigned getHashValue(clang::SourceRange Range) {
552 return detail::combineHashValue(Range.getBegin().getHashValue(),
553 Range.getEnd().getHashValue());
554 }
555
557 return LHS == RHS;
558 }
559 };
560
561} // namespace llvm
562
563#endif // LLVM_CLANG_BASIC_SOURCELOCATION_H
#define V(N, I)
Defines interfaces for clang::FileEntry and clang::FileEntryRef.
#define X(type, name)
Definition Value.h:97
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
#define SM(sm)
__device__ __2f16 b
void setEnd(SourceLocation e)
bool isTokenRange() const
Return true if the end of this range specifies the start of the last token.
static CharSourceRange getCharRange(SourceLocation B, SourceLocation E)
static CharSourceRange getCharRange(SourceRange R)
void setBegin(SourceLocation b)
static CharSourceRange getTokenRange(SourceRange R)
static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E)
SourceLocation getEnd() const
SourceLocation getBegin() const
void setTokenRange(bool TR)
CharSourceRange(SourceRange R, bool ITR)
SourceRange getAsRange() const
Cached information about one file (either on disk or in the virtual file system).
Definition FileEntry.h:302
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
friend class ASTWriter
bool operator<(const FileID &RHS) const
unsigned getHashValue() const
bool operator>(const FileID &RHS) const
bool isValid() const
friend class ASTReader
bool operator==(const FileID &RHS) const
bool isInvalid() const
bool operator>=(const FileID &RHS) const
friend class SourceManager
bool operator!=(const FileID &RHS) const
bool operator<=(const FileID &RHS) const
friend class SourceManagerTestHelper
static FileID getSentinel()
A SourceLocation and its associated SourceManager.
FullSourceLoc getFileLoc() const
unsigned getColumnNumber(bool *Invalid=nullptr) const
FileIDAndOffset getDecomposedExpansionLoc() const
Decompose the underlying SourceLocation into a raw (FileID + Offset) pair, after walking through all ...
FullSourceLoc(SourceLocation Loc, const SourceManager &SM)
bool isBeforeInTranslationUnitThan(FullSourceLoc Loc) const
Determines the order of 2 source locations in the translation unit.
FullSourceLoc getExpansionLoc() const
unsigned getLineNumber(bool *Invalid=nullptr) const
FullSourceLoc getSpellingLoc() const
std::pair< FullSourceLoc, StringRef > getModuleImportLoc() const
OptionalFileEntryRef getFileEntryRef() const
unsigned getSpellingLineNumber(bool *Invalid=nullptr) const
FullSourceLoc getImmediateMacroCallerLoc() const
friend bool operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS)
const char * getCharacterData(bool *Invalid=nullptr) const
unsigned getExpansionColumnNumber(bool *Invalid=nullptr) const
StringRef getBufferData(bool *Invalid=nullptr) const
Return a StringRef to the source buffer data for the specified FileID.
void dump() const
Prints information about this FullSourceLoc to stderr.
friend bool operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS)
bool isInSystemHeader() const
const FileEntry * getFileEntry() const
unsigned getFileOffset() const
FullSourceLoc()=default
Creates a FullSourceLoc where isValid() returns false.
PresumedLoc getPresumedLoc(bool UseLineDirectives=true) const
bool hasManager() const
Checks whether the SourceManager is present.
FileIDAndOffset getDecomposedLoc() const
Decompose the specified location into a raw FileID + Offset pair.
bool isMacroArgExpansion(FullSourceLoc *StartLoc=nullptr) const
const SourceManager & getManager() const
unsigned getExpansionLineNumber(bool *Invalid=nullptr) const
bool isBeforeInTranslationUnitThan(SourceLocation Loc) const
Determines the order of 2 source locations in the translation unit.
unsigned getSpellingColumnNumber(bool *Invalid=nullptr) const
Represents an unpacked "presumed" location which can be presented to the user.
unsigned getColumn() const
Return the presumed column number of this location.
PresumedLoc(const char *FN, FileID FID, unsigned Ln, unsigned Co, SourceLocation IL)
const char * getFilename() const
Return the presumed filename of this location.
unsigned getLine() const
Return the presumed line number of this location.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
FileID getFileID() const
PresumedLoc()=default
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
Encodes a location in the source.
void * getPtrEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) pointer encoding for it.
static SourceLocation getFromRawEncoding(UIntTy Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
friend class SourceLocationEncoding
std::string printToString(const SourceManager &SM) const
void dump(const SourceManager &SM) const
static bool isPairOfFileLocations(SourceLocation Start, SourceLocation End)
bool isValid() const
Return true if this is a valid SourceLocation object.
void print(raw_ostream &OS, const SourceManager &SM) const
friend class SourceManager
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
UIntTy getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it.
unsigned getHashValue() const
static SourceLocation getFromPtrEncoding(const void *Encoding)
Turn a pointer encoding of a SourceLocation object back into a real SourceLocation.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
SourceRange(SourceLocation loc)
bool operator==(const SourceRange &X) const
void setBegin(SourceLocation b)
bool isInvalid() const
bool fullyContains(const SourceRange &other) const
SourceLocation getEnd() const
SourceLocation getBegin() const
std::string printToString(const SourceManager &SM) const
bool operator!=(const SourceRange &X) const
void dump(const SourceManager &SM) const
SourceRange()=default
void setEnd(SourceLocation e)
SourceRange(SourceLocation begin, SourceLocation end)
void print(raw_ostream &OS, const SourceManager &SM) const
The JSON file list parser is used to communicate input to InstallAPI.
CustomizableOptional< FileEntryRef > OptionalFileEntryRef
Definition FileEntry.h:208
std::pair< FileID, unsigned > FileIDAndOffset
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
Definition CallGraph.h:206
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool operator!=(CanQual< T > x, CanQual< U > y)
bool operator<=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool operator>(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool operator>=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Comparison function class, useful for sorting FullSourceLocs.
bool operator()(const FullSourceLoc &lhs, const FullSourceLoc &rhs) const
static unsigned getHashValue(clang::FileID S)
static bool isEqual(clang::FileID LHS, clang::FileID RHS)
static bool isEqual(clang::SourceLocation LHS, clang::SourceLocation RHS)
static unsigned getHashValue(clang::SourceLocation Loc)
static bool isEqual(clang::SourceRange LHS, clang::SourceRange RHS)
static clang::SourceRange getEmptyKey()
static clang::SourceRange getTombstoneKey()
static unsigned getHashValue(clang::SourceRange Range)
static void Profile(const clang::SourceLocation &X, FoldingSetNodeID &ID)