[cfe-dev] Setting LangOpts flags

Jeff Heckey jheckey at gmail.com
Thu Oct 25 14:25:56 PDT 2012


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(break             , KEYALL|KEYFOO)
KEYWORD(foo                , KEYFOO)
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?*

-Thanks,
-Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121025/d134777e/attachment.html>


More information about the cfe-dev mailing list