-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang-repl] Add call to 'InitializeAllAsmParsers' #86727
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
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang Author: Andrew V. Teylu (aytey) ChangesThis PR fixes the following issue when working with
When working with the following input (named "unit.cpp"): __asm(".globl _ZSt21ios_base_library_initv");
int x; and then in
Signed-off-by: Andrew V. Teylu <[email protected]> Full diff: https://github.com/llvm/llvm-project/pull/86727.diff 1 Files Affected:
diff --git a/clang/tools/clang-repl/ClangRepl.cpp b/clang/tools/clang-repl/ClangRepl.cpp
index 5bad8145324d06..aecf61b97fc719 100644
--- a/clang/tools/clang-repl/ClangRepl.cpp
+++ b/clang/tools/clang-repl/ClangRepl.cpp
@@ -152,6 +152,7 @@ int main(int argc, const char **argv) {
llvm::InitializeAllTargets();
llvm::InitializeAllTargetMCs();
llvm::InitializeAllAsmPrinters();
+ llvm::InitializeAllAsmParsers();
if (OptHostSupportsJit) {
auto J = llvm::orc::LLJITBuilder().create();
|
This my first PR against LLVM; does something like this need tests? I'm 100% happy to add tests for this, but are there some examples of "good" |
Maybe this is reasonable: // REQUIRES: host-supports-jit, x86_64-linux
// UNSUPPORTED: system-aix
//
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: cat %t/inline-asm.txt | clang-repl -Xcc="-I%t"
//--- inline-asm.cpp
__asm(".globl _ZSt21ios_base_library_initv");
int x;
//--- inline-asm.txt
#include "inline-asm.cpp"
x = 10;
%quit |
|
Signed-off-by: Andrew V. Teylu <[email protected]>
Signed-off-by: Andrew V. Teylu <[email protected]>
04e6bbd
to
d1e1049
Compare
@weliveindetail @vgvassilev @junaire: sorry for pinging you directly, but could you take a look at this PR? I see you're all active on other |
Hi, thanks for the PR. I think the change looks reasonable but I'm no longer working on this so I've picked some reviewers for you. They should be able to look at this soon. |
Thank you very much :) |
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!
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.
Yes, perfect. Thanks!
@aytey We can land patches through GitHub nowadays. Is the |
Unfortunately, I don't have write access to the repo, so that's not available to me. The only action I have is "update branch". |
@aytey 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 Please check whether problems have been caused by your change specifically, as 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. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
This PR fixes the following issue when working with
clang-repl
:When working with the following input (named "unit.cpp"):
and then in
clang-repl
:Signed-off-by: Andrew V. Teylu [email protected]