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 |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () 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 StringRef | getOpcodeStr (Opcode Op) |
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to, e.g. "sizeof" or "[pre]++". | |
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) |
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 1754 of file Expr.h.
References clang::Stmt::getStmtClass().
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.
Definition at line 1752 of file Expr.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitComplexPrePostIncDec().
SourceLocation clang::UnaryOperator::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1749 of file Expr.h.
References clang::Stmt::getLocEnd(), and isPostfix().
SourceLocation clang::UnaryOperator::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 1746 of file Expr.h.
References clang::Stmt::getLocStart(), and isPostfix().
Opcode clang::UnaryOperator::getOpcode | ( | ) | const [inline] |
Definition at line 1687 of file Expr.h.
Referenced by CheckICE(), diagnoseLogicalNotOnLHSofComparison(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), EvalAddr(), EvalVal(), getPrimaryDecl(), isArithmeticOp(), isConfigurationValue(), clang::Expr::isConstantInitializer(), isDecrementOp(), isIdenticalStmt(), isIncrementDecrementOp(), isIncrementOp(), isPostfix(), isPrefix(), clang::Expr::isUnusedResultAWarning(), clang::ento::ExprEngine::Visit(), clang::ento::ConditionBRVisitor::VisitTrueTest(), clang::ASTNodeImporter::VisitUnaryOperator(), clang::ento::ExprEngine::VisitUnaryOperator(), clang::consumed::ConsumedStmtVisitor::VisitUnaryOperator(), and clang::threadSafety::BuildLockset::VisitUnaryOperator().
StringRef 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 1061 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.
Referenced by clang::Sema::CreateOverloadedUnaryOp().
SourceLocation clang::UnaryOperator::getOperatorLoc | ( | ) | const [inline] |
getOperatorLoc - Return the location of the operator.
Definition at line 1694 of file Expr.h.
Referenced by diagnoseLogicalNotOnLHSofComparison(), 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 1081 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 1095 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(), and clang::Sema::CreateOverloadedUnaryOp().
Expr* clang::UnaryOperator::getSubExpr | ( | ) | const [inline] |
Definition at line 1690 of file Expr.h.
Referenced by CheckICE(), diagnoseLogicalNotOnLHSofComparison(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), EvalAddr(), EvalVal(), clang::CodeGen::CodeGenModule::getMemberPointerConstant(), getPrimaryDecl(), GetUnreachableLoc(), isConfigurationValue(), clang::Expr::isConstantInitializer(), clang::Expr::isUnusedResultAWarning(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ConditionBRVisitor::VisitTrueTest(), clang::ASTNodeImporter::VisitUnaryOperator(), clang::ento::ExprEngine::VisitUnaryOperator(), clang::consumed::ConsumedStmtVisitor::VisitUnaryOperator(), and clang::threadSafety::BuildLockset::VisitUnaryOperator().
static bool clang::UnaryOperator::isArithmeticOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1729 of file Expr.h.
References clang::UO_LNot, and clang::UO_Plus.
bool clang::UnaryOperator::isArithmeticOp | ( | ) | const [inline] |
Definition at line 1732 of file Expr.h.
References getOpcode(), and isArithmeticOp().
Referenced by isArithmeticOp().
static bool clang::UnaryOperator::isDecrementOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1717 of file Expr.h.
References clang::UO_PostDec, and clang::UO_PreDec.
bool clang::UnaryOperator::isDecrementOp | ( | ) | const [inline] |
Definition at line 1720 of file Expr.h.
References getOpcode().
static bool clang::UnaryOperator::isIncrementDecrementOp | ( | Opcode | Op | ) | [inline, static] |
Definition at line 1724 of file Expr.h.
References clang::UO_PreDec.
Referenced by clang::ento::ExprEngine::VisitIncrementDecrementOperator().
bool clang::UnaryOperator::isIncrementDecrementOp | ( | ) | const [inline] |
Definition at line 1725 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 1710 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 1713 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 1698 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 1708 of file Expr.h.
References getOpcode(), and isPostfix().
Referenced by getLocEnd(), getLocStart(), 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 1703 of file Expr.h.
References clang::UO_PreDec, and clang::UO_PreInc.
bool clang::UnaryOperator::isPrefix | ( | ) | const [inline] |
Definition at line 1707 of file Expr.h.
References getOpcode(), and isPrefix().
Referenced by isPrefix().
void clang::UnaryOperator::setOpcode | ( | Opcode | O | ) | [inline] |
void clang::UnaryOperator::setOperatorLoc | ( | SourceLocation | L | ) | [inline] |
void clang::UnaryOperator::setSubExpr | ( | Expr * | E | ) | [inline] |