clang API Documentation

Defines | Functions
CodeGenFunction.cpp File Reference
#include "CodeGenFunction.h"
#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGOpenMPRuntime.h"
#include "CodeGenModule.h"
#include "CodeGenPGO.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Operator.h"
#include "clang/AST/TypeNodes.def"
Include dependency graph for CodeGenFunction.cpp:

Go to the source code of this file.

Defines

#define TYPE(name, parent)
#define ABSTRACT_TYPE(name, parent)
#define NON_CANONICAL_TYPE(name, parent)   case Type::name:
#define DEPENDENT_TYPE(name, parent)   case Type::name:
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(name, parent)   case Type::name:
#define TYPE(Class, Base)
#define ABSTRACT_TYPE(Class, Base)
#define NON_CANONICAL_TYPE(Class, Base)
#define DEPENDENT_TYPE(Class, Base)   case Type::Class:
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base)
#define PreserveNames   true

Functions

static void EmitIfUsed (CodeGenFunction &CGF, llvm::BasicBlock *BB)
static void GenOpenCLArgMetadata (const FunctionDecl *FD, llvm::Function *Fn, CodeGenModule &CGM, llvm::LLVMContext &Context, SmallVector< llvm::Value *, 5 > &kernelMDArgs, CGBuilderTy &Builder, ASTContext &ASTCtx)
static bool endsWithReturn (const Decl *F)
 Determine whether the function F ends with a return stmt.
static void TryMarkNoThrow (llvm::Function *F)
static void EmitSizedDeallocationFunction (CodeGenFunction &CGF, const FunctionDecl *UnsizedDealloc)
static void emitNonZeroVLAInit (CodeGenFunction &CGF, QualType baseType, llvm::Value *dest, llvm::Value *src, llvm::Value *sizeInChars)

Define Documentation

#define ABSTRACT_TYPE (   name,
  parent 
)
#define ABSTRACT_TYPE (   Class,
  Base 
)
#define DEPENDENT_TYPE (   name,
  parent 
)    case Type::name:
#define DEPENDENT_TYPE (   Class,
  Base 
)    case Type::Class:
#define NON_CANONICAL_TYPE (   name,
  parent 
)    case Type::name:
#define NON_CANONICAL_TYPE (   Class,
  Base 
)
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE (   name,
  parent 
)    case Type::name:
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE (   Class,
  Base 
)
#define PreserveNames   true

Definition at line 1729 of file CodeGenFunction.cpp.

#define TYPE (   name,
  parent 
)
#define TYPE (   Class,
  Base 
)

Function Documentation

static void EmitIfUsed ( CodeGenFunction CGF,
llvm::BasicBlock *  BB 
) [static]
static void emitNonZeroVLAInit ( CodeGenFunction CGF,
QualType  baseType,
llvm::Value dest,
llvm::Value src,
llvm::Value sizeInChars 
) [static]

emitNonZeroVLAInit - Emit the "zero" initialization of a variable-length array whose elements have a non-zero bit-pattern.

Parameters:
baseTypethe inner-most element type of the array
src- a char* pointing to the bit-pattern for a single base element of the array
sizeInChars- the total size of the VLA, in chars

Definition at line 1198 of file CodeGenFunction.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getTypeInfoInChars(), and clang::CodeGen::CodeGenTypeCache::IntPtrTy.

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

static void EmitSizedDeallocationFunction ( CodeGenFunction CGF,
const FunctionDecl UnsizedDealloc 
) [static]
static bool endsWithReturn ( const Decl F) [static]

Determine whether the function F ends with a return stmt.

Definition at line 547 of file CodeGenFunction.cpp.

References clang::FunctionDecl::getBody().

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

static void GenOpenCLArgMetadata ( const FunctionDecl FD,
llvm::Function *  Fn,
CodeGenModule CGM,
llvm::LLVMContext &  Context,
SmallVector< llvm::Value *, 5 > &  kernelMDArgs,
CGBuilderTy Builder,
ASTContext ASTCtx 
) [static]
static void TryMarkNoThrow ( llvm::Function *  F) [static]

Tries to mark the given function nounwind based on the non-existence of any throwing calls within it. We believe this is lightweight enough to do at -O0.

Definition at line 781 of file CodeGenFunction.cpp.

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