clang  6.0.0svn
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]
Collaboration diagram for clang::CodeGen::ConstantAggregateBuilderTemplateBase< Impl, Traits >:
Collaboration 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. More...
 
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. More...
 
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. More...
 
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. More...
 

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 327 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 334 of file ConstantInitBuilder.h.

◆ ArrayBuilder

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

Definition at line 332 of file ConstantInitBuilder.h.

◆ InitBuilder

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

Definition at line 331 of file ConstantInitBuilder.h.

◆ StructBuilder

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

Definition at line 333 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 337 of file ConstantInitBuilder.h.

Member Function Documentation

◆ asImpl()

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

Definition at line 341 of file ConstantInitBuilder.h.

◆ 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 348 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 361 of file ConstantInitBuilder.h.

◆ 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 392 of file ConstantInitBuilder.h.

◆ 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 370 of file ConstantInitBuilder.h.

◆ 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 379 of file ConstantInitBuilder.h.


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