This allows the "override DataLayout" callback to read both the
DataLayout and TargetTriple that was defined in the IR module when
inferring the default (for example we might not want to override the
existing value if it's non-empty).
We could also add an additional argument instead, but I feel that
passing a const reference to the Module is simpler and more extensible.
Details
Details
- Reviewers
mehdi_amini efriedma
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
@mehdi_amini In D78403 you were against passing a Module* callback, is a read-only const Module& okay or should I pass DataLayout + triple instead? I prefer the former, but if there are strong objections I'm happy to change it to the latter. Passing a read-only module should make it easier to extend in the future if needed.
Comment Actions
In general I'm in favor of narrow API: that is pass what you need and not more. That makes it for cleaner API contracts which are easier to understand and/or maintain.
Comment Actions
Looks like this is obsolete now that D140985 landed, will rebase the remaining patch stack.