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

[Clang][TableGen] Use PointerType::get(Context) in MVE TableGen emitter (NFC) #124782

Conversation

junlarsen
Copy link
Member

Follow-up to #123569

I don't know if directly using the CodeGenModule here is the best solution. Let me know if there's something better to use.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 28, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 28, 2025

@llvm/pr-subscribers-clang

Author: Mats Jun Larsen (junlarsen)

Changes

Follow-up to #123569

I don't know if directly using the CodeGenModule here is the best solution. Let me know if there's something better to use.


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

1 Files Affected:

  • (modified) clang/utils/TableGen/MveEmitter.cpp (+1-1)
diff --git a/clang/utils/TableGen/MveEmitter.cpp b/clang/utils/TableGen/MveEmitter.cpp
index 58a4d3c22ac366..334aedbb8592b5 100644
--- a/clang/utils/TableGen/MveEmitter.cpp
+++ b/clang/utils/TableGen/MveEmitter.cpp
@@ -210,7 +210,7 @@ class PointerType : public Type {
     return Name + " *";
   }
   std::string llvmName() const override {
-    return "llvm::PointerType::getUnqual(" + Pointee->llvmName() + ")";
+    return "llvm::PointerType::getUnqual(CGM.getLLVMContext())";
   }
   const Type *getPointeeType() const { return Pointee; }
 

@junlarsen junlarsen changed the title [Clang][TableGen] Use PointerType::get(Context) in MVE TableGen emitter [Clang][TableGen] Use PointerType::get(Context) in MVE TableGen emitter (NFC) Jan 28, 2025
@junlarsen junlarsen requested a review from nikic February 7, 2025 15:22
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

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

LGTM

I don't know if directly using the CodeGenModule here is the best solution. Let me know if there's something better to use.

I think that's ok. The alternative would be Builder.getContext().

@nikic
Copy link
Contributor

nikic commented Feb 7, 2025

Well, I guess you could also use Builder.getPtrTy() for the whole thing...

@junlarsen
Copy link
Member Author

I think I'll do that instead. Sounds a lot more reasonable in my opinion

@junlarsen junlarsen force-pushed the jun/clang-mve-tablegen-use-pointertype-get-context branch from 1a079d2 to 2bca977 Compare February 7, 2025 16:37
Copy link

github-actions bot commented Feb 7, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@junlarsen
Copy link
Member Author

Test failures seem unrelated.

@junlarsen junlarsen merged commit c4c22a5 into llvm:main Feb 7, 2025
6 of 8 checks passed
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants