clang  6.0.0svn
PreprocessingRecord.h
Go to the documentation of this file.
1 //===- PreprocessingRecord.h - Record of Preprocessing ----------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the PreprocessingRecord class, which maintains a record
11 // of what occurred during preprocessing.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
16 #define LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
17 
18 #include "clang/Basic/LLVM.h"
20 #include "clang/Lex/PPCallbacks.h"
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/None.h"
23 #include "llvm/ADT/Optional.h"
24 #include "llvm/ADT/PointerUnion.h"
25 #include "llvm/ADT/StringRef.h"
26 #include "llvm/ADT/iterator.h"
27 #include "llvm/ADT/iterator_range.h"
28 #include "llvm/Support/Allocator.h"
29 #include "llvm/Support/Compiler.h"
30 #include <cassert>
31 #include <cstddef>
32 #include <iterator>
33 #include <utility>
34 #include <vector>
35 
36 namespace clang {
37 
38 class PreprocessingRecord;
39 
40 } // namespace clang
41 
42 /// \brief Allocates memory within a Clang preprocessing record.
43 void *operator new(size_t bytes, clang::PreprocessingRecord &PR,
44  unsigned alignment = 8) noexcept;
45 
46 /// \brief Frees memory allocated in a Clang preprocessing record.
47 void operator delete(void *ptr, clang::PreprocessingRecord &PR,
48  unsigned) noexcept;
49 
50 namespace clang {
51 
52 class FileEntry;
53 class IdentifierInfo;
54 class MacroInfo;
55 class SourceManager;
56 class Token;
57 
58  /// \brief Base class that describes a preprocessed entity, which may be a
59  /// preprocessor directive or macro expansion.
61  public:
62  /// \brief The kind of preprocessed entity an object describes.
63  enum EntityKind {
64  /// \brief Indicates a problem trying to load the preprocessed entity.
66 
67  /// \brief A macro expansion.
69 
70  /// \defgroup Preprocessing directives
71  /// @{
72 
73  /// \brief A macro definition.
75 
76  /// \brief An inclusion directive, such as \c \#include, \c
77  /// \#import, or \c \#include_next.
79 
80  /// @}
81 
84  };
85 
86  private:
87  /// \brief The kind of preprocessed entity that this object describes.
89 
90  /// \brief The source range that covers this preprocessed entity.
91  SourceRange Range;
92 
93  protected:
94  friend class PreprocessingRecord;
95 
97  : Kind(Kind), Range(Range) {}
98 
99  public:
100  /// \brief Retrieve the kind of preprocessed entity stored in this object.
101  EntityKind getKind() const { return Kind; }
102 
103  /// \brief Retrieve the source range that covers this entire preprocessed
104  /// entity.
105  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
106 
107  /// \brief Returns true if there was a problem loading the preprocessed
108  /// entity.
109  bool isInvalid() const { return Kind == InvalidKind; }
110 
111  // Only allow allocation of preprocessed entities using the allocator
112  // in PreprocessingRecord or by doing a placement new.
113  void *operator new(size_t bytes, PreprocessingRecord &PR,
114  unsigned alignment = 8) noexcept {
115  return ::operator new(bytes, PR, alignment);
116  }
117 
118  void *operator new(size_t bytes, void *mem) noexcept { return mem; }
119 
120  void operator delete(void *ptr, PreprocessingRecord &PR,
121  unsigned alignment) noexcept {
122  return ::operator delete(ptr, PR, alignment);
123  }
124 
125  void operator delete(void *, std::size_t) noexcept {}
126  void operator delete(void *, void *) noexcept {}
127 
128  private:
129  // Make vanilla 'new' and 'delete' illegal for preprocessed entities.
130  void *operator new(size_t bytes) noexcept;
131  void operator delete(void *data) noexcept;
132  };
133 
134  /// \brief Records the presence of a preprocessor directive.
136  public:
138  : PreprocessedEntity(Kind, Range) {}
139 
140  // Implement isa/cast/dyncast/etc.
141  static bool classof(const PreprocessedEntity *PD) {
142  return PD->getKind() >= FirstPreprocessingDirective &&
144  }
145  };
146 
147  /// \brief Record the location of a macro definition.
149  /// \brief The name of the macro being defined.
150  const IdentifierInfo *Name;
151 
152  public:
153  explicit MacroDefinitionRecord(const IdentifierInfo *Name,
154  SourceRange Range)
155  : PreprocessingDirective(MacroDefinitionKind, Range), Name(Name) {}
156 
157  /// \brief Retrieve the name of the macro being defined.
158  const IdentifierInfo *getName() const { return Name; }
159 
160  /// \brief Retrieve the location of the macro name in the definition.
162 
163  // Implement isa/cast/dyncast/etc.
164  static bool classof(const PreprocessedEntity *PE) {
165  return PE->getKind() == MacroDefinitionKind;
166  }
167  };
168 
169  /// \brief Records the location of a macro expansion.
171  /// \brief The definition of this macro or the name of the macro if it is
172  /// a builtin macro.
173  llvm::PointerUnion<IdentifierInfo *, MacroDefinitionRecord *> NameOrDef;
174 
175  public:
178  NameOrDef(BuiltinName) {}
179 
181  : PreprocessedEntity(MacroExpansionKind, Range), NameOrDef(Definition) {
182  }
183 
184  /// \brief True if it is a builtin macro.
185  bool isBuiltinMacro() const { return NameOrDef.is<IdentifierInfo *>(); }
186 
187  /// \brief The name of the macro being expanded.
188  const IdentifierInfo *getName() const {
190  return Def->getName();
191  return NameOrDef.get<IdentifierInfo *>();
192  }
193 
194  /// \brief The definition of the macro being expanded. May return null if
195  /// this is a builtin macro.
197  return NameOrDef.dyn_cast<MacroDefinitionRecord *>();
198  }
199 
200  // Implement isa/cast/dyncast/etc.
201  static bool classof(const PreprocessedEntity *PE) {
202  return PE->getKind() == MacroExpansionKind;
203  }
204  };
205 
206  /// \brief Record the location of an inclusion directive, such as an
207  /// \c \#include or \c \#import statement.
209  public:
210  /// \brief The kind of inclusion directives known to the
211  /// preprocessor.
213  /// \brief An \c \#include directive.
215 
216  /// \brief An Objective-C \c \#import directive.
218 
219  /// \brief A GNU \c \#include_next directive.
221 
222  /// \brief A Clang \c \#__include_macros directive.
223  IncludeMacros
224  };
225 
226  private:
227  /// \brief The name of the file that was included, as written in
228  /// the source.
229  StringRef FileName;
230 
231  /// \brief Whether the file name was in quotation marks; otherwise, it was
232  /// in angle brackets.
233  unsigned InQuotes : 1;
234 
235  /// \brief The kind of inclusion directive we have.
236  ///
237  /// This is a value of type InclusionKind.
238  unsigned Kind : 2;
239 
240  /// \brief Whether the inclusion directive was automatically turned into
241  /// a module import.
242  unsigned ImportedModule : 1;
243 
244  /// \brief The file that was included.
245  const FileEntry *File;
246 
247  public:
249  InclusionKind Kind, StringRef FileName,
250  bool InQuotes, bool ImportedModule,
251  const FileEntry *File, SourceRange Range);
252 
253  /// \brief Determine what kind of inclusion directive this is.
254  InclusionKind getKind() const { return static_cast<InclusionKind>(Kind); }
255 
256  /// \brief Retrieve the included file name as it was written in the source.
257  StringRef getFileName() const { return FileName; }
258 
259  /// \brief Determine whether the included file name was written in quotes;
260  /// otherwise, it was written in angle brackets.
261  bool wasInQuotes() const { return InQuotes; }
262 
263  /// \brief Determine whether the inclusion directive was automatically
264  /// turned into a module import.
265  bool importedModule() const { return ImportedModule; }
266 
267  /// \brief Retrieve the file entry for the actual file that was included
268  /// by this directive.
269  const FileEntry *getFile() const { return File; }
270 
271  // Implement isa/cast/dyncast/etc.
272  static bool classof(const PreprocessedEntity *PE) {
273  return PE->getKind() == InclusionDirectiveKind;
274  }
275  };
276 
277  /// \brief An abstract class that should be subclassed by any external source
278  /// of preprocessing record entries.
280  public:
282 
283  /// \brief Read a preallocated preprocessed entity from the external source.
284  ///
285  /// \returns null if an error occurred that prevented the preprocessed
286  /// entity from being loaded.
287  virtual PreprocessedEntity *ReadPreprocessedEntity(unsigned Index) = 0;
288 
289  /// \brief Returns a pair of [Begin, End) indices of preallocated
290  /// preprocessed entities that \p Range encompasses.
291  virtual std::pair<unsigned, unsigned>
292  findPreprocessedEntitiesInRange(SourceRange Range) = 0;
293 
294  /// \brief Optionally returns true or false if the preallocated preprocessed
295  /// entity with index \p Index came from file \p FID.
297  FileID FID) {
298  return None;
299  }
300  };
301 
302  /// \brief A record of the steps taken while preprocessing a source file,
303  /// including the various preprocessing directives processed, macros
304  /// expanded, etc.
306  SourceManager &SourceMgr;
307 
308  /// \brief Allocator used to store preprocessing objects.
309  llvm::BumpPtrAllocator BumpAlloc;
310 
311  /// \brief The set of preprocessed entities in this record, in order they
312  /// were seen.
313  std::vector<PreprocessedEntity *> PreprocessedEntities;
314 
315  /// \brief The set of preprocessed entities in this record that have been
316  /// loaded from external sources.
317  ///
318  /// The entries in this vector are loaded lazily from the external source,
319  /// and are referenced by the iterator using negative indices.
320  std::vector<PreprocessedEntity *> LoadedPreprocessedEntities;
321 
322  /// \brief The set of ranges that were skipped by the preprocessor,
323  std::vector<SourceRange> SkippedRanges;
324 
325  /// \brief Global (loaded or local) ID for a preprocessed entity.
326  /// Negative values are used to indicate preprocessed entities
327  /// loaded from the external source while non-negative values are used to
328  /// indicate preprocessed entities introduced by the current preprocessor.
329  /// Value -1 corresponds to element 0 in the loaded entities vector,
330  /// value -2 corresponds to element 1 in the loaded entities vector, etc.
331  /// Value 0 is an invalid value, the index to local entities is 1-based,
332  /// value 1 corresponds to element 0 in the local entities vector,
333  /// value 2 corresponds to element 1 in the local entities vector, etc.
334  class PPEntityID {
335  friend class PreprocessingRecord;
336 
337  int ID = 0;
338 
339  explicit PPEntityID(int ID) : ID(ID) {}
340 
341  public:
342  PPEntityID() = default;
343  };
344 
345  static PPEntityID getPPEntityID(unsigned Index, bool isLoaded) {
346  return isLoaded ? PPEntityID(-int(Index)-1) : PPEntityID(Index+1);
347  }
348 
349  /// \brief Mapping from MacroInfo structures to their definitions.
350  llvm::DenseMap<const MacroInfo *, MacroDefinitionRecord *> MacroDefinitions;
351 
352  /// \brief External source of preprocessed entities.
353  ExternalPreprocessingRecordSource *ExternalSource = nullptr;
354 
355  /// \brief Retrieve the preprocessed entity at the given ID.
356  PreprocessedEntity *getPreprocessedEntity(PPEntityID PPID);
357 
358  /// \brief Retrieve the loaded preprocessed entity at the given index.
359  PreprocessedEntity *getLoadedPreprocessedEntity(unsigned Index);
360 
361  /// \brief Determine the number of preprocessed entities that were
362  /// loaded (or can be loaded) from an external source.
363  unsigned getNumLoadedPreprocessedEntities() const {
364  return LoadedPreprocessedEntities.size();
365  }
366 
367  /// \brief Returns a pair of [Begin, End) indices of local preprocessed
368  /// entities that \p Range encompasses.
369  std::pair<unsigned, unsigned>
370  findLocalPreprocessedEntitiesInRange(SourceRange Range) const;
371  unsigned findBeginLocalPreprocessedEntity(SourceLocation Loc) const;
372  unsigned findEndLocalPreprocessedEntity(SourceLocation Loc) const;
373 
374  /// \brief Allocate space for a new set of loaded preprocessed entities.
375  ///
376  /// \returns The index into the set of loaded preprocessed entities, which
377  /// corresponds to the first newly-allocated entity.
378  unsigned allocateLoadedEntities(unsigned NumEntities);
379 
380  /// \brief Register a new macro definition.
381  void RegisterMacroDefinition(MacroInfo *Macro, MacroDefinitionRecord *Def);
382 
383  public:
384  /// \brief Construct a new preprocessing record.
386 
387  /// \brief Allocate memory in the preprocessing record.
388  void *Allocate(unsigned Size, unsigned Align = 8) {
389  return BumpAlloc.Allocate(Size, Align);
390  }
391 
392  /// \brief Deallocate memory in the preprocessing record.
393  void Deallocate(void *Ptr) {}
394 
395  size_t getTotalMemory() const;
396 
397  SourceManager &getSourceManager() const { return SourceMgr; }
398 
399  /// Iteration over the preprocessed entities.
400  ///
401  /// In a complete iteration, the iterator walks the range [-M, N),
402  /// where negative values are used to indicate preprocessed entities
403  /// loaded from the external source while non-negative values are used to
404  /// indicate preprocessed entities introduced by the current preprocessor.
405  /// However, to provide iteration in source order (for, e.g., chained
406  /// precompiled headers), dereferencing the iterator flips the negative
407  /// values (corresponding to loaded entities), so that position -M
408  /// corresponds to element 0 in the loaded entities vector, position -M+1
409  /// corresponds to element 1 in the loaded entities vector, etc. This
410  /// gives us a reasonably efficient, source-order walk.
411  ///
412  /// We define this as a wrapping iterator around an int. The
413  /// iterator_adaptor_base class forwards the iterator methods to basic
414  /// integer arithmetic.
415  class iterator : public llvm::iterator_adaptor_base<
416  iterator, int, std::random_access_iterator_tag,
417  PreprocessedEntity *, int, PreprocessedEntity *,
418  PreprocessedEntity *> {
419  friend class PreprocessingRecord;
420 
421  PreprocessingRecord *Self;
422 
423  iterator(PreprocessingRecord *Self, int Position)
424  : iterator::iterator_adaptor_base(Position), Self(Self) {}
425 
426  public:
427  iterator() : iterator(nullptr, 0) {}
428 
430  bool isLoaded = this->I < 0;
431  unsigned Index = isLoaded ?
432  Self->LoadedPreprocessedEntities.size() + this->I : this->I;
433  PPEntityID ID = Self->getPPEntityID(Index, isLoaded);
434  return Self->getPreprocessedEntity(ID);
435  }
436  PreprocessedEntity *operator->() const { return **this; }
437  };
438 
439  /// \brief Begin iterator for all preprocessed entities.
441  return iterator(this, -(int)LoadedPreprocessedEntities.size());
442  }
443 
444  /// \brief End iterator for all preprocessed entities.
446  return iterator(this, PreprocessedEntities.size());
447  }
448 
449  /// \brief Begin iterator for local, non-loaded, preprocessed entities.
451  return iterator(this, 0);
452  }
453 
454  /// \brief End iterator for local, non-loaded, preprocessed entities.
456  return iterator(this, PreprocessedEntities.size());
457  }
458 
459  /// \brief iterator range for the given range of loaded
460  /// preprocessed entities.
461  llvm::iterator_range<iterator> getIteratorsForLoadedRange(unsigned start,
462  unsigned count) {
463  unsigned end = start + count;
464  assert(end <= LoadedPreprocessedEntities.size());
465  return llvm::make_range(
466  iterator(this, int(start) - LoadedPreprocessedEntities.size()),
467  iterator(this, int(end) - LoadedPreprocessedEntities.size()));
468  }
469 
470  /// \brief Returns a range of preprocessed entities that source range \p R
471  /// encompasses.
472  ///
473  /// \param R the range to look for preprocessed entities.
474  llvm::iterator_range<iterator>
475  getPreprocessedEntitiesInRange(SourceRange R);
476 
477  /// \brief Returns true if the preprocessed entity that \p PPEI iterator
478  /// points to is coming from the file \p FID.
479  ///
480  /// Can be used to avoid implicit deserializations of preallocated
481  /// preprocessed entities if we only care about entities of a specific file
482  /// and not from files \#included in the range given at
483  /// \see getPreprocessedEntitiesInRange.
484  bool isEntityInFileID(iterator PPEI, FileID FID);
485 
486  /// \brief Add a new preprocessed entity to this record.
487  PPEntityID addPreprocessedEntity(PreprocessedEntity *Entity);
488 
489  /// \brief Set the external source for preprocessed entities.
490  void SetExternalSource(ExternalPreprocessingRecordSource &Source);
491 
492  /// \brief Retrieve the external source for preprocessed entities.
494  return ExternalSource;
495  }
496 
497  /// \brief Retrieve the macro definition that corresponds to the given
498  /// \c MacroInfo.
499  MacroDefinitionRecord *findMacroDefinition(const MacroInfo *MI);
500 
501  /// \brief Retrieve all ranges that got skipped while preprocessing.
502  const std::vector<SourceRange> &getSkippedRanges() const {
503  return SkippedRanges;
504  }
505 
506  private:
507  friend class ASTReader;
508  friend class ASTWriter;
509 
510  void MacroExpands(const Token &Id, const MacroDefinition &MD,
511  SourceRange Range, const MacroArgs *Args) override;
512  void MacroDefined(const Token &Id, const MacroDirective *MD) override;
513  void MacroUndefined(const Token &Id, const MacroDefinition &MD,
514  const MacroDirective *Undef) override;
515  void InclusionDirective(SourceLocation HashLoc, const Token &IncludeTok,
516  StringRef FileName, bool IsAngled,
517  CharSourceRange FilenameRange,
518  const FileEntry *File, StringRef SearchPath,
519  StringRef RelativePath,
520  const Module *Imported) override;
521  void Ifdef(SourceLocation Loc, const Token &MacroNameTok,
522  const MacroDefinition &MD) override;
523  void Ifndef(SourceLocation Loc, const Token &MacroNameTok,
524  const MacroDefinition &MD) override;
525 
526  /// \brief Hook called whenever the 'defined' operator is seen.
527  void Defined(const Token &MacroNameTok, const MacroDefinition &MD,
528  SourceRange Range) override;
529 
530  void SourceRangeSkipped(SourceRange Range,
531  SourceLocation EndifLoc) override;
532 
533  void addMacroExpansion(const Token &Id, const MacroInfo *MI,
534  SourceRange Range);
535 
536  /// \brief Cached result of the last \see getPreprocessedEntitiesInRange
537  /// query.
538  struct {
540  std::pair<int, int> Result;
541  } CachedRangeQuery;
542 
543  std::pair<int, int> getPreprocessedEntitiesInRangeSlow(SourceRange R);
544  };
545 
546 } // namespace clang
547 
548 inline void *operator new(size_t bytes, clang::PreprocessingRecord &PR,
549  unsigned alignment) noexcept {
550  return PR.Allocate(bytes, alignment);
551 }
552 
553 inline void operator delete(void *ptr, clang::PreprocessingRecord &PR,
554  unsigned) noexcept {
555  PR.Deallocate(ptr);
556 }
557 
558 #endif // LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
const FileEntry * getFile() const
Retrieve the file entry for the actual file that was included by this directive.
static bool classof(const PreprocessedEntity *PE)
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
Definition: opencl-c.h:60
MacroExpansion(MacroDefinitionRecord *Definition, SourceRange Range)
A description of the current definition of a macro.
Definition: MacroInfo.h:564
Indicates a problem trying to load the preprocessed entity.
Base class that describes a preprocessed entity, which may be a preprocessor directive or macro expan...
SourceRange getSourceRange() const LLVM_READONLY
Retrieve the source range that covers this entire preprocessed entity.
iterator local_end()
End iterator for local, non-loaded, preprocessed entities.
static StringRef bytes(const std::vector< T, Allocator > &v)
Definition: ASTWriter.cpp:119
This interface provides a way to observe the actions of the preprocessor as it does its thing...
Definition: PPCallbacks.h:36
static const NamedDecl * getDefinition(const Decl *D)
Definition: SemaDecl.cpp:2512
Records the presence of a preprocessor directive.
One of these records is kept for each identifier that is lexed.
Iteration over the preprocessed entities.
Record the location of a macro definition.
Token - This structure provides full information about a lexed token.
Definition: Token.h:35
Describes a module or submodule.
Definition: Module.h:65
A record of the steps taken while preprocessing a source file, including the various preprocessing di...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
SourceManager & getSourceManager() const
MacroExpansion(IdentifierInfo *BuiltinName, SourceRange Range)
StringRef getFileName() const
Retrieve the included file name as it was written in the source.
Records the location of a macro expansion.
InclusionKind getKind() const
Determine what kind of inclusion directive this is.
A GNU #include_next directive.
static bool classof(const PreprocessedEntity *PE)
std::pair< int, int > Result
virtual Optional< bool > isPreprocessedEntityInFileID(unsigned Index, FileID FID)
Optionally returns true or false if the preallocated preprocessed entity with index Index came from f...
static bool classof(const PreprocessedEntity *PD)
void * Allocate(unsigned Size, unsigned Align=8)
Allocate memory in the preprocessing record.
Represents a character-granular source range.
int Id
Definition: ASTDiff.cpp:191
MacroArgs - An instance of this class captures information about the formal arguments specified to a ...
Definition: MacroArgs.h:30
Record the location of an inclusion directive, such as an #include or #import statement.
bool isBuiltinMacro() const
True if it is a builtin macro.
InclusionKind
The kind of inclusion directives known to the preprocessor.
llvm::iterator_range< iterator > getIteratorsForLoadedRange(unsigned start, unsigned count)
iterator range for the given range of loaded preprocessed entities.
const SourceManager & SM
Definition: Format.cpp:1337
EntityKind
The kind of preprocessed entity an object describes.
Encapsulates changes to the "macros namespace" (the location where the macro name became active...
Definition: MacroInfo.h:291
Kind
Encodes a location in the source.
bool isInvalid() const
Returns true if there was a problem loading the preprocessed entity.
void Deallocate(void *Ptr)
Deallocate memory in the preprocessing record.
PreprocessedEntity(EntityKind Kind, SourceRange Range)
Cached information about one file (either on disk or in the virtual file system). ...
Definition: FileManager.h:59
An abstract class that should be subclassed by any external source of preprocessing record entries...
MacroDefinitionRecord(const IdentifierInfo *Name, SourceRange Range)
const IdentifierInfo * getName() const
Retrieve the name of the macro being defined.
An inclusion directive, such as #include, #import, or #include_next.
StringRef getName() const
Return the actual identifier string.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
iterator end()
End iterator for all preprocessed entities.
Dataflow Directional Tag Classes.
static bool classof(const PreprocessedEntity *PE)
Reads an AST files chain containing the contents of a translation unit.
Definition: ASTReader.h:358
const IdentifierInfo * getName() const
The name of the macro being expanded.
bool wasInQuotes() const
Determine whether the included file name was written in quotes; otherwise, it was written in angle br...
Encapsulates the data about a macro definition (e.g.
Definition: MacroInfo.h:40
PreprocessedEntity * operator*() const
SourceLocation getLocation() const
Retrieve the location of the macro name in the definition.
An Objective-C #import directive.
Defines the PPCallbacks interface.
ExternalPreprocessingRecordSource * getExternalSource() const
Retrieve the external source for preprocessed entities.
const std::vector< SourceRange > & getSkippedRanges() const
Retrieve all ranges that got skipped while preprocessing.
Defines the clang::SourceLocation class and associated facilities.
iterator begin()
Begin iterator for all preprocessed entities.
PreprocessingDirective(EntityKind Kind, SourceRange Range)
EntityKind getKind() const
Retrieve the kind of preprocessed entity stored in this object.
bool importedModule() const
Determine whether the inclusion directive was automatically turned into a module import.
Writes an AST file containing the contents of a translation unit.
Definition: ASTWriter.h:104
PreprocessedEntity * operator->() const
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
This class handles loading and caching of source files into memory.
MacroDefinitionRecord * getDefinition() const
The definition of the macro being expanded.
iterator local_begin()
Begin iterator for local, non-loaded, preprocessed entities.