[CIR] Merge the mlir::cir namespace into cir #1084
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1025 explains why we want to move
the CIR dialect from the
mlir::cir
to thecir
namespace.This is a large PR, and I've split it out into four commits (that'll be
squashed when landing). The first commit changes
mlir::cir
tocir
everywhere. This was originally done mechanically with:
It then required some manual fixups to address edge cases.
Code that lived under
mlir::cir
could refer to themlir
namespacewithout qualification, but after the namespace change, we need to
explicitly qualify all our usages. This is done in the second commit via
https://gist.github.com/smeenai/996200fd45ad123bbf22b412d59479b6, which
is an idempotent script to add all qualifications. I added cases to the
script one at a time and reviewed each change afterwards to ensure we
were only making the intended modifications, so I feel pretty confident
in the end result. I also removed
using namespace llvm
from someheaders to avoid conflicts, which in turn required adding some
llvm::
qualifiers as well.
The third commit fixes a test, since an error message now contains the
mlir namespace. Similar tests in flang also have the namespace in their
error messages, so this is an expected change.
The fourth change runs
git clang-format
. Unfortunately, that doesn'twork for TableGen files, so we'll have a few instances of undesirable
formatting left there. I'll look into fixing that as a follow-up.
I validated the end result by examining the symbols in the built Clang
binary. There's nothing in the
mlir::cir
namespace anymore.https://gist.github.com/smeenai/8438fd01588109fcdbde5c8652781dc0 had the
symbols which lived in
cir
and should have moved toclang::CIRGen
,and I validated that all the symbols were moved, with the exceptions
noted in #1082 and the duplicated
symbols noted in #1025.