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