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

References

tools/clang/lib/AST/ExprConstant.cpp
 2406     Int = Int.trunc(NewBitWidth).extend(OldBitWidth);
 2471   Result = Value.trunc(LHS.getBitWidth());
 8281       DesiredVal = Desired.trunc(Info.Ctx.getCharWidth()).getZExtValue();
11885     APSInt Result = TrueResult.trunc(Info.Ctx.getIntWidth(E->getType()));
tools/clang/lib/AST/Interp/Interp.h
  121     auto Trunc = Value.trunc(Result.bitWidth()).toString(10);
tools/clang/lib/Sema/SemaChecking.cpp
10162     value = value.trunc(MaxWidth);
11005   llvm::APSInt TruncatedValue = Value.trunc(FieldWidth);
11254   ValueInRange = ValueInRange.trunc(Range.Width);
tools/clang/lib/Sema/SemaOverload.cpp
  452         ConvertedValue = ConvertedValue.trunc(ToWidth);
unittests/ADT/APSIntTest.cpp
  107   EXPECT_TRUE(APSInt::compareValues(S(7).trunc(32), S(8)) < 0);
  108   EXPECT_TRUE(APSInt::compareValues(S(8).trunc(32), S(7)) > 0);
  109   EXPECT_TRUE(APSInt::compareValues(S(7).trunc(32), S(7)) == 0);
  110   EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(8)) < 0);
  111   EXPECT_TRUE(APSInt::compareValues(S(8).trunc(32), S(-7)) > 0);
  112   EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-7)) == 0);
  113   EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-8)) > 0);
  114   EXPECT_TRUE(APSInt::compareValues(S(-8).trunc(32), S(-7)) < 0);
  115   EXPECT_TRUE(APSInt::compareValues(S(-7).trunc(32), S(-7)) == 0);
  116   EXPECT_TRUE(APSInt::compareValues(S(7), S(8).trunc(32)) < 0);
  117   EXPECT_TRUE(APSInt::compareValues(S(8), S(7).trunc(32)) > 0);
  118   EXPECT_TRUE(APSInt::compareValues(S(7), S(7).trunc(32)) == 0);
  119   EXPECT_TRUE(APSInt::compareValues(S(-7), S(8).trunc(32)) < 0);
  120   EXPECT_TRUE(APSInt::compareValues(S(8), S(-7).trunc(32)) > 0);
  121   EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7).trunc(32)) == 0);
  122   EXPECT_TRUE(APSInt::compareValues(S(-7), S(-8).trunc(32)) > 0);
  123   EXPECT_TRUE(APSInt::compareValues(S(-8), S(-7).trunc(32)) < 0);
  124   EXPECT_TRUE(APSInt::compareValues(S(-7), S(-7).trunc(32)) == 0);
  127   EXPECT_TRUE(APSInt::compareValues(U(7), U(8).trunc(32)) < 0);
  128   EXPECT_TRUE(APSInt::compareValues(U(8), U(7).trunc(32)) > 0);
  129   EXPECT_TRUE(APSInt::compareValues(U(7), U(7).trunc(32)) == 0);
  130   EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), U(8)) < 0);
  131   EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), U(7)) > 0);
  132   EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), U(7)) == 0);
  135   EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), S(8)) < 0);
  136   EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), S(7)) > 0);
  137   EXPECT_TRUE(APSInt::compareValues(U(7).trunc(32), S(7)) == 0);
  138   EXPECT_TRUE(APSInt::compareValues(U(8).trunc(32), S(-7)) > 0);
  139   EXPECT_TRUE(APSInt::compareValues(U(7), S(8).trunc(32)) < 0);
  140   EXPECT_TRUE(APSInt::compareValues(U(8), S(7).trunc(32)) > 0);
  141   EXPECT_TRUE(APSInt::compareValues(U(7), S(7).trunc(32)) == 0);
  142   EXPECT_TRUE(APSInt::compareValues(U(8), S(-7).trunc(32)) > 0);