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

topperc via All-commits all-commits at lists.llvm.org
Fri Jan 17 00:42:35 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: ac2c2db1674f200f87b05bee528c761600d87615
      https://github.com/llvm/llvm-project/commit/ac2c2db1674f200f87b05bee528c761600d87615
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2020-01-17 (Fri, 17 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

(cherry picked from commit caee96031d3be9f951e4a17c8d3fb1c8b748fb31)




More information about the All-commits mailing list