-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[Clang][TableGen] Use PointerType::get(Context) in MVE TableGen emitter (NFC) #124782
Conversation
@llvm/pr-subscribers-clang Author: Mats Jun Larsen (junlarsen) ChangesFollow-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:
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; }
|
There was a problem hiding this 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().
Well, I guess you could also use Builder.getPtrTy() for the whole thing... |
I think I'll do that instead. Sounds a lot more reasonable in my opinion |
1a079d2
to
2bca977
Compare
Co-authored-by: Nikita Popov <[email protected]>
✅ With the latest revision this PR passed the C/C++ code formatter. |
Test failures seem unrelated. |
…er (NFC) (llvm#124782) Follow-up to llvm#123569 Co-authored-by: Nikita Popov <[email protected]>
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.