[PATCH] D55334: [AST] Pass the ASTContext to one of the ctor of DeclRefExpr

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 10:02:57 PST 2018


riccibruno created this revision.
riccibruno added a reviewer: aaron.ballman.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.

Pass the `ASTContext` to one of the constructor of `DeclRefExpr` since
in most cases the appropriate `ASTContext` is readily available.

`Decl::getASTContext()` is not cheap since it must walk back the chain
of declaration contexts to reach the `TranslationUnitDecl`.

Also move the definition of the constructor out of the header since
the constructor is calling `DeclRefExpr::computeDependence` which
is not defined in the header.

This is a mechanical change which should not have any functional change.


Repository:
  rC Clang

https://reviews.llvm.org/D55334

Files:
  include/clang/AST/Expr.h
  lib/AST/ASTContext.cpp
  lib/AST/Expr.cpp
  lib/Analysis/ThreadSafety.cpp
  lib/Analysis/ThreadSafetyCommon.cpp
  lib/CodeGen/CGBlocks.cpp
  lib/CodeGen/CGDecl.cpp
  lib/CodeGen/CGObjC.cpp
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CGStmtOpenMP.cpp
  lib/Frontend/Rewrite/RewriteModernObjC.cpp
  lib/Frontend/Rewrite/RewriteObjC.cpp
  lib/Sema/Sema.cpp
  lib/Sema/SemaCUDA.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaObjCProperty.cpp
  lib/Sema/SemaOverload.cpp
  lib/Sema/TreeTransform.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55334.176848.patch
Type: text/x-patch
Size: 47027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181205/fe15166a/attachment-0001.bin>


More information about the cfe-commits mailing list