clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions
clang::UnaryOperator Class Reference

#include <Expr.h>

Inheritance diagram for clang::UnaryOperator:
Inheritance graph
[legend]
Collaboration diagram for clang::UnaryOperator:
Collaboration graph
[legend]

List of all members.

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)
ExprgetSubExpr () 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)

Detailed Description

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.

Definition at line 1663 of file Expr.h.


Member Typedef Documentation

Definition at line 1665 of file Expr.h.


Constructor & Destructor Documentation

clang::UnaryOperator::UnaryOperator ( Expr input,
Opcode  opc,
QualType  type,
ExprValueKind  VK,
ExprObjectKind  OK,
SourceLocation  l 
) [inline]

Definition at line 1673 of file Expr.h.

clang::UnaryOperator::UnaryOperator ( EmptyShell  Empty) [inline, explicit]

Build an empty unary operator.

Definition at line 1684 of file Expr.h.


Member Function Documentation

Reimplemented from clang::Stmt.

Definition at line 1759 of file Expr.h.

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().

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().

Reimplemented from clang::Stmt.

Definition at line 1749 of file Expr.h.

References clang::Stmt::getLocEnd(), and isPostfix().

Reimplemented from clang::Stmt.

Definition at line 1746 of file Expr.h.

References clang::Stmt::getLocStart(), and isPostfix().

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().

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().

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().

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().

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.

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.

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().

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 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().

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.

Definition at line 1707 of file Expr.h.

References getOpcode(), and isPrefix().

Referenced by isPrefix().

Definition at line 1688 of file Expr.h.

Definition at line 1695 of file Expr.h.

void clang::UnaryOperator::setSubExpr ( Expr E) [inline]

Definition at line 1691 of file Expr.h.


The documentation for this class was generated from the following files: