]> granicus.if.org Git - clang/commitdiff
[tooling] Fix assertion on MacOSX.
authorMichael Liao <michael.hliao@gmail.com>
Thu, 10 Oct 2019 23:45:20 +0000 (23:45 +0000)
committerMichael Liao <michael.hliao@gmail.com>
Thu, 10 Oct 2019 23:45:20 +0000 (23:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374478 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Tooling/Tooling.cpp

index 254cc8b7e89f5fd74626b58b9ecd6983fb9c1d44..60d4dce0cb981f94b0017d71c661ceb8b1d9167c 100644 (file)
@@ -106,7 +106,12 @@ static const llvm::opt::ArgStringList *getCC1Arguments(
         // compilation, device compilation only option, such as
         // `--cuda-device-only`, needs specifying.
         assert(Actions.size() == 2);
-        assert(isa<driver::CompileJobAction>(Actions.front()));
+        assert(
+            isa<driver::CompileJobAction>(Actions.front()) ||
+            // On MacOSX real actions may end up being wrapped in
+            // BindArchAction.
+            (isa<driver::BindArchAction>(Actions.front()) &&
+             isa<driver::CompileJobAction>(*Actions.front()->input_begin())));
         OffloadCompilation = true;
         break;
       }