Setting LangOpts flags

Hi all,

I’m working on a language that uses many C constructs, but is not a strict superset or subset of C, so some of the keywords exist and some do not. My changes so far have been:

  1. Add an enum to lib/Basic/IdentifierTable.cpp:
    namespace {
    enum {

    KEYFOO = 0x1000,
    KEYALL = 0x0fff // Do not at KEYFOO to all

  2. Add all of the keywords I wanted to include/clang/Basic/TokenKinds.def:
    KEYWORD(atomic , KEYALL)

  3. Add a language option to include/clang/Basic/LangOptions.def:
    LANGOPT(FOO , 1, 0, “FooQua”)

When I include KEYFOO in KEYALL, the keyword “foo” is found, but I want to keep the keyword list separate. How can I change the LangOptions Flag to only look for KEYFOO keywords?


You can hack up AddKeyword in IdentifierTable.cpp . Or just delete
the C keywords you don't want. :slight_smile: