;
38using namespacethreadSafety;
43 caseStmt::IntegerLiteralClass:
44 return toString(cast<IntegerLiteral>(CE)->getValue(), 10,
true);
45 caseStmt::StringLiteralClass: {
46std::string ret(
"\"");
47ret += cast<StringLiteral>(CE)->getString();
51 caseStmt::CharacterLiteralClass:
52 caseStmt::CXXNullPtrLiteralExprClass:
53 caseStmt::GNUNullExprClass:
54 caseStmt::CXXBoolLiteralExprClass:
55 caseStmt::FloatingLiteralClass:
56 caseStmt::ImaginaryLiteralClass:
57 caseStmt::ObjCStringLiteralClass:
65 if(
const auto*Ph = dyn_cast<til::Phi>(
E))
75Walker.
walk(*
this);
81 returnME ? ME->isArrow() :
false;
93 if(
const auto*RD = RT->getDecl())
94 if(
const auto*CA = RD->getAttr<CapabilityAttr>())
97 if(
const auto*TD = TT->getDecl())
98 if(
const auto*CA = TD->getAttr<CapabilityAttr>())
120 if(!DeclExp && !
Self)
129 else if(
const auto*ME = dyn_cast<MemberExpr>(DeclExp)) {
130Ctx.SelfArg = ME->getBase();
131Ctx.SelfArrow = ME->isArrow();
132}
else if(
const auto*CE = dyn_cast<CXXMemberCallExpr>(DeclExp)) {
133Ctx.SelfArg = CE->getImplicitObjectArgument();
135Ctx.NumArgs = CE->getNumArgs();
136Ctx.FunArgs = CE->getArgs();
137}
else if(
const auto*CE = dyn_cast<CallExpr>(DeclExp)) {
139 if(isa<CXXOperatorCallExpr>(CE) && isa<CXXMethodDecl>(
D)) {
140Ctx.SelfArg = CE->getArg(0);
141Ctx.SelfArrow =
false;
142Ctx.NumArgs = CE->getNumArgs() - 1;
143Ctx.FunArgs = CE->getArgs() + 1;
145Ctx.NumArgs = CE->getNumArgs();
146Ctx.FunArgs = CE->getArgs();
148}
else if(
const auto*CE = dyn_cast<CXXConstructExpr>(DeclExp)) {
149Ctx.SelfArg =
nullptr;
150Ctx.NumArgs = CE->getNumArgs();
151Ctx.FunArgs = CE->getArgs();
158 if(
const auto*CMD = dyn_cast<CXXMethodDecl>(
D))
159 if(CMD->getParent()->isLambda())
160Ctx.SelfArg =
nullptr;
163assert(!Ctx.SelfArg &&
"Ambiguous self argument");
164assert(isa<FunctionDecl>(
D) &&
"Self argument requires function");
165 if(isa<CXXMethodDecl>(
D))
175cast<CXXMethodDecl>(
D)->getFunctionObjectParameterType()),
195 if(
const auto* SLit = dyn_cast<StringLiteral>(AttrExp)) {
196 if(SLit->getString() ==
"*")
207 if(
const auto*OE = dyn_cast<CXXOperatorCallExpr>(AttrExp)) {
208 if(OE->getOperator() == OO_Exclaim) {
210AttrExp = OE->getArg(0);
213 else if(
const auto*UO = dyn_cast<UnaryOperator>(AttrExp)) {
214 if(UO->getOpcode() == UO_LNot) {
224 if(!
E|| isa<til::Literal>(
E))
230 if(
const auto*CE = dyn_cast<til::Cast>(
E)) {
241std::pair<til::LiteralPtr *, StringRef>
259 switch(S->getStmtClass()) {
260 caseStmt::DeclRefExprClass:
261 returntranslateDeclRefExpr(cast<DeclRefExpr>(S), Ctx);
262 caseStmt::CXXThisExprClass:
263 returntranslateCXXThisExpr(cast<CXXThisExpr>(S), Ctx);
264 caseStmt::MemberExprClass:
265 returntranslateMemberExpr(cast<MemberExpr>(S), Ctx);
266 caseStmt::ObjCIvarRefExprClass:
267 returntranslateObjCIVarRefExpr(cast<ObjCIvarRefExpr>(S), Ctx);
268 caseStmt::CallExprClass:
269 returntranslateCallExpr(cast<CallExpr>(S), Ctx);
270 caseStmt::CXXMemberCallExprClass:
271 returntranslateCXXMemberCallExpr(cast<CXXMemberCallExpr>(S), Ctx);
272 caseStmt::CXXOperatorCallExprClass:
273 returntranslateCXXOperatorCallExpr(cast<CXXOperatorCallExpr>(S), Ctx);
274 caseStmt::UnaryOperatorClass:
275 returntranslateUnaryOperator(cast<UnaryOperator>(S), Ctx);
276 caseStmt::BinaryOperatorClass:
277 caseStmt::CompoundAssignOperatorClass:
278 returntranslateBinaryOperator(cast<BinaryOperator>(S), Ctx);
280 caseStmt::ArraySubscriptExprClass:
281 returntranslateArraySubscriptExpr(cast<ArraySubscriptExpr>(S), Ctx);
282 caseStmt::ConditionalOperatorClass:
283 returntranslateAbstractConditionalOperator(
284cast<ConditionalOperator>(S), Ctx);
285 caseStmt::BinaryConditionalOperatorClass:
286 returntranslateAbstractConditionalOperator(
287cast<BinaryConditionalOperator>(S), Ctx);
290 caseStmt::ConstantExprClass:
291 return translate(cast<ConstantExpr>(S)->getSubExpr(), Ctx);
292 caseStmt::ParenExprClass:
293 return translate(cast<ParenExpr>(S)->getSubExpr(), Ctx);
294 caseStmt::ExprWithCleanupsClass:
295 return translate(cast<ExprWithCleanups>(S)->getSubExpr(), Ctx);
296 caseStmt::CXXBindTemporaryExprClass:
297 return translate(cast<CXXBindTemporaryExpr>(S)->getSubExpr(), Ctx);
298 caseStmt::MaterializeTemporaryExprClass:
299 return translate(cast<MaterializeTemporaryExpr>(S)->getSubExpr(), Ctx);
302 caseStmt::CharacterLiteralClass:
303 caseStmt::CXXNullPtrLiteralExprClass:
304 caseStmt::GNUNullExprClass:
305 caseStmt::CXXBoolLiteralExprClass:
306 caseStmt::FloatingLiteralClass:
307 caseStmt::ImaginaryLiteralClass:
308 caseStmt::IntegerLiteralClass:
309 caseStmt::StringLiteralClass:
310 caseStmt::ObjCStringLiteralClass:
313 caseStmt::DeclStmtClass:
314 returntranslateDeclStmt(cast<DeclStmt>(S), Ctx);
318 if(
const auto*CE = dyn_cast<CastExpr>(S))
319 returntranslateCastExpr(CE, Ctx);
329 if(
const auto*PV = dyn_cast<ParmVarDecl>(VD)) {
330 unsignedI = PV->getFunctionScopeIndex();
332 if(Ctx && Ctx->FunArgs) {
333 const Decl*Canonical = Ctx->AttrDecl->getCanonicalDecl();
334 if(isa<FunctionDecl>(
D)
338 if(
const Expr*
const*FunArgs =
339dyn_cast<const Expr *const *>(Ctx->FunArgs)) {
340assert(I < Ctx->NumArgs);
341 return translate(FunArgs[I], Ctx->Prev);
345 returncast<til::SExpr *>(Ctx->FunArgs);
350VD = isa<FunctionDecl>(
D)
351? cast<FunctionDecl>(
D)->getCanonicalDecl()->getParamDecl(I)
352: cast<ObjCMethodDecl>(
D)->getCanonicalDecl()->getParamDecl(I);
362 if(Ctx && Ctx->SelfArg) {
363 if(
const auto*SelfArg = dyn_cast<const Expr *>(Ctx->SelfArg))
366 returncast<til::SExpr *>(Ctx->SelfArg);
368assert(SelfVar &&
"We have no variable for 'this'!");
373 if(
const auto*
V= dyn_cast<til::Variable>(
E))
374 return V->clangDecl();
375 if(
const auto*Ph = dyn_cast<til::Phi>(
E))
376 returnPh->clangDecl();
377 if(
const auto*
P= dyn_cast<til::Project>(
E))
378 return P->clangDecl();
379 if(
const auto*L = dyn_cast<til::LiteralPtr>(
E))
380 returnL->clangDecl();
386 if(VD && VD->getType()->isAnyPointerType())
388 if(
const auto*
C= dyn_cast<til::Cast>(
E))
398 autoOverriddenMethods =
D->overridden_methods();
399 if(OverriddenMethods.begin() == OverriddenMethods.end())
402 D= *OverriddenMethods.begin();
413 if(
const auto*VD = dyn_cast<CXXMethodDecl>(
D))
418 P->setArrow(
true);
431 P->setArrow(
true);
438 if(CapabilityExprMode) {
441FD = FD->getMostRecentDecl();
442 if(LockReturnedAttr *At = FD->getAttr<LockReturnedAttr>()) {
445LRCallCtx.SelfArg = SelfE;
447LRCallCtx.FunArgs = CE->
getArgs();
455 for(
const auto*Arg : CE->
arguments()) {
462til::SExpr*SExprBuilder::translateCXXMemberCallExpr(
464 if(CapabilityExprMode) {
473 returntranslateCallExpr(cast<CallExpr>(ME), Ctx,
477til::SExpr*SExprBuilder::translateCXXOperatorCallExpr(
479 if(CapabilityExprMode) {
482 if(k == OO_Star || k == OO_Arrow) {
488 returntranslateCallExpr(cast<CallExpr>(OCE), Ctx);
501 if(CapabilityExprMode) {
503 if(
const auto*DRE = dyn_cast<DeclRefExpr>(UO->
getSubExpr())) {
562 if(
const auto*DRE = dyn_cast<DeclRefExpr>(LHS)) {
564CV = lookupVarDecl(VD);
570E1 = addStatement(E1,
nullptr, VD);
573 returnupdateVarDecl(VD, E1);
584 caseBO_Mul:
returntranslateBinOp(
til::BOP_Mul, BO, Ctx);
585 caseBO_Div:
returntranslateBinOp(
til::BOP_Div, BO, Ctx);
586 caseBO_Rem:
returntranslateBinOp(
til::BOP_Rem, BO, Ctx);
587 caseBO_Add:
returntranslateBinOp(
til::BOP_Add, BO, Ctx);
588 caseBO_Sub:
returntranslateBinOp(
til::BOP_Sub, BO, Ctx);
589 caseBO_Shl:
returntranslateBinOp(
til::BOP_Shl, BO, Ctx);
590 caseBO_Shr:
returntranslateBinOp(
til::BOP_Shr, BO, Ctx);
591 caseBO_LT:
returntranslateBinOp(
til::BOP_Lt, BO, Ctx);
592 caseBO_GT:
returntranslateBinOp(
til::BOP_Lt, BO, Ctx,
true);
593 caseBO_LE:
returntranslateBinOp(
til::BOP_Leq, BO, Ctx);
594 caseBO_GE:
returntranslateBinOp(
til::BOP_Leq, BO, Ctx,
true);
595 caseBO_EQ:
returntranslateBinOp(
til::BOP_Eq, BO, Ctx);
596 caseBO_NE:
returntranslateBinOp(
til::BOP_Neq, BO, Ctx);
597 caseBO_Cmp:
returntranslateBinOp(
til::BOP_Cmp, BO, Ctx);
604 caseBO_Assign:
returntranslateBinAssign(
til::BOP_Eq, BO, Ctx,
true);
605 caseBO_MulAssign:
returntranslateBinAssign(
til::BOP_Mul, BO, Ctx);
606 caseBO_DivAssign:
returntranslateBinAssign(
til::BOP_Div, BO, Ctx);
607 caseBO_RemAssign:
returntranslateBinAssign(
til::BOP_Rem, BO, Ctx);
608 caseBO_AddAssign:
returntranslateBinAssign(
til::BOP_Add, BO, Ctx);
609 caseBO_SubAssign:
returntranslateBinAssign(
til::BOP_Sub, BO, Ctx);
610 caseBO_ShlAssign:
returntranslateBinAssign(
til::BOP_Shl, BO, Ctx);
611 caseBO_ShrAssign:
returntranslateBinAssign(
til::BOP_Shr, BO, Ctx);
612 caseBO_AndAssign:
returntranslateBinAssign(
til::BOP_BitAnd, BO, Ctx);
613 caseBO_XorAssign:
returntranslateBinAssign(
til::BOP_BitXor, BO, Ctx);
614 caseBO_OrAssign:
returntranslateBinAssign(
til::BOP_BitOr, BO, Ctx);
627 caseCK_LValueToRValue: {
628 if(
const auto*DRE = dyn_cast<DeclRefExpr>(CE->
getSubExpr())) {
639 caseCK_DerivedToBase:
640 caseCK_UncheckedDerivedToBase:
641 caseCK_ArrayToPointerDecay:
642 caseCK_FunctionToPointerDecay: {
649 if(CapabilityExprMode)
665SExprBuilder::translateAbstractConditionalOperator(
676 for(
auto*I : DGrp) {
677 if(
auto*VD = dyn_cast_or_null<VarDecl>(I)) {
678 Expr*
E= VD->getInit();
684 returnaddVarDecl(VD, SE);
703CurrentInstructions.push_back(
E);
711 autoIt = LVarIdxMap.find(VD);
712 if(It != LVarIdxMap.end()) {
713assert(CurrentLVarMap[It->second].first == VD);
714 returnCurrentLVarMap[It->second].second;
723 if(
auto*
V= dyn_cast<til::Variable>(
E)) {
724 if(!
V->clangDecl())
725 V->setClangDecl(VD);
732LVarIdxMap.insert(std::make_pair(VD, CurrentLVarMap.
size()));
734CurrentLVarMap.
push_back(std::make_pair(VD,
E));
741 autoIt = LVarIdxMap.find(VD);
742 if(It == LVarIdxMap.end()) {
748CurrentLVarMap.
elem(It->second).second =
E;
755voidSExprBuilder::makePhiNodeVar(
unsignedi,
unsignedNPreds,
til::SExpr*
E) {
756 unsignedArgIndex = CurrentBlockInfo->ProcessedPredecessors;
757assert(ArgIndex > 0 && ArgIndex < NPreds);
760 if(CurrE->
block() == CurrentBB) {
763 auto*Ph = dyn_cast<til::Phi>(CurrE);
764assert(Ph &&
"Expecting Phi node.");
766Ph->values()[ArgIndex] =
E;
774 for(
unsignedPIdx = 0; PIdx < ArgIndex; ++PIdx)
775Ph->
values()[PIdx] = CurrE;
785CurrentArguments.push_back(Ph);
787IncompleteArgs.push_back(Ph);
790CurrentLVarMap.
elem(i).second = Ph;
795voidSExprBuilder::mergeEntryMap(LVarDefinitionMap Map) {
796assert(CurrentBlockInfo &&
"Not processing a block!");
798 if(!CurrentLVarMap.
valid()) {
800CurrentLVarMap = std::move(Map);
803 if(CurrentLVarMap.
sameAs(Map))
807 unsignedESz = CurrentLVarMap.
size();
808 unsignedMSz = Map.size();
809 unsignedSz = std::min(ESz, MSz);
811 for(
unsignedi = 0; i < Sz; ++i) {
812 if(CurrentLVarMap[i].first != Map[i].first) {
818 if(CurrentLVarMap[i].second != Map[i].second)
819makePhiNodeVar(i, NPreds, Map[i].second);
823CurrentLVarMap.
downsize(Map.size());
829voidSExprBuilder::mergeEntryMapBackEdge() {
838assert(CurrentBlockInfo &&
"Not processing a block!");
840 if(CurrentBlockInfo->HasBackEdges)
842CurrentBlockInfo->HasBackEdges =
true;
845 unsignedSz = CurrentLVarMap.
size();
848 for(
unsignedi = 0; i < Sz; ++i)
849makePhiNodeVar(i, NPreds,
nullptr);
855voidSExprBuilder::mergePhiNodesBackEdge(
const CFGBlock*Blk) {
857 unsignedArgIndex = BBInfo[Blk->
getBlockID()].ProcessedPredecessors;
858assert(ArgIndex > 0 && ArgIndex < BB->numPredecessors());
861 auto*Ph = dyn_cast_or_null<til::Phi>(PE);
862assert(Ph &&
"Expecting Phi Node.");
863assert(Ph->
values()[ArgIndex] ==
nullptr&&
"Wrong index for back edge.");
866assert(
E&&
"Couldn't find local variable for Phi node.");
875Scfg =
new(Arena)
til::SCFG(Arena, NBlocks);
878BBInfo.resize(NBlocks);
879BlockMap.resize(NBlocks,
nullptr);
881 for(
auto*B : *Cfg) {
884BlockMap[B->getBlockID()] = BB;
888 autoParms = isa<ObjCMethodDecl>(
D) ? cast<ObjCMethodDecl>(
D)->parameters()
889: cast<FunctionDecl>(
D)->parameters();
890 for(
auto*Pm : Parms) {
892 if(!
T.isTrivialType(Pm->getASTContext()))
904voidSExprBuilder::enterCFGBlock(
const CFGBlock*B) {
908Scfg->
add(CurrentBB);
910CurrentBlockInfo = &BBInfo[B->
getBlockID()];
917voidSExprBuilder::handlePredecessor(
const CFGBlock*Pred) {
921BlockInfo *PredInfo = &BBInfo[Pred->
getBlockID()];
922assert(PredInfo->UnprocessedSuccessors > 0);
924 if(--PredInfo->UnprocessedSuccessors == 0)
925mergeEntryMap(std::move(PredInfo->ExitMap));
927mergeEntryMap(PredInfo->ExitMap.clone());
929++CurrentBlockInfo->ProcessedPredecessors;
932voidSExprBuilder::handlePredecessorBackEdge(
const CFGBlock*Pred) {
933mergeEntryMapBackEdge();
936voidSExprBuilder::enterCFGBlockBody(
const CFGBlock*B) {
940 static_cast<unsigned>(CurrentArguments.size()), Arena);
941 for(
auto*A : CurrentArguments)
945voidSExprBuilder::handleStatement(
const Stmt*S) {
947addStatement(
E, S);
950voidSExprBuilder::handleDestructorCall(
const VarDecl*VD,
956addStatement(
E,
nullptr);
959voidSExprBuilder::exitCFGBlockBody(
const CFGBlock*B) {
961 static_cast<unsigned>(CurrentInstructions.size()), Arena);
962 for(
auto*
V: CurrentInstructions)
972 auto*Tm =
new(Arena)
til::Goto(BB, Idx);
986voidSExprBuilder::handleSuccessor(
const CFGBlock*Succ) {
987++CurrentBlockInfo->UnprocessedSuccessors;
990voidSExprBuilder::handleSuccessorBackEdge(
const CFGBlock*Succ) {
991mergePhiNodesBackEdge(Succ);
992++BBInfo[Succ->
getBlockID()].ProcessedPredecessors;
995voidSExprBuilder::exitCFGBlock(
const CFGBlock*B) {
996CurrentArguments.clear();
997CurrentInstructions.clear();
998CurrentBlockInfo->ExitMap = std::move(CurrentLVarMap);
999CurrentBB =
nullptr;
1000CurrentBlockInfo =
nullptr;
1004 for(
auto*Ph : IncompleteArgs) {
1009CurrentArguments.clear();
1010CurrentInstructions.clear();
1011IncompleteArgs.clear();
1023namespacethreadSafety {
1026llvm::BumpPtrAllocator Bpa;
1030TILPrinter::print(Scfg, llvm::errs());
llvm::DenseMap< const Stmt *, CFGBlock * > SMap
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::Expr interface and subclasses for C++ expressions.
static const Decl * getCanonicalDecl(const Decl *D)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines an enumeration for C++ overloaded operators.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Defines various enumerations that describe declaration and type specifiers.
static bool isIncompletePhi(const til::SExpr *E)
static const ValueDecl * getValueDeclFromSExpr(const til::SExpr *E)
static void maybeUpdateVD(til::SExpr *E, const ValueDecl *VD)
static bool hasAnyPointerType(const til::SExpr *E)
static const CXXMethodDecl * getFirstVirtualDecl(const CXXMethodDecl *D)
static StringRef ClassifyDiagnostic(const CapabilityAttr *A)
static bool isCalleeArrow(const Expr *E)
C Language Family Type Representation.
AbstractConditionalOperator - An abstract base class for ConditionalOperator and BinaryConditionalOpe...
Expr * getCond() const
getCond - Return the expression representing the condition for the ?: operator.
Expr * getTrueExpr() const
getTrueExpr - Return the subexpression representing the value of the expression if the condition eval...
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression representing the value of the expression if the condition eva...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
A builtin binary operation expression such as "x + y" or "x <= y".
Represents a single basic block in a source-level CFG.
succ_iterator succ_begin()
unsigned pred_size() const
unsigned getBlockID() const
Stmt * getTerminatorCondition(bool StripParens=true)
unsigned succ_size() const
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
unsigned getNumBlockIDs() const
Returns the total number of BlockIDs allocated (which start at 0).
Represents a C++ destructor within a class.
Represents a call to a member function that may be written either with member call syntax (e....
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
Represents a static or instance method of a struct/union/class.
A call to an overloaded operator written using operator syntax.
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Represents the this expression in C++.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Expr * getArg(unsigned Arg)
getArg - Return the specified argument.
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Expr ** getArgs()
Retrieve the call arguments.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
CastKind getCastKind() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
DeclContext * getDeclContext()
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
This represents one expression.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
Expr * IgnoreImplicit() LLVM_READONLY
Skip past any implicit AST nodes which might surround this expression until reaching a fixed point.
Represents a function declaration or definition.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
This represents a decl that may have a name.
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
const Expr * getBase() const
A (possibly-)qualified type.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Stmt - This represents one statement.
StmtClass getStmtClass() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isPointerOrReferenceType() const
const T * getAs() const
Member-template getAs<specific type>'.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Expr * getSubExpr() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
const til::SExpr * sexpr() const
void push_back(const T &Elem)
bool sameAs(const CopyOnWriteVector &V) const
void downsize(unsigned i)
CapabilityExpr translateAttrExpr(const Expr *AttrExp, const NamedDecl *D, const Expr *DeclExp, til::SExpr *Self=nullptr)
Translate a clang expression in an attribute to a til::SExpr.
til::SExpr * translate(const Stmt *S, CallingContext *Ctx)
std::pair< til::LiteralPtr *, StringRef > createThisPlaceholder(const Expr *Exp)
til::SExpr * lookupStmt(const Stmt *S)
til::SCFG * buildCFG(CFGWalker &Walker)
til::LiteralPtr * createVariable(const VarDecl *VD)
til::BasicBlock * lookupBlock(const CFGBlock *B)
Apply an argument to a function.
If p is a reference to an array, then p[i] is a reference to the i'th element of the array.
A basic block is part of an SCFG.
unsigned addPredecessor(BasicBlock *Pred)
const InstrArray & arguments() const
void reserveInstructions(unsigned Nins)
void addArgument(Phi *V)
Add a new argument.
size_t numPredecessors() const
Returns the number of predecessors.
InstrArray & instructions()
void reservePredecessors(unsigned NumPreds)
unsigned findPredecessorIndex(const BasicBlock *BB) const
Return the index of BB, or Predecessors.size if BB is not a predecessor.
void setTerminator(Terminator *E)
void addInstruction(SExpr *V)
Add a new instruction.
Simple arithmetic binary operations, e.g.
A conditional branch to two other blocks.
Call a function (after all arguments have been applied).
Jump to another basic block.
An if-then-else expression.
A Literal pointer to an object allocated in memory.
Load a value from memory.
Phi Node, for code in SSA form.
const ValueDecl * clangDecl() const
Return the clang declaration of the variable for this Phi node, if any.
void setClangDecl(const ValueDecl *Cvd)
Set the clang variable associated with this Phi node.
const ValArray & values() const
Project a named slot from a C++ struct or class.
Apply a self-argument to a self-applicable function.
An SCFG is a control-flow graph.
Base class for AST nodes in the typed intermediate language.
BasicBlock * block() const
Returns the block, if this is an instruction in a basic block, otherwise returns null.
void setValues(unsigned Sz, const T &C)
void reserve(size_t Ncp, MemRegionRef A)
Simple arithmetic unary operations, e.g.
Placeholder for expressions that cannot be represented in the TIL.
Placeholder for a wildcard that matches any other expression.
bool isTrivial(const SExpr *E)
void simplifyIncompleteArg(til::Phi *Ph)
TIL_BinaryOpcode
Opcode for binary arithmetic operations.
void printSCFG(CFGWalker &Walker)
std::string getSourceLiteralString(const Expr *CE)
The JSON file list parser is used to communicate input to InstallAPI.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
CastKind
CastKind - The kind of operation required for a conversion.
const FunctionProtoType * T
Encapsulates the lexical context of a function call.
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