Skip to content

Commit 69e0cdf

Browse files
committed
add comment
Signed-off-by: Jiang, Zhiwei <zhiwei.jiang@intel.com>
1 parent 20bd285 commit 69e0cdf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

clang/lib/DPCT/AnalysisInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,14 @@ class DpctGlobalInfo {
17301730
static std::unordered_set<std::string> CustomHelperFunctionAddtionalIncludes;
17311731
static std::unordered_map<clang::tooling::UnifiedPath, std::bitset<32>>
17321732
HeaderInsertedBitMap;
1733+
// `IsAfterBitsStdcxx` is used as a flag. It is set to true when PP meet
1734+
// <bits/stdc++.h>. It is reset to false when starting to process a new
1735+
// translation unit.
17331736
static bool IsAfterBitsStdcxx;
1737+
// If `IsAfterBitsStdcxx` is true, it means <bits/stdc++.h> is already
1738+
// included, so the tool will record all files included since this time point.
1739+
// When inserting `sycl.hpp`, the tool can check if the insert location is in
1740+
// the map, if it is, the tool will also insert `sycl.hpp` at the main file.
17341741
static std::map<clang::tooling::UnifiedPath /*MainFile*/,
17351742
std::set<clang::tooling::UnifiedPath>>
17361743
AfterBitsStdcxxFiles;

0 commit comments

Comments
 (0)