This moves the commandline option registration into its own function, so
that users can register translations without registering the options.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | Don't you need to test clOptions.isConstructed() before you can use it? | |
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | Doesn't seem necessary from my reading of the source: Pointer dereference accessor: C *operator->() { return &**this; }which then uses this accessor that constructs the object if necessary: C &operator*() {
void *Tmp = Ptr.load(std::memory_order_acquire);
if (!Tmp)
RegisterManagedStatic(Creator::call, Deleter::call);
return *static_cast<C *>(Ptr.load(std::memory_order_relaxed));
} | |
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | ||
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | Does it mean that operator-> will implicit register the option? if that is the case, it does not solve our problem. | |
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | I talked to Peiming and understood his comment better. | |
| mlir/lib/Tools/mlir-translate/Translation.cpp | ||
|---|---|---|
| 120–121 | Yea we want to avoid constructing the cl options object here, so I'll update this to check isConstructed. | |
Don't you need to test clOptions.isConstructed() before you can use it?