Existing implementation always aborts on syntax errors in a DataLayout
description. While this is meaningful for consuming textual IR modules, it is
inconvenient for users that may need fine-grained control over the layout from,
e.g., command-line options. Propagate errors through the parsing functions and
only abort in the top-level parsing function instead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Use the naming scheme consistent with (most of) the file. Some funcitons use
the same naming scheme for their attributes as the functions they relate to in
order to minimize renaming changes in this patch.
llvm/include/llvm/IR/DataLayout.h | ||
---|---|---|
189 | Is this a good idea to keep a duplication of every API that can fail? Couldn't we just offer the "safe" one returning an error? |
Comment Actions
Remove duplication between trySet* and set*, only keep the set* API that now
returns Error on failure instead of asserting. I haven't realized these were
private methods so there were no users in the wild that could be depending on
the current API or behavior.
Is this a good idea to keep a duplication of every API that can fail? Couldn't we just offer the "safe" one returning an error?