clang 22.0.0git
Compiler.h
Go to the documentation of this file.
1//===--- Compiler.h - Code generator for expressions -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Defines the constexpr bytecode compiler.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_INTERP_BYTECODEEXPRGEN_H
14#define LLVM_CLANG_AST_INTERP_BYTECODEEXPRGEN_H
15
16#include "ByteCodeEmitter.h"
17#include "EvalEmitter.h"
18#include "Pointer.h"
19#include "PrimType.h"
20#include "Record.h"
21#include "clang/AST/Decl.h"
22#include "clang/AST/Expr.h"
24
25namespace clang {
26class QualType;
27
28namespace interp {
29
30template <class Emitter> class LocalScope;
31template <class Emitter> class DestructorScope;
32template <class Emitter> class VariableScope;
33template <class Emitter> class DeclScope;
34template <class Emitter> class InitLinkScope;
35template <class Emitter> class InitStackScope;
36template <class Emitter> class OptionScope;
37template <class Emitter> class ArrayIndexScope;
38template <class Emitter> class SourceLocScope;
39template <class Emitter> class LoopScope;
40template <class Emitter> class LabelScope;
41template <class Emitter> class SwitchScope;
42template <class Emitter> class StmtExprScope;
43template <class Emitter> class LocOverrideScope;
44
45template <class Emitter> class Compiler;
46struct InitLink {
47public:
48 enum {
49 K_This = 0,
51 K_Temp = 2,
52 K_Decl = 3,
53 K_Elem = 5,
54 K_RVO = 6,
56 };
57
58 static InitLink This() { return InitLink{K_This}; }
59 static InitLink InitList() { return InitLink{K_InitList}; }
60 static InitLink RVO() { return InitLink{K_RVO}; }
61 static InitLink Field(unsigned Offset) {
62 InitLink IL{K_Field};
63 IL.Offset = Offset;
64 return IL;
65 }
66 static InitLink Temp(unsigned Offset) {
67 InitLink IL{K_Temp};
68 IL.Offset = Offset;
69 return IL;
70 }
71 static InitLink Decl(const ValueDecl *D) {
72 InitLink IL{K_Decl};
73 IL.D = D;
74 return IL;
75 }
76 static InitLink Elem(unsigned Index) {
77 InitLink IL{K_Elem};
78 IL.Offset = Index;
79 return IL;
80 }
81
82 InitLink(uint8_t Kind) : Kind(Kind) {}
83 template <class Emitter>
84 bool emit(Compiler<Emitter> *Ctx, const Expr *E) const;
85
86 uint32_t Kind;
87 union {
88 unsigned Offset;
89 const ValueDecl *D;
90 };
91};
92
93/// State encapsulating if a the variable creation has been successful,
94/// unsuccessful, or no variable has been created at all.
96 std::optional<bool> S = std::nullopt;
97 VarCreationState() = default;
98 VarCreationState(bool b) : S(b) {}
100
101 operator bool() const { return S && *S; }
102 bool notCreated() const { return !S; }
103};
104
105enum class ScopeKind { Call, Block };
106
107/// Compilation context for expressions.
108template <class Emitter>
109class Compiler : public ConstStmtVisitor<Compiler<Emitter>, bool>,
110 public Emitter {
111protected:
112 // Aliases for types defined in the emitter.
113 using LabelTy = typename Emitter::LabelTy;
114 using AddrTy = typename Emitter::AddrTy;
116 using CaseMap = llvm::DenseMap<const SwitchCase *, LabelTy>;
117
131
132 /// Current compilation context.
134 /// Program to link to.
136
137public:
138 /// Initializes the compiler and the backend emitter.
139 template <typename... Tys>
140 Compiler(Context &Ctx, Program &P, Tys &&...Args)
141 : Emitter(Ctx, P, Args...), Ctx(Ctx), P(P) {}
142
143 // Expressions.
144 bool VisitCastExpr(const CastExpr *E);
146 bool VisitIntegerLiteral(const IntegerLiteral *E);
150 bool VisitParenExpr(const ParenExpr *E);
151 bool VisitBinaryOperator(const BinaryOperator *E);
152 bool VisitLogicalBinOp(const BinaryOperator *E);
154 bool VisitComplexBinOp(const BinaryOperator *E);
155 bool VisitVectorBinOp(const BinaryOperator *E);
159 bool VisitCallExpr(const CallExpr *E);
160 bool VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinID);
164 bool VisitGNUNullExpr(const GNUNullExpr *E);
165 bool VisitCXXThisExpr(const CXXThisExpr *E);
166 bool VisitUnaryOperator(const UnaryOperator *E);
169 bool VisitDeclRefExpr(const DeclRefExpr *E);
173 bool VisitInitListExpr(const InitListExpr *E);
175 bool VisitConstantExpr(const ConstantExpr *E);
177 bool VisitMemberExpr(const MemberExpr *E);
182 bool VisitStringLiteral(const StringLiteral *E);
184 bool VisitObjCEncodeExpr(const ObjCEncodeExpr *E);
194 bool VisitTypeTraitExpr(const TypeTraitExpr *E);
196 bool VisitLambdaExpr(const LambdaExpr *E);
197 bool VisitPredefinedExpr(const PredefinedExpr *E);
198 bool VisitCXXThrowExpr(const CXXThrowExpr *E);
203 bool VisitSourceLocExpr(const SourceLocExpr *E);
204 bool VisitOffsetOfExpr(const OffsetOfExpr *E);
206 bool VisitSizeOfPackExpr(const SizeOfPackExpr *E);
208 bool VisitChooseExpr(const ChooseExpr *E);
209 bool VisitEmbedExpr(const EmbedExpr *E);
213 bool VisitCXXUuidofExpr(const CXXUuidofExpr *E);
214 bool VisitRequiresExpr(const RequiresExpr *E);
219 bool VisitRecoveryExpr(const RecoveryExpr *E);
220 bool VisitAddrLabelExpr(const AddrLabelExpr *E);
224 bool VisitObjCBoxedExpr(const ObjCBoxedExpr *E);
226 bool VisitStmtExpr(const StmtExpr *E);
227 bool VisitCXXNewExpr(const CXXNewExpr *E);
228 bool VisitCXXDeleteExpr(const CXXDeleteExpr *E);
229 bool VisitBlockExpr(const BlockExpr *E);
230 bool VisitCXXTypeidExpr(const CXXTypeidExpr *E);
231
232 // Statements.
233 bool visitCompoundStmt(const CompoundStmt *S);
234 bool visitDeclStmt(const DeclStmt *DS, bool EvaluateConditionDecl = false);
235 bool visitReturnStmt(const ReturnStmt *RS);
236 bool visitIfStmt(const IfStmt *IS);
237 bool visitWhileStmt(const WhileStmt *S);
238 bool visitDoStmt(const DoStmt *S);
239 bool visitForStmt(const ForStmt *S);
241 bool visitBreakStmt(const BreakStmt *S);
242 bool visitContinueStmt(const ContinueStmt *S);
243 bool visitSwitchStmt(const SwitchStmt *S);
244 bool visitCaseStmt(const CaseStmt *S);
245 bool visitDefaultStmt(const DefaultStmt *S);
246 bool visitAttributedStmt(const AttributedStmt *S);
247 bool visitCXXTryStmt(const CXXTryStmt *S);
248
249protected:
250 bool visitStmt(const Stmt *S);
251 bool visitExpr(const Expr *E, bool DestroyToplevelScope) override;
252 bool visitFunc(const FunctionDecl *F) override;
253
254 bool visitDeclAndReturn(const VarDecl *VD, bool ConstantContext) override;
255
256protected:
257 /// Emits scope cleanup instructions.
258 void emitCleanup();
259
260 /// Returns a record type from a record or pointer type.
261 const RecordType *getRecordTy(QualType Ty);
262
263 /// Returns a record from a record or pointer type.
265 Record *getRecord(const RecordDecl *RD);
266
267 /// Returns a function for the given FunctionDecl.
268 /// If the function does not exist yet, it is compiled.
269 const Function *getFunction(const FunctionDecl *FD);
270
271 OptPrimType classify(const Expr *E) const { return Ctx.classify(E); }
272 OptPrimType classify(QualType Ty) const { return Ctx.classify(Ty); }
273 bool canClassify(const Expr *E) const { return Ctx.canClassify(E); }
274 bool canClassify(QualType T) const { return Ctx.canClassify(T); }
275
276 /// Classifies a known primitive type.
278 if (auto T = classify(Ty)) {
279 return *T;
280 }
281 llvm_unreachable("not a primitive type");
282 }
283 /// Classifies a known primitive expression.
284 PrimType classifyPrim(const Expr *E) const {
285 if (auto T = classify(E))
286 return *T;
287 llvm_unreachable("not a primitive type");
288 }
289
290 /// Evaluates an expression and places the result on the stack. If the
291 /// expression is of composite type, a local variable will be created
292 /// and a pointer to said variable will be placed on the stack.
293 bool visit(const Expr *E) override;
294 /// Compiles an initializer. This is like visit() but it will never
295 /// create a variable and instead rely on a variable already having
296 /// been created. visitInitializer() then relies on a pointer to this
297 /// variable being on top of the stack.
298 bool visitInitializer(const Expr *E);
299 bool visitAsLValue(const Expr *E);
300 /// Evaluates an expression for side effects and discards the result.
301 bool discard(const Expr *E);
302 /// Just pass evaluation on to \p E. This leaves all the parsing flags
303 /// intact.
304 bool delegate(const Expr *E);
305 /// Creates and initializes a variable from the given decl.
306 VarCreationState visitVarDecl(const VarDecl *VD, bool Toplevel = false,
307 bool IsConstexprUnknown = false);
309 bool IsConstexprUnknown = false);
310 /// Visit an APValue.
311 bool visitAPValue(const APValue &Val, PrimType ValType, const Expr *E);
312 bool visitAPValueInitializer(const APValue &Val, const Expr *E, QualType T);
313 /// Visit the given decl as if we have a reference to it.
314 bool visitDeclRef(const ValueDecl *D, const Expr *E);
315
316 /// Visits an expression and converts it to a boolean.
317 bool visitBool(const Expr *E);
318
319 bool visitInitList(ArrayRef<const Expr *> Inits, const Expr *ArrayFiller,
320 const Expr *E);
321 bool visitArrayElemInit(unsigned ElemIndex, const Expr *Init,
322 OptPrimType InitT);
323 bool visitCallArgs(ArrayRef<const Expr *> Args, const FunctionDecl *FuncDecl,
324 bool Activate, bool IsOperatorCall);
325
326 /// Creates a local primitive value.
327 unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsConst,
328 const ValueDecl *ExtendingDecl = nullptr,
330 bool IsConstexprUnknown = false);
331
332 /// Allocates a space storing a local given its type.
334 const ValueDecl *ExtendingDecl = nullptr,
336 bool IsConstexprUnknown = false);
338
339private:
340 friend class VariableScope<Emitter>;
341 friend class LocalScope<Emitter>;
342 friend class DestructorScope<Emitter>;
343 friend class DeclScope<Emitter>;
344 friend class InitLinkScope<Emitter>;
345 friend class InitStackScope<Emitter>;
346 friend class OptionScope<Emitter>;
347 friend class ArrayIndexScope<Emitter>;
348 friend class SourceLocScope<Emitter>;
349 friend struct InitLink;
350 friend class LoopScope<Emitter>;
351 friend class LabelScope<Emitter>;
352 friend class SwitchScope<Emitter>;
353 friend class StmtExprScope<Emitter>;
354 friend class LocOverrideScope<Emitter>;
355
356 /// Emits a zero initializer.
357 bool visitZeroInitializer(PrimType T, QualType QT, const Expr *E);
358 bool visitZeroRecordInitializer(const Record *R, const Expr *E);
359 bool visitZeroArrayInitializer(QualType T, const Expr *E);
360 bool visitAssignment(const Expr *LHS, const Expr *RHS, const Expr *E);
361
362 /// Emits an APSInt constant.
363 bool emitConst(const llvm::APSInt &Value, PrimType Ty, const Expr *E);
364 bool emitConst(const llvm::APInt &Value, PrimType Ty, const Expr *E);
365 bool emitConst(const llvm::APSInt &Value, const Expr *E);
366 bool emitConst(const llvm::APInt &Value, const Expr *E) {
367 return emitConst(Value, classifyPrim(E), E);
368 }
369
370 /// Emits an integer constant.
371 template <typename T> bool emitConst(T Value, PrimType Ty, const Expr *E);
372 template <typename T> bool emitConst(T Value, const Expr *E);
373 bool emitBool(bool V, const Expr *E) override {
374 return this->emitConst(V, E);
375 }
376
377 llvm::RoundingMode getRoundingMode(const Expr *E) const {
379
380 if (FPO.getRoundingMode() == llvm::RoundingMode::Dynamic)
381 return llvm::RoundingMode::NearestTiesToEven;
382
383 return FPO.getRoundingMode();
384 }
385
386 uint32_t getFPOptions(const Expr *E) const {
387 return E->getFPFeaturesInEffect(Ctx.getLangOpts()).getAsOpaqueInt();
388 }
389
390 bool emitPrimCast(PrimType FromT, PrimType ToT, QualType ToQT, const Expr *E);
391 PrimType classifyComplexElementType(QualType T) const {
392 assert(T->isAnyComplexType());
393
394 QualType ElemType = T->getAs<ComplexType>()->getElementType();
395
396 return *this->classify(ElemType);
397 }
398
399 PrimType classifyVectorElementType(QualType T) const {
400 assert(T->isVectorType());
401 return *this->classify(T->getAs<VectorType>()->getElementType());
402 }
403
404 bool emitComplexReal(const Expr *SubExpr);
405 bool emitComplexBoolCast(const Expr *E);
406 bool emitComplexComparison(const Expr *LHS, const Expr *RHS,
407 const BinaryOperator *E);
408 bool emitRecordDestructionPop(const Record *R, SourceInfo Loc);
409 bool emitDestructionPop(const Descriptor *Desc, SourceInfo Loc);
410 bool emitDummyPtr(const DeclTy &D, const Expr *E);
411 bool emitFloat(const APFloat &F, const Expr *E);
412 unsigned collectBaseOffset(const QualType BaseType,
413 const QualType DerivedType);
414 bool emitLambdaStaticInvokerBody(const CXXMethodDecl *MD);
415 bool emitBuiltinBitCast(const CastExpr *E);
416 bool compileConstructor(const CXXConstructorDecl *Ctor);
417 bool compileDestructor(const CXXDestructorDecl *Dtor);
418 bool compileUnionAssignmentOperator(const CXXMethodDecl *MD);
419
420 bool checkLiteralType(const Expr *E);
421 bool maybeEmitDeferredVarInit(const VarDecl *VD);
422
423 bool refersToUnion(const Expr *E);
424
425protected:
426 /// Variable to storage mapping.
427 llvm::DenseMap<const ValueDecl *, Scope::Local> Locals;
428
429 /// OpaqueValueExpr to location mapping.
430 llvm::DenseMap<const OpaqueValueExpr *, unsigned> OpaqueExprs;
431
432 /// Current scope.
434
435 /// Current argument index. Needed to emit ArrayInitIndexExpr.
436 std::optional<uint64_t> ArrayIndex;
437
438 /// DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
439 const Expr *SourceLocDefaultExpr = nullptr;
440
441 /// Flag indicating if return value is to be discarded.
442 bool DiscardResult = false;
443
444 bool InStmtExpr = false;
445 bool ToLValue = false;
446
447 /// Flag inidicating if we're initializing an already created
448 /// variable. This is set in visitInitializer().
449 bool Initializing = false;
450 const ValueDecl *InitializingDecl = nullptr;
451
453 bool InitStackActive = false;
454
455 /// Type of the expression returned by the function.
457
458 /// Switch case mapping.
460 /// Stack of label information for loops and switch statements.
462
464};
465
466extern template class Compiler<ByteCodeEmitter>;
467extern template class Compiler<EvalEmitter>;
468
469/// Scope chain managing the variable lifetimes.
470template <class Emitter> class VariableScope {
471public:
474 : Ctx(Ctx), Parent(Ctx->VarScope), ValDecl(VD), Kind(Kind) {
475 Ctx->VarScope = this;
476 }
477
478 virtual ~VariableScope() { Ctx->VarScope = this->Parent; }
479
480 virtual void addLocal(const Scope::Local &Local) {
481 llvm_unreachable("Shouldn't be called");
482 }
483
484 void addExtended(const Scope::Local &Local, const ValueDecl *ExtendingDecl) {
485 // Walk up the chain of scopes until we find the one for ExtendingDecl.
486 // If there is no such scope, attach it to the parent one.
487 VariableScope *P = this;
488 while (P) {
489 if (P->ValDecl == ExtendingDecl) {
490 P->addLocal(Local);
491 return;
492 }
493 P = P->Parent;
494 if (!P)
495 break;
496 }
497
498 // Use the parent scope.
499 if (this->Parent)
500 this->Parent->addLocal(Local);
501 else
502 this->addLocal(Local);
503 }
504
505 /// Like addExtended, but adds to the nearest scope of the given kind.
507 VariableScope *P = this;
508 while (P) {
509 if (P->Kind == Kind) {
510 P->addLocal(Local);
511 return;
512 }
513 P = P->Parent;
514 if (!P)
515 break;
516 }
517
518 // Add to this scope.
519 this->addLocal(Local);
520 }
521
522 virtual void emitDestruction() {}
523 virtual bool emitDestructors(const Expr *E = nullptr) { return true; }
524 virtual bool destroyLocals(const Expr *E = nullptr) { return true; }
525 VariableScope *getParent() const { return Parent; }
526 ScopeKind getKind() const { return Kind; }
527
528protected:
529 /// Compiler instance.
531 /// Link to the parent scope.
533 const ValueDecl *ValDecl = nullptr;
535};
536
537/// Generic scope for local variables.
538template <class Emitter> class LocalScope : public VariableScope<Emitter> {
539public:
544
545 /// Emit a Destroy op for this scope.
546 ~LocalScope() override {
547 if (!Idx)
548 return;
549 this->Ctx->emitDestroy(*Idx, SourceInfo{});
551 }
552
553 /// Overriden to support explicit destruction.
554 void emitDestruction() override {
555 if (!Idx)
556 return;
557
558 this->emitDestructors();
559 this->Ctx->emitDestroy(*Idx, SourceInfo{});
560 }
561
562 /// Explicit destruction of local variables.
563 bool destroyLocals(const Expr *E = nullptr) override {
564 if (!Idx)
565 return true;
566
567 // NB: We are *not* resetting Idx here as to allow multiple
568 // calls to destroyLocals().
569 bool Success = this->emitDestructors(E);
570 this->Ctx->emitDestroy(*Idx, E);
571 return Success;
572 }
573
574 void addLocal(const Scope::Local &Local) override {
575 if (!Idx) {
576 Idx = static_cast<unsigned>(this->Ctx->Descriptors.size());
577 this->Ctx->Descriptors.emplace_back();
578 this->Ctx->emitInitScope(*Idx, {});
579 }
580
581 this->Ctx->Descriptors[*Idx].emplace_back(Local);
582 }
583
584 bool emitDestructors(const Expr *E = nullptr) override {
585 if (!Idx)
586 return true;
587 // Emit destructor calls for local variables of record
588 // type with a destructor.
589 for (Scope::Local &Local : llvm::reverse(this->Ctx->Descriptors[*Idx])) {
590 if (Local.Desc->hasTrivialDtor())
591 continue;
592 if (!this->Ctx->emitGetPtrLocal(Local.Offset, E))
593 return false;
594
595 if (!this->Ctx->emitDestructionPop(Local.Desc, Local.Desc->getLoc()))
596 return false;
597
599 }
600 return true;
601 }
602
604 if (!Idx)
605 return;
606
607 for (const Scope::Local &Local : this->Ctx->Descriptors[*Idx]) {
609 }
610 }
611
613 if (const auto *OVE =
614 llvm::dyn_cast_if_present<OpaqueValueExpr>(Local.Desc->asExpr())) {
615 if (auto It = this->Ctx->OpaqueExprs.find(OVE);
616 It != this->Ctx->OpaqueExprs.end())
617 this->Ctx->OpaqueExprs.erase(It);
618 };
619 }
620
621 /// Index of the scope in the chain.
622 UnsignedOrNone Idx = std::nullopt;
623};
624
625/// Scope for storage declared in a compound statement.
626// FIXME: Remove?
627template <class Emitter> class BlockScope final : public LocalScope<Emitter> {
628public:
631};
632
633template <class Emitter> class ArrayIndexScope final {
634public:
635 ArrayIndexScope(Compiler<Emitter> *Ctx, uint64_t Index) : Ctx(Ctx) {
636 OldArrayIndex = Ctx->ArrayIndex;
637 Ctx->ArrayIndex = Index;
638 }
639
640 ~ArrayIndexScope() { Ctx->ArrayIndex = OldArrayIndex; }
641
642private:
644 std::optional<uint64_t> OldArrayIndex;
645};
646
647template <class Emitter> class SourceLocScope final {
648public:
649 SourceLocScope(Compiler<Emitter> *Ctx, const Expr *DefaultExpr) : Ctx(Ctx) {
650 assert(DefaultExpr);
651 // We only switch if the current SourceLocDefaultExpr is null.
652 if (!Ctx->SourceLocDefaultExpr) {
653 Enabled = true;
654 Ctx->SourceLocDefaultExpr = DefaultExpr;
655 }
656 }
657
659 if (Enabled)
660 Ctx->SourceLocDefaultExpr = nullptr;
661 }
662
663private:
665 bool Enabled = false;
666};
667
668template <class Emitter> class InitLinkScope final {
669public:
671 Ctx->InitStack.push_back(std::move(Link));
672 }
673
674 ~InitLinkScope() { this->Ctx->InitStack.pop_back(); }
675
676private:
678};
679
680template <class Emitter> class InitStackScope final {
681public:
683 : Ctx(Ctx), OldValue(Ctx->InitStackActive) {
684 Ctx->InitStackActive = Active;
685 }
686
687 ~InitStackScope() { this->Ctx->InitStackActive = OldValue; }
688
689private:
691 bool OldValue;
692};
693
694} // namespace interp
695} // namespace clang
696
697#endif
#define V(N, I)
llvm::MachO::Record Record
Definition MachO.h:31
__device__ __2f16 b
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition APValue.h:122
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
Definition Expr.h:4289
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4486
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Definition Expr.h:5957
Represents a loop initializing the elements of an array.
Definition Expr.h:5904
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2723
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2990
Represents an attribute applied to a statement.
Definition Stmt.h:2203
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:3974
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6560
BreakStmt - This represents a break.
Definition Stmt.h:3135
Represents a C++2a __builtin_bit_cast(T, v) expression.
Definition ExprCXX.h:5470
Represents binding an expression to a temporary.
Definition ExprCXX.h:1494
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:723
Represents a call to a C++ constructor.
Definition ExprCXX.h:1549
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1271
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1378
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2620
A C++ dynamic_cast expression (C++ [expr.dynamic.cast]).
Definition ExprCXX.h:481
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Definition StmtCXX.h:135
Represents a call to an inherited base class constructor from an inheriting constructor.
Definition ExprCXX.h:1753
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2349
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4303
The null pointer literal (C++11 [lex.nullptr])
Definition ExprCXX.h:768
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5135
A C++ reinterpret_cast expression (C++ [expr.reinterpret.cast]).
Definition ExprCXX.h:526
A rewritten comparison expression that was originally written using operator syntax.
Definition ExprCXX.h:286
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2198
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:800
Represents the this expression in C++.
Definition ExprCXX.h:1155
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1209
CXXTryStmt - A C++ try block, including all handlers.
Definition StmtCXX.h:69
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:848
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1069
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2879
CaseStmt - Represent a case statement.
Definition Stmt.h:1920
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3612
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4784
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4236
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3541
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1720
Represents the specialization of a concept - evaluates to a prvalue of type bool.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1084
ContinueStmt - This represents a continue.
Definition Stmt.h:3119
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4655
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1272
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Definition Stmt.h:1611
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
DoStmt - This represents a 'do/while' stmt.
Definition Stmt.h:2832
Represents a reference to emded data.
Definition Expr.h:5062
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3655
This represents one expression.
Definition Expr.h:112
FPOptions getFPFeaturesInEffect(const LangOptions &LO) const
Returns the set of floating point options that apply to this expression.
Definition Expr.cpp:3922
An expression trait intrinsic.
Definition ExprCXX.h:3063
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6500
RoundingMode getRoundingMode() const
ForStmt - This represents a 'for (init;cond;inc)' stmt.
Definition Stmt.h:2888
Represents a function declaration or definition.
Definition Decl.h:1999
GNUNullExpr - Implements the GNU __null extension, which is a name for a null pointer constant that h...
Definition Expr.h:4859
Represents a C11 generic selection.
Definition Expr.h:6114
IfStmt - This represents an if/then/else.
Definition Stmt.h:2259
ImaginaryLiteral - We support imaginary integer and floating point literals, like "1....
Definition Expr.h:1733
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:5993
Describes an C or C++ initializer list.
Definition Expr.h:5235
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1970
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4914
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3300
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:88
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:128
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:409
ObjCStringLiteral, used for Objective-C string literals i.e.
Definition ExprObjC.h:52
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2529
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1180
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2184
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2007
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6692
A (possibly-)qualified type.
Definition TypeBase.h:937
Represents a struct/union/class.
Definition Decl.h:4309
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7364
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition Stmt.h:3160
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4579
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4435
Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), __builtin_FUNCTION(),...
Definition Expr.h:4953
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4531
Stmt - This represents one statement.
Definition Stmt.h:85
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1801
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4658
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2509
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2890
bool isAnyComplexType() const
Definition TypeBase.h:8657
bool isVectorType() const
Definition TypeBase.h:8661
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9101
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2627
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2246
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:711
Represents a variable declaration or definition.
Definition Decl.h:925
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2697
ArrayIndexScope(Compiler< Emitter > *Ctx, uint64_t Index)
Definition Compiler.h:635
BlockScope(Compiler< Emitter > *Ctx, ScopeKind Kind=ScopeKind::Block)
Definition Compiler.h:629
A memory block, either on the stack or in the heap.
Definition InterpBlock.h:44
Compilation context for expressions.
Definition Compiler.h:110
llvm::SmallVector< InitLink > InitStack
Definition Compiler.h:452
VarCreationState visitVarDecl(const VarDecl *VD, bool Toplevel=false, bool IsConstexprUnknown=false)
Creates and initializes a variable from the given decl.
bool VisitArrayInitIndexExpr(const ArrayInitIndexExpr *E)
bool VisitCXXDeleteExpr(const CXXDeleteExpr *E)
bool VisitOffsetOfExpr(const OffsetOfExpr *E)
bool visitContinueStmt(const ContinueStmt *S)
bool VisitCharacterLiteral(const CharacterLiteral *E)
PrimType classifyPrim(const Expr *E) const
Classifies a known primitive expression.
Definition Compiler.h:284
bool visitArrayElemInit(unsigned ElemIndex, const Expr *Init, OptPrimType InitT)
Pointer to the array(not the element!) must be on the stack when calling this.
bool VisitCXXParenListInitExpr(const CXXParenListInitExpr *E)
bool VisitConceptSpecializationExpr(const ConceptSpecializationExpr *E)
bool VisitCompoundLiteralExpr(const CompoundLiteralExpr *E)
bool visitBool(const Expr *E)
Visits an expression and converts it to a boolean.
bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *E)
bool visitDeclAndReturn(const VarDecl *VD, bool ConstantContext) override
Toplevel visitDeclAndReturn().
PrimType classifyPrim(QualType Ty) const
Classifies a known primitive type.
Definition Compiler.h:277
bool VisitTypeTraitExpr(const TypeTraitExpr *E)
bool VisitLambdaExpr(const LambdaExpr *E)
bool VisitMemberExpr(const MemberExpr *E)
llvm::DenseMap< const OpaqueValueExpr *, unsigned > OpaqueExprs
OpaqueValueExpr to location mapping.
Definition Compiler.h:430
bool VisitBinaryOperator(const BinaryOperator *E)
Definition Compiler.cpp:840
bool visitAttributedStmt(const AttributedStmt *S)
bool VisitPackIndexingExpr(const PackIndexingExpr *E)
VarCreationState visitDecl(const VarDecl *VD, bool IsConstexprUnknown=false)
bool visitAPValueInitializer(const APValue &Val, const Expr *E, QualType T)
bool VisitArraySubscriptExpr(const ArraySubscriptExpr *E)
bool VisitCallExpr(const CallExpr *E)
std::optional< uint64_t > ArrayIndex
Current argument index. Needed to emit ArrayInitIndexExpr.
Definition Compiler.h:436
bool VisitPseudoObjectExpr(const PseudoObjectExpr *E)
bool VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *E)
const Function * getFunction(const FunctionDecl *FD)
Returns a function for the given FunctionDecl.
void emitCleanup()
Emits scope cleanup instructions.
bool VisitFixedPointBinOp(const BinaryOperator *E)
bool VisitCastExpr(const CastExpr *E)
Definition Compiler.cpp:212
bool VisitObjCEncodeExpr(const ObjCEncodeExpr *E)
bool VisitFixedPointUnaryOperator(const UnaryOperator *E)
bool VisitComplexUnaryOperator(const UnaryOperator *E)
llvm::DenseMap< const SwitchCase *, LabelTy > CaseMap
Definition Compiler.h:116
bool VisitBlockExpr(const BlockExpr *E)
friend struct InitLink
Definition Compiler.h:349
bool visitAPValue(const APValue &Val, PrimType ValType, const Expr *E)
Visit an APValue.
bool VisitCXXScalarValueInitExpr(const CXXScalarValueInitExpr *E)
bool VisitLogicalBinOp(const BinaryOperator *E)
bool visitCompoundStmt(const CompoundStmt *S)
Context & Ctx
Current compilation context.
Definition Compiler.h:133
bool visitDeclRef(const ValueDecl *D, const Expr *E)
Visit the given decl as if we have a reference to it.
bool visitBreakStmt(const BreakStmt *S)
bool visitExpr(const Expr *E, bool DestroyToplevelScope) override
bool visitForStmt(const ForStmt *S)
bool VisitDeclRefExpr(const DeclRefExpr *E)
bool VisitOpaqueValueExpr(const OpaqueValueExpr *E)
bool VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E)
bool VisitStmtExpr(const StmtExpr *E)
bool VisitBuiltinBitCastExpr(const BuiltinBitCastExpr *E)
Definition Compiler.cpp:776
bool VisitFixedPointLiteral(const FixedPointLiteral *E)
Definition Compiler.cpp:822
const FunctionDecl * CompilingFunction
Definition Compiler.h:463
bool VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *E)
VariableScope< Emitter > * VarScope
Current scope.
Definition Compiler.h:433
bool VisitCXXNewExpr(const CXXNewExpr *E)
const ValueDecl * InitializingDecl
Definition Compiler.h:450
bool VisitCompoundAssignOperator(const CompoundAssignOperator *E)
bool visit(const Expr *E) override
Evaluates an expression and places the result on the stack.
bool delegate(const Expr *E)
Just pass evaluation on to E.
bool discard(const Expr *E)
Evaluates an expression for side effects and discards the result.
bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E)
CaseMap CaseLabels
Switch case mapping.
Definition Compiler.h:459
Record * getRecord(QualType Ty)
Returns a record from a record or pointer type.
const RecordType * getRecordTy(QualType Ty)
Returns a record type from a record or pointer type.
bool VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E)
bool visitInitList(ArrayRef< const Expr * > Inits, const Expr *ArrayFiller, const Expr *E)
bool VisitSizeOfPackExpr(const SizeOfPackExpr *E)
bool VisitPredefinedExpr(const PredefinedExpr *E)
bool VisitSourceLocExpr(const SourceLocExpr *E)
Compiler(Context &Ctx, Program &P, Tys &&...Args)
Initializes the compiler and the backend emitter.
Definition Compiler.h:140
bool visitDeclStmt(const DeclStmt *DS, bool EvaluateConditionDecl=false)
bool VisitExtVectorElementExpr(const ExtVectorElementExpr *E)
bool VisitObjCStringLiteral(const ObjCStringLiteral *E)
bool VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *E)
bool visitInitializer(const Expr *E)
Compiles an initializer.
const Expr * SourceLocDefaultExpr
DefaultInit- or DefaultArgExpr, needed for SourceLocExpr.
Definition Compiler.h:439
UnsignedOrNone OptLabelTy
Definition Compiler.h:115
bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *E)
bool VisitPointerArithBinOp(const BinaryOperator *E)
Perform addition/subtraction of a pointer and an integer or subtraction of two pointers.
bool visitCallArgs(ArrayRef< const Expr * > Args, const FunctionDecl *FuncDecl, bool Activate, bool IsOperatorCall)
bool VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *E)
bool visitDefaultStmt(const DefaultStmt *S)
typename Emitter::LabelTy LabelTy
Definition Compiler.h:113
bool VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *E)
bool visitStmt(const Stmt *S)
bool VisitExpressionTraitExpr(const ExpressionTraitExpr *E)
bool VisitVectorUnaryOperator(const UnaryOperator *E)
bool VisitCXXConstructExpr(const CXXConstructExpr *E)
bool VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *E)
bool VisitObjCBoxedExpr(const ObjCBoxedExpr *E)
unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsConst, const ValueDecl *ExtendingDecl=nullptr, ScopeKind SC=ScopeKind::Block, bool IsConstexprUnknown=false)
Creates a local primitive value.
bool VisitCXXInheritedCtorInitExpr(const CXXInheritedCtorInitExpr *E)
bool VisitRecoveryExpr(const RecoveryExpr *E)
bool VisitRequiresExpr(const RequiresExpr *E)
bool Initializing
Flag inidicating if we're initializing an already created variable.
Definition Compiler.h:449
bool visitReturnStmt(const ReturnStmt *RS)
bool VisitCXXThrowExpr(const CXXThrowExpr *E)
bool VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E)
bool VisitChooseExpr(const ChooseExpr *E)
bool visitFunc(const FunctionDecl *F) override
bool visitCXXForRangeStmt(const CXXForRangeStmt *S)
bool visitCaseStmt(const CaseStmt *S)
bool VisitComplexBinOp(const BinaryOperator *E)
llvm::DenseMap< const ValueDecl *, Scope::Local > Locals
Variable to storage mapping.
Definition Compiler.h:427
bool VisitAbstractConditionalOperator(const AbstractConditionalOperator *E)
bool VisitCXXTypeidExpr(const CXXTypeidExpr *E)
UnsignedOrNone allocateTemporary(const Expr *E)
bool VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinID)
bool VisitImplicitValueInitExpr(const ImplicitValueInitExpr *E)
typename Emitter::AddrTy AddrTy
Definition Compiler.h:114
bool VisitCXXRewrittenBinaryOperator(const CXXRewrittenBinaryOperator *E)
OptPrimType classify(QualType Ty) const
Definition Compiler.h:272
OptPrimType ReturnType
Type of the expression returned by the function.
Definition Compiler.h:456
bool VisitUnaryOperator(const UnaryOperator *E)
bool VisitFloatCompoundAssignOperator(const CompoundAssignOperator *E)
OptPrimType classify(const Expr *E) const
Definition Compiler.h:271
llvm::SmallVector< LabelInfo > LabelInfoStack
Stack of label information for loops and switch statements.
Definition Compiler.h:461
bool VisitGenericSelectionExpr(const GenericSelectionExpr *E)
bool visitDoStmt(const DoStmt *S)
bool VisitIntegerLiteral(const IntegerLiteral *E)
Definition Compiler.cpp:781
bool VisitInitListExpr(const InitListExpr *E)
UnsignedOrNone allocateLocal(DeclTy &&Decl, QualType Ty=QualType(), const ValueDecl *ExtendingDecl=nullptr, ScopeKind=ScopeKind::Block, bool IsConstexprUnknown=false)
Allocates a space storing a local given its type.
bool VisitVectorBinOp(const BinaryOperator *E)
bool VisitStringLiteral(const StringLiteral *E)
bool VisitParenExpr(const ParenExpr *E)
Definition Compiler.cpp:835
bool VisitCXXNoexceptExpr(const CXXNoexceptExpr *E)
bool VisitShuffleVectorExpr(const ShuffleVectorExpr *E)
bool VisitPointerCompoundAssignOperator(const CompoundAssignOperator *E)
bool DiscardResult
Flag indicating if return value is to be discarded.
Definition Compiler.h:442
bool VisitEmbedExpr(const EmbedExpr *E)
bool VisitConvertVectorExpr(const ConvertVectorExpr *E)
bool VisitCXXThisExpr(const CXXThisExpr *E)
bool VisitConstantExpr(const ConstantExpr *E)
bool VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *E)
bool visitSwitchStmt(const SwitchStmt *S)
bool canClassify(QualType T) const
Definition Compiler.h:274
bool VisitCXXUuidofExpr(const CXXUuidofExpr *E)
bool VisitExprWithCleanups(const ExprWithCleanups *E)
bool visitAsLValue(const Expr *E)
bool visitWhileStmt(const WhileStmt *S)
bool visitIfStmt(const IfStmt *IS)
bool VisitAddrLabelExpr(const AddrLabelExpr *E)
bool canClassify(const Expr *E) const
Definition Compiler.h:273
bool VisitFloatingLiteral(const FloatingLiteral *E)
Definition Compiler.cpp:789
Program & P
Program to link to.
Definition Compiler.h:135
bool VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E)
bool VisitGNUNullExpr(const GNUNullExpr *E)
bool VisitImaginaryLiteral(const ImaginaryLiteral *E)
Definition Compiler.cpp:798
bool VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
bool visitCXXTryStmt(const CXXTryStmt *S)
Holds all information required to evaluate constexpr code in a module.
Definition Context.h:41
const LangOptions & getLangOpts() const
Returns the language options.
Definition Context.cpp:276
Scope used to handle temporaries in toplevel variable declarations.
Definition Compiler.cpp:39
Bytecode function.
Definition Function.h:86
InitLinkScope(Compiler< Emitter > *Ctx, InitLink &&Link)
Definition Compiler.h:670
InitStackScope(Compiler< Emitter > *Ctx, bool Active)
Definition Compiler.h:682
When generating code for e.g.
Definition Compiler.cpp:187
Generic scope for local variables.
Definition Compiler.h:538
UnsignedOrNone Idx
Index of the scope in the chain.
Definition Compiler.h:622
~LocalScope() override
Emit a Destroy op for this scope.
Definition Compiler.h:546
bool destroyLocals(const Expr *E=nullptr) override
Explicit destruction of local variables.
Definition Compiler.h:563
LocalScope(Compiler< Emitter > *Ctx, const ValueDecl *VD)
Definition Compiler.h:542
bool emitDestructors(const Expr *E=nullptr) override
Definition Compiler.h:584
void emitDestruction() override
Overriden to support explicit destruction.
Definition Compiler.h:554
void removeIfStoredOpaqueValue(const Scope::Local &Local)
Definition Compiler.h:612
void addLocal(const Scope::Local &Local) override
Definition Compiler.h:574
LocalScope(Compiler< Emitter > *Ctx, ScopeKind Kind=ScopeKind::Block)
Definition Compiler.h:540
Sets the context for break/continue statements.
Definition Compiler.cpp:113
Scope used to handle initialization methods.
Definition Compiler.cpp:59
The program contains and links the bytecode for all functions.
Definition Program.h:36
Structure/Class descriptor.
Definition Record.h:25
Describes the statement/declaration an opcode was generated from.
Definition Source.h:73
SourceLocScope(Compiler< Emitter > *Ctx, const Expr *DefaultExpr)
Definition Compiler.h:649
Scope chain managing the variable lifetimes.
Definition Compiler.h:470
void addExtended(const Scope::Local &Local, const ValueDecl *ExtendingDecl)
Definition Compiler.h:484
void addForScopeKind(const Scope::Local &Local, ScopeKind Kind)
Like addExtended, but adds to the nearest scope of the given kind.
Definition Compiler.h:506
Compiler< Emitter > * Ctx
Compiler instance.
Definition Compiler.h:530
virtual bool emitDestructors(const Expr *E=nullptr)
Definition Compiler.h:523
virtual bool destroyLocals(const Expr *E=nullptr)
Definition Compiler.h:524
const ValueDecl * ValDecl
Definition Compiler.h:533
VariableScope * Parent
Link to the parent scope.
Definition Compiler.h:532
VariableScope(Compiler< Emitter > *Ctx, const ValueDecl *VD, ScopeKind Kind=ScopeKind::Block)
Definition Compiler.h:472
virtual void addLocal(const Scope::Local &Local)
Definition Compiler.h:480
ScopeKind getKind() const
Definition Compiler.h:526
VariableScope * getParent() const
Definition Compiler.h:525
virtual void emitDestruction()
Definition Compiler.h:522
#define bool
Definition gpuintrin.h:32
bool Call(InterpState &S, CodePtr OpPC, const Function *Func, uint32_t VarArgSize)
Definition Interp.cpp:1553
llvm::PointerUnion< const Decl *, const Expr * > DeclTy
Definition Descriptor.h:29
static bool Activate(InterpState &S, CodePtr OpPC)
Definition Interp.h:1984
llvm::APFloat APFloat
Definition Floating.h:27
PrimType
Enumeration of the primitive types of the VM.
Definition PrimType.h:34
bool Init(InterpState &S, CodePtr OpPC)
Definition Interp.h:2098
The JSON file list parser is used to communicate input to InstallAPI.
@ Success
Annotation was successful.
Definition Parser.h:65
@ Link
'link' clause, allowed on 'declare' construct.
nullptr
This class represents a compute construct, representing a 'Kind' of β€˜parallel’, 'serial',...
const FunctionProtoType * T
const VariableScope< Emitter > * BreakOrContinueScope
Definition Compiler.h:120
LabelInfo(const Stmt *Name, OptLabelTy BreakLabel, OptLabelTy ContinueLabel, OptLabelTy DefaultLabel, const VariableScope< Emitter > *BreakOrContinueScope)
Definition Compiler.h:124
Information about a local's storage.
Definition Function.h:39
State encapsulating if a the variable creation has been successful, unsuccessful, or no variable has ...
Definition Compiler.h:95
static VarCreationState NotCreated()
Definition Compiler.h:99
std::optional< bool > S
Definition Compiler.h:96