[PATCH] D69903: [Basic] Introduce PODSourceLocation, NFCI

Mikhail Maltsev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 09:22:30 PST 2019


miyuki created this revision.
miyuki added reviewers: faisalv, rsmith, aprantl, JDevlieghere.
Herald added subscribers: cfe-commits, jfb, arphaman.
Herald added a project: clang.
miyuki added a parent revision: D69840: [Basic] Make SourceLocation usable as key in hash maps, NFCI.
miyuki edited parent revisions, added: D69844: [Basic] Integrate SourceLocation with FoldingSet, NFCI; removed: D69840: [Basic] Make SourceLocation usable as key in hash maps, NFCI.

The goal of this change is to further reduce the number of cases when
the internal representation of SourceLocation is accessed directly.

The change adds a new class PODSourceLocation and replaces 'unsigned'
with 'PODSourceLocation' where possible. The PODSourceLocation class
holds the same information as SourceLocation, but it is a POD type,
hence it can be used in contexts where SourceLocation cannot be used
(e.g. unions with implicit default constructors).

SourceLocation objects can be converted to PODSourceLocation and
constructed from PODSourceLocation using the corresponding helpers
getPOD and getFromPOD.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69903

Files:
  clang/include/clang/AST/DeclObjC.h
  clang/include/clang/AST/DeclarationName.h
  clang/include/clang/AST/DependentDiagnostic.h
  clang/include/clang/AST/Expr.h
  clang/include/clang/AST/TemplateBase.h
  clang/include/clang/Basic/SourceLocation.h
  clang/include/clang/Basic/SourceManager.h
  clang/include/clang/Lex/Token.h
  clang/include/clang/Sema/DeclSpec.h
  clang/include/clang/Sema/Designator.h
  clang/include/clang/Sema/Initialization.h
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/DeclObjC.cpp
  clang/lib/AST/DeclarationName.cpp
  clang/lib/AST/Expr.cpp
  clang/lib/AST/NestedNameSpecifier.cpp
  clang/lib/Lex/ModuleMap.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Sema/DeclSpec.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/lib/Sema/SemaType.cpp
  clang/lib/Sema/TreeTransform.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/tools/clang-refactor/TestSupport.cpp
  clang/tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69903.228082.patch
Type: text/x-patch
Size: 50563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191106/65c5c28d/attachment-0001.bin>


More information about the cfe-commits mailing list