Index: include/clang/Basic/IdentifierTable.h =================================================================== --- include/clang/Basic/IdentifierTable.h +++ include/clang/Basic/IdentifierTable.h @@ -116,10 +116,19 @@ llvm::StringMapEntry *Entry = nullptr; + IdentifierInfo() + : TokenID(tok::identifier), ObjCOrBuiltinID(0), HasMacro(false), + HadMacro(false), IsExtension(false), IsFutureCompatKeyword(false), + IsPoisoned(false), IsCPPOperatorKeyword(false), + NeedsHandleIdentifier(false), IsFromAST(false), ChangedAfterLoad(false), + FEChangedAfterLoad(false), RevertedTokenID(false), OutOfDate(false), + IsModulesImport(false) {} + public: - IdentifierInfo(); IdentifierInfo(const IdentifierInfo &) = delete; IdentifierInfo &operator=(const IdentifierInfo &) = delete; + IdentifierInfo(IdentifierInfo &&) = delete; + IdentifierInfo &operator=(IdentifierInfo &&) = delete; /// Return true if this is the identifier for the specified string. /// @@ -138,31 +147,10 @@ /// Return the beginning of the actual null-terminated string for this /// identifier. - const char *getNameStart() const { - if (Entry) return Entry->getKeyData(); - // FIXME: This is gross. It would be best not to embed specific details - // of the PTH file format here. - // The 'this' pointer really points to a - // std::pair, where internal pointer - // points to the external string data. - using actualtype = std::pair; - - return ((const actualtype*) this)->second; - } + const char *getNameStart() const { return Entry->getKeyData(); } /// Efficiently return the length of this identifier info. - unsigned getLength() const { - if (Entry) return Entry->getKeyLength(); - // FIXME: This is gross. It would be best not to embed specific details - // of the PTH file format here. - // The 'this' pointer really points to a - // std::pair, where internal pointer - // points to the external string data. - using actualtype = std::pair; - - const char* p = ((const actualtype*) this)->second - 2; - return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1; - } + unsigned getLength() const { return Entry->getKeyLength(); } /// Return the actual identifier string. StringRef getName() const { Index: lib/Basic/IdentifierTable.cpp =================================================================== --- lib/Basic/IdentifierTable.cpp +++ lib/Basic/IdentifierTable.cpp @@ -34,28 +34,6 @@ using namespace clang; //===----------------------------------------------------------------------===// -// IdentifierInfo Implementation -//===----------------------------------------------------------------------===// - -IdentifierInfo::IdentifierInfo() { - TokenID = tok::identifier; - ObjCOrBuiltinID = 0; - HasMacro = false; - HadMacro = false; - IsExtension = false; - IsFutureCompatKeyword = false; - IsPoisoned = false; - IsCPPOperatorKeyword = false; - NeedsHandleIdentifier = false; - IsFromAST = false; - ChangedAfterLoad = false; - FEChangedAfterLoad = false; - RevertedTokenID = false; - OutOfDate = false; - IsModulesImport = false; -} - -//===----------------------------------------------------------------------===// // IdentifierTable Implementation //===----------------------------------------------------------------------===//