[all-commits] [llvm/llvm-project] 6f79f8: [HIP] Fix duplicate clang -cc1 options on MSVC too...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Wed Mar 18 11:48:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f79f80e6e473e1b28ee678cc11bc44efb2448a4
      https://github.com/llvm/llvm-project/commit/6f79f80e6e473e1b28ee678cc11bc44efb2448a4
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-03-18 (Wed, 18 Mar 2020)

  Changed paths:
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/test/Driver/hip-options.hip

  Log Message:
  -----------
  [HIP] Fix duplicate clang -cc1 options on MSVC toolchain

HIPToolChain::TranslateArgs call TranslateArgs of host toolchain with
the input args to get a list of derived args called DAL, then
go through the input args by itself and append them to DAL.

This assumes that the host toolchain should not append any unchanged
args to DAL, otherwise there will be duplicates since
HIPToolChain will append it again.

This works for GNU toolchain since it returns an empty list for DAL.

However, MSVC toolchain will append unchanged args to DAL, which
causes duplicate args.

This patch let MSVC toolchain not append unchanged args for HIP
offloading kind, which fixes this issue.

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




More information about the All-commits mailing list