This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by craig.topper on Jan 16 2020, 5:33 PM.

Details

Summary

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.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 16 2020, 5:33 PM
Treebeard removed a subscriber: Treebeard.
Treebeard added a subscriber: Treebeard.
dblaikie accepted this revision.Jan 16 2020, 5:54 PM

Ah, bother - good catch!

This revision is now accepted and ready to land.Jan 16 2020, 5:54 PM
This revision was automatically updated to reflect the committed changes.