Bang Operator

Hello all,

I don’t find anything helping me understand the llvm bang operator. In the llvm TableGen language reference, it only says:

'TableGen also has “bang operators” which have a wide variety of meanings:

I would be very thankful if someone can explain it to me.

e.g. what does “!strconcat” or “!if” mean?

Cheers

ES

Those are defined in the "Language Introduction":

http://llvm.org/docs/TableGen/LangIntro.html#tablegen-values-and-expressions

Not sure why we have things split into three separate pages:

  * TableGen - http://llvm.org/docs/TableGen/index.html

  * Introduction - http://llvm.org/docs/TableGen/LangIntro.html

  * Reference - http://llvm.org/docs/TableGen/LangRef.html

I consistently find myself lost between those pages.

-- Meador

Thanks Meador,

The confusion point for me is that, does ! as an operator (bang operator) add any meaning to the strconcat?

No. All "functions" like strconcat are preceded with !
You can consider it a part of the name.

-Krzysztof

> Hello all,
>
> I don't find anything helping me understand the llvm bang operator. In
the
> llvm TableGen language reference, it only says:
>
> 'TableGen also has “bang operators” which have a wide variety of
meanings:'
>
> I would be very thankful if someone can explain it to me.
>
> e.g. what does "!strconcat" or "!if" mean?

Those are defined in the "Language Introduction":

http://llvm.org/docs/TableGen/LangIntro.html#tablegen-values-and-expressions

Not sure why we have things split into three separate pages:

  * TableGen - http://llvm.org/docs/TableGen/index.html

  * Introduction - http://llvm.org/docs/TableGen/LangIntro.html

  * Reference - http://llvm.org/docs/TableGen/LangRef.html

index is about TableGen as a whole (i.e. what you might use it for, why you
would use it for that, etc.).
LangIntro is about how to use the language itself (irrespective of any
particular backend).
LangRef is a dry language reference (i.e. that you would look at or update
if modifying lib/TableGen).

Unless you are hacking in lib/TableGen, you should not need to be looking
at LangRef too much, except to maybe get an idea about the precise syntax
for a construct when you get a syntax error.

LangRef currently is mostly about syntax; there remains work to be done to
fully cover the semantics of the various constructs.

-- Sean Silva