Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/include/clang/Lex/Token.h
Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | bool getFlag(TokenFlags Flag) const { | ||||
return (Flags & Flag) != 0; | return (Flags & Flag) != 0; | ||||
} | } | ||||
/// Unset the specified flag. | /// Unset the specified flag. | ||||
void clearFlag(TokenFlags Flag) { | void clearFlag(TokenFlags Flag) { | ||||
Flags &= ~Flag; | Flags &= ~Flag; | ||||
} | } | ||||
/// Return the internal represtation of the flags. | /// Return the internal representation of the flags. | ||||
/// | /// | ||||
/// This is only intended for low-level operations such as writing tokens to | /// This is only intended for low-level operations such as writing tokens to | ||||
/// disk. | /// disk. | ||||
unsigned getFlags() const { | unsigned getFlags() const { | ||||
return Flags; | return Flags; | ||||
} | } | ||||
/// Set the internal representation of the flags. | |||||
/// | |||||
/// This is only intended for low-level operations such as writing tokens to | |||||
/// disk. | |||||
void setFlags(unsigned Flags) { | |||||
this->Flags = Flags; | |||||
} | |||||
/// Set a flag to either true or false. | /// Set a flag to either true or false. | ||||
void setFlagValue(TokenFlags Flag, bool Val) { | void setFlagValue(TokenFlags Flag, bool Val) { | ||||
if (Val) | if (Val) | ||||
setFlag(Flag); | setFlag(Flag); | ||||
else | else | ||||
clearFlag(Flag); | clearFlag(Flag); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |