[PATCH] D100380: [Polly] In getBuild() use isl::noexception bindings

Riccardo Mori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 14 17:20:49 PDT 2021


patacca added a comment.

This is the declaration of the function you should use (you can find it in `isl-noexceptions.h`):
`ast_build manage(__isl_take isl_ast_build *ptr);`

When creating a isl C++ object from a raw C pointer you should never call the constructor because it's declared as private. You should instead call `isl::manage` or `isl::manage_copy` like this:

  ast_build BuildCopied = isl::manage_copy(raw_c_pointer);
  ast_build Build = isl::manage(raw_c_pointer);

Also you should probably fix the code styling with `ninja polly-update-format` or `ninja polly-check-format`



================
Comment at: polly/lib/CodeGen/IslAst.cpp:659
+  IslAstUserPayload *Payload = getNodePayload(Node);
+  auto Build = Payload ? isl::ast_build(isl::manage(Payload->Build))
+                       : isl::ast_build();
----------------
That's not what I meant. You should use `isl::manage` without calling directly the constructor.


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

https://reviews.llvm.org/D100380



More information about the llvm-commits mailing list