clang  6.0.0svn
DeclarationName.h
Go to the documentation of this file.
1 //===-- DeclarationName.h - Representation of declaration names -*- 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 declares the DeclarationName and DeclarationNameTable classes.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_AST_DECLARATIONNAME_H
14 #define LLVM_CLANG_AST_DECLARATIONNAME_H
15 
18 #include "llvm/Support/Compiler.h"
19 
20 namespace llvm {
21  template <typename T> struct DenseMapInfo;
22 }
23 
24 namespace clang {
25  class ASTContext;
26  class CXXDeductionGuideNameExtra;
27  class CXXLiteralOperatorIdName;
28  class CXXOperatorIdName;
29  class CXXSpecialName;
30  class DeclarationNameExtra;
31  class IdentifierInfo;
32  class MultiKeywordSelector;
33  enum OverloadedOperatorKind : int;
34  struct PrintingPolicy;
35  class QualType;
36  class TemplateDecl;
37  class Type;
38  class TypeSourceInfo;
39  class UsingDirectiveDecl;
40 
41  template <typename> class CanQual;
42  typedef CanQual<Type> CanQualType;
43 
44 /// DeclarationName - The name of a declaration. In the common case,
45 /// this just stores an IdentifierInfo pointer to a normal
46 /// name. However, it also provides encodings for Objective-C
47 /// selectors (optimizing zero- and one-argument selectors, which make
48 /// up 78% percent of all selectors in Cocoa.h) and special C++ names
49 /// for constructors, destructors, and conversion functions.
51 public:
52  /// NameKind - The kind of name this object contains.
53  enum NameKind {
64  CXXUsingDirective
65  };
66  static const unsigned NumNameKinds = CXXUsingDirective + 1;
67 
68 private:
69  /// StoredNameKind - The kind of name that is actually stored in the
70  /// upper bits of the Ptr field. This is only used internally.
71  ///
72  /// Note: The entries here are synchronized with the entries in Selector,
73  /// for efficient translation between the two.
74  enum StoredNameKind {
75  StoredIdentifier = 0,
76  StoredObjCZeroArgSelector = 0x01,
77  StoredObjCOneArgSelector = 0x02,
78  StoredDeclarationNameExtra = 0x03,
79  PtrMask = 0x03
80  };
81 
82  /// Ptr - The lowest two bits are used to express what kind of name
83  /// we're actually storing, using the values of NameKind. Depending
84  /// on the kind of name this is, the upper bits of Ptr may have one
85  /// of several different meanings:
86  ///
87  /// StoredIdentifier - The name is a normal identifier, and Ptr is
88  /// a normal IdentifierInfo pointer.
89  ///
90  /// StoredObjCZeroArgSelector - The name is an Objective-C
91  /// selector with zero arguments, and Ptr is an IdentifierInfo
92  /// pointer pointing to the selector name.
93  ///
94  /// StoredObjCOneArgSelector - The name is an Objective-C selector
95  /// with one argument, and Ptr is an IdentifierInfo pointer
96  /// pointing to the selector name.
97  ///
98  /// StoredDeclarationNameExtra - Ptr is actually a pointer to a
99  /// DeclarationNameExtra structure, whose first value will tell us
100  /// whether this is an Objective-C selector, C++ operator-id name,
101  /// or special C++ name.
102  uintptr_t Ptr;
103 
104  /// getStoredNameKind - Return the kind of object that is stored in
105  /// Ptr.
106  StoredNameKind getStoredNameKind() const {
107  return static_cast<StoredNameKind>(Ptr & PtrMask);
108  }
109 
110  /// getExtra - Get the "extra" information associated with this
111  /// multi-argument selector or C++ special name.
112  DeclarationNameExtra *getExtra() const {
113  assert(getStoredNameKind() == StoredDeclarationNameExtra &&
114  "Declaration name does not store an Extra structure");
115  return reinterpret_cast<DeclarationNameExtra *>(Ptr & ~PtrMask);
116  }
117 
118  /// getAsCXXSpecialName - If the stored pointer is actually a
119  /// CXXSpecialName, returns a pointer to it. Otherwise, returns
120  /// a NULL pointer.
121  CXXSpecialName *getAsCXXSpecialName() const {
122  NameKind Kind = getNameKind();
123  if (Kind >= CXXConstructorName && Kind <= CXXConversionFunctionName)
124  return reinterpret_cast<CXXSpecialName *>(getExtra());
125  return nullptr;
126  }
127 
128  /// If the stored pointer is actually a CXXDeductionGuideNameExtra, returns a
129  /// pointer to it. Otherwise, returns a NULL pointer.
130  CXXDeductionGuideNameExtra *getAsCXXDeductionGuideNameExtra() const {
131  if (getNameKind() == CXXDeductionGuideName)
132  return reinterpret_cast<CXXDeductionGuideNameExtra *>(getExtra());
133  return nullptr;
134  }
135 
136  /// getAsCXXOperatorIdName
137  CXXOperatorIdName *getAsCXXOperatorIdName() const {
138  if (getNameKind() == CXXOperatorName)
139  return reinterpret_cast<CXXOperatorIdName *>(getExtra());
140  return nullptr;
141  }
142 
143  CXXLiteralOperatorIdName *getAsCXXLiteralOperatorIdName() const {
144  if (getNameKind() == CXXLiteralOperatorName)
145  return reinterpret_cast<CXXLiteralOperatorIdName *>(getExtra());
146  return nullptr;
147  }
148 
149  // Construct a declaration name from the name of a C++ constructor,
150  // destructor, or conversion function.
152  : Ptr(reinterpret_cast<uintptr_t>(Name)) {
153  assert((Ptr & PtrMask) == 0 && "Improperly aligned DeclarationNameExtra");
154  Ptr |= StoredDeclarationNameExtra;
155  }
156 
157  /// Construct a declaration name from a raw pointer.
158  DeclarationName(uintptr_t Ptr) : Ptr(Ptr) { }
159 
160  friend class DeclarationNameTable;
161  friend class NamedDecl;
162 
163  /// getFETokenInfoAsVoidSlow - Retrieves the front end-specified pointer
164  /// for this name as a void pointer if it's not an identifier.
165  void *getFETokenInfoAsVoidSlow() const;
166 
167 public:
168  /// DeclarationName - Used to create an empty selector.
169  DeclarationName() : Ptr(0) { }
170 
171  // Construct a declaration name from an IdentifierInfo *.
173  : Ptr(reinterpret_cast<uintptr_t>(II)) {
174  assert((Ptr & PtrMask) == 0 && "Improperly aligned IdentifierInfo");
175  }
176 
177  // Construct a declaration name from an Objective-C selector.
178  DeclarationName(Selector Sel) : Ptr(Sel.InfoPtr) { }
179 
180  /// getUsingDirectiveName - Return name for all using-directives.
181  static DeclarationName getUsingDirectiveName();
182 
183  // operator bool() - Evaluates true when this declaration name is
184  // non-empty.
185  explicit operator bool() const {
186  return ((Ptr & PtrMask) != 0) ||
187  (reinterpret_cast<IdentifierInfo *>(Ptr & ~PtrMask));
188  }
189 
190  /// \brief Evaluates true when this declaration name is empty.
191  bool isEmpty() const {
192  return !*this;
193  }
194 
195  /// Predicate functions for querying what type of name this is.
196  bool isIdentifier() const { return getStoredNameKind() == StoredIdentifier; }
197  bool isObjCZeroArgSelector() const {
198  return getStoredNameKind() == StoredObjCZeroArgSelector;
199  }
200  bool isObjCOneArgSelector() const {
201  return getStoredNameKind() == StoredObjCOneArgSelector;
202  }
203 
204  /// getNameKind - Determine what kind of name this is.
205  NameKind getNameKind() const;
206 
207  /// \brief Determines whether the name itself is dependent, e.g., because it
208  /// involves a C++ type that is itself dependent.
209  ///
210  /// Note that this does not capture all of the notions of "dependent name",
211  /// because an identifier can be a dependent name if it is used as the
212  /// callee in a call expression with dependent arguments.
213  bool isDependentName() const;
214 
215  /// getNameAsString - Retrieve the human-readable string for this name.
216  std::string getAsString() const;
217 
218  /// getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in
219  /// this declaration name, or NULL if this declaration name isn't a
220  /// simple identifier.
222  if (isIdentifier())
223  return reinterpret_cast<IdentifierInfo *>(Ptr);
224  return nullptr;
225  }
226 
227  /// getAsOpaqueInteger - Get the representation of this declaration
228  /// name as an opaque integer.
229  uintptr_t getAsOpaqueInteger() const { return Ptr; }
230 
231  /// getAsOpaquePtr - Get the representation of this declaration name as
232  /// an opaque pointer.
233  void *getAsOpaquePtr() const { return reinterpret_cast<void*>(Ptr); }
234 
236  DeclarationName N;
237  N.Ptr = reinterpret_cast<uintptr_t> (P);
238  return N;
239  }
240 
242  DeclarationName N;
243  N.Ptr = P;
244  return N;
245  }
246 
247  /// getCXXNameType - If this name is one of the C++ names (of a
248  /// constructor, destructor, or conversion function), return the
249  /// type associated with that name.
250  QualType getCXXNameType() const;
251 
252  /// If this name is the name of a C++ deduction guide, return the
253  /// template associated with that name.
254  TemplateDecl *getCXXDeductionGuideTemplate() const;
255 
256  /// getCXXOverloadedOperator - If this name is the name of an
257  /// overloadable operator in C++ (e.g., @c operator+), retrieve the
258  /// kind of overloaded operator.
259  OverloadedOperatorKind getCXXOverloadedOperator() const;
260 
261  /// getCXXLiteralIdentifier - If this name is the name of a literal
262  /// operator, retrieve the identifier associated with it.
263  IdentifierInfo *getCXXLiteralIdentifier() const;
264 
265  /// getObjCSelector - Get the Objective-C selector stored in this
266  /// declaration name.
268  assert((getNameKind() == ObjCZeroArgSelector ||
269  getNameKind() == ObjCOneArgSelector ||
270  getNameKind() == ObjCMultiArgSelector ||
271  Ptr == 0) && "Not a selector!");
272  return Selector(Ptr);
273  }
274 
275  /// getFETokenInfo/setFETokenInfo - The language front-end is
276  /// allowed to associate arbitrary metadata with some kinds of
277  /// declaration names, including normal identifiers and C++
278  /// constructors, destructors, and conversion functions.
279  template<typename T>
280  T *getFETokenInfo() const {
281  if (const IdentifierInfo *Info = getAsIdentifierInfo())
282  return Info->getFETokenInfo<T>();
283  return static_cast<T*>(getFETokenInfoAsVoidSlow());
284  }
285 
286  void setFETokenInfo(void *T);
287 
288  /// operator== - Determine whether the specified names are identical..
290  return LHS.Ptr == RHS.Ptr;
291  }
292 
293  /// operator!= - Determine whether the specified names are different.
295  return LHS.Ptr != RHS.Ptr;
296  }
297 
299  return DeclarationName(uintptr_t(-1));
300  }
301 
303  return DeclarationName(uintptr_t(-2));
304  }
305 
306  static int compare(DeclarationName LHS, DeclarationName RHS);
307 
308  void print(raw_ostream &OS, const PrintingPolicy &Policy);
309 
310  void dump() const;
311 };
312 
313 raw_ostream &operator<<(raw_ostream &OS, DeclarationName N);
314 
315 /// Ordering on two declaration names. If both names are identifiers,
316 /// this provides a lexicographical ordering.
318  return DeclarationName::compare(LHS, RHS) < 0;
319 }
320 
321 /// Ordering on two declaration names. If both names are identifiers,
322 /// this provides a lexicographical ordering.
324  return DeclarationName::compare(LHS, RHS) > 0;
325 }
326 
327 /// Ordering on two declaration names. If both names are identifiers,
328 /// this provides a lexicographical ordering.
330  return DeclarationName::compare(LHS, RHS) <= 0;
331 }
332 
333 /// Ordering on two declaration names. If both names are identifiers,
334 /// this provides a lexicographical ordering.
336  return DeclarationName::compare(LHS, RHS) >= 0;
337 }
338 
339 /// DeclarationNameTable - Used to store and retrieve DeclarationName
340 /// instances for the various kinds of declaration names, e.g., normal
341 /// identifiers, C++ constructor names, etc. This class contains
342 /// uniqued versions of each of the C++ special names, which can be
343 /// retrieved using its member functions (e.g.,
344 /// getCXXConstructorName).
346  const ASTContext &Ctx;
347  void *CXXSpecialNamesImpl; // Actually a FoldingSet<CXXSpecialName> *
348  CXXOperatorIdName *CXXOperatorNames; // Operator names
349  void *CXXLiteralOperatorNames; // Actually a CXXOperatorIdName*
350  void *CXXDeductionGuideNames; // FoldingSet<CXXDeductionGuideNameExtra> *
351 
353  void operator=(const DeclarationNameTable&) = delete;
354 
355 public:
358 
359  /// getIdentifier - Create a declaration name that is a simple
360  /// identifier.
362  return DeclarationName(ID);
363  }
364 
365  /// getCXXConstructorName - Returns the name of a C++ constructor
366  /// for the given Type.
367  DeclarationName getCXXConstructorName(CanQualType Ty);
368 
369  /// getCXXDestructorName - Returns the name of a C++ destructor
370  /// for the given Type.
371  DeclarationName getCXXDestructorName(CanQualType Ty);
372 
373  /// Returns the name of a C++ deduction guide for the given template.
374  DeclarationName getCXXDeductionGuideName(TemplateDecl *TD);
375 
376  /// getCXXConversionFunctionName - Returns the name of a C++
377  /// conversion function for the given Type.
378  DeclarationName getCXXConversionFunctionName(CanQualType Ty);
379 
380  /// getCXXSpecialName - Returns a declaration name for special kind
381  /// of C++ name, e.g., for a constructor, destructor, or conversion
382  /// function.
384  CanQualType Ty);
385 
386  /// getCXXOperatorName - Get the name of the overloadable C++
387  /// operator corresponding to Op.
388  DeclarationName getCXXOperatorName(OverloadedOperatorKind Op);
389 
390  /// getCXXLiteralOperatorName - Get the name of the literal operator function
391  /// with II as the identifier.
392  DeclarationName getCXXLiteralOperatorName(IdentifierInfo *II);
393 };
394 
395 /// DeclarationNameLoc - Additional source/type location info
396 /// for a declaration name. Needs a DeclarationName in order
397 /// to be interpreted correctly.
399  // The source location for identifier stored elsewhere.
400  // struct {} Identifier;
401 
402  // Type info for constructors, destructors and conversion functions.
403  // Locations (if any) for the tilde (destructor) or operator keyword
404  // (conversion) are stored elsewhere.
405  struct NT {
407  };
408 
409  // The location (if any) of the operator keyword is stored elsewhere.
410  struct CXXOpName {
411  unsigned BeginOpNameLoc;
412  unsigned EndOpNameLoc;
413  };
414 
415  // The location (if any) of the operator keyword is stored elsewhere.
416  struct CXXLitOpName {
417  unsigned OpNameLoc;
418  };
419 
420  // struct {} CXXUsingDirective;
421  // struct {} ObjCZeroArgSelector;
422  // struct {} ObjCOneArgSelector;
423  // struct {} ObjCMultiArgSelector;
424  union {
425  struct NT NamedType;
426  struct CXXOpName CXXOperatorName;
427  struct CXXLitOpName CXXLiteralOperatorName;
428  };
429 
431  // FIXME: this should go away once all DNLocs are properly initialized.
432  DeclarationNameLoc() { memset((void*) this, 0, sizeof(*this)); }
433 }; // struct DeclarationNameLoc
434 
435 
436 /// DeclarationNameInfo - A collector data type for bundling together
437 /// a DeclarationName and the correspnding source/type location info.
439 private:
440  /// Name - The declaration name, also encoding name kind.
441  DeclarationName Name;
442  /// Loc - The main source location for the declaration name.
443  SourceLocation NameLoc;
444  /// Info - Further source/type location info for special kinds of names.
445  DeclarationNameLoc LocInfo;
446 
447 public:
448  // FIXME: remove it.
450 
452  : Name(Name), NameLoc(NameLoc), LocInfo(Name) {}
453 
455  DeclarationNameLoc LocInfo)
456  : Name(Name), NameLoc(NameLoc), LocInfo(LocInfo) {}
457 
458  /// getName - Returns the embedded declaration name.
459  DeclarationName getName() const { return Name; }
460  /// setName - Sets the embedded declaration name.
461  void setName(DeclarationName N) { Name = N; }
462 
463  /// getLoc - Returns the main location of the declaration name.
464  SourceLocation getLoc() const { return NameLoc; }
465  /// setLoc - Sets the main location of the declaration name.
466  void setLoc(SourceLocation L) { NameLoc = L; }
467 
468  const DeclarationNameLoc &getInfo() const { return LocInfo; }
469  DeclarationNameLoc &getInfo() { return LocInfo; }
470  void setInfo(const DeclarationNameLoc &Info) { LocInfo = Info; }
471 
472  /// getNamedTypeInfo - Returns the source type info associated to
473  /// the name. Assumes it is a constructor, destructor or conversion.
475  assert(Name.getNameKind() == DeclarationName::CXXConstructorName ||
476  Name.getNameKind() == DeclarationName::CXXDestructorName ||
477  Name.getNameKind() == DeclarationName::CXXConversionFunctionName);
478  return LocInfo.NamedType.TInfo;
479  }
480  /// setNamedTypeInfo - Sets the source type info associated to
481  /// the name. Assumes it is a constructor, destructor or conversion.
483  assert(Name.getNameKind() == DeclarationName::CXXConstructorName ||
484  Name.getNameKind() == DeclarationName::CXXDestructorName ||
485  Name.getNameKind() == DeclarationName::CXXConversionFunctionName);
486  LocInfo.NamedType.TInfo = TInfo;
487  }
488 
489  /// getCXXOperatorNameRange - Gets the range of the operator name
490  /// (without the operator keyword). Assumes it is a (non-literal) operator.
492  assert(Name.getNameKind() == DeclarationName::CXXOperatorName);
493  return SourceRange(
494  SourceLocation::getFromRawEncoding(LocInfo.CXXOperatorName.BeginOpNameLoc),
495  SourceLocation::getFromRawEncoding(LocInfo.CXXOperatorName.EndOpNameLoc)
496  );
497  }
498  /// setCXXOperatorNameRange - Sets the range of the operator name
499  /// (without the operator keyword). Assumes it is a C++ operator.
501  assert(Name.getNameKind() == DeclarationName::CXXOperatorName);
504  }
505 
506  /// getCXXLiteralOperatorNameLoc - Returns the location of the literal
507  /// operator name (not the operator keyword).
508  /// Assumes it is a literal operator.
510  assert(Name.getNameKind() == DeclarationName::CXXLiteralOperatorName);
511  return SourceLocation::
512  getFromRawEncoding(LocInfo.CXXLiteralOperatorName.OpNameLoc);
513  }
514  /// setCXXLiteralOperatorNameLoc - Sets the location of the literal
515  /// operator name (not the operator keyword).
516  /// Assumes it is a literal operator.
518  assert(Name.getNameKind() == DeclarationName::CXXLiteralOperatorName);
520  }
521 
522  /// \brief Determine whether this name involves a template parameter.
523  bool isInstantiationDependent() const;
524 
525  /// \brief Determine whether this name contains an unexpanded
526  /// parameter pack.
527  bool containsUnexpandedParameterPack() const;
528 
529  /// getAsString - Retrieve the human-readable string for this name.
530  std::string getAsString() const;
531 
532  /// printName - Print the human-readable name to a stream.
533  void printName(raw_ostream &OS) const;
534 
535  /// getBeginLoc - Retrieve the location of the first token.
536  SourceLocation getBeginLoc() const { return NameLoc; }
537  /// getEndLoc - Retrieve the location of the last token.
538  SourceLocation getEndLoc() const;
539  /// getSourceRange - The range of the declaration name.
540  SourceRange getSourceRange() const LLVM_READONLY {
541  return SourceRange(getLocStart(), getLocEnd());
542  }
543  SourceLocation getLocStart() const LLVM_READONLY {
544  return getBeginLoc();
545  }
546  SourceLocation getLocEnd() const LLVM_READONLY {
547  SourceLocation EndLoc = getEndLoc();
548  return EndLoc.isValid() ? EndLoc : getLocStart();
549  }
550 };
551 
552 /// Insertion operator for diagnostics. This allows sending DeclarationName's
553 /// into a diagnostic with <<.
555  DeclarationName N) {
557  DiagnosticsEngine::ak_declarationname);
558  return DB;
559 }
560 
561 /// Insertion operator for partial diagnostics. This allows binding
562 /// DeclarationName's into a partial diagnostic with <<.
564  DeclarationName N) {
566  DiagnosticsEngine::ak_declarationname);
567  return PD;
568 }
569 
570 inline raw_ostream &operator<<(raw_ostream &OS,
571  DeclarationNameInfo DNInfo) {
572  DNInfo.printName(OS);
573  return OS;
574 }
575 
576 } // end namespace clang
577 
578 namespace llvm {
579 /// Define DenseMapInfo so that DeclarationNames can be used as keys
580 /// in DenseMap and DenseSets.
581 template<>
582 struct DenseMapInfo<clang::DeclarationName> {
585  }
586 
589  }
590 
591  static unsigned getHashValue(clang::DeclarationName Name) {
593  }
594 
595  static inline bool
597  return LHS == RHS;
598  }
599 };
600 
601 template <>
602 struct isPodLike<clang::DeclarationName> { static const bool value = true; };
603 
604 } // end namespace llvm
605 
606 #endif
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
void setInfo(const DeclarationNameLoc &Info)
Smart pointer class that efficiently represents Objective-C method names.
CXXSpecialName - Records the type associated with one of the "special" kinds of declaration names in ...
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
A (possibly-)qualified type.
Definition: Type.h:614
static bool isEqual(clang::DeclarationName LHS, clang::DeclarationName RHS)
NameKind
NameKind - The kind of name this object contains.
SourceRange getCXXOperatorNameRange() const
getCXXOperatorNameRange - Gets the range of the operator name (without the operator keyword)...
const DeclarationNameLoc & getInfo() const
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:26
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
Selector getObjCSelector() const
getObjCSelector - Get the Objective-C selector stored in this declaration name.
StringRef P
SourceLocation getBeginLoc() const
getBeginLoc - Retrieve the location of the first token.
A container of type source information.
Definition: Decl.h:62
bool isEmpty() const
Evaluates true when this declaration name is empty.
void setCXXLiteralOperatorNameLoc(SourceLocation Loc)
setCXXLiteralOperatorNameLoc - Sets the location of the literal operator name (not the operator keywo...
void * getAsOpaquePtr() const
getAsOpaquePtr - Get the representation of this declaration name as an opaque pointer.
Describes how types, statements, expressions, and declarations should be printed. ...
Definition: PrettyPrinter.h:38
bool operator<=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
CXXOperatorIdName - Contains extra information for the name of an overloaded operator in C++...
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
Definition: Diagnostic.h:1067
One of these records is kept for each identifier that is lexed.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:128
void setName(DeclarationName N)
setName - Sets the embedded declaration name.
friend bool operator==(DeclarationName LHS, DeclarationName RHS)
operator== - Determine whether the specified names are identical..
static DeclarationName getFromOpaquePtr(void *P)
bool operator>(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
DeclarationNameExtra - Common base of the MultiKeywordSelector, CXXSpecialName, and CXXOperatorIdName...
void setCXXOperatorNameRange(SourceRange R)
setCXXOperatorNameRange - Sets the range of the operator name (without the operator keyword)...
uintptr_t getAsOpaqueInteger() const
getAsOpaqueInteger - Get the representation of this declaration name as an opaque integer...
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
DeclarationName(const IdentifierInfo *II)
static clang::DeclarationName getTombstoneKey()
static unsigned getHashValue(clang::DeclarationName Name)
NameKind getNameKind() const
getNameKind - Determine what kind of name this is.
A little helper class used to produce diagnostics.
Definition: Diagnostic.h:953
Contains extra information for the name of a C++ deduction guide.
llvm::StringRef getAsString(SyncScope S)
Definition: SyncScope.h:51
static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y)
const FunctionProtoType * T
friend bool operator!=(DeclarationName LHS, DeclarationName RHS)
operator!= - Determine whether the specified names are different.
DeclarationNameTable - Used to store and retrieve DeclarationName instances for the various kinds of ...
DeclarationName(Selector Sel)
#define bool
Definition: stdbool.h:31
static clang::DeclarationName getEmptyKey()
TypeSourceInfo * getNamedTypeInfo() const
getNamedTypeInfo - Returns the source type info associated to the name.
static DeclarationName getFromOpaqueInteger(uintptr_t P)
IdentifierInfo * getAsIdentifierInfo() const
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn&#39;t a simple identifier.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
SourceLocation getLocEnd() const LLVM_READONLY
bool isIdentifier() const
Predicate functions for querying what type of name this is.
SourceLocation getEnd() const
struct CXXOpName CXXOperatorName
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Definition: opencl-c.h:82
DeclarationNameInfo(DeclarationName Name, SourceLocation NameLoc)
T * getFETokenInfo() const
getFETokenInfo/setFETokenInfo - The language front-end is allowed to associate arbitrary metadata wit...
bool isObjCOneArgSelector() const
Kind
Encodes a location in the source.
DeclarationName getName() const
getName - Returns the embedded declaration name.
DeclarationName getIdentifier(const IdentifierInfo *ID)
getIdentifier - Create a declaration name that is a simple identifier.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
bool operator>=(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
void printName(raw_ostream &OS) const
printName - Print the human-readable name to a stream.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getLocStart() const LLVM_READONLY
DeclarationNameInfo(DeclarationName Name, SourceLocation NameLoc, DeclarationNameLoc LocInfo)
The base class of all kinds of template declarations (e.g., class, function, etc.).
Definition: DeclTemplate.h:378
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
Definition: OperatorKinds.h:22
DeclarationName - The name of a declaration.
DeclarationNameLoc & getInfo()
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
DeclarationName()
DeclarationName - Used to create an empty selector.
struct CXXLitOpName CXXLiteralOperatorName
SourceRange getSourceRange() const LLVM_READONLY
getSourceRange - The range of the declaration name.
static DeclarationName getTombstoneMarker()
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
CXXLiteralOperatorName - Contains the actual identifier that makes up the name.
void setNamedTypeInfo(TypeSourceInfo *TInfo)
setNamedTypeInfo - Sets the source type info associated to the name.
static raw_ostream & operator<<(raw_ostream &os, const clang::ento::MemRegion *R)
Definition: MemRegion.h:1425
SourceLocation getCXXLiteralOperatorNameLoc() const
getCXXLiteralOperatorNameLoc - Returns the location of the literal operator name (not the operator ke...
void setLoc(SourceLocation L)
setLoc - Sets the main location of the declaration name.
A trivial tuple used to represent a source range.
NamedDecl - This represents a decl with a name.
Definition: Decl.h:213
static DeclarationName getEmptyMarker()
SourceLocation getBegin() const
bool isObjCZeroArgSelector() const