Refactor DIExpression::With* into a flag enum in order to be less error-prone to use (as discussed on D60866).
Details
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
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks a lot, this is going to be a far less error-prone API!
| include/llvm/IR/DebugInfoMetadata.h | ||
|---|---|---|
| 2481 ↗ | (On Diff #199592) | I would either use unsigned or uint8_t here. uint16_t seems arbitrary. | 
| 2481 ↗ | (On Diff #199592) | DIExpression::DIExpressionFlags is probably overkill. How about DIExpression::PrependOps? | 
| 2482 ↗ | (On Diff #199592) | For readability: How about adding ApplyOffset = 0? | 
| lib/CodeGen/LiveDebugValues.cpp | ||
| 467 ↗ | (On Diff #199592) | Then this becomes DIExpression::ApplyOffset | 
| lib/CodeGen/PrologEpilogInserter.cpp | ||
| 1191 ↗ | (On Diff #199592) | bool WithStackValue = true; DIExpr = DIExpression::prependOpcodes(DIExpr, Ops, WithStackValue); | 
| lib/CodeGen/SafeStack.cpp | ||
| 578 ↗ | (On Diff #199592) | same here | 
| lib/Target/X86/X86OptimizeLEAs.cpp | ||
| 574 ↗ | (On Diff #199592) | Expr = DIExpression::prepend(Expr, DIExpression::StackValue, AddrDispShift) | 
| lib/Transforms/Instrumentation/AddressSanitizer.cpp | ||
| 3112 ↗ | (On Diff #199592) | again, a bool NoDeref = false helper may improve readability. | 
| lib/Transforms/Utils/InlineFunction.cpp | ||
| 1820 ↗ | (On Diff #199592) | ditto. | 
Comment Actions
Thanks! One bonus cleanup inline :-)
| lib/Transforms/Utils/Local.cpp | ||
|---|---|---|
| 1554 ↗ | (On Diff #199772) | We should probably just pass DIExprFlags, Offset instead of the two bools here. |