[clang-offload-bundler] Support `.cui` and `.d`.
authorMichael Liao <michael.hliao@gmail.com>
Wed, 9 Oct 2019 13:53:37 +0000 (13:53 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Wed, 9 Oct 2019 13:53:37 +0000 (13:53 +0000)
Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68663

llvm-svn: 374167

clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp

index 277c031..19325e4 100644 (file)
@@ -71,6 +71,8 @@ static cl::opt<std::string>
                        "Current supported types are:\n"
                        "  i   - cpp-output\n"
                        "  ii  - c++-cpp-output\n"
+                       "  cui - cuda/hip-output\n"
+                       "  d   - dependency\n"
                        "  ll  - llvm\n"
                        "  bc  - llvm-bc\n"
                        "  s   - assembler\n"
@@ -628,6 +630,12 @@ static FileHandler *CreateFileHandler(MemoryBuffer &FirstInput) {
     return new TextFileHandler(/*Comment=*/"//");
   if (FilesType == "ii")
     return new TextFileHandler(/*Comment=*/"//");
+  if (FilesType == "cui")
+    return new TextFileHandler(/*Comment=*/"//");
+  // TODO: `.d` should be eventually removed once `-M` and its variants are
+  // handled properly in offload compilation.
+  if (FilesType == "d")
+    return new TextFileHandler(/*Comment=*/"#");
   if (FilesType == "ll")
     return new TextFileHandler(/*Comment=*/";");
   if (FilesType == "bc")