Refactor DIExpression::With* into a flag enum in order to be less error-prone to use (as discussed on D60866).
Details
- Reviewers
aprantl - Commits
- rZORGf6404f23ce92: [DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)
rGf6404f23ce92: [DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)
rGe85bbf564de9: [DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)
rL361137: [DebugInfoMetadata] Refactor DIExpression::prepend constants (NFC)
Diff Detail
Event Timeline
Thanks a lot, this is going to be a far less error-prone API!
include/llvm/IR/DebugInfoMetadata.h | ||
---|---|---|
2481 | I would either use unsigned or uint8_t here. uint16_t seems arbitrary. | |
2481 | DIExpression::DIExpressionFlags is probably overkill. How about DIExpression::PrependOps? | |
2482 | For readability: How about adding ApplyOffset = 0? | |
lib/CodeGen/LiveDebugValues.cpp | ||
464–465 | Then this becomes DIExpression::ApplyOffset | |
lib/CodeGen/PrologEpilogInserter.cpp | ||
1190–1191 | bool WithStackValue = true; DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, WithStackValue); | |
lib/CodeGen/SafeStack.cpp | ||
578 | same here | |
lib/Target/X86/X86OptimizeLEAs.cpp | ||
575 | Expr = DIExpression::prepend(Expr, DIExpression::StackValue, AddrDispShift) | |
lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
3110–3111 | again, a bool NoDeref = false helper may improve readability. | |
lib/Transforms/Utils/InlineFunction.cpp | ||
1820 | ditto. |
Thanks! One bonus cleanup inline :-)
lib/Transforms/Utils/Local.cpp | ||
---|---|---|
1554 | We should probably just pass DIExprFlags, Offset instead of the two bools here. |
I would either use unsigned or uint8_t here. uint16_t seems arbitrary.