class ConstantAggregateBuilderTemplateBase

Declaration

template <class Impl, class Traits>
class ConstantAggregateBuilderTemplateBase { /* full declaration omitted */ };

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:345

Templates

Impl
Traits

Method Overview

Methods

ConstantAggregateBuilderTemplateBase<
    type - parameter - 0 - 0,
    type - parameter - 0 - 1>(
    clang::CodeGen::
        ConstantAggregateBuilderTemplateBase::
            InitBuilder& builder,
    clang::CodeGen::
        ConstantAggregateBuilderTemplateBase::
            AggregateBuilderBase* parent)

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:355

Parameters

clang::CodeGen:: ConstantAggregateBuilderTemplateBase:: InitBuilder& builder
clang::CodeGen:: ConstantAggregateBuilderTemplateBase:: AggregateBuilderBase* parent

Impl& asImpl()

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:359

clang::CodeGen::
    ConstantAggregateBuilderTemplateBase::
        ArrayBuilder
        beginArray(llvm::Type* eltTy = nullptr)

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:362

Parameters

llvm::Type* eltTy = nullptr

clang::CodeGen::
    ConstantAggregateBuilderTemplateBase::
        StructBuilder
        beginStruct(
            llvm::StructType* ty = nullptr)

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:366

Parameters

llvm::StructType* ty = nullptr

void finishAndAddTo(
    clang::CodeGen::
        ConstantAggregateBuilderTemplateBase::
            AggregateBuilderBase& parent)

Description

Given that this builder was created by beginning an array or struct component on the given parent builder, finish the array/struct component and add it to the parent. It is an intentional choice that the parent is passed in explicitly despite it being redundant with information already kept in the builder. This aids in readability by making it easier to find the places that add components to a builder, as well as "bookending" the sub-builder more explicitly.

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:379

Parameters

clang::CodeGen:: ConstantAggregateBuilderTemplateBase:: AggregateBuilderBase& parent

clang::CodeGen::ConstantInitFuture
finishAndCreateFuture()

Description

Given that this builder was created by beginning an array or struct directly on a ConstantInitBuilder, finish the array/struct and return a future which can be used to install the initializer in a global later. This is useful for allowing a finished initializer to passed to an API which will build the global. However, the "future" preserves a dependency on the original builder; it is an error to pass it aside.

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:410

template <class... As>
llvm::GlobalVariable* finishAndCreateGlobal(
    As&&... args)

Description

Given that this builder was created by beginning an array or struct directly on a ConstantInitBuilder, finish the array/struct and create a global variable with it as the initializer.

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:388

Templates

As

Parameters

As&&... args

void finishAndSetAsInitializer(
    llvm::GlobalVariable* global)

Description

Given that this builder was created by beginning an array or struct directly on a ConstantInitBuilder, finish the array/struct and set it as the initializer of the given global variable.

Declared at: clang/include/clang/CodeGen/ConstantInitBuilder.h:397

Parameters

llvm::GlobalVariable* global