clang API Documentation
#include <Expr.h>


Public Types | |
| typedef UnaryOperatorKind | Opcode |
Public Member Functions | |
| UnaryOperator (Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l) | |
| UnaryOperator (EmptyShell Empty) | |
| Build an empty unary operator. | |
| Opcode | getOpcode () const |
| void | setOpcode (Opcode O) |
| Expr * | getSubExpr () const |
| void | setSubExpr (Expr *E) |
| SourceLocation | getOperatorLoc () const |
| getOperatorLoc - Return the location of the operator. | |
| void | setOperatorLoc (SourceLocation L) |
| bool | isPrefix () const |
| bool | isPostfix () const |
| bool | isIncrementOp () const |
| bool | isDecrementOp () const |
| bool | isIncrementDecrementOp () const |
| bool | isArithmeticOp () const |
| SourceRange | getSourceRange () const LLVM_READONLY |
| SourceLocation | getExprLoc () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static bool | isPostfix (Opcode Op) |
| isPostfix - Return true if this is a postfix operation, like x++. | |
| static bool | isPrefix (Opcode Op) |
| isPrefix - Return true if this is a prefix operation, like --x. | |
| static bool | isIncrementOp (Opcode Op) |
| static bool | isDecrementOp (Opcode Op) |
| static bool | isIncrementDecrementOp (Opcode Op) |
| static bool | isArithmeticOp (Opcode Op) |
| static const char * | getOpcodeStr (Opcode Op) |
| static Opcode | getOverloadedOpcode (OverloadedOperatorKind OO, bool Postfix) |
| Retrieve the unary opcode that corresponds to the given overloaded operator. | |
| static OverloadedOperatorKind | getOverloadedOperator (Opcode Opc) |
| Retrieve the overloaded operator kind that corresponds to the given unary opcode. | |
| static bool | classof (const Stmt *T) |
| static bool | classof (const UnaryOperator *) |
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Notes on various nodes:
Real/Imag - These return the real/imag part of a complex operand. If applied to a non-complex value, the former returns its operand and the later returns zero in the type of the operand.
| clang::UnaryOperator::UnaryOperator | ( | Expr * | input, |
| Opcode | opc, | ||
| QualType | type, | ||
| ExprValueKind | VK, | ||
| ExprObjectKind | OK, | ||
| SourceLocation | l | ||
| ) | [inline] |
| clang::UnaryOperator::UnaryOperator | ( | EmptyShell | Empty | ) | [inline, explicit] |
| child_range clang::UnaryOperator::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
| static bool clang::UnaryOperator::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 1617 of file Expr.h.
References clang::Stmt::getStmtClass().
| static bool clang::UnaryOperator::classof | ( | const UnaryOperator * | ) | [inline, static] |
| SourceLocation clang::UnaryOperator::getExprLoc | ( | ) | const [inline] |
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic expression.
Reimplemented from clang::Expr.
| Opcode clang::UnaryOperator::getOpcode | ( | ) | const [inline] |
Definition at line 1550 of file Expr.h.
Referenced by CheckICE(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), EvalAddr(), EvalVal(), getPrimaryDecl(), isArithmeticOp(), clang::Expr::isConstantInitializer(), isDecrementOp(), isIncrementDecrementOp(), isIncrementOp(), isPostfix(), isPrefix(), clang::Expr::isUnusedResultAWarning(), clang::ento::ConditionBRVisitor::VisitTrueTest(), and clang::ASTNodeImporter::VisitUnaryOperator().
| const char * UnaryOperator::getOpcodeStr | ( | Opcode | Op | ) | [static] |
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to, e.g. "sizeof" or "[pre]++"
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to, e.g. "sizeof" or "[pre]++".
Definition at line 740 of file Expr.cpp.
References clang::UO_AddrOf, clang::UO_Deref, clang::UO_Extension, clang::UO_Imag, clang::UO_LNot, clang::UO_Minus, clang::UO_Not, clang::UO_Plus, clang::UO_PostDec, clang::UO_PostInc, clang::UO_PreDec, clang::UO_PreInc, and clang::UO_Real.
| SourceLocation clang::UnaryOperator::getOperatorLoc | ( | ) | const [inline] |
getOperatorLoc - Return the location of the operator.
Definition at line 1557 of file Expr.h.
Referenced by GetUnreachableLoc(), clang::Expr::isUnusedResultAWarning(), and clang::ASTNodeImporter::VisitUnaryOperator().
| UnaryOperatorKind UnaryOperator::getOverloadedOpcode | ( | OverloadedOperatorKind | OO, |
| bool | Postfix | ||
| ) | [static] |
Retrieve the unary opcode that corresponds to the given overloaded operator.
Definition at line 760 of file Expr.cpp.
References clang::UO_AddrOf, clang::UO_Deref, clang::UO_LNot, clang::UO_Minus, clang::UO_Not, clang::UO_Plus, clang::UO_PostDec, clang::UO_PostInc, clang::UO_PreDec, and clang::UO_PreInc.
Referenced by clang::TreeTransform< Derived >::RebuildCXXOperatorCallExpr().
| OverloadedOperatorKind UnaryOperator::getOverloadedOperator | ( | Opcode | Opc | ) | [static] |
Retrieve the overloaded operator kind that corresponds to the given unary opcode.
Definition at line 774 of file Expr.cpp.
References clang::OO_None, clang::UO_AddrOf, clang::UO_Deref, clang::UO_LNot, clang::UO_Minus, clang::UO_Not, clang::UO_Plus, clang::UO_PostDec, clang::UO_PostInc, clang::UO_PreDec, and clang::UO_PreInc.
Referenced by clang::Sema::BuildUnaryOp().
| SourceRange clang::UnaryOperator::getSourceRange | ( | ) | const [inline] |
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.
Reimplemented from clang::Stmt.
Definition at line 1609 of file Expr.h.
References clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), and isPostfix().
| Expr* clang::UnaryOperator::getSubExpr | ( | ) | const [inline] |
Definition at line 1553 of file Expr.h.
Referenced by CheckICE(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), EvalAddr(), EvalVal(), clang::CodeGen::CodeGenModule::getMemberPointerConstant(), getPrimaryDecl(), GetUnreachableLoc(), clang::Expr::isConstantInitializer(), clang::Expr::isUnusedResultAWarning(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ConditionBRVisitor::VisitTrueTest(), and clang::ASTNodeImporter::VisitUnaryOperator().
| static bool clang::UnaryOperator::isArithmeticOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1592 of file Expr.h.
References clang::UO_LNot, and clang::UO_Plus.
| bool clang::UnaryOperator::isArithmeticOp | ( | ) | const [inline] |
Definition at line 1595 of file Expr.h.
References getOpcode(), and isArithmeticOp().
Referenced by isArithmeticOp().
| static bool clang::UnaryOperator::isDecrementOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1580 of file Expr.h.
References clang::UO_PostDec, and clang::UO_PreDec.
| bool clang::UnaryOperator::isDecrementOp | ( | ) | const [inline] |
Definition at line 1583 of file Expr.h.
References getOpcode().
| static bool clang::UnaryOperator::isIncrementDecrementOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1587 of file Expr.h.
References clang::UO_PreDec.
Referenced by clang::ento::ExprEngine::VisitIncrementDecrementOperator().
| bool clang::UnaryOperator::isIncrementDecrementOp | ( | ) | const [inline] |
Definition at line 1588 of file Expr.h.
References getOpcode().
Referenced by clang::Sema::BuildUnaryOp(), and clang::Sema::checkPseudoObjectIncDec().
| static bool clang::UnaryOperator::isIncrementOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1573 of file Expr.h.
References clang::UO_PostInc, and clang::UO_PreInc.
Referenced by clang::ento::ExprEngine::VisitIncrementDecrementOperator().
| bool clang::UnaryOperator::isIncrementOp | ( | ) | const [inline] |
Definition at line 1576 of file Expr.h.
References getOpcode().
| static bool clang::UnaryOperator::isPostfix | ( | Opcode | Op | ) | [inline, static] |
isPostfix - Return true if this is a postfix operation, like x++.
Definition at line 1561 of file Expr.h.
References clang::UO_PostDec, and clang::UO_PostInc.
Referenced by clang::ento::ExprEngine::VisitIncrementDecrementOperator().
| bool clang::UnaryOperator::isPostfix | ( | ) | const [inline] |
Definition at line 1571 of file Expr.h.
References getOpcode(), and isPostfix().
Referenced by getSourceRange(), and isPostfix().
| static bool clang::UnaryOperator::isPrefix | ( | Opcode | Op | ) | [inline, static] |
isPrefix - Return true if this is a prefix operation, like --x.
Definition at line 1566 of file Expr.h.
References clang::UO_PreDec, and clang::UO_PreInc.
| bool clang::UnaryOperator::isPrefix | ( | ) | const [inline] |
Definition at line 1570 of file Expr.h.
References getOpcode(), and isPrefix().
Referenced by isPrefix().
| void clang::UnaryOperator::setOperatorLoc | ( | SourceLocation | L | ) | [inline] |