Skip to content

Commit aa326b8

Browse files
authored
[SYCLomatic] Fix a bug that analysis mode is not enabled when the option specifed (#1944)
Signed-off-by: Ziran Zhang <[email protected]>
1 parent dd0caa8 commit aa326b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/DPCT/DPCT.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,9 @@ int runDPCT(int argc, const char **argv) {
592592
if (CodePinReport)
593593
CallIndependentTool("codepin-report.py");
594594

595+
if (AnalysisMode)
596+
DpctGlobalInfo::enableAnalysisMode();
597+
595598
if (InRootPath.getPath().size() >= MAX_PATH_LEN - 1) {
596599
DpctLog() << "Error: --in-root '" << InRootPath.getPath() << "' is too long\n";
597600
ShowStatus(MigrationErrorPathTooLong);
@@ -729,8 +732,7 @@ int runDPCT(int argc, const char **argv) {
729732
#else
730733
std::string DVerbose = "";
731734
#endif
732-
if (!DpctGlobalInfo::isAnalysisModeEnabled() &&
733-
!checkReportArgs(ReportType.getValue(), ReportFormat.getValue(),
735+
if (!checkReportArgs(ReportType.getValue(), ReportFormat.getValue(),
734736
ReportFilePrefix, ReportOnly, GenReport, DVerbose)) {
735737
ShowStatus(MigrationErrorInvalidReportArgs);
736738
dpctExit(MigrationErrorInvalidReportArgs);

0 commit comments

Comments
 (0)