[cfe-users] binary operator

Csaba Raduly via cfe-users cfe-users at lists.llvm.org
Tue Jul 12 10:31:31 PDT 2016

Hi Folkert,

On Tue, Jul 12, 2016 at 1:46 PM, folkert via cfe-users wrote:
> Hi,
> When iterating through the AST I encounter BinaryOperator-s, part of an
> IfStmt.
> My question now is: how can I find which operator it is? E.g. ==, >=,
> etc.
> I'm using libclang.

You can call BinaryOperator::getOpcode, which will return an Opcode,
which is a typedef of the BinaryOperatorKind enum.

GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

More information about the cfe-users mailing list