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; }
922 SExpr *record() { return Rec; }
923 const SExpr *record() const { return Rec; }
925 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
927 bool isArrow() const { return (Flags & 0x01) != 0; }
935 return Cvdecl->getName();
937 return SlotName;
943 return Vs.reduceProject(*this, Nr);
950 return Ct;
951 return Cmp.comparePointers(Cvdecl, E->Cvdecl);
964 static bool classof(const SExpr *E) { return E->opcode() == COP_Call; }
970 SExpr *target() { return Target; }
971 const SExpr *target() const { return Target; }
973 const clang::CallExpr *clangCallExpr() const { return Cexpr; }
978 return Vs.reduceCall(*this, Nt);
983 return Cmp.compare(target(), E->target());
995 static bool classof(const SExpr *E) { return E->opcode() == COP_Call; }
1005 AllocKind kind() const { return static_cast<AllocKind>(Flags); }
1007 SExpr *dataType() { return Dtype; }
1008 const SExpr *dataType() const { return Dtype; }
1013 return Vs.reduceAlloc(*this, Nd);
1020 return Ct;
1021 return Cmp.compare(dataType(), E->dataType());
1032 static bool classof(const SExpr *E) { return E->opcode() == COP_Load; }
1037 SExpr *pointer() { return Ptr; }
1038 const SExpr *pointer() const { return Ptr; }
1043 return Vs.reduceLoad(*this, Np);
1048 return Cmp.compare(pointer(), E->pointer());
1060 static bool classof(const SExpr *E) { return E->opcode() == COP_Store; }
1065 SExpr *destination() { return Dest; } // Address to store to
1066 const SExpr *destination() const { return Dest; }
1068 SExpr *source() { return Source; } // Value to store
1069 const SExpr *source() const { return Source; }
1075 return Vs.reduceStore(*this, Np, Nv);
1082 return Ct;
1083 return Cmp.compare(source(), E->source());
1096 static bool classof(const SExpr *E) { return E->opcode() == COP_ArrayIndex; }
1102 SExpr *array() { return Array; }
1103 const SExpr *array() const { return Array; }
1105 SExpr *index() { return Index; }
1106 const SExpr *index() const { return Index; }
1112 return Vs.reduceArrayIndex(*this, Na, Ni);
1119 return Ct;
1120 return Cmp.compare(index(), E->index());
1134 static bool classof(const SExpr *E) { return E->opcode() == COP_ArrayAdd; }
1140 SExpr *array() { return Array; }
1141 const SExpr *array() const { return Array; }
1143 SExpr *index() { return Index; }
1144 const SExpr *index() const { return Index; }
1150 return Vs.reduceArrayAdd(*this, Na, Ni);
1157 return Ct;
1158 return Cmp.compare(index(), E->index());
1171 static bool classof(const SExpr *E) { return E->opcode() == COP_UnaryOp; }
1179 return static_cast<TIL_UnaryOpcode>(Flags);
1182 SExpr *expr() { return Expr0; }
1183 const SExpr *expr() const { return Expr0; }
1188 return Vs.reduceUnaryOp(*this, Ne);
1196 return Ct;
1197 return Cmp.compare(expr(), E->expr());
1209 static bool classof(const SExpr *E) { return E->opcode() == COP_BinaryOp; }
1221 return static_cast<TIL_BinaryOpcode>(Flags);
1224 SExpr *expr0() { return Expr0; }
1225 const SExpr *expr0() const { return Expr0; }
1227 SExpr *expr1() { return Expr1; }
1228 const SExpr *expr1() const { return Expr1; }
1234 return Vs.reduceBinaryOp(*this, Ne0, Ne1);
1242 return Ct;
1245 return Ct;
1246 return Cmp.compare(expr1(), E->expr1());
1260 static bool classof(const SExpr *E) { return E->opcode() == COP_Cast; }
1266 return static_cast<TIL_CastOpcode>(Flags);
1269 SExpr *expr() { return Expr0; }
1270 const SExpr *expr() const { return Expr0; }
1275 return Vs.reduceCast(*this, Ne);
1283 return Ct;
1284 return Cmp.compare(expr(), E->expr());
1311 static bool classof(const SExpr *E) { return E->opcode() == COP_Phi; }
1320 const ValArray &values() const { return Values; }
1321 ValArray &values() { return Values; }
1323 Status status() const { return static_cast<Status>(Flags); }
1326 /// Return the clang declaration of the variable for this Phi node, if any.
1327 const clang::ValueDecl *clangDecl() const { return Cvdecl; }
1340 return Vs.reducePhi(*this, Nvs);
1346 return Cmp.comparePointers(this, E);
1355 /// Base class for basic block terminators: Branch, Goto, and Return.
1359 return E->opcode() >= COP_Goto && E->opcode() <= COP_Return;
1367 /// Return the list of basic blocks that this terminator can branch to.
1371 return const_cast<Terminator*>(this)->successors();
1383 static bool classof(const SExpr *E) { return E->opcode() == COP_Goto; }
1390 const BasicBlock *targetBlock() const { return TargetBlock; }
1391 BasicBlock *targetBlock() { return TargetBlock; }
1394 unsigned index() const { return Index; }
1396 /// Return the list of basic blocks that this terminator can branch to.
1398 return TargetBlock;
1404 return Vs.reduceGoto(*this, Ntb);
1410 return Cmp.comparePointers(this, E);
1424 static bool classof(const SExpr *E) { return E->opcode() == COP_Branch; }
1437 const SExpr *condition() const { return Condition; }
1438 SExpr *condition() { return Condition; }
1440 const BasicBlock *thenBlock() const { return Branches[0]; }
1441 BasicBlock *thenBlock() { return Branches[0]; }
1443 const BasicBlock *elseBlock() const { return Branches[1]; }
1444 BasicBlock *elseBlock() { return Branches[1]; }
1446 /// Return the list of basic blocks that this terminator can branch to.
1448 return llvm::makeArrayRef(Branches);
1456 return Vs.reduceBranch(*this, Nc, Ntb, Nte);
1462 return Cmp.comparePointers(this, E);
1471 /// Return from the enclosing function, passing the return value to the caller.
1472 /// Only the exit block should end with a return statement.
1473 class Return : public Terminator {
1475 static bool classof(const SExpr *E) { return E->opcode() == COP_Return; }
1477 Return(SExpr* Rval) : Terminator(COP_Return), Retval(Rval) {}
1478 Return(const Return &R, SExpr* Rval) : Terminator(R), Retval(Rval) {}
1480 /// Return an empty list.
1482 return None;
1485 SExpr *returnValue() { return Retval; }
1486 const SExpr *returnValue() const { return Retval; }
1491 return Vs.reduceReturn(*this, Ne);
1495 typename C::CType compare(const Return *E, C &Cmp) const {
1496 return Cmp.compare(Retval, E->Retval);
1506 case COP_Goto: return cast<Goto>(this)->successors();
1507 case COP_Branch: return cast<Branch>(this)->successors();
1508 case COP_Return: return cast<Return>(this)->successors();
1510 return None;
1533 return OtherNode.NodeID > NodeID &&
1538 return OtherNode.NodeID >= NodeID &&
1547 static bool classof(const SExpr *E) { return E->opcode() == COP_BasicBlock; }
1558 int blockID() const { return BlockID; }
1561 size_t numPredecessors() const { return Predecessors.size(); }
1562 size_t numSuccessors() const { return successors().size(); }
1564 const SCFG* cfg() const { return CFGPtr; }
1565 SCFG* cfg() { return CFGPtr; }
1567 const BasicBlock *parent() const { return DominatorNode.Parent; }
1568 BasicBlock *parent() { return DominatorNode.Parent; }
1570 const InstrArray &arguments() const { return Args; }
1571 InstrArray &arguments() { return Args; }
1573 InstrArray &instructions() { return Instrs; }
1574 const InstrArray &instructions() const { return Instrs; }
1579 BlockArray &predecessors() { return Predecessors; }
1580 const BlockArray &predecessors() const { return Predecessors; }
1582 ArrayRef<BasicBlock*> successors() { return TermInstr->successors(); }
1583 ArrayRef<BasicBlock*> successors() const { return TermInstr->successors(); }
1585 const Terminator *terminator() const { return TermInstr; }
1586 Terminator *terminator() { return TermInstr; }
1591 return DominatorNode.isParentOfOrEqual(Other.DominatorNode);
1595 return PostDominatorNode.isParentOfOrEqual(Other.PostDominatorNode);
1608 // Add a new predecessor, and return the phi-node index for it.
1621 /// Return the index of BB, or Predecessors.size if BB is not a predecessor.
1624 return std::distance(Predecessors.cbegin(), I);
1648 return
1654 return Cmp.comparePointers(this, E);
1692 static bool classof(const SExpr *E) { return E->opcode() == COP_SCFG; }
1701 Exit->setTerminator(new (A) Return(V));
1711 /// Return true if this CFG is valid.
1712 bool valid() const { return Entry && Exit && Blocks.size() > 0; }
1714 /// Return true if this CFG has been normalized.
1717 bool normal() const { return Normal; }
1719 iterator begin() { return Blocks.begin(); }
1720 iterator end() { return Blocks.end(); }
1722 const_iterator begin() const { return cbegin(); }
1723 const_iterator end() const { return cend(); }
1725 const_iterator cbegin() const { return Blocks.cbegin(); }
1726 const_iterator cend() const { return Blocks.cend(); }
1728 const BasicBlock *entry() const { return Entry; }
1729 BasicBlock *entry() { return Entry; }
1730 const BasicBlock *exit() const { return Exit; }
1731 BasicBlock *exit() { return Exit; }
1733 /// Return the number of blocks in the CFG.
1734 /// Block::blockID() will return a number less than numBlocks();
1735 size_t numBlocks() const { return Blocks.size(); }
1737 /// Return the total number of instructions in the CFG.
1739 /// A call to SExpr::id() will return a number less than numInstructions().
1740 unsigned numInstructions() { return NumInstructions; }
1763 return Vs.reduceSCFG(*this, Bbs);
1769 return Cmp.comparePointers(this, E);
1790 static bool classof(const SExpr *E) { return E->opcode() == COP_Identifier; }
1795 StringRef name() const { return Name; }
1799 return Vs.reduceIdentifier(*this);
1804 return Cmp.compareStrings(name(), E->name());
1816 static bool classof(const SExpr *E) { return E->opcode() == COP_IfThenElse; }
1825 SExpr *condition() { return Condition; } // Address to store to
1826 const SExpr *condition() const { return Condition; }
1828 SExpr *thenExpr() { return ThenExpr; } // Value to store
1829 const SExpr *thenExpr() const { return ThenExpr; }
1831 SExpr *elseExpr() { return ElseExpr; } // Value to store
1832 const SExpr *elseExpr() const { return ElseExpr; }
1839 return Vs.reduceIfThenElse(*this, Nc, Nt, Ne);
1846 return Ct;
1849 return Ct;
1850 return Cmp.compare(elseExpr(), E->elseExpr());
1864 static bool classof(const SExpr *E) { return E->opcode() == COP_Let; }
1873 Variable *variableDecl() { return VarDecl; }
1874 const Variable *variableDecl() const { return VarDecl; }
1876 SExpr *body() { return Body; }
1877 const SExpr *body() const { return Body; }
1887 return Vs.reduceLet(*this, Nvd, E1);
1895 return Ct;
1899 return Ct;