Date: Wed, 29 Aug 2018 17:50:47 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r338380 - in vendor/clang/dist-release_70: docs include/clang/AST include/clang/Analysis include/clang/Basic include/clang/Sema lib/AST lib/Analysis lib/Basic/Targets lib/CodeGen lib/He... Message-ID: <201808291750.w7THolNP022522@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Wed Aug 29 17:50:47 2018 New Revision: 338380 URL: https://svnweb.freebsd.org/changeset/base/338380 Log: Vendor import of clang release_70 branch r340910: https://llvm.org/svn/llvm-project/cfe/branches/release_70@340910 Added: vendor/clang/dist-release_70/test/CodeGenCXX/block-byref.cpp (contents, props changed) Modified: vendor/clang/dist-release_70/docs/ReleaseNotes.rst vendor/clang/dist-release_70/docs/UsersManual.rst vendor/clang/dist-release_70/include/clang/AST/Comment.h vendor/clang/dist-release_70/include/clang/AST/Decl.h vendor/clang/dist-release_70/include/clang/AST/DeclBase.h vendor/clang/dist-release_70/include/clang/AST/DeclCXX.h vendor/clang/dist-release_70/include/clang/AST/DeclObjC.h vendor/clang/dist-release_70/include/clang/AST/DeclarationName.h vendor/clang/dist-release_70/include/clang/AST/Expr.h vendor/clang/dist-release_70/include/clang/AST/ExprCXX.h vendor/clang/dist-release_70/include/clang/AST/ExprObjC.h vendor/clang/dist-release_70/include/clang/AST/ExprOpenMP.h vendor/clang/dist-release_70/include/clang/AST/OpenMPClause.h vendor/clang/dist-release_70/include/clang/AST/RawCommentList.h vendor/clang/dist-release_70/include/clang/AST/Stmt.h vendor/clang/dist-release_70/include/clang/AST/StmtCXX.h vendor/clang/dist-release_70/include/clang/AST/StmtObjC.h vendor/clang/dist-release_70/include/clang/AST/StmtOpenMP.h vendor/clang/dist-release_70/include/clang/Analysis/CloneDetection.h vendor/clang/dist-release_70/include/clang/Basic/BuiltinsX86_64.def vendor/clang/dist-release_70/include/clang/Sema/DeclSpec.h vendor/clang/dist-release_70/lib/AST/DeclObjC.cpp vendor/clang/dist-release_70/lib/AST/Expr.cpp vendor/clang/dist-release_70/lib/AST/ExprCXX.cpp vendor/clang/dist-release_70/lib/AST/MicrosoftMangle.cpp vendor/clang/dist-release_70/lib/AST/Stmt.cpp vendor/clang/dist-release_70/lib/AST/StmtObjC.cpp vendor/clang/dist-release_70/lib/Analysis/CloneDetection.cpp vendor/clang/dist-release_70/lib/Basic/Targets/X86.h vendor/clang/dist-release_70/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist-release_70/lib/CodeGen/CGExpr.cpp vendor/clang/dist-release_70/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist-release_70/lib/CodeGen/CoverageMappingGen.cpp vendor/clang/dist-release_70/lib/Headers/intrin.h vendor/clang/dist-release_70/lib/Sema/SemaChecking.cpp vendor/clang/dist-release_70/lib/Sema/SemaInit.cpp vendor/clang/dist-release_70/test/CodeGen/ms-x86-intrinsics.c vendor/clang/dist-release_70/test/CodeGenCXX/atomic-inline.cpp vendor/clang/dist-release_70/test/CodeGenCXX/cfi-cross-dso.cpp vendor/clang/dist-release_70/test/CodeGenCXX/cfi-icall.cpp vendor/clang/dist-release_70/test/CodeGenCXX/debug-info-thunk.cpp vendor/clang/dist-release_70/test/CodeGenCXX/dllexport.cpp vendor/clang/dist-release_70/test/CodeGenCXX/mangle-ms.cpp vendor/clang/dist-release_70/test/CodeGenCXX/microsoft-abi-structors.cpp vendor/clang/dist-release_70/test/CodeGenCXX/microsoft-abi-throw.cpp vendor/clang/dist-release_70/test/CodeGenCXX/microsoft-abi-thunks.cpp vendor/clang/dist-release_70/test/CodeGenCXX/microsoft-abi-vftables.cpp vendor/clang/dist-release_70/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp vendor/clang/dist-release_70/test/CodeGenCXX/msabi-swiftcall-cc.cpp vendor/clang/dist-release_70/test/CodeGenCXX/pragma-init_seg.cpp vendor/clang/dist-release_70/test/CodeGenCXX/type-metadata.cpp vendor/clang/dist-release_70/test/Headers/ms-intrin.cpp vendor/clang/dist-release_70/test/OpenMP/declare_target_codegen.cpp vendor/clang/dist-release_70/test/Sema/statements.c Modified: vendor/clang/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_70/docs/ReleaseNotes.rst Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/docs/ReleaseNotes.rst Wed Aug 29 17:50:47 2018 (r338380) @@ -222,11 +222,32 @@ Objective-C Language Changes in Clang ... -OpenCL C Language Changes in Clang ----------------------------------- +OpenCL C/C++ Language Changes in Clang +-------------------------------------- -... +Miscellaneous changes in OpenCL C: +- Added ``cles_khr_int64`` extension. + +- Added bug fixes and simplifications to Clang blocks in OpenCL mode. + +- Added compiler flag ``-cl-uniform-work-group-size`` to allow extra compile time optimisation. + +- Propagate ``denorms-are-zero`` attribute to IR if ``-cl-denorms-are-zero`` is passed to the compiler. + +- Separated ``read_only`` and ``write_only`` pipe IR types. + +- Fixed address space for the ``__func__`` predefined macro. + +- Improved diagnostics of kernel argument types. + + +Started OpenCL C++ support: + +- Added ``-std/-cl-std=c++``. + +- Added support for keywords. + OpenMP Support in Clang ---------------------------------- @@ -265,7 +286,10 @@ These are major API changes that have happened since t Clang. If upgrading an external codebase that uses Clang as a library, this section should help get you past the largest hurdles of upgrading. -- ... +- The methods ``getLocStart``, ``getStartLoc`` and ``getLocEnd`` in the AST + classes are deprecated. New APIs ``getBeginLoc`` and ``getEndLoc`` should + be used instead. While the old methods remain in this release, they will + not be present in the next release of Clang. AST Matchers ------------ Modified: vendor/clang/dist-release_70/docs/UsersManual.rst ============================================================================== --- vendor/clang/dist-release_70/docs/UsersManual.rst Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/docs/UsersManual.rst Wed Aug 29 17:50:47 2018 (r338380) @@ -2711,16 +2711,17 @@ Command Prompt or a regular Command Prompt where the e up using e.g. `vcvarsall.bat <http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx>`_. clang-cl can also be used from inside Visual Studio by selecting the LLVM -Platform Toolset. The toolset is installed by the LLVM installer, which can be -downloaded from the `LLVM release <http://releases.llvm.org/download.html>`_ or -`snapshot build <http://llvm.org/builds/>`_ web pages. To use the toolset, -select a project in Solution Explorer, open its Property Page (Alt+F7), and in -the "General" section of "Configuration Properties" change "Platform Toolset" -to e.g. LLVM-vs2014. +Platform Toolset. The toolset is not part of the installer, but may be installed +separately from the +`Visual Studio Marketplace <https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain>`_. +To use the toolset, select a project in Solution Explorer, open its Property +Page (Alt+F7), and in the "General" section of "Configuration Properties" +change "Platform Toolset" to LLVM. Doing so enables an additional Property +Page for selecting the clang-cl executable to use for builds. To use the toolset with MSBuild directly, invoke it with e.g. -``/p:PlatformToolset=LLVM-vs2014``. This allows trying out the clang-cl -toolchain without modifying your project files. +``/p:PlatformToolset=LLVM``. This allows trying out the clang-cl toolchain +without modifying your project files. It's also possible to point MSBuild at clang-cl without changing toolset by passing ``/p:CLToolPath=c:\llvm\bin /p:CLToolExe=clang-cl.exe``. @@ -2729,7 +2730,7 @@ When using CMake and the Visual Studio generators, the :: - cmake -G"Visual Studio 15 2017" -T LLVM-vs2014 .. + cmake -G"Visual Studio 15 2017" -T LLVM .. When using CMake with the Ninja generator, set the ``CMAKE_C_COMPILER`` and ``CMAKE_CXX_COMPILER`` variables to clang-cl: Modified: vendor/clang/dist-release_70/include/clang/AST/Comment.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/Comment.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/Comment.h Wed Aug 29 17:50:47 2018 (r338380) @@ -215,13 +215,11 @@ class Comment { (public) SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { - return Range.getBegin(); - } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { - return Range.getEnd(); - } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceLocation getLocation() const LLVM_READONLY { return Loc; } Modified: vendor/clang/dist-release_70/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/Decl.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/Decl.h Wed Aug 29 17:50:47 2018 (r338380) @@ -614,7 +614,8 @@ class NamespaceDecl : public NamedDecl, public DeclCon return SourceRange(LocStart, RBraceLoc); } - SourceLocation getLocStart() const LLVM_READONLY { return LocStart; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LocStart; } SourceLocation getRBraceLoc() const { return RBraceLoc; } void setLocStart(SourceLocation L) { LocStart = L; } void setRBraceLoc(SourceLocation L) { RBraceLoc = L; } @@ -735,7 +736,8 @@ class DeclaratorDecl : public ValueDecl { (public) SourceRange getSourceRange() const override LLVM_READONLY; - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getOuterLocStart(); } @@ -2851,7 +2853,8 @@ class TypeDecl : public NamedDecl { (public) const Type *getTypeForDecl() const { return TypeForDecl; } void setTypeForDecl(const Type *TD) { TypeForDecl = TD; } - SourceLocation getLocStart() const LLVM_READONLY { return LocStart; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LocStart; } void setLocStart(SourceLocation L) { LocStart = L; } SourceRange getSourceRange() const override LLVM_READONLY { if (LocStart.isValid()) @@ -4223,7 +4226,8 @@ class ExportDecl final : public Decl, public DeclConte SourceLocation getRBraceLoc() const { return RBraceLoc; } void setRBraceLoc(SourceLocation L) { RBraceLoc = L; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (RBraceLoc.isValid()) return RBraceLoc; // No braces: get the end location of the (only) declaration in context Modified: vendor/clang/dist-release_70/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/DeclBase.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/DeclBase.h Wed Aug 29 17:50:47 2018 (r338380) @@ -406,11 +406,13 @@ class alignas(8) Decl { (public) return SourceRange(getLocation(), getLocation()); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getSourceRange().getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSourceRange().getEnd(); } Modified: vendor/clang/dist-release_70/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/DeclCXX.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/DeclCXX.h Wed Aug 29 17:50:47 2018 (r338380) @@ -233,8 +233,10 @@ class CXXBaseSpecifier { (public) /// Retrieves the source range that contains the entire base specifier. SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } /// Get the location at which the base class type was written. SourceLocation getBaseTypeLoc() const LLVM_READONLY { @@ -2884,7 +2886,8 @@ class LinkageSpecDecl : public Decl, public DeclContex HasBraces = RBraceLoc.isValid(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (hasBraces()) return getRBraceLoc(); // No braces: get the end location of the (only) declaration in context Modified: vendor/clang/dist-release_70/include/clang/AST/DeclObjC.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/DeclObjC.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/DeclObjC.h Wed Aug 29 17:50:47 2018 (r338380) @@ -318,8 +318,10 @@ class ObjCMethodDecl : public NamedDecl, public DeclCo SourceLocation getDeclaratorEndLoc() const { return DeclEndLoc; } // Location information, modeled after the Stmt API. - SourceLocation getLocStart() const LLVM_READONLY { return getLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getLocation(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; SourceRange getSourceRange() const override LLVM_READONLY { return SourceRange(getLocation(), getLocEnd()); } @@ -2831,7 +2833,8 @@ class ObjCPropertyImplDecl : public Decl { (public) SourceRange getSourceRange() const override LLVM_READONLY; - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } ObjCPropertyDecl *getPropertyDecl() const { Modified: vendor/clang/dist-release_70/include/clang/AST/DeclarationName.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/DeclarationName.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/DeclarationName.h Wed Aug 29 17:50:47 2018 (r338380) @@ -557,22 +557,19 @@ struct DeclarationNameInfo { (public) /// getBeginLoc - Retrieve the location of the first token. SourceLocation getBeginLoc() const { return NameLoc; } - /// getEndLoc - Retrieve the location of the last token. - SourceLocation getEndLoc() const { return getLocEnd(); } - /// getSourceRange - The range of the declaration name. SourceRange getSourceRange() const LLVM_READONLY { return SourceRange(getLocStart(), getLocEnd()); } - SourceLocation getLocStart() const LLVM_READONLY { - return getBeginLoc(); - } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { SourceLocation EndLoc = getEndLocPrivate(); return EndLoc.isValid() ? EndLoc : getLocStart(); } + private: SourceLocation getEndLocPrivate() const; }; Modified: vendor/clang/dist-release_70/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/Expr.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/Expr.h Wed Aug 29 17:50:47 2018 (r338380) @@ -904,10 +904,12 @@ class OpaqueValueExpr : public Expr { (public) /// Retrieve the location of this expression. SourceLocation getLocation() const { return Loc; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SourceExpr ? SourceExpr->getLocStart() : Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SourceExpr ? SourceExpr->getLocEnd() : Loc; } SourceLocation getExprLoc() const LLVM_READONLY { @@ -1064,8 +1066,10 @@ class DeclRefExpr final (public) SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; /// Determine whether this declaration reference was preceded by a /// C++ nested-name-specifier, e.g., \c N::foo. @@ -1242,8 +1246,10 @@ class PredefinedExpr : public Expr { (public) static StringRef getIdentTypeName(IdentType IT); static std::string ComputeName(IdentType IT, const Decl *CurrentDecl); - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { return T->getStmtClass() == PredefinedExprClass; @@ -1331,8 +1337,10 @@ class IntegerLiteral : public Expr, public APIntStorag /// Returns a new empty integer literal. static IntegerLiteral *Create(const ASTContext &C, EmptyShell Empty); - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } /// Retrieve the location of the literal. SourceLocation getLocation() const { return Loc; } @@ -1370,8 +1378,10 @@ class FixedPointLiteral : public Expr, public APIntSto QualType type, SourceLocation l, unsigned Scale); - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } /// \brief Retrieve the location of the literal. SourceLocation getLocation() const { return Loc; } @@ -1424,8 +1434,10 @@ class CharacterLiteral : public Expr { (public) return static_cast<CharacterKind>(CharacterLiteralBits.Kind); } - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } unsigned getValue() const { return Value; } @@ -1497,8 +1509,10 @@ class FloatingLiteral : public Expr, private APFloatSt SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } static bool classof(const Stmt *T) { return T->getStmtClass() == FloatingLiteralClass; @@ -1534,8 +1548,12 @@ class ImaginaryLiteral : public Expr { (public) Expr *getSubExpr() { return cast<Expr>(Val); } void setSubExpr(Expr *E) { Val = E; } - SourceLocation getLocStart() const LLVM_READONLY { return Val->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Val->getLocEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { + return Val->getLocStart(); + } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Val->getLocEnd(); } static bool classof(const Stmt *T) { return T->getStmtClass() == ImaginaryLiteralClass; @@ -1708,8 +1726,10 @@ class StringLiteral : public Expr { (public) tokloc_iterator tokloc_begin() const { return TokLocs; } tokloc_iterator tokloc_end() const { return TokLocs + NumConcatenated; } - SourceLocation getLocStart() const LLVM_READONLY { return TokLocs[0]; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return TokLocs[0]; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return TokLocs[NumConcatenated - 1]; } @@ -1748,8 +1768,10 @@ class ParenExpr : public Expr { (public) Expr *getSubExpr() { return cast<Expr>(Val); } void setSubExpr(Expr *E) { Val = E; } - SourceLocation getLocStart() const LLVM_READONLY { return L; } - SourceLocation getLocEnd() const LLVM_READONLY { return R; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return L; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return R; } /// Get the location of the left parentheses '('. SourceLocation getLParen() const { return L; } @@ -1872,10 +1894,12 @@ class UnaryOperator : public Expr { (public) /// the given unary opcode. static OverloadedOperatorKind getOverloadedOperator(Opcode Opc); - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return isPostfix() ? Val->getLocStart() : Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return isPostfix() ? Loc : Val->getLocEnd(); } SourceLocation getExprLoc() const LLVM_READONLY { return Loc; } @@ -1980,8 +2004,10 @@ class OffsetOfNode { (public) /// contains the location of the period (if there is one) and the /// identifier. SourceRange getSourceRange() const LLVM_READONLY { return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } }; /// OffsetOfExpr - [C99 7.17] - This represents an expression of the form @@ -2080,8 +2106,10 @@ class OffsetOfExpr final (public) return NumExprs; } - SourceLocation getLocStart() const LLVM_READONLY { return OperatorLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == OffsetOfExprClass; @@ -2176,8 +2204,10 @@ class UnaryExprOrTypeTraitExpr : public Expr { (public SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return OpLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return OpLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == UnaryExprOrTypeTraitExprClass; @@ -2250,10 +2280,12 @@ class ArraySubscriptExpr : public Expr { (public) return getRHS()->getType()->isIntegerType() ? getRHS() : getLHS(); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getLHS()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return RBracketLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; } SourceLocation getRBracketLoc() const { return RBracketLoc; } void setRBracketLoc(SourceLocation L) { RBracketLoc = L; } @@ -2420,8 +2452,10 @@ class CallExpr : public Expr { (public) SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; /// Return true if this is a call to __assume() or __builtin_assume() with /// a non-value-dependent constant parameter evaluating as false. @@ -2666,8 +2700,10 @@ class MemberExpr final (public) SourceLocation getMemberLoc() const { return MemberLoc; } void setMemberLoc(SourceLocation L) { MemberLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; SourceLocation getExprLoc() const LLVM_READONLY { return MemberLoc; } @@ -2756,7 +2792,8 @@ class CompoundLiteralExpr : public Expr { (public) TInfoAndScope.setPointer(tinfo); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { // FIXME: Init should never be null. if (!Init) return SourceLocation(); @@ -2764,7 +2801,8 @@ class CompoundLiteralExpr : public Expr { (public) return Init->getLocStart(); return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { // FIXME: Init should never be null. if (!Init) return SourceLocation(); @@ -2958,10 +2996,12 @@ class ImplicitCastExpr final (public) static ImplicitCastExpr *CreateEmpty(const ASTContext &Context, unsigned PathSize); - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getSubExpr()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getLocEnd(); } @@ -3067,8 +3107,10 @@ class CStyleCastExpr final (public) SourceLocation getRParenLoc() const { return RPLoc; } void setRParenLoc(SourceLocation L) { RPLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return LPLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getLocEnd(); } @@ -3147,10 +3189,12 @@ class BinaryOperator : public Expr { (public) Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); } void setRHS(Expr *E) { SubExprs[RHS] = E; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getLHS()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getRHS()->getLocEnd(); } @@ -3430,10 +3474,12 @@ class ConditionalOperator : public AbstractConditional Expr *getLHS() const { return cast<Expr>(SubExprs[LHS]); } Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getCond()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getRHS()->getLocEnd(); } @@ -3518,10 +3564,12 @@ class BinaryConditionalOperator : public AbstractCondi return cast<Expr>(SubExprs[RHS]); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getCommon()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getFalseExpr()->getLocEnd(); } @@ -3576,8 +3624,10 @@ class AddrLabelExpr : public Expr { (public) SourceLocation getLabelLoc() const { return LabelLoc; } void setLabelLoc(SourceLocation L) { LabelLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return AmpAmpLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return LabelLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AmpAmpLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; } LabelDecl *getLabel() const { return Label; } void setLabel(LabelDecl *L) { Label = L; } @@ -3621,8 +3671,10 @@ class StmtExpr : public Expr { (public) const CompoundStmt *getSubStmt() const { return cast<CompoundStmt>(SubStmt); } void setSubStmt(CompoundStmt *S) { SubStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } SourceLocation getLParenLoc() const { return LParenLoc; } void setLParenLoc(SourceLocation L) { LParenLoc = L; } @@ -3670,8 +3722,10 @@ class ShuffleVectorExpr : public Expr { (public) SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ShuffleVectorExprClass; @@ -3754,8 +3808,10 @@ class ConvertVectorExpr : public Expr { (public) /// getRParenLoc - Return the location of final right parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ConvertVectorExprClass; @@ -3835,8 +3891,10 @@ class ChooseExpr : public Expr { (public) SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ChooseExprClass; @@ -3874,8 +3932,10 @@ class GNUNullExpr : public Expr { (public) SourceLocation getTokenLocation() const { return TokenLoc; } void setTokenLocation(SourceLocation L) { TokenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return TokenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return TokenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return TokenLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return TokenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == GNUNullExprClass; @@ -3926,8 +3986,10 @@ class VAArgExpr : public Expr { (public) SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == VAArgExprClass; @@ -4160,8 +4222,10 @@ class InitListExpr : public Expr { (public) InitListExprBits.HadArrayRangeDesignator = ARD; } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == InitListExprClass; @@ -4395,13 +4459,15 @@ class DesignatedInitExpr final (public) return ArrayOrRange.Index; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { if (Kind == FieldDesignator) return getDotLoc().isInvalid()? getFieldLoc() : getDotLoc(); else return getLBracketLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Kind == FieldDesignator ? getFieldLoc() : getRBracketLoc(); } SourceRange getSourceRange() const LLVM_READONLY { @@ -4484,8 +4550,10 @@ class DesignatedInitExpr final (public) SourceRange getDesignatorsSourceRange() const; - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == DesignatedInitExprClass; @@ -4526,8 +4594,10 @@ class NoInitExpr : public Expr { (public) return T->getStmtClass() == NoInitExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } // Iterators child_range children() { @@ -4561,8 +4631,10 @@ class DesignatedInitUpdateExpr : public Expr { (public explicit DesignatedInitUpdateExpr(EmptyShell Empty) : Expr(DesignatedInitUpdateExprClass, Empty) { } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == DesignatedInitUpdateExprClass; @@ -4636,10 +4708,12 @@ class ArrayInitLoopExpr : public Expr { (public) return S->getStmtClass() == ArrayInitLoopExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getCommonExpr()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getCommonExpr()->getLocEnd(); } @@ -4671,8 +4745,10 @@ class ArrayInitIndexExpr : public Expr { (public) return S->getStmtClass() == ArrayInitIndexExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } child_range children() { return child_range(child_iterator(), child_iterator()); @@ -4707,8 +4783,10 @@ class ImplicitValueInitExpr : public Expr { (public) return T->getStmtClass() == ImplicitValueInitExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } // Iterators child_range children() { @@ -4752,8 +4830,10 @@ class ParenListExpr : public Expr { (public) SourceLocation getLParenLoc() const { return LParenLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ParenListExprClass; @@ -4876,8 +4956,10 @@ class GenericSelectionExpr : public Expr { (public) const Expr *getResultExpr() const { return getAssocExpr(getResultIndex()); } Expr *getResultExpr() { return getAssocExpr(getResultIndex()); } - SourceLocation getLocStart() const LLVM_READONLY { return GenericLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return GenericLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == GenericSelectionExprClass; @@ -4942,10 +5024,12 @@ class ExtVectorElementExpr : public Expr { (public) /// aggregate Constant of ConstantInt(s). void getEncodedElementAccess(SmallVectorImpl<uint32_t> &Elts) const; - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return AccessorLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return AccessorLoc; } /// isArrow - Return true if the base expression is a pointer to vector, /// return false if the base expression is a vector. @@ -4987,8 +5071,14 @@ class BlockExpr : public Expr { (public) const Stmt *getBody() const; Stmt *getBody(); - SourceLocation getLocStart() const LLVM_READONLY { return getCaretLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return getBody()->getLocEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { + return getCaretLocation(); + } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return getBody()->getLocEnd(); + } /// getFunctionType - Return the underlying function type for this block. const FunctionProtoType *getFunctionType() const; @@ -5040,8 +5130,10 @@ class AsTypeExpr : public Expr { (public) /// getRParenLoc - Return the location of final right parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == AsTypeExprClass; @@ -5182,10 +5274,12 @@ class PseudoObjectExpr final (public) return getSyntacticForm()->getExprLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getSyntacticForm()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSyntacticForm()->getLocEnd(); } @@ -5309,8 +5403,10 @@ class AtomicExpr : public Expr { (public) SourceLocation getBuiltinLoc() const { return BuiltinLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return BuiltinLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == AtomicExprClass; @@ -5363,8 +5459,10 @@ class TypoExpr : public Expr { (public) return const_child_range(const_child_iterator(), const_child_iterator()); } - SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); } static bool classof(const Stmt *T) { return T->getStmtClass() == TypoExprClass; Modified: vendor/clang/dist-release_70/include/clang/AST/ExprCXX.h ============================================================================== --- vendor/clang/dist-release_70/include/clang/AST/ExprCXX.h Wed Aug 29 17:50:41 2018 (r338379) +++ vendor/clang/dist-release_70/include/clang/AST/ExprCXX.h Wed Aug 29 17:50:47 2018 (r338380) @@ -132,8 +132,10 @@ class CXXOperatorCallExpr : public CallExpr { (public) : getOperatorLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const { return Range; } static bool classof(const Stmt *T) { @@ -278,8 +280,10 @@ class CXXNamedCastExpr : public ExplicitCastExpr { (pu /// Retrieve the location of the closing parenthesis. SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } SourceRange getAngleBrackets() const LLVM_READONLY { return AngleBrackets; } static bool classof(const Stmt *T) { @@ -524,13 +528,15 @@ class UserDefinedLiteral : public CallExpr { (public) return const_cast<UserDefinedLiteral*>(this)->getCookedLiteral(); } - SourceLocation getLocStart() const { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { if (getLiteralOperatorKind() == LOK_Template) return getRParenLoc(); return getArg(0)->getLocStart(); } - SourceLocation getLocEnd() const { return getRParenLoc(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const { return getRParenLoc(); } /// Returns the location of a ud-suffix in the expression. /// @@ -563,8 +569,10 @@ class CXXBoolLiteralExpr : public Expr { (public) bool getValue() const { return Value; } void setValue(bool V) { Value = V; } - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } @@ -594,8 +602,10 @@ class CXXNullPtrLiteralExpr : public Expr { (public) explicit CXXNullPtrLiteralExpr(EmptyShell Empty) : Expr(CXXNullPtrLiteralExprClass, Empty) {} - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } @@ -631,11 +641,13 @@ class CXXStdInitializerListExpr : public Expr { (publi Expr *getSubExpr() { return static_cast<Expr*>(SubExpr); } const Expr *getSubExpr() const { return static_cast<const Expr*>(SubExpr); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SubExpr->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExpr->getLocEnd(); } @@ -723,8 +735,10 @@ class CXXTypeidExpr : public Expr { (public) Operand = E; } - SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); } SourceRange getSourceRange() const LLVM_READONLY { return Range; } void setSourceRange(SourceRange R) { Range = R; } @@ -778,7 +792,8 @@ class MSPropertyRefExpr : public Expr { (public) return getBaseExpr() && getBaseExpr()->isImplicitCXXThis(); } - SourceLocation getLocStart() const { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { if (!isImplicitAccess()) return BaseExpr->getLocStart(); else if (QualifierLoc) @@ -787,7 +802,8 @@ class MSPropertyRefExpr : public Expr { (public) return MemberLoc; } - SourceLocation getLocEnd() const { return getMemberLoc(); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808291750.w7THolNP022522>