Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save PlloYNiiE/874072 to your computer and use it in GitHub Desktop.

Select an option

Save PlloYNiiE/874072 to your computer and use it in GitHub Desktop.
SieveStatementPrinter::VisitBinaryOperator.cpp
void SieveStatementPrinter::VisitBinaryOperator(BinaryOperator *E) {
//Indent(level, " Visiting Binary Operator");
/*
//RhsDR->getDecl();
if (E->isAssignmentOp()) {
if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(E->getLHS())) {
if (VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
if (VD->hasInit()) {
llvm::outs() << "----- HAS INIT" << "\n";
llvm::outs() << VD->getNameAsString() << "<<---->>" << VD->getType().getAsString() << "\n" ;
}
else {
llvm::outs() << "+++++ NO INIT" << "\n";
llvm::outs() << VD->getNameAsString() << "<<---->>" << VD->getType().getAsString() << "\n" ;
}
Expr* RHS = E->getRHS()->IgnoreParenCasts();
if (DeclRefExpr* RhsDR = dyn_cast<DeclRefExpr>(RHS))
{
llvm::outs() << " CASTED RHS \n";
if (VD == dyn_cast<VarDecl>(RhsDR->getDecl()))
{
llvm::outs() << " RhsDR == VD \n";
}
}
else
{
llvm::outs() << " CANT CAST RHS \n";
}
}
}
}
if (E->isAdditiveOp()) {
llvm::outs() << " ++++++ ADD ++++ \n";
}
if (E->isComparisonOp()) {
llvm::outs() << " ====== COMPARE ===== \n";
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment