PreprocessingRecord.h revision f03b888a12ccff7d54ddd8a79a0141cf23adbf67
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#ifndef LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
15#define LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
16
17#include "clang/Lex/PPCallbacks.h"
18#include "clang/Basic/SourceLocation.h"
19#include "clang/Basic/IdentifierTable.h"
20#include "llvm/ADT/SmallVector.h"
21#include "llvm/ADT/DenseMap.h"
22#include "llvm/ADT/Optional.h"
23#include "llvm/Support/Allocator.h"
24#include "llvm/Support/Compiler.h"
25#include <vector>
26
27namespace clang {
28  class IdentifierInfo;
29  class PreprocessingRecord;
30}
31
32/// \brief Allocates memory within a Clang preprocessing record.
33void* operator new(size_t bytes, clang::PreprocessingRecord& PR,
34                   unsigned alignment = 8) throw();
35
36/// \brief Frees memory allocated in a Clang preprocessing record.
37void operator delete(void* ptr, clang::PreprocessingRecord& PR,
38                     unsigned) throw();
39
40namespace clang {
41  class MacroDefinition;
42  class FileEntry;
43
44  /// \brief Base class that describes a preprocessed entity, which may be a
45  /// preprocessor directive or macro expansion.
46  class PreprocessedEntity {
47  public:
48    /// \brief The kind of preprocessed entity an object describes.
49    enum EntityKind {
50      /// \brief Indicates a problem trying to load the preprocessed entity.
51      InvalidKind,
52
53      /// \brief A macro expansion.
54      MacroExpansionKind,
55
56      /// \defgroup Preprocessing directives
57      /// @{
58
59      /// \brief A macro definition.
60      MacroDefinitionKind,
61
62      /// \brief An inclusion directive, such as \c \#include, \c
63      /// \#import, or \c \#include_next.
64      InclusionDirectiveKind,
65
66      /// @}
67
68      FirstPreprocessingDirective = MacroDefinitionKind,
69      LastPreprocessingDirective = InclusionDirectiveKind
70    };
71
72  private:
73    /// \brief The kind of preprocessed entity that this object describes.
74    EntityKind Kind;
75
76    /// \brief The source range that covers this preprocessed entity.
77    SourceRange Range;
78
79  protected:
80    PreprocessedEntity(EntityKind Kind, SourceRange Range)
81      : Kind(Kind), Range(Range) { }
82
83    friend class PreprocessingRecord;
84
85  public:
86    /// \brief Retrieve the kind of preprocessed entity stored in this object.
87    EntityKind getKind() const { return Kind; }
88
89    /// \brief Retrieve the source range that covers this entire preprocessed
90    /// entity.
91    SourceRange getSourceRange() const LLVM_READONLY { return Range; }
92
93    /// \brief Returns true if there was a problem loading the preprocessed
94    /// entity.
95    bool isInvalid() const { return Kind == InvalidKind; }
96
97    // Implement isa/cast/dyncast/etc.
98    static bool classof(const PreprocessedEntity *) { return true; }
99
100    // Only allow allocation of preprocessed entities using the allocator
101    // in PreprocessingRecord or by doing a placement new.
102    void* operator new(size_t bytes, PreprocessingRecord& PR,
103                       unsigned alignment = 8) throw() {
104      return ::operator new(bytes, PR, alignment);
105    }
106
107    void* operator new(size_t bytes, void* mem) throw() {
108      return mem;
109    }
110
111    void operator delete(void* ptr, PreprocessingRecord& PR,
112                         unsigned alignment) throw() {
113      return ::operator delete(ptr, PR, alignment);
114    }
115
116    void operator delete(void*, std::size_t) throw() { }
117    void operator delete(void*, void*) throw() { }
118
119  private:
120    // Make vanilla 'new' and 'delete' illegal for preprocessed entities.
121    void* operator new(size_t bytes) throw();
122    void operator delete(void* data) throw();
123  };
124
125  /// \brief Records the presence of a preprocessor directive.
126  class PreprocessingDirective : public PreprocessedEntity {
127  public:
128    PreprocessingDirective(EntityKind Kind, SourceRange Range)
129      : PreprocessedEntity(Kind, Range) { }
130
131    // Implement isa/cast/dyncast/etc.
132    static bool classof(const PreprocessedEntity *PD) {
133      return PD->getKind() >= FirstPreprocessingDirective &&
134             PD->getKind() <= LastPreprocessingDirective;
135    }
136    static bool classof(const PreprocessingDirective *) { return true; }
137  };
138
139  /// \brief Record the location of a macro definition.
140  class MacroDefinition : public PreprocessingDirective {
141    /// \brief The name of the macro being defined.
142    const IdentifierInfo *Name;
143
144  public:
145    explicit MacroDefinition(const IdentifierInfo *Name, SourceRange Range)
146      : PreprocessingDirective(MacroDefinitionKind, Range), Name(Name) { }
147
148    /// \brief Retrieve the name of the macro being defined.
149    const IdentifierInfo *getName() const { return Name; }
150
151    /// \brief Retrieve the location of the macro name in the definition.
152    SourceLocation getLocation() const { return getSourceRange().getBegin(); }
153
154    // Implement isa/cast/dyncast/etc.
155    static bool classof(const PreprocessedEntity *PE) {
156      return PE->getKind() == MacroDefinitionKind;
157    }
158    static bool classof(const MacroDefinition *) { return true; }
159  };
160
161  /// \brief Records the location of a macro expansion.
162  class MacroExpansion : public PreprocessedEntity {
163    /// \brief The definition of this macro or the name of the macro if it is
164    /// a builtin macro.
165    llvm::PointerUnion<IdentifierInfo *, MacroDefinition *> NameOrDef;
166
167  public:
168    MacroExpansion(IdentifierInfo *BuiltinName, SourceRange Range)
169      : PreprocessedEntity(MacroExpansionKind, Range),
170        NameOrDef(BuiltinName) { }
171
172    MacroExpansion(MacroDefinition *Definition, SourceRange Range)
173      : PreprocessedEntity(MacroExpansionKind, Range),
174        NameOrDef(Definition) { }
175
176    /// \brief True if it is a builtin macro.
177    bool isBuiltinMacro() const { return NameOrDef.is<IdentifierInfo *>(); }
178
179    /// \brief The name of the macro being expanded.
180    const IdentifierInfo *getName() const {
181      if (MacroDefinition *Def = getDefinition())
182        return Def->getName();
183      return NameOrDef.get<IdentifierInfo*>();
184    }
185
186    /// \brief The definition of the macro being expanded. May return null if
187    /// this is a builtin macro.
188    MacroDefinition *getDefinition() const {
189      return NameOrDef.dyn_cast<MacroDefinition *>();
190    }
191
192    // Implement isa/cast/dyncast/etc.
193    static bool classof(const PreprocessedEntity *PE) {
194      return PE->getKind() == MacroExpansionKind;
195    }
196    static bool classof(const MacroExpansion *) { return true; }
197  };
198
199  /// \brief Record the location of an inclusion directive, such as an
200  /// \c \#include or \c \#import statement.
201  class InclusionDirective : public PreprocessingDirective {
202  public:
203    /// \brief The kind of inclusion directives known to the
204    /// preprocessor.
205    enum InclusionKind {
206      /// \brief An \c \#include directive.
207      Include,
208      /// \brief An Objective-C \c \#import directive.
209      Import,
210      /// \brief A GNU \c \#include_next directive.
211      IncludeNext,
212      /// \brief A Clang \c \#__include_macros directive.
213      IncludeMacros
214    };
215
216  private:
217    /// \brief The name of the file that was included, as written in
218    /// the source.
219    StringRef FileName;
220
221    /// \brief Whether the file name was in quotation marks; otherwise, it was
222    /// in angle brackets.
223    unsigned InQuotes : 1;
224
225    /// \brief The kind of inclusion directive we have.
226    ///
227    /// This is a value of type InclusionKind.
228    unsigned Kind : 2;
229
230    /// \brief Whether the inclusion directive was automatically turned into
231    /// a module import.
232    unsigned ImportedModule : 1;
233
234    /// \brief The file that was included.
235    const FileEntry *File;
236
237  public:
238    InclusionDirective(PreprocessingRecord &PPRec,
239                       InclusionKind Kind, StringRef FileName,
240                       bool InQuotes, bool ImportedModule,
241                       const FileEntry *File, SourceRange Range);
242
243    /// \brief Determine what kind of inclusion directive this is.
244    InclusionKind getKind() const { return static_cast<InclusionKind>(Kind); }
245
246    /// \brief Retrieve the included file name as it was written in the source.
247    StringRef getFileName() const { return FileName; }
248
249    /// \brief Determine whether the included file name was written in quotes;
250    /// otherwise, it was written in angle brackets.
251    bool wasInQuotes() const { return InQuotes; }
252
253    /// \brief Determine whether the inclusion directive was automatically
254    /// turned into a module import.
255    bool importedModule() const { return ImportedModule; }
256
257    /// \brief Retrieve the file entry for the actual file that was included
258    /// by this directive.
259    const FileEntry *getFile() const { return File; }
260
261    // Implement isa/cast/dyncast/etc.
262    static bool classof(const PreprocessedEntity *PE) {
263      return PE->getKind() == InclusionDirectiveKind;
264    }
265    static bool classof(const InclusionDirective *) { return true; }
266  };
267
268  /// \brief An abstract class that should be subclassed by any external source
269  /// of preprocessing record entries.
270  class ExternalPreprocessingRecordSource {
271  public:
272    virtual ~ExternalPreprocessingRecordSource();
273
274    /// \brief Read a preallocated preprocessed entity from the external source.
275    ///
276    /// \returns null if an error occurred that prevented the preprocessed
277    /// entity from being loaded.
278    virtual PreprocessedEntity *ReadPreprocessedEntity(unsigned Index) = 0;
279
280    /// \brief Returns a pair of [Begin, End) indices of preallocated
281    /// preprocessed entities that \p Range encompasses.
282    virtual std::pair<unsigned, unsigned>
283        findPreprocessedEntitiesInRange(SourceRange Range) = 0;
284
285    /// \brief Optionally returns true or false if the preallocated preprocessed
286    /// entity with index \p Index came from file \p FID.
287    virtual llvm::Optional<bool> isPreprocessedEntityInFileID(unsigned Index,
288                                                              FileID FID) {
289      return llvm::Optional<bool>();
290    }
291  };
292
293  /// \brief A record of the steps taken while preprocessing a source file,
294  /// including the various preprocessing directives processed, macros
295  /// expanded, etc.
296  class PreprocessingRecord : public PPCallbacks {
297    SourceManager &SourceMgr;
298
299    /// \brief Allocator used to store preprocessing objects.
300    llvm::BumpPtrAllocator BumpAlloc;
301
302    /// \brief The set of preprocessed entities in this record, in order they
303    /// were seen.
304    std::vector<PreprocessedEntity *> PreprocessedEntities;
305
306    /// \brief The set of preprocessed entities in this record that have been
307    /// loaded from external sources.
308    ///
309    /// The entries in this vector are loaded lazily from the external source,
310    /// and are referenced by the iterator using negative indices.
311    std::vector<PreprocessedEntity *> LoadedPreprocessedEntities;
312
313    bool RecordCondDirectives;
314    unsigned CondDirectiveNextIdx;
315    SmallVector<unsigned, 6> CondDirectiveStack;
316
317    class CondDirectiveLoc {
318      SourceLocation Loc;
319      unsigned Idx;
320
321    public:
322      CondDirectiveLoc(SourceLocation Loc, unsigned Idx) : Loc(Loc), Idx(Idx) {}
323
324      SourceLocation getLoc() const { return Loc; }
325      unsigned getIdx() const { return Idx; }
326
327      class Comp {
328        SourceManager &SM;
329      public:
330        explicit Comp(SourceManager &SM) : SM(SM) {}
331        bool operator()(const CondDirectiveLoc &LHS,
332                        const CondDirectiveLoc &RHS) {
333          return SM.isBeforeInTranslationUnit(LHS.getLoc(), RHS.getLoc());
334        }
335        bool operator()(const CondDirectiveLoc &LHS, SourceLocation RHS) {
336          return SM.isBeforeInTranslationUnit(LHS.getLoc(), RHS);
337        }
338        bool operator()(SourceLocation LHS, const CondDirectiveLoc &RHS) {
339          return SM.isBeforeInTranslationUnit(LHS, RHS.getLoc());
340        }
341      };
342    };
343
344    typedef std::vector<CondDirectiveLoc> CondDirectiveLocsTy;
345    /// \brief The locations of conditional directives in source order.
346    CondDirectiveLocsTy CondDirectiveLocs;
347
348    void addCondDirectiveLoc(CondDirectiveLoc DirLoc);
349    unsigned findCondDirectiveIdx(SourceLocation Loc) const;
350
351    /// \brief Global (loaded or local) ID for a preprocessed entity.
352    /// Negative values are used to indicate preprocessed entities
353    /// loaded from the external source while non-negative values are used to
354    /// indicate preprocessed entities introduced by the current preprocessor.
355    /// Value -1 corresponds to element 0 in the loaded entities vector,
356    /// value -2 corresponds to element 1 in the loaded entities vector, etc.
357    /// Value 0 is an invalid value, the index to local entities is 1-based,
358    /// value 1 corresponds to element 0 in the local entities vector,
359    /// value 2 corresponds to element 1 in the local entities vector, etc.
360    class PPEntityID {
361      int ID;
362      explicit PPEntityID(int ID) : ID(ID) {}
363      friend class PreprocessingRecord;
364    public:
365      PPEntityID() : ID(0) {}
366    };
367
368    static PPEntityID getPPEntityID(unsigned Index, bool isLoaded) {
369      return isLoaded ? PPEntityID(-int(Index)-1) : PPEntityID(Index+1);
370    }
371
372    /// \brief Mapping from MacroInfo structures to their definitions.
373    llvm::DenseMap<const MacroInfo *, PPEntityID> MacroDefinitions;
374
375    /// \brief External source of preprocessed entities.
376    ExternalPreprocessingRecordSource *ExternalSource;
377
378    /// \brief Retrieve the preprocessed entity at the given ID.
379    PreprocessedEntity *getPreprocessedEntity(PPEntityID PPID);
380
381    /// \brief Retrieve the loaded preprocessed entity at the given index.
382    PreprocessedEntity *getLoadedPreprocessedEntity(unsigned Index);
383
384    /// \brief Determine the number of preprocessed entities that were
385    /// loaded (or can be loaded) from an external source.
386    unsigned getNumLoadedPreprocessedEntities() const {
387      return LoadedPreprocessedEntities.size();
388    }
389
390    /// \brief Returns a pair of [Begin, End) indices of local preprocessed
391    /// entities that \p Range encompasses.
392    std::pair<unsigned, unsigned>
393      findLocalPreprocessedEntitiesInRange(SourceRange Range) const;
394    unsigned findBeginLocalPreprocessedEntity(SourceLocation Loc) const;
395    unsigned findEndLocalPreprocessedEntity(SourceLocation Loc) const;
396
397    /// \brief Allocate space for a new set of loaded preprocessed entities.
398    ///
399    /// \returns The index into the set of loaded preprocessed entities, which
400    /// corresponds to the first newly-allocated entity.
401    unsigned allocateLoadedEntities(unsigned NumEntities);
402
403    /// \brief Register a new macro definition.
404    void RegisterMacroDefinition(MacroInfo *Macro, PPEntityID PPID);
405
406  public:
407    /// \brief Construct a new preprocessing record.
408    PreprocessingRecord(SourceManager &SM, bool RecordConditionalDirectives);
409
410    /// \brief Allocate memory in the preprocessing record.
411    void *Allocate(unsigned Size, unsigned Align = 8) {
412      return BumpAlloc.Allocate(Size, Align);
413    }
414
415    /// \brief Deallocate memory in the preprocessing record.
416    void Deallocate(void *Ptr) { }
417
418    size_t getTotalMemory() const;
419
420    SourceManager &getSourceManager() const { return SourceMgr; }
421
422    // Iteration over the preprocessed entities.
423    class iterator {
424      PreprocessingRecord *Self;
425
426      /// \brief Position within the preprocessed entity sequence.
427      ///
428      /// In a complete iteration, the Position field walks the range [-M, N),
429      /// where negative values are used to indicate preprocessed entities
430      /// loaded from the external source while non-negative values are used to
431      /// indicate preprocessed entities introduced by the current preprocessor.
432      /// However, to provide iteration in source order (for, e.g., chained
433      /// precompiled headers), dereferencing the iterator flips the negative
434      /// values (corresponding to loaded entities), so that position -M
435      /// corresponds to element 0 in the loaded entities vector, position -M+1
436      /// corresponds to element 1 in the loaded entities vector, etc. This
437      /// gives us a reasonably efficient, source-order walk.
438      int Position;
439
440    public:
441      typedef PreprocessedEntity *value_type;
442      typedef value_type&         reference;
443      typedef value_type*         pointer;
444      typedef std::random_access_iterator_tag iterator_category;
445      typedef int                 difference_type;
446
447      iterator() : Self(0), Position(0) { }
448
449      iterator(PreprocessingRecord *Self, int Position)
450        : Self(Self), Position(Position) { }
451
452      value_type operator*() const {
453        bool isLoaded = Position < 0;
454        unsigned Index = isLoaded ?
455            Self->LoadedPreprocessedEntities.size() + Position : Position;
456        PPEntityID ID = Self->getPPEntityID(Index, isLoaded);
457        return Self->getPreprocessedEntity(ID);
458      }
459
460      value_type operator[](difference_type D) {
461        return *(*this + D);
462      }
463
464      iterator &operator++() {
465        ++Position;
466        return *this;
467      }
468
469      iterator operator++(int) {
470        iterator Prev(*this);
471        ++Position;
472        return Prev;
473      }
474
475      iterator &operator--() {
476        --Position;
477        return *this;
478      }
479
480      iterator operator--(int) {
481        iterator Prev(*this);
482        --Position;
483        return Prev;
484      }
485
486      friend bool operator==(const iterator &X, const iterator &Y) {
487        return X.Position == Y.Position;
488      }
489
490      friend bool operator!=(const iterator &X, const iterator &Y) {
491        return X.Position != Y.Position;
492      }
493
494      friend bool operator<(const iterator &X, const iterator &Y) {
495        return X.Position < Y.Position;
496      }
497
498      friend bool operator>(const iterator &X, const iterator &Y) {
499        return X.Position > Y.Position;
500      }
501
502      friend bool operator<=(const iterator &X, const iterator &Y) {
503        return X.Position < Y.Position;
504      }
505
506      friend bool operator>=(const iterator &X, const iterator &Y) {
507        return X.Position > Y.Position;
508      }
509
510      friend iterator& operator+=(iterator &X, difference_type D) {
511        X.Position += D;
512        return X;
513      }
514
515      friend iterator& operator-=(iterator &X, difference_type D) {
516        X.Position -= D;
517        return X;
518      }
519
520      friend iterator operator+(iterator X, difference_type D) {
521        X.Position += D;
522        return X;
523      }
524
525      friend iterator operator+(difference_type D, iterator X) {
526        X.Position += D;
527        return X;
528      }
529
530      friend difference_type operator-(const iterator &X, const iterator &Y) {
531        return X.Position - Y.Position;
532      }
533
534      friend iterator operator-(iterator X, difference_type D) {
535        X.Position -= D;
536        return X;
537      }
538      friend class PreprocessingRecord;
539    };
540    friend class iterator;
541
542    /// \brief Begin iterator for all preprocessed entities.
543    iterator begin() {
544      return iterator(this, -(int)LoadedPreprocessedEntities.size());
545    }
546
547    /// \brief End iterator for all preprocessed entities.
548    iterator end() {
549      return iterator(this, PreprocessedEntities.size());
550    }
551
552    /// \brief Begin iterator for local, non-loaded, preprocessed entities.
553    iterator local_begin() {
554      return iterator(this, 0);
555    }
556
557    /// \brief End iterator for local, non-loaded, preprocessed entities.
558    iterator local_end() {
559      return iterator(this, PreprocessedEntities.size());
560    }
561
562    /// \brief begin/end iterator pair for the given range of loaded
563    /// preprocessed entities.
564    std::pair<iterator, iterator>
565    getIteratorsForLoadedRange(unsigned start, unsigned count) {
566      unsigned end = start + count;
567      assert(end <= LoadedPreprocessedEntities.size());
568      return std::make_pair(
569                   iterator(this, int(start)-LoadedPreprocessedEntities.size()),
570                   iterator(this, int(end)-LoadedPreprocessedEntities.size()));
571    }
572
573    /// \brief Returns a pair of [Begin, End) iterators of preprocessed entities
574    /// that source range \p R encompasses.
575    ///
576    /// \param R the range to look for preprocessed entities.
577    ///
578    std::pair<iterator, iterator> getPreprocessedEntitiesInRange(SourceRange R);
579
580    /// \brief Returns true if the preprocessed entity that \p PPEI iterator
581    /// points to is coming from the file \p FID.
582    ///
583    /// Can be used to avoid implicit deserializations of preallocated
584    /// preprocessed entities if we only care about entities of a specific file
585    /// and not from files \#included in the range given at
586    /// \see getPreprocessedEntitiesInRange.
587    bool isEntityInFileID(iterator PPEI, FileID FID);
588
589    /// \brief Add a new preprocessed entity to this record.
590    PPEntityID addPreprocessedEntity(PreprocessedEntity *Entity);
591
592    /// \brief Returns true if this PreprocessingRecord is keeping track of
593    /// conditional directives locations.
594    bool isRecordingConditionalDirectives() const {
595      return RecordCondDirectives;
596    }
597
598    /// \brief Returns true if the given range intersects with a conditional
599    /// directive. if a \#if/\#endif block is fully contained within the range,
600    /// this function will return false.
601    bool rangeIntersectsConditionalDirective(SourceRange Range) const;
602
603    /// \brief Returns true if the given locations are in different regions,
604    /// separated by conditional directive blocks.
605    bool areInDifferentConditionalDirectiveRegion(SourceLocation LHS,
606                                                  SourceLocation RHS) const {
607      return findCondDirectiveIdx(LHS) != findCondDirectiveIdx(RHS);
608    }
609
610    /// \brief Set the external source for preprocessed entities.
611    void SetExternalSource(ExternalPreprocessingRecordSource &Source);
612
613    /// \brief Retrieve the external source for preprocessed entities.
614    ExternalPreprocessingRecordSource *getExternalSource() const {
615      return ExternalSource;
616    }
617
618    /// \brief Retrieve the macro definition that corresponds to the given
619    /// \c MacroInfo.
620    MacroDefinition *findMacroDefinition(const MacroInfo *MI);
621
622  private:
623    virtual void MacroExpands(const Token &Id, const MacroInfo* MI,
624                              SourceRange Range);
625    virtual void MacroDefined(const Token &Id, const MacroInfo *MI);
626    virtual void MacroUndefined(const Token &Id, const MacroInfo *MI);
627    virtual void InclusionDirective(SourceLocation HashLoc,
628                                    const Token &IncludeTok,
629                                    StringRef FileName,
630                                    bool IsAngled,
631                                    CharSourceRange FilenameRange,
632                                    const FileEntry *File,
633                                    StringRef SearchPath,
634                                    StringRef RelativePath,
635                                    const Module *Imported);
636    virtual void If(SourceLocation Loc, SourceRange ConditionRange);
637    virtual void Elif(SourceLocation Loc, SourceRange ConditionRange,
638                      SourceLocation IfLoc);
639    virtual void Ifdef(SourceLocation Loc, const Token &MacroNameTok);
640    virtual void Ifndef(SourceLocation Loc, const Token &MacroNameTok);
641    virtual void Else(SourceLocation Loc, SourceLocation IfLoc);
642    virtual void Endif(SourceLocation Loc, SourceLocation IfLoc);
643
644    /// \brief Cached result of the last \see getPreprocessedEntitiesInRange
645    /// query.
646    struct {
647      SourceRange Range;
648      std::pair<int, int> Result;
649    } CachedRangeQuery;
650
651    std::pair<int, int> getPreprocessedEntitiesInRangeSlow(SourceRange R);
652
653    friend class ASTReader;
654    friend class ASTWriter;
655  };
656} // end namespace clang
657
658inline void* operator new(size_t bytes, clang::PreprocessingRecord& PR,
659                          unsigned alignment) throw() {
660  return PR.Allocate(bytes, alignment);
661}
662
663inline void operator delete(void* ptr, clang::PreprocessingRecord& PR,
664                            unsigned) throw() {
665  PR.Deallocate(ptr);
666}
667
668#endif // LLVM_CLANG_LEX_PREPROCESSINGRECORD_H
669