Skip to content

[MC][DXContainer] Initialize SourceNames::Header scalar fields - #211751

Merged
dzhidzhoev merged 2 commits into
llvm:mainfrom
tfzee:patch-2
Aug 5, 2026
Merged

[MC][DXContainer] Initialize SourceNames::Header scalar fields#211751
dzhidzhoev merged 2 commits into
llvm:mainfrom
tfzee:patch-2

Conversation

@tfzee

@tfzee tfzee commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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.
@github-actions

Copy link
Copy Markdown

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.

  • All contributions to LLVM must follow our LLVM AI Tool Use Policy. In particular, if you used AI while working on this PR, remember to add a note to the PR description.
  • The LLVM Code-Review Policy and Practices document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR.
  • Our LLVM Developer Policy describes our expectations for code quality, commit summaries and contains notes on our CI system.

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 questions

How 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 @ followed by their GitHub username.

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,
The LLVM Community

@llvmorg-github-actions llvmorg-github-actions Bot added llvm:mc Machine (object) code backend:DirectX labels Jul 24, 2026
@llvmorg-github-actions

llvmorg-github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-mc

@llvm/pr-subscribers-backend-directx

Author: tfzee (tfzee)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/211751.diff

1 Files Affected:

  • (modified) llvm/include/llvm/MC/DXContainerInfo.h (+4-4)
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() {

@tfzee

tfzee commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Ping

@e-kud
e-kud requested a review from dzhidzhoev August 3, 2026 09:06

@dzhidzhoev dzhidzhoev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@dzhidzhoev
dzhidzhoev enabled auto-merge (squash) August 5, 2026 16:16
@dzhidzhoev
dzhidzhoev merged commit 2ec3d71 into llvm:main Aug 5, 2026
10 of 12 checks passed
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

@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!

jinge90 pushed a commit to jinge90/llvm-project that referenced this pull request Aug 6, 2026
…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.
@tfzee
tfzee deleted the patch-2 branch August 6, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:DirectX llvm:mc Machine (object) code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants