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