-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[clang-repl] Teach clang-repl how to load PCHs. #94166
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||
// REQUIRES: host-supports-jit | ||||
// UNSUPPORTED: system-aix | ||||
|
||||
// RUN: rm -f %t.pch | ||||
// RUN: %clang_cc1 -fmax-type-align=16 -pic-level 2 -fdeprecated-macro -stack-protector 1 -fblocks -fskip-odr-check-in-gmf -fexceptions -fcxx-exceptions -fgnuc-version=0 -triple=%target_triple -DPCH -fincremental-extensions -emit-pch -x c++-header -o %t.pch %s | ||||
// RUN: clang-repl -Xcc -fgnuc-version=0 -Xcc -triple=%target_triple -Xcc -include-pch -Xcc %t.pch '#include "%s"' | FileCheck %s | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @weliveindetail, it seems that clang-repl prefers the process triple:
What should we do here? Should we implement a lit version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How we can get the “right” triple from clang? And yes, sometimes the build can be configured in an odd way (we have some bots) where the triple from clang is different from the triple of the JIT. Unfortunately, we did not find a way to suppress these cases with a good lit clause last time we dealt with them. |
||||
|
||||
#ifdef PCH | ||||
int f_pch() { return 5; } | ||||
#endif // PCH | ||||
|
||||
extern "C" int printf(const char *, ...); | ||||
auto r1 = printf("f_pch = %d\n", f_pch()); | ||||
// CHECK: f_pch = 5 |
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.
Why is IR gen finished when we're just starting the module?
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.
It's a double negation: it is /not/ finished when we start a new module.