diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-24 03:55:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-24 03:55:14 +0000 |
commit | ca63fa00786e51c207c829f4182f11a6c6b552be (patch) | |
tree | 34e3a6ebeaa746676b09a865d373be8fda627f37 /include/clang/Basic/IdentifierTable.h | |
parent | 6bb816a3b895e9c983d89b22d510dca58a0eb75e (diff) |
Two more Windows-related fixes:
- More enum signeness bitfield fixes (MSVC treats enums as signed).
- Fixed in Lex/HeaderSearch.cpp an unsafe copy between two
HeaderSearch::PerFileInfo entries in a common vector. The copy involved two
calls to getFileInfo() within the assignment; these calls could have
side-effects that enlarged the internal vector, and with MSVC this would
invalidate one of the values in the assignment.
Patch by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 97119261d9..fa3143f656 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -40,7 +40,8 @@ class IdentifierInfo { // signed char and TokenKinds > 127 won't be handled correctly. unsigned TokenID : 8; // Front-end token ID or tok::identifier. unsigned BuiltinID : 9; // ID if this is a builtin (__builtin_inf). - tok::ObjCKeywordKind ObjCID : 5; // ID for objc @ keyword like @'protocol'. + // NOTE: VC++ treats enums as signed, avoid using tok::ObjCKeywordKind enum + unsigned ObjCID : 5; // ID for objc @ keyword like @'protocol'. bool HasMacro : 1; // True if there is a #define for this. bool IsExtension : 1; // True if identifier is a lang extension. bool IsPoisoned : 1; // True if identifier is poisoned. @@ -91,7 +92,9 @@ public: /// getObjCKeywordID - Return the Objective-C keyword ID for the this /// identifier. For example, 'class' will return tok::objc_class if ObjC is /// enabled. - tok::ObjCKeywordKind getObjCKeywordID() const { return ObjCID; } + tok::ObjCKeywordKind getObjCKeywordID() const { + return tok::ObjCKeywordKind(ObjCID); + } void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCID = ID; } /// getBuiltinID - Return a value indicating whether this is a builtin |