The first argument in the constructor was ignored, and the remaining arguments were always passed as their defaults.
This patch simplifies the class by moving all initializations to the members.
Details
Diff Detail
Event Timeline
lib/DebugInfo/DWARF/DWARFDie.cpp | ||
---|---|---|
666 | You don't need to call default member constructor explicitly. Default member initialization could be used for Index too. |
- Removed AttrValue from the member initializer list of the constructor of DWARFDie::attribute_iterator.
lib/DebugInfo/DWARF/DWARFDie.cpp | ||
---|---|---|
666 | The main intent here was to remove the first unused argument in the constructor of DWARFAttribute because it is a bit of misleading. And other changes in that class were done because there was no reason not to do them when I was there. |
include/llvm/DebugInfo/DWARF/DWARFAttribute.h | ||
---|---|---|
32 | Form(0) is what the DWARFFormValue default ctor uses, you do not need to make this explicit here. |
- Adjusted the initializer for Value.
- Removed the constructor.
- Removed the method clear() and replaced the only usage with AttrValue = {}.
include/llvm/DebugInfo/DWARF/DWARFAttribute.h | ||
---|---|---|
33–34 | This should be written as: DWARFFormValue Value; There's no need to explicitly default construct & then copy construct the object - the default constructor will be called implicitly. |
include/llvm/DebugInfo/DWARF/DWARFAttribute.h | ||
---|---|---|
33–34 | Well, I usually prefer more explicit code because it is just simpler to understand, hoping that the optimizer will remove any redundancy. But let it be as you said. |
Form(0) is what the DWARFFormValue default ctor uses, you do not need to make this explicit here.