53
53
#include < array>
54
54
#include < sstream>
55
55
56
+ #include < iostream>
57
+
56
58
using namespace clang ;
57
59
using namespace clang ::tooling;
58
60
using namespace clang ::driver;
@@ -100,6 +102,10 @@ class SYCLToolchain {
100
102
FileManager *Files,
101
103
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
102
104
DiagnosticConsumer *DiagConsumer) override {
105
+ std::cerr << __PRETTY_FUNCTION__ << std::endl;
106
+ for (auto &arg : Invocation->getCC1CommandLine ())
107
+ std::cout << " " << arg;
108
+ std::cout << std::endl;
103
109
// Create a compiler instance to handle the actual work.
104
110
CompilerInstance Compiler (std::move (Invocation),
105
111
std::move (PCHContainerOps));
@@ -127,6 +133,7 @@ class SYCLToolchain {
127
133
std::vector<std::string> createCommandLine (const InputArgList &UserArgList,
128
134
BinaryFormat Format,
129
135
std::string_view SourceFilePath) {
136
+ std::cerr << __PRETTY_FUNCTION__ << std::endl;
130
137
DerivedArgList DAL{UserArgList};
131
138
const auto &OptTable = getDriverOptTable ();
132
139
DAL.AddFlagArg (nullptr , OptTable.getOption (OPT_fsycl_device_only));
@@ -163,6 +170,9 @@ class SYCLToolchain {
163
170
transform (ASL, std::back_inserter (CommandLine),
164
171
[](const char *AS) { return std::string{AS}; });
165
172
CommandLine.emplace_back (SourceFilePath);
173
+ for (auto &arg : CommandLine)
174
+ std::cout << " " << arg;
175
+ std::cout << std::endl;
166
176
return CommandLine;
167
177
}
168
178
@@ -177,6 +187,10 @@ class SYCLToolchain {
177
187
FileManager *Files,
178
188
std::shared_ptr<PCHContainerOperations> PCHContainerOps,
179
189
DiagnosticConsumer *DiagConsumer) override {
190
+ std::cerr << __PRETTY_FUNCTION__ << std::endl;
191
+ for (auto &arg : Invocation->getCC1CommandLine ())
192
+ std::cout << " " << arg;
193
+ std::cout << std::endl;
180
194
auto MainFilePath = Invocation->getFrontendOpts ().Inputs [0 ].getFile ();
181
195
auto MainFileBuffer = Files->getBufferForFile (MainFilePath);
182
196
assert (MainFileBuffer && " Can't get memory buffer for in-memory source?" );
@@ -450,6 +464,7 @@ Expected<ModuleUPtr> jit_compiler::compileDeviceCode(
450
464
ClangDiagnosticWrapper Wrapper (BuildLog, &DiagOpts);
451
465
452
466
bool AutoPCH = UserArgList.hasArg (OPT_auto_pch);
467
+ std::cerr << " AutoPCH: " << std::boolalpha << AutoPCH << std::endl;
453
468
454
469
if (SYCLToolchain::instance ().run (UserArgList, Format, SourceFile.Path , ELOA,
455
470
getInMemoryFS (SourceFile, IncludeFiles),
0 commit comments