[all-commits] [llvm/llvm-project] d69459: [clang][IFS] Allow 2 output files when using -o an...

Puyan Lotfi via All-commits all-commits at lists.llvm.org
Mon Dec 9 11:49:05 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d694594d7650571dec40cc0ef9db6087963d62a0
      https://github.com/llvm/llvm-project/commit/d694594d7650571dec40cc0ef9db6087963d62a0
  Author: Puyan Lotfi <puyan at puyan.org>
  Date:   2019-12-09 (Mon, 09 Dec 2019)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/InterfaceStubs/driver-test3.c

  Log Message:
  -----------
  [clang][IFS] Allow 2 output files when using -o and -c with clang IFS stubs.

This patch allows for -o to be used with -c when compiling with clang
interface stubs enabled. This is because the second file will be an
intermediate ifs stubs file that is the text stub analog of the .o file.
Both get produces in this case, so two files.

Why are we doing this? Because we want to support the case where
interface stubs are used bu first invoking clang like so:

clang -c <other flags> -emit-interface-stubs foo.c -o foo.o
...
clang -emit-interface-stubs <.o files> -o libfoo.so

This should generate N .ifs files, and one .ifso file. Prior to this
patch, using -o with the -c invocation was not possible. Currently the
clang driver supports generating a a.out/.so file at the same time as a
merged ifs file / ifso file, but this is done by checking that the final
job is the IfsMerge job. When -c is used, the final job is a Compile job
so what this patch does is check to figure out of the job type is
TY_IFS_CPP.

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




More information about the All-commits mailing list