[clang] 4ef9110 - [clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.

Puyan Lotfi via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 17:04:24 PST 2019


Author: Puyan Lotfi
Date: 2019-12-04T20:03:57-05:00
New Revision: 4ef9110b8d1004840d70477382c6bd10fb487fb6

URL: https://github.com/llvm/llvm-project/commit/4ef9110b8d1004840d70477382c6bd10fb487fb6
DIFF: https://github.com/llvm/llvm-project/commit/4ef9110b8d1004840d70477382c6bd10fb487fb6.diff

LOG: [clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.

Many of the inputs to clang driver toolchain tools can be things other
than files such as -Xclang and -Xlinker arguments. For now we don't take
such tool pass-through type arguments (although having an -Xifs would be nice to
have to replace things like -emit-merged-ifs). So because for the moment
we are not doing any sort of argument pass-through, I am going to have
InterfaceStubs Merger ignore any non-file type input arguments.

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

Added: 
    clang/test/InterfaceStubs/XlinkerInputArgs.cpp

Modified: 
    clang/lib/Driver/ToolChains/InterfaceStubs.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/InterfaceStubs.cpp b/clang/lib/Driver/ToolChains/InterfaceStubs.cpp
index f441f4787097..8f947e79bd1f 100644
--- a/clang/lib/Driver/ToolChains/InterfaceStubs.cpp
+++ b/clang/lib/Driver/ToolChains/InterfaceStubs.cpp
@@ -46,6 +46,8 @@ void Merger::ConstructJob(Compilation &C, const JobAction &JA,
   // Here we append the input files. If the input files are object files, then
   // we look for .ifs files present in the same location as the object files.
   for (const auto &Input : Inputs) {
+    if (!Input.isFilename())
+      continue;
     SmallString<128> InputFilename(Input.getFilename());
     if (Input.getType() == types::TY_Object)
       llvm::sys::path::replace_extension(InputFilename, ".ifs");

diff  --git a/clang/test/InterfaceStubs/XlinkerInputArgs.cpp b/clang/test/InterfaceStubs/XlinkerInputArgs.cpp
new file mode 100644
index 000000000000..cb4ef8aca952
--- /dev/null
+++ b/clang/test/InterfaceStubs/XlinkerInputArgs.cpp
@@ -0,0 +1,3 @@
+// RUN: %clang -### -Xlinker -Bsymbolic -emit-interface-stubs 2>&1 | FileCheck %s
+// CHECK: Bsymbolic
+// CHECK-NOT: Bsymbolic


        


More information about the cfe-commits mailing list