[MC][DXContainer] Initialize SourceNames::Header scalar fields - #211751
Conversation
The previous constructor left these fields undefined. This updates it to initialize the fields explicitly and switch to default constructor. Making sure that on every use the fields are automatically initialized.
|
Hello @tfzee 👋 Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.
Please reply to this message to confirm that you have read these policies, especially the LLVM AI Tool Use Policy, and that any AI tool usage has been noted in the PR description. Frequently asked questionsHow do I add reviewers? This PR will be automatically labeled, and the relevant teams will be notified. For some parts of the project, reviewers may also be added automatically. You can also add reviewers manually using the Reviewers section on this page. If you cannot use that section, it is probably because you do not have write permissions for the repository. In that case, you can request a review by tagging reviewers in a comment using What if there are no comments? If you have not received any comments on your PR after a week, you can request a review by pinging the PR with a comment such as “Ping”. The common courtesy ping rate is once a week. Please remember that you are asking for volunteer time from other developers. Are any special GitHub settings required to contribute to LLVM? We only require contributors to have a public email address associated with their GitHub commits, see this section of LLVM Developer Policy for details. If you have questions, feel free to leave a comment on this PR, or ask on LLVM Discord or LLVM Discourse. Thank you, |
|
@llvm/pr-subscribers-llvm-mc @llvm/pr-subscribers-backend-directx Author: tfzee (tfzee) ChangesThe previous constructor left these fields undefined. This updates it to initialize the fields explicitly and switch to default constructor. Making sure that on every use the fields are automatically initialized. Full diff: https://github.com/llvm/llvm-project/pull/211751.diff 1 Files Affected:
diff --git a/llvm/include/llvm/MC/DXContainerInfo.h b/llvm/include/llvm/MC/DXContainerInfo.h
index 3d54840f70594..7f1744034866d 100644
--- a/llvm/include/llvm/MC/DXContainerInfo.h
+++ b/llvm/include/llvm/MC/DXContainerInfo.h
@@ -75,11 +75,11 @@ struct SourceInfo {
struct SourceNames : public Section {
struct Header {
- uint32_t Flags;
- uint32_t Count;
- uint16_t EntriesSizeInBytes;
+ uint32_t Flags = 0;
+ uint32_t Count = 0;
+ uint16_t EntriesSizeInBytes = 0;
- Header() {}
+ Header() = default;
LLVM_ABI Header(const dxbc::SourceInfo::Names::HeaderOnDisk &H);
void swapBytes() {
|
|
Ping |
|
@tfzee Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
…211751) The previous constructor left these fields undefined. This updates it to initialize the fields explicitly and switch to default constructor. Making sure that on every use the fields are automatically initialized.
The previous constructor left these fields undefined. This updates it to initialize the fields explicitly and switch to default constructor. Making sure that on every use the fields are automatically initialized.