[PATCH] D66862: Make lround builtin constexpr (and others)

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 14:54:08 PDT 2019


rsmith added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:9617
+    APFloat FPVal(0.0);
+    APSInt IVal(Info.Ctx.getIntWidth(E->getType()), 0);
+    bool isExact = true;
----------------
Please use `/*isUnsigned=*/false` for the second argument rather than `0`.


================
Comment at: clang/lib/AST/ExprConstant.cpp:9618
+    APSInt IVal(Info.Ctx.getIntWidth(E->getType()), 0);
+    bool isExact = true;
+
----------------
Please capitalize local variable names to match the convention used in this file.


================
Comment at: clang/lib/AST/ExprConstant.cpp:9625
+
+    return Success(IVal.getExtValue(), E);
+  }
----------------
Just `return Success(IVal, E);` here. Going via `getExtValue` will assert if the integer type is wider than 64 bits.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66862/new/

https://reviews.llvm.org/D66862





More information about the cfe-commits mailing list