clang 20.0.0git
Functions
CGVTables.cpp File Reference
#include "CGCXXABI.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Support/Format.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include <algorithm>
#include <cstdio>
#include <utility>

Go to the source code of this file.

Functions

static void setThunkProperties (CodeGenModule &CGM, const ThunkInfo &Thunk, llvm::Function *ThunkFn, bool ForVTable, GlobalDecl GD)
 
static bool similar (const ABIArgInfo &infoL, CanQualType typeL, const ABIArgInfo &infoR, CanQualType typeR)
 
static RValue PerformReturnAdjustment (CodeGenFunction &CGF, QualType ResultType, RValue RV, const ThunkInfo &Thunk)
 
static void resolveTopLevelMetadata (llvm::Function *Fn, llvm::ValueToValueMapTy &VMap)
 This function clones a function's DISubprogram node and enters it into a value map with the intent that the map can be utilized by the cloner to short-circuit Metadata node mapping.
 
static bool shouldEmitVTableThunk (CodeGenModule &CGM, const CXXMethodDecl *MD, bool IsUnprototyped, bool ForVTable)
 
static bool UseRelativeLayout (const CodeGenModule &CGM)
 
static void AddPointerLayoutOffset (const CodeGenModule &CGM, ConstantArrayBuilder &builder, CharUnits offset)
 
static void AddRelativeLayoutOffset (const CodeGenModule &CGM, ConstantArrayBuilder &builder, CharUnits offset)
 
static bool shouldEmitAvailableExternallyVTable (const CodeGenModule &CGM, const CXXRecordDecl *RD)
 
static bool shouldEmitVTableAtEndOfTranslationUnit (CodeGenModule &CGM, const CXXRecordDecl *RD)
 Given that we're currently at the end of the translation unit, and we've emitted a reference to the vtable for this class, should we define that vtable?
 

Function Documentation

◆ AddPointerLayoutOffset()

static void AddPointerLayoutOffset ( const CodeGenModule CGM,
ConstantArrayBuilder builder,
CharUnits  offset 
)
static

◆ AddRelativeLayoutOffset()

static void AddRelativeLayoutOffset ( const CodeGenModule CGM,
ConstantArrayBuilder builder,
CharUnits  offset 
)
static

◆ PerformReturnAdjustment()

static RValue PerformReturnAdjustment ( CodeGenFunction CGF,
QualType  ResultType,
RValue  RV,
const ThunkInfo Thunk 
)
static

◆ resolveTopLevelMetadata()

static void resolveTopLevelMetadata ( llvm::Function *  Fn,
llvm::ValueToValueMapTy &  VMap 
)
static

This function clones a function's DISubprogram node and enters it into a value map with the intent that the map can be utilized by the cloner to short-circuit Metadata node mapping.

Furthermore, the function resolves any DILocalVariable nodes referenced by dbg.value intrinsics so they can be properly mapped during cloning.

Definition at line 121 of file CGVTables.cpp.

◆ setThunkProperties()

static void setThunkProperties ( CodeGenModule CGM,
const ThunkInfo Thunk,
llvm::Function *  ThunkFn,
bool  ForVTable,
GlobalDecl  GD 
)
static

◆ shouldEmitAvailableExternallyVTable()

static bool shouldEmitAvailableExternallyVTable ( const CodeGenModule CGM,
const CXXRecordDecl RD 
)
static

◆ shouldEmitVTableAtEndOfTranslationUnit()

static bool shouldEmitVTableAtEndOfTranslationUnit ( CodeGenModule CGM,
const CXXRecordDecl RD 
)
static

Given that we're currently at the end of the translation unit, and we've emitted a reference to the vtable for this class, should we define that vtable?

Definition at line 1250 of file CGVTables.cpp.

References clang::CodeGen::CodeGenModule::getVTables(), clang::CodeGen::CodeGenVTables::isVTableExternal(), and shouldEmitAvailableExternallyVTable().

◆ shouldEmitVTableThunk()

static bool shouldEmitVTableThunk ( CodeGenModule CGM,
const CXXMethodDecl MD,
bool  IsUnprototyped,
bool  ForVTable 
)
static

◆ similar()

static bool similar ( const ABIArgInfo infoL,
CanQualType  typeL,
const ABIArgInfo infoR,
CanQualType  typeR 
)
static

Definition at line 61 of file CGVTables.cpp.

References clang::CodeGen::ABIArgInfo::getKind().

◆ UseRelativeLayout()

static bool UseRelativeLayout ( const CodeGenModule CGM)
static