assert(CXXRD &&
"Cannot compile a destructor for a nullptr");
38 if(
autoDtor = Dtors.find(CXXRD); Dtor != Dtors.end())
39 returnDtor->getSecond();
42 returnllvm::orc::ExecutorAddr{};
47llvm::StringRef Name =
51 returnAddrOrErr.takeError();
53Dtors[CXXRD] = *AddrOrErr;
60:
public TypeVisitor<InterfaceKindVisitor, InterfaceKind> {
68: S(S),
E(
E), Args(Args) {}
98assert(!AddrOfE.
isInvalid() &&
"Can not create unary expression");
99Args.push_back(AddrOfE.
get());
109HandleIntegralOrEnumType(Ty);
118HandleIntegralOrEnumType(Ty);
125 voidHandleIntegralOrEnumType(
const Type*Ty) {
132assert(!CastedExpr.
isInvalid() &&
"Cannot create cstyle cast expr");
133Args.push_back(CastedExpr.
get());
136 voidHandlePtrType(
const Type*Ty) {
141assert(!CastedExpr.
isInvalid() &&
"Can not create cstyle cast expression");
142Args.push_back(CastedExpr.
get());
164 if(!ValuePrintingInfo[0]) {
165assert(llvm::all_of(ValuePrintingInfo, [](
Expr*
E) {
return!
E; }));
168llvm::StringRef Name) -> llvm::Error {
171RedeclarationKind::ForVisibleRedeclaration);
174 returnllvm::make_error<llvm::StringError>(
175Name +
" not found!", llvm::inconvertibleErrorCode());
179 returnllvm::Error::success();
181 static constexprllvm::StringRef Builtin[] = {
182 "__clang_Interpreter_SetValueNoAlloc",
183 "__clang_Interpreter_SetValueWithAlloc",
184 "__clang_Interpreter_SetValueCopyArr",
"__ci_newtag"};
185 if(llvm::Error Err =
186LookupInterface(ValuePrintingInfo[
NoAlloc], Builtin[
NoAlloc]))
187 returnstd::move(Err);
190 if(llvm::Error Err =
192 returnstd::move(Err);
193 if(llvm::Error Err =
195 returnstd::move(Err);
196 if(llvm::Error Err =
197LookupInterface(ValuePrintingInfo[
NewTag], Builtin[
NewTag]))
198 returnstd::move(Err);
207AdjustedArgs.push_back(
213 if(
auto*EWC = llvm::dyn_cast_if_present<ExprWithCleanups>(
E))
214 E= EWC->getSubExpr();
228AdjustedArgs.push_back(TypeArg);
244assert(!AllocCall.
isInvalid() &&
"Can't create runtime interface call!");
251Dtor->
addAttr(UsedAttr::CreateImplicit(Ctx));
258 const auto*ConstantArrTy =
259cast<ConstantArrayType>(DesugaredTy.
getTypePtr());
262 Expr*Args[] = {
E, AllocCall.
get(), ArrSizeExpr};
276 "Can't create runtime placement new call!");
290llvm_unreachable(
"Unhandled InterfaceKind");
297 returnSetValueE.
get();
302using namespace clang;
314 void*This,
void*OutVal,
void*OpaqueType, ...) {
317VRef =
Value(I, OpaqueType);
329QT = ET->getDecl()->getIntegerType();
332llvm_unreachable(
"unknown type kind!");
335 caseBuiltinType::Bool:
336VRef.setBool(
va_arg(args,
int));
338 caseBuiltinType::Char_S:
339VRef.setChar_S(
va_arg(args,
int));
341 caseBuiltinType::SChar:
342VRef.setSChar(
va_arg(args,
int));
344 caseBuiltinType::Char_U:
345VRef.setChar_U(
va_arg(args,
unsigned));
347 caseBuiltinType::UChar:
348VRef.setUChar(
va_arg(args,
unsigned));
350 caseBuiltinType::Short:
351VRef.setShort(
va_arg(args,
int));
353 caseBuiltinType::UShort:
354VRef.setUShort(
va_arg(args,
unsigned));
356 caseBuiltinType::Int:
357VRef.setInt(
va_arg(args,
int));
359 caseBuiltinType::UInt:
360VRef.setUInt(
va_arg(args,
unsigned));
362 caseBuiltinType::Long:
363VRef.setLong(
va_arg(args,
long));
365 caseBuiltinType::ULong:
366VRef.setULong(
va_arg(args,
unsigned long));
368 caseBuiltinType::LongLong:
369VRef.setLongLong(
va_arg(args,
long long));
371 caseBuiltinType::ULongLong:
372VRef.setULongLong(
va_arg(args,
unsigned long long));
375 caseBuiltinType::Float:
376VRef.setFloat(
va_arg(args,
double));
378 caseBuiltinType::Double:
379VRef.setDouble(
va_arg(args,
double));
381 caseBuiltinType::LongDouble:
382VRef.setLongDouble(
va_arg(args,
long double));
399 return operator new(__sz,
__p);
Defines the clang::ASTContext interface.
REPL_EXTERNAL_VISIBILITY void * __clang_Interpreter_SetValueWithAlloc(void *This, void *OutVal, void *OpaqueType)
void REPL_EXTERNAL_VISIBILITY __clang_Interpreter_SetValueNoAlloc(void *This, void *OutVal, void *OpaqueType,...)
#define REPL_EXTERNAL_VISIBILITY
Defines the clang::Preprocessor interface.
C Language Family Type Representation.
#define va_start(ap, param)
__builtin_va_list va_list
static __inline__ uint32_t volatile uint32_t * __p
virtual bool HandleTopLevelDecl(DeclGroupRef D)
HandleTopLevelDecl - Handle the specified top-level declaration.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TranslationUnitDecl * getTranslationUnitDecl() const
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
const LangOptions & getLangOpts() const
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
uint64_t getConstantArrayElementCount(const ConstantArrayType *CA) const
Return number of constant array elements.
QualType getBitIntType(bool Unsigned, unsigned NumBits) const
Return a bit-precise integer type with the specified signedness and bit count.
This class is used for builtin types like 'int'.
Represents a C++ destructor within a class.
Represents a C++ struct/union/class.
bool hasIrrelevantDestructor() const
Determine whether this class has a destructor which has no semantic effect.
Represents a C++ nested-name-specifier or a global scope specifier.
llvm::StringRef GetMangledName(GlobalDecl GD)
Given a global declaration, return a mangled name for this declaration which has been added to this c...
ASTConsumer & getASTConsumer() const
Represents the canonical version of C arrays with a specified constant size.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
This represents one expression.
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language.
Represents a prototype with parameter type info, e.g.
GlobalDecl - represents a global declaration.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
InterfaceKind VisitConstantArrayType(const ConstantArrayType *Ty)
InterfaceKind VisitFunctionProtoType(const FunctionProtoType *Ty)
InterfaceKind computeInterfaceKind(QualType Ty)
InterfaceKind VisitReferenceType(const ReferenceType *Ty)
InterfaceKind VisitPointerType(const PointerType *Ty)
InterfaceKind VisitEnumType(const EnumType *Ty)
InterfaceKind VisitBuiltinType(const BuiltinType *Ty)
InterfaceKind VisitRecordType(const RecordType *Ty)
InterfaceKind VisitMemberPointerType(const MemberPointerType *Ty)
InterfaceKindVisitor(Sema &S, Expr *E, llvm::SmallVectorImpl< Expr * > &Args)
Provides top-level interfaces for incremental compilation and execution.
llvm::Expected< llvm::orc::ExecutorAddr > getSymbolAddress(GlobalDecl GD) const
const CompilerInstance * getCompilerInstance() const
Represents the results of name lookup.
A pointer to member type per C++ 8.3.3 - Pointers to members.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
void * getAsOpaquePtr() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Base for LValueReferenceType and RValueReferenceType.
Scope - A scope is a transient data structure that is used while parsing the program.
Sema - This implements semantic analysis and AST building for C.
ExprResult CreateBuiltinUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *InputExpr, bool IsAfterAmp=false)
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
ASTContext & getASTContext() const
CXXDestructorDecl * LookupDestructor(CXXRecordDecl *Class)
Look for the destructor of the given class.
ExprResult BuildCXXNew(SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional< Expr * > ArraySize, SourceRange DirectInitRange, Expr *Initializer)
ExprResult BuildCStyleCastExpr(SourceLocation LParenLoc, TypeSourceInfo *Ty, SourceLocation RParenLoc, Expr *Op)
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL, bool AcceptInvalidDecl=false)
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
ExprResult ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr)
ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEndLoc() const LLVM_READONLY
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
InterfaceKind Visit(const Type *T)
Performs the operation associated with this visitor object.
The base class of the type hierarchy.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
const T * castAs() const
Member-template castAs<specific type>.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
bool isFloatingType() const
const T * getAs() const
Member-template getAs<specific type>'.
bool isNullPtrType() const
bool isRecordType() const
The JSON file list parser is used to communicate input to InstallAPI.
IntegerLiteral * IntegerLiteralExpr(ASTContext &C, uint64_t Val)
@ Dtor_Base
Base object dtor.
Expr * CStyleCastPtrExpr(Sema &S, QualType Ty, Expr *E)
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4