[PATCH] D70620: [CommandLine] Add callbacks to Options

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 02:24:53 PST 2019


serge-sans-paille added a comment.

@hintonda I really prefer your version now, except the extra casting stuff that you can probably avoid (?)
Concerning your high level concerns, I don't have enough understanding of the big picture to help, sorry ^^!



================
Comment at: llvm/include/llvm/Support/CommandLine.h:1356
     this->setPosition(pos);
+    Callback(reinterpret_cast<void*>(&Val));
     return false;
----------------
A `reinterpret_cast` is not needed here


================
Comment at: llvm/include/llvm/Support/CommandLine.h:1416
+    T &NCVal = const_cast<T&>(Val);
+    Callback(reinterpret_cast<void*>(&NCVal));
     return this->getValue();
----------------
Would this work if the function took  a `void const*` instead? And again, the `reinterpret_cast` here is not needed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70620





More information about the llvm-commits mailing list