Skip to content

Commit ad4bf40

Browse files
authored
[SYCLomatic] Create out-root folder when using '--gen-helper-function' before save new files (#849)
Signed-off-by: Jiang, Zhiwei <[email protected]>
1 parent 40dd71e commit ad4bf40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/DPCT/GenHelperFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ std::unordered_map<std::string, std::string> HelperFileNameMap{
125125
} // namespace
126126

127127
void genHelperFunction(const std::string &OutRoot) {
128+
if (!llvm::sys::fs::is_directory(OutRoot))
129+
llvm::sys::fs::create_directory(llvm::Twine(OutRoot));
128130
std::string ToPath = OutRoot + "/include";
129131
if (!llvm::sys::fs::is_directory(ToPath))
130132
llvm::sys::fs::create_directory(llvm::Twine(ToPath));

0 commit comments

Comments
 (0)