[all-commits] [llvm/llvm-project] a6439b: [clang][driver] Only warn once about invalid libra...

tbaederr via All-commits all-commits at lists.llvm.org
Tue Feb 9 21:21:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6439b52088b1d58d8e7aa9891c9011648710593
      https://github.com/llvm/llvm-project/commit/a6439b52088b1d58d8e7aa9891c9011648710593
  Author: Timm Bäder <tbaeder at redhat.com>
  Date:   2021-02-10 (Wed, 10 Feb 2021)

  Changed paths:
    M clang/include/clang/Driver/ToolChain.h
    M clang/lib/Driver/ToolChain.cpp
    A clang/test/Driver/undefined-libs.cpp

  Log Message:
  -----------
  [clang][driver] Only warn once about invalid library values

Since ToolChain::GetCXXStdlibType() is a simple getter that might emit
the "invalid library name in argument" warning, it can conceivably be
called several times while initializing the build pipeline.

Before this patch, a simple 'clang++ -stdlib=foo ./test.cpp' would print
the warning twice, -rt=lib=foo would print 6 times.

Change this and always only print the warning once. Keep the rest of the
semantics of the functions.

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




More information about the All-commits mailing list