diff options
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 03533f87b9..27697df76c 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -83,24 +83,26 @@ public: /// const char *getName() 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<IdentifierInfo, const char*>, where internal pointer // points to the external string data. - return ((std::pair<IdentifierInfo, const char*>*) this)->second + 4; + return ((std::pair<IdentifierInfo, const char*>*) this)->second; } /// getLength - 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<IdentifierInfo, const char*>, where internal pointer // points to the external string data. - const char* p = ((std::pair<IdentifierInfo, const char*>*) this)->second; - return ((unsigned) p[0]) - | (((unsigned) p[1]) << 8) - | (((unsigned) p[2]) << 16) - | (((unsigned) p[3]) << 24); + const char* p = ((std::pair<IdentifierInfo, const char*>*) this)->second-2; + return (((unsigned) p[0]) + | (((unsigned) p[1]) << 8)) - 1; } /// hasMacroDefinition - Return true if this identifier is #defined to some |