Date: Wed, 29 Aug 2018 20:53:24 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r338391 - in projects/clang700-import: contrib/compiler-rt/lib/lsan contrib/libc++/include contrib/llvm/include/llvm/CodeGen/GlobalISel contrib/llvm/include/llvm/IR contrib/llvm/include... Message-ID: <201808292053.w7TKrOOP026776@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Wed Aug 29 20:53:24 2018 New Revision: 338391 URL: https://svnweb.freebsd.org/changeset/base/338391 Log: Merge llvm, clang, lld, lldb, compiler-rt and libc++ release_70 branch r340910, resolve conflicts, and bump version numbers. PR: 230240, 230355 Deleted: projects/clang700-import/lib/clang/include/llvm/Support/DataTypes.h Modified: projects/clang700-import/contrib/compiler-rt/lib/lsan/lsan_common.cc projects/clang700-import/contrib/libc++/include/__node_handle projects/clang700-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h projects/clang700-import/contrib/llvm/include/llvm/IR/Function.h projects/clang700-import/contrib/llvm/include/llvm/MC/MCExpr.h projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h projects/clang700-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp projects/clang700-import/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp projects/clang700-import/contrib/llvm/lib/IR/DebugInfo.cpp projects/clang700-import/contrib/llvm/lib/MC/MCExpr.cpp projects/clang700-import/contrib/llvm/lib/MC/MCParser/AsmParser.cpp projects/clang700-import/contrib/llvm/lib/Support/Path.cpp projects/clang700-import/contrib/llvm/lib/Support/Windows/Path.inc projects/clang700-import/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td projects/clang700-import/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp projects/clang700-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h projects/clang700-import/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Comment.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Decl.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Expr.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Stmt.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h projects/clang700-import/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def projects/clang700-import/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h projects/clang700-import/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/AST/Expr.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/AST/Stmt.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/AST/StmtObjC.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/Headers/intrin.h projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp projects/clang700-import/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp projects/clang700-import/contrib/llvm/tools/lld/docs/ReleaseNotes.rst projects/clang700-import/lib/clang/include/clang/Basic/Version.inc projects/clang700-import/lib/clang/include/clang/Config/config.h projects/clang700-import/lib/clang/include/lld/Common/Version.inc projects/clang700-import/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: projects/clang700-import/contrib/compiler-rt/ (props changed) projects/clang700-import/contrib/libc++/ (props changed) projects/clang700-import/contrib/llvm/ (props changed) projects/clang700-import/contrib/llvm/tools/clang/ (props changed) projects/clang700-import/contrib/llvm/tools/lld/ (props changed) projects/clang700-import/contrib/llvm/tools/lldb/ (props changed) Modified: projects/clang700-import/contrib/compiler-rt/lib/lsan/lsan_common.cc ============================================================================== --- projects/clang700-import/contrib/compiler-rt/lib/lsan/lsan_common.cc Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/compiler-rt/lib/lsan/lsan_common.cc Wed Aug 29 20:53:24 2018 (r338391) @@ -100,8 +100,6 @@ static SuppressionContext *GetSuppressionContext() { static InternalMmapVector<RootRegion> *root_regions; -static uptr initialized_for_pid; - InternalMmapVector<RootRegion> const *GetRootRegions() { return root_regions; } void InitializeRootRegions() { @@ -115,7 +113,6 @@ const char *MaybeCallLsanDefaultOptions() { } void InitCommonLsan() { - initialized_for_pid = internal_getpid(); InitializeRootRegions(); if (common_flags()->detect_leaks) { // Initialization which can fail or print warnings should only be done if @@ -571,12 +568,6 @@ static void CheckForLeaksCallback(const SuspendedThrea static bool CheckForLeaks() { if (&__lsan_is_turned_off && __lsan_is_turned_off()) return false; - if (initialized_for_pid != internal_getpid()) { - // If process was forked and it had threads we fail to detect references - // from other threads. - Report("WARNING: LeakSanitizer is disabled in forked process.\n"); - return false; - } EnsureMainThreadIDIsCorrect(); CheckForLeaksParam param; param.success = false; Modified: projects/clang700-import/contrib/libc++/include/__node_handle ============================================================================== --- projects/clang700-import/contrib/libc++/include/__node_handle Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/libc++/include/__node_handle Wed Aug 29 20:53:24 2018 (r338391) @@ -26,7 +26,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER > 14 -#define __cpp_lib_node_extract 201606L +// FIXME: Uncomment this when we support the 'merge' functionality. +// #define __cpp_lib_node_extract 201606L // Specialized in __tree & __hash_table for their _NodeType. template <class _NodeType, class _Alloc> Modified: projects/clang700-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h ============================================================================== --- projects/clang700-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h Wed Aug 29 20:53:24 2018 (r338391) @@ -232,6 +232,7 @@ class IRTranslator : public MachineFunctionPass { (pri /// Returns true if the value should be split into multiple LLTs. /// If \p Offsets is given then the split type's offsets will be stored in it. + /// If \p Offsets is not empty it will be cleared first. bool valueIsSplit(const Value &V, SmallVectorImpl<uint64_t> *Offsets = nullptr); Modified: projects/clang700-import/contrib/llvm/include/llvm/IR/Function.h ============================================================================== --- projects/clang700-import/contrib/llvm/include/llvm/IR/Function.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/include/llvm/IR/Function.h Wed Aug 29 20:53:24 2018 (r338391) @@ -557,7 +557,7 @@ class Function : public GlobalObject, public ilist_nod /// True if this function needs an unwind table. bool needsUnwindTableEntry() const { - return hasUWTable() || !doesNotThrow(); + return hasUWTable() || !doesNotThrow() || hasPersonalityFn(); } /// Determine if the function returns a structure through first Modified: projects/clang700-import/contrib/llvm/include/llvm/MC/MCExpr.h ============================================================================== --- projects/clang700-import/contrib/llvm/include/llvm/MC/MCExpr.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/include/llvm/MC/MCExpr.h Wed Aug 29 20:53:24 2018 (r338391) @@ -588,6 +588,8 @@ class MCTargetExpr : public MCExpr { (public) virtual bool evaluateAsRelocatableImpl(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const = 0; + // allow Target Expressions to be checked for equality + virtual bool isEqualTo(const MCExpr *x) const { return false; } // This should be set when assigned expressions are not valid ".set" // expressions, e.g. registers, and must be inlined. virtual bool inlineAssignedExpr() const { return false; } Modified: projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h ============================================================================== --- projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h Wed Aug 29 20:53:24 2018 (r338391) @@ -25,7 +25,7 @@ namespace MCParserUtils { /// On success, returns false and sets the Symbol and Value output parameters. bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Symbol, - const MCExpr *&Value, bool AllowExtendedExpr = false); + const MCExpr *&Value); } // namespace MCParserUtils Modified: projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h ============================================================================== --- projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h Wed Aug 29 20:53:24 2018 (r338391) @@ -372,9 +372,9 @@ class MCTargetAsmParser : public MCAsmParserExtension SemaCallback = Callback; } - // Target-specific parsing of assembler-level variable assignment. - virtual bool parseAssignmentExpression(const MCExpr *&Res, SMLoc &EndLoc) { - return getParser().parseExpression(Res, EndLoc); + // Target-specific parsing of expression. + virtual bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { + return getParser().parsePrimaryExpr(Res, EndLoc); } virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, Modified: projects/clang700-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -223,8 +223,17 @@ static cl::opt<bool> namespace { +enum ExtType { + ZeroExtension, // Zero extension has been seen. + SignExtension, // Sign extension has been seen. + BothExtension // This extension type is used if we saw sext after + // ZeroExtension had been set, or if we saw zext after + // SignExtension had been set. It makes the type + // information of a promoted instruction invalid. +}; + using SetOfInstrs = SmallPtrSet<Instruction *, 16>; -using TypeIsSExt = PointerIntPair<Type *, 1, bool>; +using TypeIsSExt = PointerIntPair<Type *, 2, ExtType>; using InstrToOrigTy = DenseMap<Instruction *, TypeIsSExt>; using SExts = SmallVector<Instruction *, 16>; using ValueToSExts = DenseMap<Value *, SExts>; @@ -3277,6 +3286,41 @@ namespace { /// Hepler class to perform type promotion. class TypePromotionHelper { + /// Utility function to add a promoted instruction \p ExtOpnd to + /// \p PromotedInsts and record the type of extension we have seen. + static void addPromotedInst(InstrToOrigTy &PromotedInsts, + Instruction *ExtOpnd, + bool IsSExt) { + ExtType ExtTy = IsSExt ? SignExtension : ZeroExtension; + InstrToOrigTy::iterator It = PromotedInsts.find(ExtOpnd); + if (It != PromotedInsts.end()) { + // If the new extension is same as original, the information in + // PromotedInsts[ExtOpnd] is still correct. + if (It->second.getInt() == ExtTy) + return; + + // Now the new extension is different from old extension, we make + // the type information invalid by setting extension type to + // BothExtension. + ExtTy = BothExtension; + } + PromotedInsts[ExtOpnd] = TypeIsSExt(ExtOpnd->getType(), ExtTy); + } + + /// Utility function to query the original type of instruction \p Opnd + /// with a matched extension type. If the extension doesn't match, we + /// cannot use the information we had on the original type. + /// BothExtension doesn't match any extension type. + static const Type *getOrigType(const InstrToOrigTy &PromotedInsts, + Instruction *Opnd, + bool IsSExt) { + ExtType ExtTy = IsSExt ? SignExtension : ZeroExtension; + InstrToOrigTy::const_iterator It = PromotedInsts.find(Opnd); + if (It != PromotedInsts.end() && It->second.getInt() == ExtTy) + return It->second.getPointer(); + return nullptr; + } + /// Utility function to check whether or not a sign or zero extension /// of \p Inst with \p ConsideredExtType can be moved through \p Inst by /// either using the operands of \p Inst or promoting \p Inst. @@ -3465,10 +3509,9 @@ bool TypePromotionHelper::canGetThrough(const Instruct // I.e., check that trunc just drops extended bits of the same kind of // the extension. // #1 get the type of the operand and check the kind of the extended bits. - const Type *OpndType; - InstrToOrigTy::const_iterator It = PromotedInsts.find(Opnd); - if (It != PromotedInsts.end() && It->second.getInt() == IsSExt) - OpndType = It->second.getPointer(); + const Type *OpndType = getOrigType(PromotedInsts, Opnd, IsSExt); + if (OpndType) + ; else if ((IsSExt && isa<SExtInst>(Opnd)) || (!IsSExt && isa<ZExtInst>(Opnd))) OpndType = Opnd->getOperand(0)->getType(); else @@ -3596,8 +3639,7 @@ Value *TypePromotionHelper::promoteOperandForOther( // Remember the original type of the instruction before promotion. // This is useful to know that the high bits are sign extended bits. - PromotedInsts.insert(std::pair<Instruction *, TypeIsSExt>( - ExtOpnd, TypeIsSExt(ExtOpnd->getType(), IsSExt))); + addPromotedInst(PromotedInsts, ExtOpnd, IsSExt); // Step #1. TPT.mutateType(ExtOpnd, Ext->getType()); // Step #2. Modified: projects/clang700-import/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -1435,6 +1435,8 @@ void IRTranslator::finishPendingPhis() { bool IRTranslator::valueIsSplit(const Value &V, SmallVectorImpl<uint64_t> *Offsets) { SmallVector<LLT, 4> SplitTys; + if (Offsets && !Offsets->empty()) + Offsets->clear(); computeValueLLTs(*DL, *V.getType(), SplitTys, Offsets); return SplitTys.size() > 1; } Modified: projects/clang700-import/contrib/llvm/lib/IR/DebugInfo.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/IR/DebugInfo.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/IR/DebugInfo.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -1329,7 +1329,7 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags) { return wrap(unwrap(Builder)->createParameterVariable( - unwrap<DIScope>(Scope), Name, ArgNo, unwrap<DIFile>(File), + unwrap<DIScope>(Scope), {Name, NameLen}, ArgNo, unwrap<DIFile>(File), LineNo, unwrap<DIType>(Ty), AlwaysPreserve, map_from_llvmDIFlags(Flags))); } Modified: projects/clang700-import/contrib/llvm/lib/MC/MCExpr.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/MC/MCExpr.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/MC/MCExpr.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -750,8 +750,22 @@ bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, c if (!ABE->getLHS()->evaluateAsRelocatableImpl(LHSValue, Asm, Layout, Fixup, Addrs, InSet) || !ABE->getRHS()->evaluateAsRelocatableImpl(RHSValue, Asm, Layout, Fixup, - Addrs, InSet)) + Addrs, InSet)) { + // Check if both are Target Expressions, see if we can compare them. + if (const MCTargetExpr *L = dyn_cast<MCTargetExpr>(ABE->getLHS())) + if (const MCTargetExpr *R = cast<MCTargetExpr>(ABE->getRHS())) { + switch (ABE->getOpcode()) { + case MCBinaryExpr::EQ: + Res = MCValue::get((L->isEqualTo(R)) ? -1 : 0); + return true; + case MCBinaryExpr::NE: + Res = MCValue::get((R->isEqualTo(R)) ? 0 : -1); + return true; + default: {} + } + } return false; + } // We only support a few operations on non-constant expressions, handle // those first. Modified: projects/clang700-import/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -337,7 +337,7 @@ class AsmParser : public MCAsmParser { (private) StringRef parseStringToComma(); bool parseAssignment(StringRef Name, bool allow_redef, - bool NoDeadStrip = false, bool AllowExtendedExpr = false); + bool NoDeadStrip = false); unsigned getBinOpPrecedence(AsmToken::TokenKind K, MCBinaryExpr::Opcode &Kind); @@ -1363,7 +1363,8 @@ void AsmParser::altMacroString(StringRef AltMacroStr,s bool AsmParser::parseExpression(const MCExpr *&Res, SMLoc &EndLoc) { // Parse the expression. Res = nullptr; - if (parsePrimaryExpr(Res, EndLoc) || parseBinOpRHS(1, Res, EndLoc)) + if (getTargetParser().parsePrimaryExpr(Res, EndLoc) || + parseBinOpRHS(1, Res, EndLoc)) return true; // As a special case, we support 'a op b @ modifier' by rewriting the @@ -1617,7 +1618,7 @@ bool AsmParser::parseBinOpRHS(unsigned Precedence, con // Eat the next primary expression. const MCExpr *RHS; - if (parsePrimaryExpr(RHS, EndLoc)) + if (getTargetParser().parsePrimaryExpr(RHS, EndLoc)) return true; // If BinOp binds less tightly with RHS than the operator after RHS, let @@ -1826,7 +1827,7 @@ bool AsmParser::parseStatement(ParseStatementInfo &Inf // identifier '=' ... -> assignment statement Lex(); - return parseAssignment(IDVal, true, /*NoDeadStrip*/ false, /*AllowExtendedExpr*/true); + return parseAssignment(IDVal, true); default: // Normal instruction or directive. break; @@ -2766,11 +2767,11 @@ void AsmParser::handleMacroExit() { } bool AsmParser::parseAssignment(StringRef Name, bool allow_redef, - bool NoDeadStrip, bool AllowExtendedExpr) { + bool NoDeadStrip) { MCSymbol *Sym; const MCExpr *Value; if (MCParserUtils::parseAssignmentExpression(Name, allow_redef, *this, Sym, - Value, AllowExtendedExpr)) + Value)) return true; if (!Sym) { @@ -5839,17 +5840,12 @@ static bool isSymbolUsedInExpression(const MCSymbol *S bool parseAssignmentExpression(StringRef Name, bool allow_redef, MCAsmParser &Parser, MCSymbol *&Sym, - const MCExpr *&Value, bool AllowExtendedExpr) { + const MCExpr *&Value) { // FIXME: Use better location, we should use proper tokens. SMLoc EqualLoc = Parser.getTok().getLoc(); - SMLoc EndLoc; - if (AllowExtendedExpr) { - if (Parser.getTargetParser().parseAssignmentExpression(Value, EndLoc)) { - return Parser.TokError("missing expression"); - } - } else if (Parser.parseExpression(Value, EndLoc)) - return Parser.TokError("missing expression"); + if (Parser.parseExpression(Value)) + return Parser.TokError("missing expression"); // Note: we don't count b as used in "a = b". This is to allow // a = b Modified: projects/clang700-import/contrib/llvm/lib/Support/Path.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Support/Path.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Support/Path.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -1150,8 +1150,16 @@ Error TempFile::keep(const Twine &Name) { // If we can't cancel the delete don't rename. auto H = reinterpret_cast<HANDLE>(_get_osfhandle(FD)); std::error_code RenameEC = setDeleteDisposition(H, false); - if (!RenameEC) + if (!RenameEC) { RenameEC = rename_fd(FD, Name); + // If rename failed because it's cross-device, copy instead + if (RenameEC == + std::error_code(ERROR_NOT_SAME_DEVICE, std::system_category())) { + RenameEC = copy_file(TmpName, Name); + setDeleteDisposition(H, true); + } + } + // If we can't rename, discard the temporary file. if (RenameEC) setDeleteDisposition(H, true); Modified: projects/clang700-import/contrib/llvm/lib/Support/Windows/Path.inc ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Support/Windows/Path.inc Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Support/Windows/Path.inc Wed Aug 29 20:53:24 2018 (r338391) @@ -450,7 +450,7 @@ static std::error_code rename_handle(HANDLE FromHandle if (std::error_code EC2 = realPathFromHandle(FromHandle, WideFrom)) return EC2; if (::MoveFileExW(WideFrom.begin(), WideTo.begin(), - MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED)) + MOVEFILE_REPLACE_EXISTING)) return std::error_code(); return mapWindowsError(GetLastError()); } Modified: projects/clang700-import/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td Wed Aug 29 20:53:24 2018 (r338391) @@ -576,6 +576,12 @@ def : ROSysReg<"ICH_VTR_EL2", 0b11, 0b100, 0b11 def : ROSysReg<"ICH_EISR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b011>; def : ROSysReg<"ICH_ELRSR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b101>; +// SVE control registers +// Op0 Op1 CRn CRm Op2 +let Requires = [{ {AArch64::FeatureSVE} }] in { +def : ROSysReg<"ID_AA64ZFR0_EL1", 0b11, 0b000, 0b0000, 0b0100, 0b100>; +} + // v8.1a "Limited Ordering Regions" extension-specific system register // Op0 Op1 CRn CRm Op2 let Requires = [{ {AArch64::HasV8_1aOps} }] in @@ -1310,6 +1316,15 @@ def : RWSysReg<"DIT", 0b11, 0b011, 0b0100 def : RWSysReg<"VNCR_EL2", 0b11, 0b100, 0b0010, 0b0010, 0b000>; } // HasV8_4aOps + +// SVE control registers +// Op0 Op1 CRn CRm Op2 +let Requires = [{ {AArch64::FeatureSVE} }] in { +def : RWSysReg<"ZCR_EL1", 0b11, 0b000, 0b0001, 0b0010, 0b000>; +def : RWSysReg<"ZCR_EL2", 0b11, 0b100, 0b0001, 0b0010, 0b000>; +def : RWSysReg<"ZCR_EL3", 0b11, 0b110, 0b0001, 0b0010, 0b000>; +def : RWSysReg<"ZCR_EL12", 0b11, 0b101, 0b0001, 0b0010, 0b000>; +} // Cyclone specific system registers // Op0 Op1 CRn CRm Op2 Modified: projects/clang700-import/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -955,7 +955,7 @@ class X86AsmParser : public MCTargetAsmParser { (publi void SetFrameRegister(unsigned RegNo) override; - bool parseAssignmentExpression(const MCExpr *&Res, SMLoc &EndLoc) override; + bool parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) override; bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands) override; @@ -2260,15 +2260,17 @@ std::unique_ptr<X86Operand> X86AsmParser::ParseMemOper return X86Operand::CreateMem(getPointerWidth(), Disp, MemStart, MemEnd); } -// Parse either a standard expression or a register. -bool X86AsmParser::parseAssignmentExpression(const MCExpr *&Res, - SMLoc &EndLoc) { +// Parse either a standard primary expression or a register. +bool X86AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) { MCAsmParser &Parser = getParser(); - if (Parser.parseExpression(Res, EndLoc)) { + if (Parser.parsePrimaryExpr(Res, EndLoc)) { SMLoc StartLoc = Parser.getTok().getLoc(); // Normal Expression parse fails, check if it could be a register. unsigned RegNo; - if (Parser.getTargetParser().ParseRegister(RegNo, StartLoc, EndLoc)) + bool TryRegParse = + getTok().is(AsmToken::Percent) || + (isParsingIntelSyntax() && getTok().is(AsmToken::Identifier)); + if (!TryRegParse || ParseRegister(RegNo, StartLoc, EndLoc)) return true; // Clear previous parse error and return correct expression. Parser.clearPendingErrors(); Modified: projects/clang700-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h Wed Aug 29 20:53:24 2018 (r338391) @@ -48,7 +48,7 @@ class X86MCExpr : public MCTargetExpr { (public) /// @} void printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const override { - if (MAI->getAssemblerDialect() == 0) + if (!MAI || MAI->getAssemblerDialect() == 0) OS << '%'; OS << X86ATTInstPrinter::getRegisterName(RegNo); } @@ -59,6 +59,11 @@ class X86MCExpr : public MCTargetExpr { (public) } // Register values should be inlined as they are not valid .set expressions. bool inlineAssignedExpr() const override { return true; } + bool isEqualTo(const MCExpr *X) const override { + if (auto *E = dyn_cast<X86MCExpr>(X)) + return getRegNo() == E->getRegNo(); + return false; + } void visitUsedExpr(MCStreamer &Streamer) const override{}; MCFragment *findAssociatedFragment() const override { return nullptr; } Modified: projects/clang700-import/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp ============================================================================== --- projects/clang700-import/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp Wed Aug 29 20:53:24 2018 (r338391) @@ -388,6 +388,15 @@ Optional<QuotRemPair> FastDivInsertionTask::insertFast return None; } + // After Constant Hoisting pass, long constants may be represented as + // bitcast instructions. As a result, some constants may look like an + // instruction at first, and an additional check is necessary to find out if + // an operand is actually a constant. + if (auto *BCI = dyn_cast<BitCastInst>(Divisor)) + if (BCI->getParent() == SlowDivOrRem->getParent() && + isa<ConstantInt>(BCI->getOperand(0))) + return None; + if (DividendShort && !isSignedOp()) { // If the division is unsigned and Dividend is known to be short, then // either Modified: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Comment.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Comment.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Comment.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Decl.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Decl.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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: projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Expr.h ============================================================================== --- projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Expr.h Wed Aug 29 20:49:56 2018 (r338390) +++ projects/clang700-import/contrib/llvm/tools/clang/include/clang/AST/Expr.h Wed Aug 29 20:53:24 2018 (r338391) @@ -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; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808292053.w7TKrOOP026776>