reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/AST/Interp/Block.h
   68   T &deref() { return *reinterpret_cast<T *>(data()); }
tools/clang/lib/AST/Interp/Boolean.h
   37   bool operator<(Boolean RHS) const { return V < RHS.V; }
   38   bool operator>(Boolean RHS) const { return V > RHS.V; }
   39   bool operator<=(Boolean RHS) const { return V <= RHS.V; }
   40   bool operator>=(Boolean RHS) const { return V >= RHS.V; }
   41   bool operator==(Boolean RHS) const { return V == RHS.V; }
   42   bool operator!=(Boolean RHS) const { return V != RHS.V; }
   46   Boolean operator-() const { return Boolean(V); }
   47   Boolean operator~() const { return Boolean(true); }
   61   Boolean toUnsigned() const { return *this; }
   74   ComparisonCategoryResult compare(const Boolean &RHS) const {
   80   Boolean truncate(unsigned TruncBits) const { return *this; }
   84   static Boolean min(unsigned NumBits) { return Boolean(false); }
   85   static Boolean max(unsigned NumBits) { return Boolean(true); }
   88   static typename std::enable_if<std::is_integral<T>::value, Boolean>::type
   90     return Boolean(Value != 0);
   94   static typename std::enable_if<SrcBits != 0, Boolean>::type from(
   96     return Boolean(!Value.isZero());
  100   static Boolean from(Integral<0, SrcSign> Value) {
  101     return Boolean(!Value.isZero());
  104   static Boolean zero() { return from(false); }
  107   static Boolean from(T Value, unsigned NumBits) {
  108     return Boolean(Value);
  115   static bool increment(Boolean A, Boolean *R) {
  115   static bool increment(Boolean A, Boolean *R) {
  120   static bool decrement(Boolean A, Boolean *R) {
  120   static bool decrement(Boolean A, Boolean *R) {
  124   static bool add(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  124   static bool add(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  124   static bool add(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  129   static bool sub(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  129   static bool sub(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  129   static bool sub(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  134   static bool mul(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  134   static bool mul(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  134   static bool mul(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
  140 inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Boolean &B) {
tools/clang/lib/AST/Interp/Interp.cpp
   36   const T &Ret = S.Stk.pop<T>();
   36   const T &Ret = S.Stk.pop<T>();
   46     S.Stk.push<T>(Ret);
   50     if (!ReturnValue<T>(Ret, Result))
tools/clang/lib/AST/Interp/Interp.h
   41 template <typename T> bool ReturnValue(const T &V, APValue &R) {
  102 bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS,
  103                      const T &RHS) {
  105   T Result;
  107     S.Stk.push<T>(Result);
  112   S.Stk.push<T>(Result);
  133   const T &RHS = S.Stk.pop<T>();
  133   const T &RHS = S.Stk.pop<T>();
  134   const T &LHS = S.Stk.pop<T>();
  134   const T &LHS = S.Stk.pop<T>();
  136   return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
  136   return AddSubMulHelper<T, T::add, std::plus>(S, OpPC, Bits, LHS, RHS);
  141   const T &RHS = S.Stk.pop<T>();
  141   const T &RHS = S.Stk.pop<T>();
  142   const T &LHS = S.Stk.pop<T>();
  142   const T &LHS = S.Stk.pop<T>();
  144   return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
  144   return AddSubMulHelper<T, T::sub, std::minus>(S, OpPC, Bits, LHS, RHS);
  149   const T &RHS = S.Stk.pop<T>();
  149   const T &RHS = S.Stk.pop<T>();
  150   const T &LHS = S.Stk.pop<T>();
  150   const T &LHS = S.Stk.pop<T>();
  152   return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
  152   return AddSubMulHelper<T, T::mul, std::multiplies>(S, OpPC, Bits, LHS, RHS);
  164   const T &RHS = S.Stk.pop<T>();
  164   const T &RHS = S.Stk.pop<T>();
  165   const T &LHS = S.Stk.pop<T>();
  165   const T &LHS = S.Stk.pop<T>();
  172   return CmpHelper<T>(S, OpPC, Fn);
  220   return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
  227   return CmpHelperEQ<T>(S, OpPC, [](ComparisonCategoryResult R) {
  234   return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
  241   return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
  249   return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
  256   return CmpHelper<T>(S, OpPC, [](ComparisonCategoryResult R) {
  282   S.Stk.push<T>(S.Stk.peek<T>());
  282   S.Stk.push<T>(S.Stk.peek<T>());
  288   S.Stk.pop<T>();
  308   S.Stk.push<T>(S.Current->getLocal<T>(I));
  308   S.Stk.push<T>(S.Current->getLocal<T>(I));
  314   S.Current->setLocal<T>(I, S.Stk.pop<T>());
  314   S.Current->setLocal<T>(I, S.Stk.pop<T>());
  323   S.Stk.push<T>(S.Current->getParam<T>(I));
  323   S.Stk.push<T>(S.Current->getParam<T>(I));
  329   S.Current->setParam<T>(I, S.Stk.pop<T>());
  329   S.Current->setParam<T>(I, S.Stk.pop<T>());
  343   S.Stk.push<T>(Field.deref<T>());
  343   S.Stk.push<T>(Field.deref<T>());
  349   const T &Value = S.Stk.pop<T>();
  349   const T &Value = S.Stk.pop<T>();
  358   Field.deref<T>() = Value;
  372   S.Stk.push<T>(Field.deref<T>());
  372   S.Stk.push<T>(Field.deref<T>());
  386   S.Stk.push<T>(Field.deref<T>());
  386   S.Stk.push<T>(Field.deref<T>());
  394   const T &Value = S.Stk.pop<T>();
  394   const T &Value = S.Stk.pop<T>();
  401   Field.deref<T>() = Value;
  410   S.Stk.push<T>(B->deref<T>());
  410   S.Stk.push<T>(B->deref<T>());
  422   S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
  422   S.P.getGlobal(I)->deref<T>() = S.Stk.pop<T>();
  434   Field.deref<T>() = S.Stk.pop<T>();
  434   Field.deref<T>() = S.Stk.pop<T>();
  447   const auto &Value = S.Stk.pop<T>();
  447   const auto &Value = S.Stk.pop<T>();
  448   Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx()));
  461   Field.deref<T>() = S.Stk.pop<T>();
  461   Field.deref<T>() = S.Stk.pop<T>();
  469   const T &Value = S.Stk.pop<T>();
  469   const T &Value = S.Stk.pop<T>();
  471   Field.deref<T>() = Value;
  479   const T &Value = S.Stk.pop<T>();
  479   const T &Value = S.Stk.pop<T>();
  481   Field.deref<T>() = Value.truncate(F->Decl->getBitWidthValue(S.getCtx()));
  489   const T &Value = S.Stk.pop<T>();
  489   const T &Value = S.Stk.pop<T>();
  492   Field.deref<T>() = Value;
  623   S.Stk.push<T>(Ptr.deref<T>());
  623   S.Stk.push<T>(Ptr.deref<T>());
  632   S.Stk.push<T>(Ptr.deref<T>());
  632   S.Stk.push<T>(Ptr.deref<T>());
  638   const T &Value = S.Stk.pop<T>();
  638   const T &Value = S.Stk.pop<T>();
  642   Ptr.deref<T>() = Value;
  648   const T &Value = S.Stk.pop<T>();
  648   const T &Value = S.Stk.pop<T>();
  652   Ptr.deref<T>() = Value;
  658   const T &Value = S.Stk.pop<T>();
  658   const T &Value = S.Stk.pop<T>();
  663     Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx()));
  665     Ptr.deref<T>() = Value;
  672   const T &Value = S.Stk.pop<T>();
  672   const T &Value = S.Stk.pop<T>();
  677     Ptr.deref<T>() = Value.truncate(FD->getBitWidthValue(S.getCtx()));
  679     Ptr.deref<T>() = Value;
  686   const T &Value = S.Stk.pop<T>();
  686   const T &Value = S.Stk.pop<T>();
  691   new (&Ptr.deref<T>()) T(Value);
  691   new (&Ptr.deref<T>()) T(Value);
  697   const T &Value = S.Stk.pop<T>();
  697   const T &Value = S.Stk.pop<T>();
  702   new (&Ptr.deref<T>()) T(Value);
  702   new (&Ptr.deref<T>()) T(Value);
  708   const T &Value = S.Stk.pop<T>();
  708   const T &Value = S.Stk.pop<T>();
  713   new (&Ptr.deref<T>()) T(Value);
  713   new (&Ptr.deref<T>()) T(Value);
  723   const T &Offset = S.Stk.pop<T>();
  723   const T &Offset = S.Stk.pop<T>();
  731   T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
  731   T Index = T::from(Ptr.getIndex(), Offset.bitWidth());
  781   return OffsetHelper<T, true>(S, OpPC);
  786   return OffsetHelper<T, false>(S, OpPC);
  816   S.Stk.push<T>(T::zero());
  816   S.Stk.push<T>(T::zero());
tools/clang/lib/AST/Interp/InterpFrame.cpp
   57 static void print(llvm::raw_ostream &OS, const T &V, ASTContext &, QualType) {
tools/clang/lib/AST/Interp/InterpFrame.h
   66   template <typename T> const T &getLocal(unsigned Offset) {
   67     return localRef<T>(Offset);
   71   template <typename T> void setLocal(unsigned Offset, const T &Value) {
   72     localRef<T>(Offset) = Value;
   79   template <typename T> const T &getParam(unsigned Offset) {
   82       return stackRef<T>(Offset);
   84       return Pointer(reinterpret_cast<Block *>(Pt->second.get())).deref<T>();
   89   template <typename T> void setParam(unsigned Offset, const T &Value) {
   90      getParamPointer(Offset).deref<T>() = Value;
  115   template <typename T> const T &stackRef(unsigned Offset) {
  120   template <typename T> T &localRef(unsigned Offset) {
tools/clang/lib/AST/Interp/InterpStack.h
   30   template <typename T, typename... Tys> void push(Tys &&... Args) {
   31     new (grow(aligned_size<T>())) T(std::forward<Tys>(Args)...);
   31     new (grow(aligned_size<T>())) T(std::forward<Tys>(Args)...);
   31     new (grow(aligned_size<T>())) T(std::forward<Tys>(Args)...);
   35   template <typename T> T pop() {
   36     auto *Ptr = &peek<T>();
   36     auto *Ptr = &peek<T>();
   37     auto Value = std::move(*Ptr);
   39     shrink(aligned_size<T>());
   45     auto *Ptr = &peek<T>();
   45     auto *Ptr = &peek<T>();
   47     shrink(aligned_size<T>());
   51   template <typename T> T &peek() {
   52     return *reinterpret_cast<T *>(peek(aligned_size<T>()));
   69     return ((sizeof(T) + PtrAlign - 1) / PtrAlign) * PtrAlign;
tools/clang/lib/AST/Interp/Pointer.h
  280   template <typename T> T &deref() const {
tools/clang/lib/AST/Interp/PrimType.h
   50 template <> struct PrimConv<PT_Bool> { using T = Boolean; };
usr/include/c++/7.4.0/bits/move.h
   72     constexpr _Tp&&
   73     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
   83     constexpr _Tp&&
   84     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
   98     move(_Tp&& __t) noexcept
usr/include/c++/7.4.0/type_traits
 1629     { typedef _Tp   type; };
 1633     { typedef _Tp   type; };
 2157     { typedef _Tp type; };