clang 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | List of all members
clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits > Class Template Reference

#include "clang/CodeGen/ConstantInitBuilder.h"

Inheritance diagram for clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >:
Inheritance graph
[legend]

Public Types

using InitBuilder = typename Traits::InitBuilder
 
using ArrayBuilder = typename Traits::ArrayBuilder
 
using StructBuilder = typename Traits::StructBuilder
 
using AggregateBuilderBase = typename Traits::AggregateBuilderBase
 

Public Member Functions

ArrayBuilder beginArray (llvm::Type *eltTy=nullptr)
 
StructBuilder beginStruct (llvm::StructType *ty=nullptr)
 
void finishAndAddTo (AggregateBuilderBase &parent)
 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.
 
template<class... As>
llvm::GlobalVariable * finishAndCreateGlobal (As &&...args)
 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.
 
void finishAndSetAsInitializer (llvm::GlobalVariable *global)
 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.
 
ConstantInitFuture finishAndCreateFuture ()
 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.
 

Protected Member Functions

 ConstantAggregateBuilderTemplateBase (InitBuilder &builder, AggregateBuilderBase *parent)
 
Impl & asImpl ()
 

Detailed Description

template<class Impl, class Traits>
class clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >

Definition at line 348 of file ConstantInitBuilder.h.

Member Typedef Documentation

◆ AggregateBuilderBase

template<class Impl , class Traits >
using clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::AggregateBuilderBase = typename Traits::AggregateBuilderBase

Definition at line 355 of file ConstantInitBuilder.h.

◆ ArrayBuilder

template<class Impl , class Traits >
using clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::ArrayBuilder = typename Traits::ArrayBuilder

Definition at line 353 of file ConstantInitBuilder.h.

◆ InitBuilder

template<class Impl , class Traits >
using clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::InitBuilder = typename Traits::InitBuilder

Definition at line 352 of file ConstantInitBuilder.h.

◆ StructBuilder

template<class Impl , class Traits >
using clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::StructBuilder = typename Traits::StructBuilder

Definition at line 354 of file ConstantInitBuilder.h.

Constructor & Destructor Documentation

◆ ConstantAggregateBuilderTemplateBase()

template<class Impl , class Traits >
clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::ConstantAggregateBuilderTemplateBase ( InitBuilder builder,
AggregateBuilderBase parent 
)
inlineprotected

Definition at line 358 of file ConstantInitBuilder.h.

Member Function Documentation

◆ asImpl()

template<class Impl , class Traits >
Impl & clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::asImpl ( )
inlineprotected

◆ beginArray()

template<class Impl , class Traits >
ArrayBuilder clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::beginArray ( llvm::Type *  eltTy = nullptr)
inline

◆ beginStruct()

template<class Impl , class Traits >
StructBuilder clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::beginStruct ( llvm::StructType *  ty = nullptr)
inline

Definition at line 369 of file ConstantInitBuilder.h.

◆ finishAndAddTo()

template<class Impl , class Traits >
void clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndAddTo ( AggregateBuilderBase parent)
inline

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.

Definition at line 382 of file ConstantInitBuilder.h.

References clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::asImpl(), and Parent.

◆ finishAndCreateFuture()

template<class Impl , class Traits >
ConstantInitFuture clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndCreateFuture ( )
inline

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.

Definition at line 413 of file ConstantInitBuilder.h.

References clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::asImpl(), and Parent.

◆ finishAndCreateGlobal()

template<class Impl , class Traits >
template<class... As>
llvm::GlobalVariable * clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndCreateGlobal ( As &&...  args)
inline

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.

Definition at line 391 of file ConstantInitBuilder.h.

References clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::asImpl(), and Parent.

◆ finishAndSetAsInitializer()

template<class Impl , class Traits >
void clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::finishAndSetAsInitializer ( llvm::GlobalVariable *  global)
inline

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.

Definition at line 400 of file ConstantInitBuilder.h.

References clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >::asImpl(), and Parent.


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