29#include "llvm/ADT/StringExtras.h"
30#include "llvm/ADT/StringRef.h"
31#include "llvm/Support/Casting.h"
38using namespace threadSafety;
43 case Stmt::IntegerLiteralClass:
44 return toString(cast<IntegerLiteral>(CE)->getValue(), 10,
true);
45 case Stmt::StringLiteralClass: {
46 std::string ret(
"\"");
47 ret += cast<StringLiteral>(CE)->getString();
51 case Stmt::CharacterLiteralClass:
52 case Stmt::CXXNullPtrLiteralExprClass:
53 case Stmt::GNUNullExprClass:
54 case Stmt::CXXBoolLiteralExprClass:
55 case Stmt::FloatingLiteralClass:
56 case Stmt::ImaginaryLiteralClass:
57 case Stmt::ObjCStringLiteralClass:
65 if (
const auto *Ph = dyn_cast<til::Phi>(
E))
81 return ME ? 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)) {
132 }
else if (
const auto *CE = dyn_cast<CXXMemberCallExpr>(DeclExp)) {
133 Ctx.
SelfArg = CE->getImplicitObjectArgument();
135 Ctx.
NumArgs = CE->getNumArgs();
137 }
else if (
const auto *CE = dyn_cast<CallExpr>(DeclExp)) {
138 Ctx.
NumArgs = CE->getNumArgs();
140 }
else if (
const auto *CE = dyn_cast<CXXConstructExpr>(DeclExp)) {
142 Ctx.
NumArgs = CE->getNumArgs();
147 assert(!Ctx.
SelfArg &&
"Ambiguous self argument");
148 assert(isa<FunctionDecl>(
D) &&
"Self argument requires function");
149 if (isa<CXXMethodDecl>(
D))
159 cast<CXXMethodDecl>(
D)->getFunctionObjectParameterType()),
179 if (
const auto* SLit = dyn_cast<StringLiteral>(AttrExp)) {
180 if (SLit->getString() ==
"*")
191 if (
const auto *OE = dyn_cast<CXXOperatorCallExpr>(AttrExp)) {
192 if (OE->getOperator() == OO_Exclaim) {
194 AttrExp = OE->getArg(0);
197 else if (
const auto *UO = dyn_cast<UnaryOperator>(AttrExp)) {
198 if (UO->getOpcode() == UO_LNot) {
208 if (!
E || isa<til::Literal>(
E))
214 if (
const auto *CE = dyn_cast<til::Cast>(
E)) {
225std::pair<til::LiteralPtr *, StringRef>
243 switch (S->getStmtClass()) {
244 case Stmt::DeclRefExprClass:
245 return translateDeclRefExpr(cast<DeclRefExpr>(S), Ctx);
246 case Stmt::CXXThisExprClass:
247 return translateCXXThisExpr(cast<CXXThisExpr>(S), Ctx);
248 case Stmt::MemberExprClass:
249 return translateMemberExpr(cast<MemberExpr>(S), Ctx);
250 case Stmt::ObjCIvarRefExprClass:
251 return translateObjCIVarRefExpr(cast<ObjCIvarRefExpr>(S), Ctx);
252 case Stmt::CallExprClass:
253 return translateCallExpr(cast<CallExpr>(S), Ctx);
254 case Stmt::CXXMemberCallExprClass:
255 return translateCXXMemberCallExpr(cast<CXXMemberCallExpr>(S), Ctx);
256 case Stmt::CXXOperatorCallExprClass:
257 return translateCXXOperatorCallExpr(cast<CXXOperatorCallExpr>(S), Ctx);
258 case Stmt::UnaryOperatorClass:
259 return translateUnaryOperator(cast<UnaryOperator>(S), Ctx);
260 case Stmt::BinaryOperatorClass:
261 case Stmt::CompoundAssignOperatorClass:
262 return translateBinaryOperator(cast<BinaryOperator>(S), Ctx);
264 case Stmt::ArraySubscriptExprClass:
265 return translateArraySubscriptExpr(cast<ArraySubscriptExpr>(S), Ctx);
266 case Stmt::ConditionalOperatorClass:
267 return translateAbstractConditionalOperator(
268 cast<ConditionalOperator>(S), Ctx);
269 case Stmt::BinaryConditionalOperatorClass:
270 return translateAbstractConditionalOperator(
271 cast<BinaryConditionalOperator>(S), Ctx);
274 case Stmt::ConstantExprClass:
275 return translate(cast<ConstantExpr>(S)->getSubExpr(), Ctx);
276 case Stmt::ParenExprClass:
277 return translate(cast<ParenExpr>(S)->getSubExpr(), Ctx);
278 case Stmt::ExprWithCleanupsClass:
279 return translate(cast<ExprWithCleanups>(S)->getSubExpr(), Ctx);
280 case Stmt::CXXBindTemporaryExprClass:
281 return translate(cast<CXXBindTemporaryExpr>(S)->getSubExpr(), Ctx);
282 case Stmt::MaterializeTemporaryExprClass:
283 return translate(cast<MaterializeTemporaryExpr>(S)->getSubExpr(), Ctx);
286 case Stmt::CharacterLiteralClass:
287 case Stmt::CXXNullPtrLiteralExprClass:
288 case Stmt::GNUNullExprClass:
289 case Stmt::CXXBoolLiteralExprClass:
290 case Stmt::FloatingLiteralClass:
291 case Stmt::ImaginaryLiteralClass:
292 case Stmt::IntegerLiteralClass:
293 case Stmt::StringLiteralClass:
294 case Stmt::ObjCStringLiteralClass:
297 case Stmt::DeclStmtClass:
298 return translateDeclStmt(cast<DeclStmt>(S), Ctx);
302 if (
const auto *CE = dyn_cast<CastExpr>(S))
303 return translateCastExpr(CE, Ctx);
313 if (
const auto *PV = dyn_cast<ParmVarDecl>(VD)) {
314 unsigned I = PV->getFunctionScopeIndex();
318 if (isa<FunctionDecl>(
D)
322 if (
const Expr *
const *FunArgs =
324 assert(I < Ctx->NumArgs);
334 VD = isa<FunctionDecl>(
D)
335 ? cast<FunctionDecl>(
D)->getCanonicalDecl()->getParamDecl(I)
336 : cast<ObjCMethodDecl>(
D)->getCanonicalDecl()->getParamDecl(I);
347 if (
const auto *SelfArg = dyn_cast<const Expr *>(Ctx->
SelfArg))
350 return cast<til::SExpr *>(Ctx->
SelfArg);
352 assert(SelfVar &&
"We have no variable for 'this'!");
357 if (
const auto *
V = dyn_cast<til::Variable>(
E))
358 return V->clangDecl();
359 if (
const auto *Ph = dyn_cast<til::Phi>(
E))
360 return Ph->clangDecl();
361 if (
const auto *
P = dyn_cast<til::Project>(
E))
362 return P->clangDecl();
363 if (
const auto *L = dyn_cast<til::LiteralPtr>(
E))
364 return L->clangDecl();
370 if (VD && VD->getType()->isAnyPointerType())
372 if (
const auto *
C = dyn_cast<til::Cast>(
E))
382 auto OverriddenMethods =
D->overridden_methods();
383 if (OverriddenMethods.begin() == OverriddenMethods.end())
386 D = *OverriddenMethods.begin();
397 if (
const auto *VD = dyn_cast<CXXMethodDecl>(
D))
422 if (CapabilityExprMode) {
425 FD = FD->getMostRecentDecl();
426 if (LockReturnedAttr *At = FD->getAttr<LockReturnedAttr>()) {
429 LRCallCtx.SelfArg = SelfE;
431 LRCallCtx.FunArgs = CE->
getArgs();
439 for (
const auto *Arg : CE->
arguments()) {
446til::SExpr *SExprBuilder::translateCXXMemberCallExpr(
448 if (CapabilityExprMode) {
457 return translateCallExpr(cast<CallExpr>(ME), Ctx,
461til::SExpr *SExprBuilder::translateCXXOperatorCallExpr(
463 if (CapabilityExprMode) {
466 if (k == OO_Star || k == OO_Arrow) {
472 return translateCallExpr(cast<CallExpr>(OCE), Ctx);
485 if (CapabilityExprMode) {
487 if (
const auto *DRE = dyn_cast<DeclRefExpr>(UO->
getSubExpr())) {
546 if (
const auto *DRE = dyn_cast<DeclRefExpr>(LHS)) {
548 CV = lookupVarDecl(VD);
554 E1 = addStatement(E1,
nullptr, VD);
557 return updateVarDecl(VD, E1);
568 case BO_Mul:
return translateBinOp(
til::BOP_Mul, BO, Ctx);
569 case BO_Div:
return translateBinOp(
til::BOP_Div, BO, Ctx);
570 case BO_Rem:
return translateBinOp(
til::BOP_Rem, BO, Ctx);
571 case BO_Add:
return translateBinOp(
til::BOP_Add, BO, Ctx);
572 case BO_Sub:
return translateBinOp(
til::BOP_Sub, BO, Ctx);
573 case BO_Shl:
return translateBinOp(
til::BOP_Shl, BO, Ctx);
574 case BO_Shr:
return translateBinOp(
til::BOP_Shr, BO, Ctx);
575 case BO_LT:
return translateBinOp(
til::BOP_Lt, BO, Ctx);
576 case BO_GT:
return translateBinOp(
til::BOP_Lt, BO, Ctx,
true);
577 case BO_LE:
return translateBinOp(
til::BOP_Leq, BO, Ctx);
578 case BO_GE:
return translateBinOp(
til::BOP_Leq, BO, Ctx,
true);
579 case BO_EQ:
return translateBinOp(
til::BOP_Eq, BO, Ctx);
580 case BO_NE:
return translateBinOp(
til::BOP_Neq, BO, Ctx);
581 case BO_Cmp:
return translateBinOp(
til::BOP_Cmp, BO, Ctx);
588 case BO_Assign:
return translateBinAssign(
til::BOP_Eq, BO, Ctx,
true);
589 case BO_MulAssign:
return translateBinAssign(
til::BOP_Mul, BO, Ctx);
590 case BO_DivAssign:
return translateBinAssign(
til::BOP_Div, BO, Ctx);
591 case BO_RemAssign:
return translateBinAssign(
til::BOP_Rem, BO, Ctx);
592 case BO_AddAssign:
return translateBinAssign(
til::BOP_Add, BO, Ctx);
593 case BO_SubAssign:
return translateBinAssign(
til::BOP_Sub, BO, Ctx);
594 case BO_ShlAssign:
return translateBinAssign(
til::BOP_Shl, BO, Ctx);
595 case BO_ShrAssign:
return translateBinAssign(
til::BOP_Shr, BO, Ctx);
596 case BO_AndAssign:
return translateBinAssign(
til::BOP_BitAnd, BO, Ctx);
597 case BO_XorAssign:
return translateBinAssign(
til::BOP_BitXor, BO, Ctx);
598 case BO_OrAssign:
return translateBinAssign(
til::BOP_BitOr, BO, Ctx);
611 case CK_LValueToRValue: {
612 if (
const auto *DRE = dyn_cast<DeclRefExpr>(CE->
getSubExpr())) {
623 case CK_DerivedToBase:
624 case CK_UncheckedDerivedToBase:
625 case CK_ArrayToPointerDecay:
626 case CK_FunctionToPointerDecay: {
633 if (CapabilityExprMode)
649SExprBuilder::translateAbstractConditionalOperator(
660 for (
auto *I : DGrp) {
661 if (
auto *VD = dyn_cast_or_null<VarDecl>(I)) {
662 Expr *
E = VD->getInit();
668 return addVarDecl(VD, SE);
687 CurrentInstructions.push_back(
E);
695 auto It = LVarIdxMap.find(VD);
696 if (It != LVarIdxMap.end()) {
697 assert(CurrentLVarMap[It->second].first == VD);
698 return CurrentLVarMap[It->second].second;
707 if (
auto *
V = dyn_cast<til::Variable>(
E)) {
716 LVarIdxMap.insert(std::make_pair(VD, CurrentLVarMap.
size()));
718 CurrentLVarMap.
push_back(std::make_pair(VD,
E));
725 auto It = LVarIdxMap.find(VD);
726 if (It == LVarIdxMap.end()) {
732 CurrentLVarMap.
elem(It->second).second =
E;
739void SExprBuilder::makePhiNodeVar(
unsigned i,
unsigned NPreds,
til::SExpr *
E) {
740 unsigned ArgIndex = CurrentBlockInfo->ProcessedPredecessors;
741 assert(ArgIndex > 0 && ArgIndex < NPreds);
744 if (CurrE->
block() == CurrentBB) {
747 auto *Ph = dyn_cast<til::Phi>(CurrE);
748 assert(Ph &&
"Expecting Phi node.");
750 Ph->values()[ArgIndex] =
E;
758 for (
unsigned PIdx = 0; PIdx < ArgIndex; ++PIdx)
759 Ph->
values()[PIdx] = CurrE;
769 CurrentArguments.push_back(Ph);
771 IncompleteArgs.push_back(Ph);
774 CurrentLVarMap.
elem(i).second = Ph;
779void SExprBuilder::mergeEntryMap(LVarDefinitionMap Map) {
780 assert(CurrentBlockInfo &&
"Not processing a block!");
782 if (!CurrentLVarMap.
valid()) {
784 CurrentLVarMap = std::move(Map);
787 if (CurrentLVarMap.
sameAs(Map))
791 unsigned ESz = CurrentLVarMap.
size();
792 unsigned MSz = Map.size();
793 unsigned Sz = std::min(ESz, MSz);
795 for (
unsigned i = 0; i < Sz; ++i) {
796 if (CurrentLVarMap[i].first != Map[i].first) {
802 if (CurrentLVarMap[i].second != Map[i].second)
803 makePhiNodeVar(i, NPreds, Map[i].second);
807 CurrentLVarMap.
downsize(Map.size());
813void SExprBuilder::mergeEntryMapBackEdge() {
822 assert(CurrentBlockInfo &&
"Not processing a block!");
824 if (CurrentBlockInfo->HasBackEdges)
826 CurrentBlockInfo->HasBackEdges =
true;
829 unsigned Sz = CurrentLVarMap.
size();
832 for (
unsigned i = 0; i < Sz; ++i)
833 makePhiNodeVar(i, NPreds,
nullptr);
839void SExprBuilder::mergePhiNodesBackEdge(
const CFGBlock *Blk) {
841 unsigned ArgIndex = BBInfo[Blk->
getBlockID()].ProcessedPredecessors;
842 assert(ArgIndex > 0 && ArgIndex < BB->numPredecessors());
845 auto *Ph = dyn_cast_or_null<til::Phi>(PE);
846 assert(Ph &&
"Expecting Phi Node.");
847 assert(Ph->
values()[ArgIndex] ==
nullptr &&
"Wrong index for back edge.");
850 assert(
E &&
"Couldn't find local variable for Phi node.");
859 Scfg =
new (Arena)
til::SCFG(Arena, NBlocks);
862 BBInfo.resize(NBlocks);
863 BlockMap.resize(NBlocks,
nullptr);
865 for (
auto *B : *Cfg) {
868 BlockMap[B->getBlockID()] = BB;
872 auto Parms = isa<ObjCMethodDecl>(
D) ? cast<ObjCMethodDecl>(
D)->parameters()
873 : cast<FunctionDecl>(
D)->parameters();
874 for (
auto *Pm : Parms) {
876 if (!
T.isTrivialType(Pm->getASTContext()))
888void SExprBuilder::enterCFGBlock(
const CFGBlock *B) {
892 Scfg->
add(CurrentBB);
901void SExprBuilder::handlePredecessor(
const CFGBlock *Pred) {
905 BlockInfo *PredInfo = &BBInfo[Pred->
getBlockID()];
906 assert(PredInfo->UnprocessedSuccessors > 0);
908 if (--PredInfo->UnprocessedSuccessors == 0)
909 mergeEntryMap(std::move(PredInfo->ExitMap));
911 mergeEntryMap(PredInfo->ExitMap.clone());
913 ++CurrentBlockInfo->ProcessedPredecessors;
916void SExprBuilder::handlePredecessorBackEdge(
const CFGBlock *Pred) {
917 mergeEntryMapBackEdge();
920void SExprBuilder::enterCFGBlockBody(
const CFGBlock *B) {
924 static_cast<unsigned>(CurrentArguments.size()), Arena);
925 for (
auto *A : CurrentArguments)
929void SExprBuilder::handleStatement(
const Stmt *S) {
934void SExprBuilder::handleDestructorCall(
const VarDecl *VD,
940 addStatement(
E,
nullptr);
943void SExprBuilder::exitCFGBlockBody(
const CFGBlock *B) {
945 static_cast<unsigned>(CurrentInstructions.size()), Arena);
946 for (
auto *
V : CurrentInstructions)
956 auto *Tm =
new (Arena)
til::Goto(BB, Idx);
970void SExprBuilder::handleSuccessor(
const CFGBlock *Succ) {
971 ++CurrentBlockInfo->UnprocessedSuccessors;
974void SExprBuilder::handleSuccessorBackEdge(
const CFGBlock *Succ) {
975 mergePhiNodesBackEdge(Succ);
976 ++BBInfo[Succ->
getBlockID()].ProcessedPredecessors;
979void SExprBuilder::exitCFGBlock(
const CFGBlock *B) {
980 CurrentArguments.clear();
981 CurrentInstructions.clear();
982 CurrentBlockInfo->ExitMap = std::move(CurrentLVarMap);
984 CurrentBlockInfo =
nullptr;
988 for (
auto *Ph : IncompleteArgs) {
993 CurrentArguments.clear();
994 CurrentInstructions.clear();
995 IncompleteArgs.clear();
1007namespace threadSafety {
1010 llvm::BumpPtrAllocator Bpa;
1014 TILPrinter::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.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
CastKind
CastKind - The kind of operation required for a conversion.
const FunctionProtoType * T
Encapsulates the lexical context of a function call.
llvm::PointerUnion< const Expr *const *, til::SExpr * > FunArgs
const NamedDecl * AttrDecl
llvm::PointerUnion< const Expr *, til::SExpr * > SelfArg