clang API Documentation

Defines | Enumerations | Functions
CGExprScalar.cpp File Reference
#include "CodeGenFunction.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CodeGenModule.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include <cstdarg>
Include dependency graph for CGExprScalar.cpp:

Go to the source code of this file.

Defines

#define HANDLEBINOP(OP)
#define VISITCOMP(CODE, UI, SI, FP)
#define COMPOUND_OP(Op)

Enumerations

enum  IntrinsicType { VCMPEQ, VCMPGT }

Functions

static llvm::Constant * getMaskElt (llvm::ShuffleVectorInst *SVI, unsigned Idx, unsigned Off, llvm::Type *I32Ty)
static bool ShouldNullCheckClassCastValue (const CastExpr *CE)
static ValueemitPointerArithmetic (CodeGenFunction &CGF, const BinOpInfo &op, bool isSubtraction)
 Emit pointer + index arithmetic.
static ValuebuildFMulAdd (llvm::BinaryOperator *MulOp, Value *Addend, const CodeGenFunction &CGF, CGBuilderTy &Builder, bool negMul, bool negAdd)
static ValuetryEmitFMulAdd (const BinOpInfo &op, const CodeGenFunction &CGF, CGBuilderTy &Builder, bool isSub=false)
static llvm::Intrinsic::ID GetIntrinsic (IntrinsicType IT, BuiltinType::Kind ElemKind)
static bool isCheapEnoughToEvaluateUnconditionally (const Expr *E, CodeGenFunction &CGF)

Define Documentation

#define COMPOUND_OP (   Op)
Value:
case BO_##Op##Assign:                                                     \
      return Scalar.EmitCompoundAssignLValue(E, &ScalarExprEmitter::Emit##Op, \
                                             Result)

Referenced by clang::CodeGen::CodeGenFunction::EmitCompoundAssignmentLValue().

#define HANDLEBINOP (   OP)
Value:
Value *VisitBin ## OP(const BinaryOperator *E) {                         \
    return Emit ## OP(EmitBinOps(E));                                      \
  }                                                                        \
  Value *VisitBin ## OP ## Assign(const CompoundAssignOperator *E) {       \
    return EmitCompoundAssign(E, &ScalarExprEmitter::Emit ## OP);          \
  }

Definition at line 506 of file CGExprScalar.cpp.

#define VISITCOMP (   CODE,
  UI,
  SI,
  FP 
)
Value:
Value *VisitBin##CODE(const BinaryOperator *E) { \
      return EmitCompare(E, llvm::ICmpInst::UI, llvm::ICmpInst::SI, \
                         llvm::FCmpInst::FP); }

Definition at line 528 of file CGExprScalar.cpp.


Enumeration Type Documentation

Enumerator:
VCMPEQ 
VCMPGT 

Definition at line 2733 of file CGExprScalar.cpp.


Function Documentation

static Value* buildFMulAdd ( llvm::BinaryOperator *  MulOp,
Value Addend,
const CodeGenFunction CGF,
CGBuilderTy Builder,
bool  negMul,
bool  negAdd 
) [static]
static Value* emitPointerArithmetic ( CodeGenFunction CGF,
const BinOpInfo &  op,
bool  isSubtraction 
) [static]
static llvm::Intrinsic::ID GetIntrinsic ( IntrinsicType  IT,
BuiltinType::Kind  ElemKind 
) [static]

Definition at line 2735 of file CGExprScalar.cpp.

References VCMPEQ.

static llvm::Constant* getMaskElt ( llvm::ShuffleVectorInst *  SVI,
unsigned  Idx,
unsigned  Off,
llvm::Type *  I32Ty 
) [static]

Definition at line 1132 of file CGExprScalar.cpp.

static bool isCheapEnoughToEvaluateUnconditionally ( const Expr E,
CodeGenFunction CGF 
) [static]

isCheapEnoughToEvaluateUnconditionally - Return true if the specified expression is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally. This is used to convert control flow into selects in some cases.

Definition at line 3145 of file CGExprScalar.cpp.

References clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::IgnoreParens(), and clang::Expr::isEvaluatable().

static bool ShouldNullCheckClassCastValue ( const CastExpr CE) [static]
static Value* tryEmitFMulAdd ( const BinOpInfo &  op,
const CodeGenFunction CGF,
CGBuilderTy Builder,
bool  isSub = false 
) [static]