Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SandboxIR][NFC] Move sandboxir::Use into a separate file #99074

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

vporpo
Copy link
Contributor

@vporpo vporpo commented Jul 16, 2024

This helps avoid circular dependencies in a follow-up patch.

#include "llvm/Support/raw_ostream.h"

namespace llvm {
namespace sandboxir {
Copy link
Member

Choose a reason for hiding this comment

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

namespace llvm::sandboxir {

Copy link
Member

Choose a reason for hiding this comment

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

Maybe not. llvm::Use could be forward declared. IIRC raw_ostream can also be forward declared.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would we forward declare llvm::Use?

Copy link
Member

Choose a reason for hiding this comment

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

To get rid of the include.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Including llvm IR header files is not going to cause any dependency issues, so I think it should be fine to keep it this way.

void dump(raw_ostream &OS) const;
void dump() const;
#endif // NDEBUG
};
Copy link
Member

@tschuett tschuett Jul 16, 2024

Choose a reason for hiding this comment

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

A new line would be nice, but ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I will add one.

@@ -0,0 +1,51 @@
#ifndef LLVM_TRANSFORMS_SANDBOXIR_USE_H
#define LLVM_TRANSFORMS_SANDBOXIR_USE_H
Copy link
Member

Choose a reason for hiding this comment

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

This is not in the transforms directory. Maybe there was a version in transforms. The include guard looks odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's also missing the LLVM header!

Copy link
Member

Choose a reason for hiding this comment

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

The TRANSFORMS was copy-pasted from SandboxIR.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, let me fix that too.

This helps avoid circular dependencies in a follow-up patch.
@vporpo vporpo merged commit d01d9ab into llvm:main Jul 16, 2024
4 of 5 checks passed
sgundapa pushed a commit to sgundapa/upstream_effort that referenced this pull request Jul 23, 2024
This helps avoid circular dependencies in a follow-up patch.
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: This helps avoid circular dependencies in a follow-up patch.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants