[PATCH] D80786: Rename APIs in unittests/AST/Language.h in preparation to share them

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 03:45:35 PDT 2020


gribozavr created this revision.
Herald added subscribers: cfe-commits, martong.
Herald added a reviewer: shafik.
Herald added a reviewer: rengolin.
Herald added a project: clang.

Declaring these helpers in the ast_matcher namespace in the clangAST
library seems inappropriate -- neither these helpers, nor clangAST have
anything to do with AST matchers. Therefore, I moved these helpers to
the clang namespace.

Declaring another typedef called "ArgVector" is not a good idea -- we
already have both "ArgVector", "ArgsVector", and "ArgList". I renamed it
to "UnittestClangArgs" to emphasize semantics and de-emphasize
vector-ness.

Declaring another enum called "Language" is not a good idea because we
arleady have the "clang::Language" enum. I renamed it to
"UnittestLanguage".

Similarly, I renamed "getBasicRunOptionsForLanguage" to
"getCommandLineArgsForTesting" to explain the semantics better (what are
"run options"?) and not repeat types in the function name
("ForLanguage").


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80786

Files:
  clang/unittests/AST/ASTImporterFixtures.cpp
  clang/unittests/AST/ASTImporterFixtures.h
  clang/unittests/AST/ASTImporterODRStrategiesTest.cpp
  clang/unittests/AST/ASTImporterTest.cpp
  clang/unittests/AST/ASTImporterVisibilityTest.cpp
  clang/unittests/AST/Language.cpp
  clang/unittests/AST/Language.h
  clang/unittests/AST/MatchVerifier.h
  clang/unittests/AST/StructuralEquivalenceTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80786.267163.patch
Type: text/x-patch
Size: 30043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200529/84ecbff7/attachment-0001.bin>


More information about the cfe-commits mailing list