Home | History | Annotate | Download | only in Analyses

Lines Matching defs:Return

118 /// Return the name of a unary opcode.
121 /// Return the name of a binary opcode.
170 case 1: return ST_8;
171 case 2: return ST_16;
172 case 4: return ST_32;
173 case 8: return ST_64;
174 case 16: return ST_128;
175 default: return ST_0;
182 return ValueType(BT_Void, ST_0, false, 0);
187 return ValueType(BT_Bool, ST_1, false, 0);
192 return ValueType(BT_Int, ST_8, true, 0);
197 return ValueType(BT_Int, ST_8, false, 0);
202 return ValueType(BT_Int, ST_16, true, 0);
207 return ValueType(BT_Int, ST_16, false, 0);
212 return ValueType(BT_Int, ST_32, true, 0);
217 return ValueType(BT_Int, ST_32, false, 0);
222 return ValueType(BT_Int, ST_64, true, 0);
227 return ValueType(BT_Int, ST_64, false, 0);
232 return ValueType(BT_Float, ST_32, true, 0);
237 return ValueType(BT_Float, ST_64, true, 0);
242 return ValueType(BT_Float, ST_128, true, 0);
247 return ValueType(BT_String, getSizeType(sizeof(StringRef)), false, 0);
252 return ValueType(BT_Pointer, getSizeType(sizeof(void*)), false, 0);
262 TIL_Opcode opcode() const { return static_cast<TIL_Opcode>(Opcode); }
279 return ::operator new(S, R);
289 unsigned id() const { return SExprID; }
293 BasicBlock* block() const { return Block; }
323 return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr;
347 static bool classof(const SExpr *E) { return E->opcode() == COP_Variable; }
369 /// Return the kind of variable (let, function param, or self)
370 VariableKind kind() const { return static_cast<VariableKind>(Flags); }
372 /// Return the name of the variable, if any.
373 StringRef name() const { return Name; }
375 /// Return the clang declaration for this variable, if any.
376 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
378 /// Return the definition of the variable.
381 SExpr *definition() { return Definition; }
382 const SExpr *definition() const { return Definition; }
392 return Vs.reduceVariableRef(this);
397 return Cmp.compareVariableRefs(this, E);
416 static bool classof(const SExpr *E) { return E->opcode() == COP_Future; }
431 virtual SExpr *compute() { return nullptr; }
433 // Return the result of this future if it exists, otherwise return null.
435 return Result;
438 // Return the result of this future; forcing it if necessary.
442 return force();
444 return nullptr; // infinite loop; illegal recursion.
446 return Result;
453 return Vs.traverse(Result, Ctx);
459 return Cmp.comparePointers(this, E);
460 return Cmp.compare(Result, E->Result);
474 static bool classof(const SExpr *E) { return E->opcode() == COP_Undefined; }
481 return Vs.reduceUndefined(*this);
486 return Cmp.trueResult();
497 static bool classof(const SExpr *E) { return E->opcode() == COP_Wildcard; }
503 return Vs.reduceWildcard(*this);
508 return Cmp.trueResult();
518 static bool classof(const SExpr *E) { return E->opcode() == COP_Literal; }
527 const clang::Expr *clangExpr() const { return Cexpr; }
529 ValueType valueType() const { return ValType; }
532 return *static_cast<const LiteralT<T>*>(this);
535 return *static_cast<LiteralT<T>*>(this);
543 return Cmp.trueResult();
559 T value() const { return Val;}
560 T& value() { return Val; }
571 return Vs.reduceLiteral(*this);
577 return Vs.reduceLiteralT(as<bool>());
582 return Vs.reduceLiteralT(as<int8_t>());
584 return Vs.reduceLiteralT(as<uint8_t>());
587 return Vs.reduceLiteralT(as<int16_t>());
589 return Vs.reduceLiteralT(as<uint16_t>());
592 return Vs.reduceLiteralT(as<int32_t>());
594 return Vs.reduceLiteralT(as<uint32_t>());
597 return Vs.reduceLiteralT(as<int64_t>());
599 return Vs.reduceLiteralT(as<uint64_t>());
607 return Vs.reduceLiteralT(as<float>());
609 return Vs.reduceLiteralT(as<double>());
615 return Vs.reduceLiteralT(as<StringRef>());
617 return Vs.reduceLiteralT(as<void*>());
621 return Vs.reduceLiteral(*this);
629 static bool classof(const SExpr *E) { return E->opcode() == COP_LiteralPtr; }
635 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
639 return Vs.reduceLiteralPtr(*this);
644 return Cmp.comparePointers(Cvdecl, E->Cvdecl);
654 /// e.g. (Function (x: Int) (Function (y: Int) (Code { return x + y })))
657 static bool classof(const SExpr *E) { return E->opcode() == COP_Function; }
668 Variable *variableDecl() { return VarDecl; }
669 const Variable *variableDecl() const { return VarDecl; }
671 SExpr *body() { return Body; }
672 const SExpr *body() const { return Body; }
682 return Vs.reduceFunction(*this, Nvd, E1);
690 return Ct;
694 return Ct;
708 static bool classof(const SExpr *E) { return E->opcode() == COP_SFunction; }
723 Variable *variableDecl() { return VarDecl; }
724 const Variable *variableDecl() const { return VarDecl; }
726 SExpr *body() { return Body; }
727 const SExpr *body() const { return Body; }
738 return Vs.reduceSFunction(*this, Nvd, E1);
746 return Ct;
758 static bool classof(const SExpr *E) { return E->opcode() == COP_Code; }
764 SExpr *returnType() { return ReturnType; }
765 const SExpr *returnType() const { return ReturnType; }
767 SExpr *body() { return Body; }
768 const SExpr *body() const { return Body; }
774 return Vs.reduceCode(*this, Nt, Nb);
781 return Ct;
782 return Cmp.compare(body(), E->body());
794 static bool classof(const SExpr *E) { return E->opcode() == COP_Field; }
800 SExpr *range() { return Range; }
801 const SExpr *range() const { return Range; }
803 SExpr *body() { return Body; }
804 const SExpr *body() const { return Body; }
810 return Vs.reduceField(*this, Nr, Nb);
817 return Ct;
818 return Cmp.compare(body(), E->body());
834 static bool classof(const SExpr *E) { return E->opcode() == COP_Apply; }
841 SExpr *fun() { return Fun; }
842 const SExpr *fun() const { return Fun; }
844 SExpr *arg() { return Arg; }
845 const SExpr *arg() const { return Arg; }
851 return Vs.reduceApply(*this, Nf, Na);
858 return Ct;
859 return Cmp.compare(arg(), E->arg());
871 static bool classof(const SExpr *E) { return E->opcode() == COP_SApply; }
877 SExpr *sfun() { return Sfun; }
878 const SExpr *sfun() const { return Sfun; }
880 SExpr *arg() { return Arg ? Arg : Sfun; }
881 const SExpr *arg() const { return Arg ? Arg : Sfun; }
883 bool isDelegation() const { return Arg != nullptr; }
890 return Vs.reduceSApply(*this, Nf, Na);
897 return Ct;
898 return Cmp.compare(arg(), E->arg());
910 static bool classof(const SExpr *E) { return E->opcode() == COP_Project; }
917 SExpr *record() { return Rec; }
918 const SExpr *record() const { return Rec; }
920 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
922 bool isArrow() const { return (Flags & 0x01) != 0; }
930 return Cvdecl->getName();
936 return *SlotName;
942 return Vs.reduceProject(*this, Nr);
949 return Ct;
950 return Cmp.comparePointers(Cvdecl, E->Cvdecl);
963 static bool classof(const SExpr *E) { return E->opcode() == COP_Call; }
969 SExpr *target() { return Target; }
970 const SExpr *target() const { return Target; }
972 const clang::CallExpr *clangCallExpr() const { return Cexpr; }
977 return Vs.reduceCall(*this, Nt);
982 return Cmp.compare(target(), E->target());
994 static bool classof(const SExpr *E) { return E->opcode() == COP_Call; }
1004 AllocKind kind() const { return static_cast<AllocKind>(Flags); }
1006 SExpr *dataType() { return Dtype; }
1007 const SExpr *dataType() const { return Dtype; }
1012 return Vs.reduceAlloc(*this, Nd);
1019 return Ct;
1020 return Cmp.compare(dataType(), E->dataType());
1031 static bool classof(const SExpr *E) { return E->opcode() == COP_Load; }
1036 SExpr *pointer() { return Ptr; }
1037 const SExpr *pointer() const { return Ptr; }
1042 return Vs.reduceLoad(*this, Np);
1047 return Cmp.compare(pointer(), E->pointer());
1059 static bool classof(const SExpr *E) { return E->opcode() == COP_Store; }
1064 SExpr *destination() { return Dest; } // Address to store to
1065 const SExpr *destination() const { return Dest; }
1067 SExpr *source() { return Source; } // Value to store
1068 const SExpr *source() const { return Source; }
1074 return Vs.reduceStore(*this, Np, Nv);
1081 return Ct;
1082 return Cmp.compare(source(), E->source());
1095 static bool classof(const SExpr *E) { return E->opcode() == COP_ArrayIndex; }
1101 SExpr *array() { return Array; }
1102 const SExpr *array() const { return Array; }
1104 SExpr *index() { return Index; }
1105 const SExpr *index() const { return Index; }
1111 return Vs.reduceArrayIndex(*this, Na, Ni);
1118 return Ct;
1119 return Cmp.compare(index(), E->index());
1133 static bool classof(const SExpr *E) { return E->opcode() == COP_ArrayAdd; }
1139 SExpr *array() { return Array; }
1140 const SExpr *array() const { return Array; }
1142 SExpr *index() { return Index; }
1143 const SExpr *index() const { return Index; }
1149 return Vs.reduceArrayAdd(*this, Na, Ni);
1156 return Ct;
1157 return Cmp.compare(index(), E->index());
1170 static bool classof(const SExpr *E) { return E->opcode() == COP_UnaryOp; }
1178 return static_cast<TIL_UnaryOpcode>(Flags);
1181 SExpr *expr() { return Expr0; }
1182 const SExpr *expr() const { return Expr0; }
1187 return Vs.reduceUnaryOp(*this, Ne);
1195 return Ct;
1196 return Cmp.compare(expr(), E->expr());
1208 static bool classof(const SExpr *E) { return E->opcode() == COP_BinaryOp; }
1220 return static_cast<TIL_BinaryOpcode>(Flags);
1223 SExpr *expr0() { return Expr0; }
1224 const SExpr *expr0() const { return Expr0; }
1226 SExpr *expr1() { return Expr1; }
1227 const SExpr *expr1() const { return Expr1; }
1233 return Vs.reduceBinaryOp(*this, Ne0, Ne1);
1241 return Ct;
1244 return Ct;
1245 return Cmp.compare(expr1(), E->expr1());
1259 static bool classof(const SExpr *E) { return E->opcode() == COP_Cast; }
1265 return static_cast<TIL_CastOpcode>(Flags);
1268 SExpr *expr() { return Expr0; }
1269 const SExpr *expr() const { return Expr0; }
1274 return Vs.reduceCast(*this, Ne);
1282 return Ct;
1283 return Cmp.compare(expr(), E->expr());
1310 static bool classof(const SExpr *E) { return E->opcode() == COP_Phi; }
1319 const ValArray &values() const { return Values; }
1320 ValArray &values() { return Values; }
1322 Status status() const { return static_cast<Status>(Flags); }
1325 /// Return the clang declaration of the variable for this Phi node, if any.
1326 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
1339 return Vs.reducePhi(*this, Nvs);
1345 return Cmp.comparePointers(this, E);
1354 /// Base class for basic block terminators: Branch, Goto, and Return.
1358 return E->opcode() >= COP_Goto && E->opcode() <= COP_Return;
1366 /// Return the list of basic blocks that this terminator can branch to.
1370 return const_cast<Terminator*>(this)->successors();
1382 static bool classof(const SExpr *E) { return E->opcode() == COP_Goto; }
1389 const BasicBlock *targetBlock() const { return TargetBlock; }
1390 BasicBlock *targetBlock() { return TargetBlock; }
1393 unsigned index() const { return Index; }
1395 /// Return the list of basic blocks that this terminator can branch to.
1397 return TargetBlock;
1403 return Vs.reduceGoto(*this, Ntb);
1409 return Cmp.comparePointers(this, E);
1423 static bool classof(const SExpr *E) { return E->opcode() == COP_Branch; }
1436 const SExpr *condition() const { return Condition; }
1437 SExpr *condition() { return Condition; }
1439 const BasicBlock *thenBlock() const { return Branches[0]; }
1440 BasicBlock *thenBlock() { return Branches[0]; }
1442 const BasicBlock *elseBlock() const { return Branches[1]; }
1443 BasicBlock *elseBlock() { return Branches[1]; }
1445 /// Return the list of basic blocks that this terminator can branch to.
1447 return llvm::makeArrayRef(Branches);
1455 return Vs.reduceBranch(*this, Nc, Ntb, Nte);
1461 return Cmp.comparePointers(this, E);
1470 /// Return from the enclosing function, passing the return value to the caller.
1471 /// Only the exit block should end with a return statement.
1472 class Return : public Terminator {
1474 static bool classof(const SExpr *E) { return E->opcode() == COP_Return; }
1476 Return(SExpr* Rval) : Terminator(COP_Return), Retval(Rval) {}
1477 Return(const Return &R, SExpr* Rval) : Terminator(R), Retval(Rval) {}
1479 /// Return an empty list.
1481 return None;
1484 SExpr *returnValue() { return Retval; }
1485 const SExpr *returnValue() const { return Retval; }
1490 return Vs.reduceReturn(*this, Ne);
1494 typename C::CType compare(const Return *E, C &Cmp) const {
1495 return Cmp.compare(Retval, E->Retval);
1505 case COP_Goto: return cast<Goto>(this)->successors();
1506 case COP_Branch: return cast<Branch>(this)->successors();
1507 case COP_Return: return cast<Return>(this)->successors();
1509 return None;
1532 return OtherNode.NodeID > NodeID &&
1537 return OtherNode.NodeID >= NodeID &&
1546 static bool classof(const SExpr *E) { return E->opcode() == COP_BasicBlock; }
1557 int blockID() const { return BlockID; }
1560 size_t numPredecessors() const { return Predecessors.size(); }
1561 size_t numSuccessors() const { return successors().size(); }
1563 const SCFG* cfg() const { return CFGPtr; }
1564 SCFG* cfg() { return CFGPtr; }
1566 const BasicBlock *parent() const { return DominatorNode.Parent; }
1567 BasicBlock *parent() { return DominatorNode.Parent; }
1569 const InstrArray &arguments() const { return Args; }
1570 InstrArray &arguments() { return Args; }
1572 InstrArray &instructions() { return Instrs; }
1573 const InstrArray &instructions() const { return Instrs; }
1578 BlockArray &predecessors() { return Predecessors; }
1579 const BlockArray &predecessors() const { return Predecessors; }
1581 ArrayRef<BasicBlock*> successors() { return TermInstr->successors(); }
1582 ArrayRef<BasicBlock*> successors() const { return TermInstr->successors(); }
1584 const Terminator *terminator() const { return TermInstr; }
1585 Terminator *terminator() { return TermInstr; }
1590 return DominatorNode.isParentOfOrEqual(Other.DominatorNode);
1594 return PostDominatorNode.isParentOfOrEqual(Other.PostDominatorNode);
1607 // Add a new predecessor, and return the phi-node index for it.
1620 /// Return the index of BB, or Predecessors.size if BB is not a predecessor.
1623 return std::distance(Predecessors.cbegin(), I);
1647 return
1653 return Cmp.comparePointers(this, E);
1691 static bool classof(const SExpr *E) { return E->opcode() == COP_SCFG; }
1700 Exit->setTerminator(new (A) Return(V));
1710 /// Return true if this CFG is valid.
1711 bool valid() const { return Entry && Exit && Blocks.size() > 0; }
1713 /// Return true if this CFG has been normalized.
1716 bool normal() const { return Normal; }
1718 iterator begin() { return Blocks.begin(); }
1719 iterator end() { return Blocks.end(); }
1721 const_iterator begin() const { return cbegin(); }
1722 const_iterator end() const { return cend(); }
1724 const_iterator cbegin() const { return Blocks.cbegin(); }
1725 const_iterator cend() const { return Blocks.cend(); }
1727 const BasicBlock *entry() const { return Entry; }
1728 BasicBlock *entry() { return Entry; }
1729 const BasicBlock *exit() const { return Exit; }
1730 BasicBlock *exit() { return Exit; }
1732 /// Return the number of blocks in the CFG.
1733 /// Block::blockID() will return a number less than numBlocks();
1734 size_t numBlocks() const { return Blocks.size(); }
1736 /// Return the total number of instructions in the CFG.
1738 /// A call to SExpr::id() will return a number less than numInstructions().
1739 unsigned numInstructions() { return NumInstructions; }
1762 return Vs.reduceSCFG(*this, Bbs);
1768 return Cmp.comparePointers(this, E);
1789 static bool classof(const SExpr *E) { return E->opcode() == COP_Identifier; }
1794 StringRef name() const { return Name; }
1798 return Vs.reduceIdentifier(*this);
1803 return Cmp.compareStrings(name(), E->name());
1815 static bool classof(const SExpr *E) { return E->opcode() == COP_IfThenElse; }
1824 SExpr *condition() { return Condition; } // Address to store to
1825 const SExpr *condition() const { return Condition; }
1827 SExpr *thenExpr() { return ThenExpr; } // Value to store
1828 const SExpr *thenExpr() const { return ThenExpr; }
1830 SExpr *elseExpr() { return ElseExpr; } // Value to store
1831 const SExpr *elseExpr() const { return ElseExpr; }
1838 return Vs.reduceIfThenElse(*this, Nc, Nt, Ne);
1845 return Ct;
1848 return Ct;
1849 return Cmp.compare(elseExpr(), E->elseExpr());
1863 static bool classof(const SExpr *E) { return E->opcode() == COP_Let; }
1872 Variable *variableDecl() { return VarDecl; }
1873 const Variable *variableDecl() const { return VarDecl; }
1875 SExpr *body() { return Body; }
1876 const SExpr *body() const { return Body; }
1886 return Vs.reduceLet(*this, Nvd, E1);
1894 return Ct;
1898 return Ct;