[PATCH] D121378: [clang][dataflow] Model the behavior of various optional members

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 08:41:06 PST 2022


xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:64
 static BoolValue *getHasValue(Value *Val) {
-  if (auto *OptionalVal = cast_or_null<StructValue>(Val)) {
+  if (auto *OptionalVal = cast_or_null<StructValue>(Val))
     return cast<BoolValue>(OptionalVal->getProperty("has_value"));
----------------
Nit: unintended change?


================
Comment at: clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp:33
 static constexpr char StdTypeTraitsHeader[] = R"(
+#ifndef TYPE_TRAITS_H
+#define TYPE_TRAITS_H
----------------
I wonder if it is more sustainable in the long term to have these headers in a separate file and `#include` them here (and build the raw string literal with a macro if that is possible at all).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121378



More information about the cfe-commits mailing list