[PATCH] D120897: [flang] Remove 'using namespace mlir;` from header files
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 3 05:38:39 PST 2022
awarzynski created this revision.
Herald added subscribers: Chia-hungDuan, mehdi_amini, rriddle.
Herald added a reviewer: clementval.
Herald added projects: Flang, All.
awarzynski requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, jdoerfert.
Herald added a project: LLVM.
Currently, CGOps.h and FIROps.h contain `using namespace mlir;`. Every
file that includes one of these header files (directly and transitively)
will have the MLIR namespace enabled. With name-clashes within
sub-projects (LLVM and MLIR, MLIR and Flang), this is not desired. Also,
it is not possible to "un-use" a namespace once it is "used". Instead,
we should try to limit `using namespace` to implementation files (i.e.
*.cpp).
This patch removes `using namespace mlir;` from header files and adjusts
other files accordingly. In header and TableGen files, extra namespace
qualifier is added when referring to symbols defined in MLIR. Similar
approach was used for source files that didn't require many changes.
Otherwise, `using namespace mlir;` is added.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120897
Files:
flang/include/flang/Optimizer/Builder/Factory.h
flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td
flang/include/flang/Optimizer/Dialect/FIROps.h
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/IO.cpp
flang/lib/Lower/OpenACC.cpp
flang/lib/Lower/OpenMP.cpp
flang/lib/Optimizer/Builder/Character.cpp
flang/lib/Optimizer/Builder/DoLoopHelper.cpp
flang/lib/Optimizer/Builder/FIRBuilder.cpp
flang/lib/Optimizer/Builder/MutableBox.cpp
flang/lib/Optimizer/CodeGen/CGOps.h
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
flang/lib/Optimizer/Dialect/FIRDialect.cpp
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/lib/Optimizer/Transforms/AffineDemotion.cpp
flang/lib/Optimizer/Transforms/AffinePromotion.cpp
flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
flang/lib/Optimizer/Transforms/ExternalNameConversion.cpp
flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp
flang/lib/Optimizer/Transforms/RewriteLoop.cpp
flang/unittests/Optimizer/Builder/DoLoopHelperTest.cpp
flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp
flang/unittests/Optimizer/Builder/Runtime/CharacterTest.cpp
flang/unittests/Optimizer/Builder/Runtime/NumericTest.cpp
flang/unittests/Optimizer/Builder/Runtime/ReductionTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120897.412687.patch
Type: text/x-patch
Size: 23260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220303/34281c04/attachment-0001.bin>
More information about the llvm-commits
mailing list