[all-commits] [llvm/llvm-project] caee96: [Transforms][RISCV] Remove a "using namespace llvm...

topperc via All-commits all-commits at lists.llvm.org
Thu Jan 16 20:52:36 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: caee96031d3be9f951e4a17c8d3fb1c8b748fb31
      https://github.com/llvm/llvm-project/commit/caee96031d3be9f951e4a17c8d3fb1c8b748fb31
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/SizeOpts.h
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

  Log Message:
  -----------
  [Transforms][RISCV] Remove a "using namespace llvm" from an include file. Fix a place that became dependent on it.

This include file was created in October and has a "using namespace llvm". This seems to get exposed to other include files and finally onto cpp files. While this somewhat okay for llvm itself, its bad for other projects that use llvm as a library and includes a header file that picks this up. This was found by ISPC which has some class names at gloal scope with the same names as LLVM.

It looks like RISCV accidentally became dependent on this. I fixed it by reordering some includes in the RISCV code, but maybe we want to change the TableGenEmitter to put "namespace llvm {" in the generated file instead? But we probably want to do the simplest thing first so we can merge it to 10.0.

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




More information about the All-commits mailing list