clang 22.0.0git
|
A convenience builder class for complex constant initializers, especially for anonymous global structures used by various language runtimes. More...
#include "clang/CodeGen/ConstantInitBuilder.h"
Protected Member Functions | |
ConstantInitBuilderBase (CodeGenModule &CGM) | |
~ConstantInitBuilderBase () |
Friends | |
class | ConstantInitFuture |
class | ConstantAggregateBuilderBase |
template<class, class> | |
class | ConstantAggregateBuilderTemplateBase |
A convenience builder class for complex constant initializers, especially for anonymous global structures used by various language runtimes.
The basic usage pattern is expected to be something like: ConstantInitBuilder builder(CGM); auto toplevel = builder.beginStruct(); toplevel.addInt(CGM.SizeTy, widgets.size()); auto widgetArray = builder.beginArray(); for (auto &widget : widgets) { auto widgetDesc = widgetArray.beginStruct(); widgetDesc.addInt(CGM.SizeTy, widget.getPower()); widgetDesc.add(CGM.GetAddrOfConstantStringFromLiteral(widget.getName())); widgetDesc.add(CGM.GetAddrOfGlobal(widget.getInitializerDecl())); widgetDesc.finishAndAddTo(widgetArray); } widgetArray.finishAndAddTo(toplevel); auto global = toplevel.finishAndCreateGlobal("WIDGET_LIST", Align, /*constant*â/ true);
Definition at line 54 of file ConstantInitBuilder.h.
|
inlineexplicitprotected |
Definition at line 72 of file ConstantInitBuilder.h.
Referenced by clang::CodeGen::ConstantInitBuilderTemplateBase< Traits >::ConstantInitBuilderTemplateBase().
|
inlineprotected |
Definition at line 74 of file ConstantInitBuilder.h.
|
friend |
Definition at line 67 of file ConstantInitBuilder.h.
References ConstantAggregateBuilderBase.
Referenced by ConstantAggregateBuilderBase.
|
friend |
Definition at line 69 of file ConstantInitBuilder.h.
References ConstantAggregateBuilderTemplateBase.
Referenced by ConstantAggregateBuilderTemplateBase.
|
friend |
Definition at line 66 of file ConstantInitBuilder.h.
References ConstantInitFuture.
Referenced by ConstantInitFuture.