diff options
57 files changed, 925 insertions, 580 deletions
diff --git a/contrib/compiler-rt/lib/lsan/lsan_common.cc b/contrib/compiler-rt/lib/lsan/lsan_common.cc index 012a673c3b25..eaa5cadc8ffb 100644 --- a/contrib/compiler-rt/lib/lsan/lsan_common.cc +++ b/contrib/compiler-rt/lib/lsan/lsan_common.cc @@ -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 SuspendedThreadsList &suspended_threads, 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; diff --git a/contrib/libc++/include/__node_handle b/contrib/libc++/include/__node_handle index fe09f3c1e51c..567f8b047a34 100644 --- a/contrib/libc++/include/__node_handle +++ b/contrib/libc++/include/__node_handle @@ -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> diff --git a/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h b/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h index f3553966fcdf..2498ee933210 100644 --- a/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h +++ b/contrib/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h @@ -232,6 +232,7 @@ private: /// 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); diff --git a/contrib/llvm/include/llvm/IR/Function.h b/contrib/llvm/include/llvm/IR/Function.h index c8d6b0776fbf..02e3ecc8e27f 100644 --- a/contrib/llvm/include/llvm/IR/Function.h +++ b/contrib/llvm/include/llvm/IR/Function.h @@ -557,7 +557,7 @@ public: /// 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 diff --git a/contrib/llvm/include/llvm/MC/MCExpr.h b/contrib/llvm/include/llvm/MC/MCExpr.h index c4dfbe949078..3fd58a169d4b 100644 --- a/contrib/llvm/include/llvm/MC/MCExpr.h +++ b/contrib/llvm/include/llvm/MC/MCExpr.h @@ -588,6 +588,8 @@ 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; } diff --git a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h index 259113bc3860..84173bb9cb8e 100644 --- a/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h +++ b/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h @@ -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 diff --git a/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h b/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h index 2d188a6755e1..135b5fab07ce 100644 --- a/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h +++ b/contrib/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h @@ -372,9 +372,9 @@ public: 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, diff --git a/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp b/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp index c41beb094604..be685b26a9ea 100644 --- a/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/contrib/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -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 Instruction *Inst, // 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. diff --git a/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 80da50562d32..75496fba0449 100644 --- a/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/contrib/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -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; } diff --git a/contrib/llvm/lib/IR/DebugInfo.cpp b/contrib/llvm/lib/IR/DebugInfo.cpp index 77585ee30cd8..165c881c13e7 100644 --- a/contrib/llvm/lib/IR/DebugInfo.cpp +++ b/contrib/llvm/lib/IR/DebugInfo.cpp @@ -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))); } diff --git a/contrib/llvm/lib/MC/MCExpr.cpp b/contrib/llvm/lib/MC/MCExpr.cpp index 0694a8fa620e..a4c99a0c1c15 100644 --- a/contrib/llvm/lib/MC/MCExpr.cpp +++ b/contrib/llvm/lib/MC/MCExpr.cpp @@ -750,8 +750,22 @@ bool MCExpr::evaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm, 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. diff --git a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp index 39a760826d96..501a1cccf60e 100644 --- a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp @@ -337,7 +337,7 @@ 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,std::string &Res) { 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, const MCExpr *&Res, // 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 &Info, // 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 *Sym, const MCExpr *Value) { 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 diff --git a/contrib/llvm/lib/Support/Path.cpp b/contrib/llvm/lib/Support/Path.cpp index 098230290ed2..768a819c8d05 100644 --- a/contrib/llvm/lib/Support/Path.cpp +++ b/contrib/llvm/lib/Support/Path.cpp @@ -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); diff --git a/contrib/llvm/lib/Support/Windows/Path.inc b/contrib/llvm/lib/Support/Windows/Path.inc index b64b013d7407..f425d607af47 100644 --- a/contrib/llvm/lib/Support/Windows/Path.inc +++ b/contrib/llvm/lib/Support/Windows/Path.inc @@ -450,7 +450,7 @@ static std::error_code rename_handle(HANDLE FromHandle, const Twine &To) { 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()); } diff --git a/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td b/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td index 8acd32533eea..dbc4deaf3f9f 100644 --- a/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td +++ b/contrib/llvm/lib/Target/AArch64/AArch64SystemOperands.td @@ -576,6 +576,12 @@ def : ROSysReg<"ICH_VTR_EL2", 0b11, 0b100, 0b1100, 0b1011, 0b001>; 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 @@ -1311,6 +1317,15 @@ 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 let Requires = [{ {AArch64::ProcCyclone} }] in diff --git a/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index fafbed0bd935..b02e4d80fbba 100644 --- a/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -955,7 +955,7 @@ public: 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::ParseMemOperand(unsigned SegReg, 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(); diff --git a/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h b/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h index f1438cd24960..1070f70468fa 100644 --- a/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h +++ b/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h @@ -48,7 +48,7 @@ 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 @@ 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; } diff --git a/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp b/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp index 05512a6dff3e..e7828af648a9 100644 --- a/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp +++ b/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp @@ -388,6 +388,15 @@ Optional<QuotRemPair> FastDivInsertionTask::insertFastDivAndRem() { 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 diff --git a/contrib/llvm/tools/clang/include/clang/AST/Comment.h b/contrib/llvm/tools/clang/include/clang/AST/Comment.h index f5538dec2a14..030a5a89e492 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/Comment.h +++ b/contrib/llvm/tools/clang/include/clang/AST/Comment.h @@ -215,13 +215,11 @@ 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; } diff --git a/contrib/llvm/tools/clang/include/clang/AST/Decl.h b/contrib/llvm/tools/clang/include/clang/AST/Decl.h index ebdb2890daf5..6885968bae60 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/Decl.h +++ b/contrib/llvm/tools/clang/include/clang/AST/Decl.h @@ -614,7 +614,8 @@ public: 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 @@ 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 @@ 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 @@ public: 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 diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h b/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h index d6b89d971d94..81df1c0b6aa9 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h +++ b/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h @@ -406,11 +406,13 @@ 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(); } diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h b/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h index 4353f66a34e4..bc478f6334ad 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h +++ b/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h @@ -233,8 +233,10 @@ 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 @@ public: 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 diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h b/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h index c1cc726e3152..926b5e3f1ee5 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h +++ b/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h @@ -318,8 +318,10 @@ public: 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 @@ 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 { diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h b/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h index 856f3ab5720e..ed0429039cd0 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h +++ b/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h @@ -557,22 +557,19 @@ 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; }; diff --git a/contrib/llvm/tools/clang/include/clang/AST/Expr.h b/contrib/llvm/tools/clang/include/clang/AST/Expr.h index c18fbf05df68..e7e32b9fe1ad 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/Expr.h +++ b/contrib/llvm/tools/clang/include/clang/AST/Expr.h @@ -904,10 +904,12 @@ 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 @@ 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 @@ 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 @@ public: /// 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 APIntStorage { 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 @@ 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 @@ public: 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ public: 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 @@ public: 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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; diff --git a/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h b/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h index 7ab8020dec64..5ce55bde371b 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h +++ b/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h @@ -132,8 +132,10 @@ 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 @@ public: /// 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 @@ 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 @@ 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 @@ 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 @@ public: 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 @@ 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 @@ 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 @@ public: return MemberLoc; } - SourceLocation getLocEnd() const { return getMemberLoc(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const { return getMemberLoc(); } child_range children() { return child_range((Stmt**)&BaseExpr, (Stmt**)&BaseExpr + 1); @@ -847,11 +863,13 @@ public: Expr *getIdx() { return cast<Expr>(SubExprs[IDX_EXPR]); } const Expr *getIdx() const { return cast<Expr>(SubExprs[IDX_EXPR]); } - 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 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; } @@ -933,8 +951,10 @@ public: void setUuidStr(StringRef US) { UuidStr = US; } StringRef getUuidStr() const { return UuidStr; } - 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; } @@ -982,8 +1002,10 @@ public: 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; } bool isImplicit() const { return Implicit; } void setImplicit(bool I) { Implicit = I; } @@ -1037,9 +1059,11 @@ public: /// this variable. bool isThrownVariableInScope() const { return IsThrownVariableInScope; } - SourceLocation getLocStart() const LLVM_READONLY { return ThrowLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return ThrowLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (!getSubExpr()) return ThrowLoc; return getSubExpr()->getLocEnd(); @@ -1108,8 +1132,10 @@ public: /// Default argument expressions have no representation in the /// source, so they have an empty source range. - 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(); } SourceLocation getExprLoc() const LLVM_READONLY { return Loc; } @@ -1168,8 +1194,10 @@ public: return Field->getInClassInitializer(); } - 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() == CXXDefaultInitExprClass; @@ -1241,11 +1269,15 @@ public: Expr *getSubExpr() { return cast<Expr>(SubExpr); } void setSubExpr(Expr *E) { SubExpr = E; } - 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 { return SubExpr->getLocEnd();} + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubExpr->getLocEnd(); + } // Implement isa/cast/dyncast/etc. static bool classof(const Stmt *T) { @@ -1398,8 +1430,10 @@ public: Args[Arg] = ArgExpr; } - 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; SourceRange getParenOrBraceRange() const { return ParenOrBraceRange; } void setParenOrBraceRange(SourceRange Range) { ParenOrBraceRange = Range; } @@ -1470,8 +1504,10 @@ public: bool inheritedFromVBase() const { return InheritedFromVirtualBase; } SourceLocation getLocation() const LLVM_READONLY { return Loc; } - 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() == CXXInheritedCtorInitExprClass; @@ -1533,8 +1569,10 @@ public: /// Determine whether this expression models list-initialization. bool isListInitialization() const { return LParenLoc.isInvalid(); } - 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() == CXXFunctionalCastExprClass; @@ -1577,8 +1615,10 @@ public: TypeSourceInfo *getTypeSourceInfo() const { return Type; } - 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() == CXXTemporaryObjectExprClass; @@ -1814,11 +1854,13 @@ public: return T->getStmtClass() == LambdaExprClass; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return IntroducerRange.getBegin(); } - SourceLocation getLocEnd() const LLVM_READONLY { return ClosingBrace; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return ClosingBrace; } child_range children() { // Includes initialization exprs plus body stmt @@ -1853,8 +1895,10 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + 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 RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == CXXScalarValueInitExprClass; @@ -2073,7 +2117,8 @@ public: return SubExprs + Array + hasInitializer() + getNumPlacementArgs(); } - SourceLocation getStartLoc() const { return Range.getBegin(); } + SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { return Range.getBegin(); } SourceLocation getEndLoc() const { return Range.getEnd(); } SourceRange getDirectInitRange() const { return DirectInitRange; } @@ -2082,7 +2127,7 @@ public: return Range; } - SourceLocation getLocStart() const LLVM_READONLY { return getStartLoc(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } static bool classof(const Stmt *T) { @@ -2160,8 +2205,12 @@ public: /// be a pointer, return an invalid type. QualType getDestroyedType() const; - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY {return Argument->getLocEnd();} + 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 Argument->getLocEnd(); + } static bool classof(const Stmt *T) { return T->getStmtClass() == CXXDeleteExprClass; @@ -2346,8 +2395,12 @@ public: DestroyedType = PseudoDestructorTypeStorage(Info); } - SourceLocation getLocStart() const LLVM_READONLY {return Base->getLocStart();} - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { + return Base->getLocStart(); + } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == CXXPseudoDestructorExprClass; @@ -2428,8 +2481,10 @@ public: getNumArgs()); } - 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; } static bool classof(const Stmt *T) { return T->getStmtClass() == TypeTraitExprClass; @@ -2489,8 +2544,10 @@ public: virtual ~ArrayTypeTraitExpr() = default; - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParen; } + 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 RParen; } ArrayTypeTrait getTrait() const { return static_cast<ArrayTypeTrait>(ATT); } @@ -2553,8 +2610,10 @@ public: explicit ExpressionTraitExpr(EmptyShell Empty) : Expr(ExpressionTraitExprClass, Empty), ET(0), Value(false) {} - SourceLocation getLocStart() const LLVM_READONLY { return Loc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParen; } + 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 RParen; } ExpressionTrait getTrait() const { return static_cast<ExpressionTrait>(ET); } @@ -2845,13 +2904,15 @@ public: /// that was looked in to find these results. CXXRecordDecl *getNamingClass() const { return NamingClass; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { if (NestedNameSpecifierLoc l = getQualifierLoc()) return l.getBeginLoc(); return getNameInfo().getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); return getNameInfo().getLocEnd(); @@ -2997,11 +3058,13 @@ public: /// Note: getLocStart() is the start of the whole DependentScopeDeclRefExpr, /// and differs from getLocation().getStart(). - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return QualifierLoc.getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); return getLocation(); @@ -3077,11 +3140,15 @@ public: /// when modifying an existing AST to preserve its invariants. void setSubExpr(Expr *E) { SubExpr = E; } - 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 { return SubExpr->getLocEnd();} + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubExpr->getLocEnd(); + } // Implement isa/cast/dyncast/etc. static bool classof(const Stmt *T) { @@ -3202,9 +3269,11 @@ public: *(arg_begin() + I) = E; } - SourceLocation getLocStart() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY; - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (!RParenLoc.isValid() && NumArgs > 0) return getArg(NumArgs - 1)->getLocEnd(); return RParenLoc; @@ -3424,7 +3493,8 @@ public: return {getTemplateArgs(), getNumTemplateArgs()}; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { if (!isImplicitAccess()) return Base->getLocStart(); if (getQualifier()) @@ -3432,7 +3502,8 @@ public: return MemberNameInfo.getBeginLoc(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); return MemberNameInfo.getEndLoc(); @@ -3574,7 +3645,8 @@ public: // diagnosing a problem with this expression. SourceLocation getExprLoc() const LLVM_READONLY { return getMemberLoc(); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { if (!isImplicitAccess()) return Base->getLocStart(); if (NestedNameSpecifierLoc l = getQualifierLoc()) @@ -3582,7 +3654,8 @@ public: return getMemberNameInfo().getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (hasExplicitTemplateArgs()) return getRAngleLoc(); return getMemberNameInfo().getLocEnd(); @@ -3647,8 +3720,10 @@ public: Expr *getOperand() const { return static_cast<Expr*>(Operand); } - 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; } bool getValue() const { return Value; } @@ -3725,11 +3800,13 @@ public: return None; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Pattern->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return EllipsisLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return EllipsisLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == PackExpansionExprClass; @@ -3849,8 +3926,10 @@ public: return llvm::makeArrayRef(Args, Args + Length); } - 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() == SizeOfPackExprClass; @@ -3893,8 +3972,10 @@ public: Param(param), Replacement(replacement), NameLoc(loc) {} SourceLocation getNameLoc() const { return NameLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } Expr *getReplacement() const { return cast<Expr>(Replacement); } @@ -3957,8 +4038,10 @@ public: /// template arguments. TemplateArgument getArgumentPack() const; - SourceLocation getLocStart() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == SubstNonTypeTemplateParmPackExprClass; @@ -4030,8 +4113,10 @@ public: /// Get an expansion of the parameter pack by index. ParmVarDecl *getExpansion(unsigned I) const { return begin()[I]; } - SourceLocation getLocStart() const LLVM_READONLY { return NameLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return NameLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return NameLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == FunctionParmPackExprClass; @@ -4142,11 +4227,13 @@ public: return getValueKind() == VK_LValue; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getTemporary()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getTemporary()->getLocEnd(); } @@ -4217,13 +4304,11 @@ public: SourceLocation getEllipsisLoc() const { return EllipsisLoc; } BinaryOperatorKind getOperator() const { return Opcode; } - SourceLocation getLocStart() const LLVM_READONLY { - return LParenLoc; - } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { - return RParenLoc; - } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == CXXFoldExprClass; @@ -4312,11 +4397,11 @@ public: return static_cast<Expr*>(SubExprs[SubExpr::Resume]); } - SourceLocation getLocStart() const LLVM_READONLY { - return KeywordLoc; - } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getCommonExpr()->getLocEnd(); } @@ -4400,9 +4485,11 @@ public: SourceLocation getKeywordLoc() const { return KeywordLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return KeywordLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getOperand()->getLocEnd(); } diff --git a/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h b/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h index bb0402c27080..d02b00340663 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h +++ b/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h @@ -67,8 +67,10 @@ public: SourceLocation getAtLoc() const { return AtLoc; } void setAtLoc(SourceLocation L) { AtLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return String->getLocEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return String->getLocEnd(); } // Iterators child_range children() { return child_range(&String, &String+1); } @@ -94,8 +96,10 @@ 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; } @@ -141,8 +145,10 @@ public: SourceLocation getAtLoc() const { return Range.getBegin(); } - 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; @@ -194,8 +200,10 @@ public: static ObjCArrayLiteral *CreateEmpty(const ASTContext &C, unsigned NumElements); - 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; } /// Retrieve elements of array of literals. @@ -359,8 +367,10 @@ public: return DictWithObjectsMethod; } - 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; } // Iterators @@ -412,8 +422,10 @@ public: EncodedType = EncType; } - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } // Iterators child_range children() { @@ -447,8 +459,10 @@ public: void setAtLoc(SourceLocation L) { AtLoc = L; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } /// getNumArgs - Return the number of actual arguments to this call. unsigned getNumArgs() const { return SelName.getNumArgs(); } @@ -496,8 +510,10 @@ public: void setAtLoc(SourceLocation L) { AtLoc = L; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } // Iterators child_range children() { @@ -556,10 +572,12 @@ public: SourceLocation getLocation() const { return Loc; } void setLocation(SourceLocation L) { Loc = L; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return isFreeIvar() ? Loc : getBase()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Loc; } SourceLocation getOpLoc() const { return OpLoc; } void setOpLoc(SourceLocation L) { OpLoc = L; } @@ -742,11 +760,13 @@ public: /// Determine the type of the base, regardless of the kind of receiver. QualType getReceiverType(const ASTContext &ctx) const; - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return isObjectReceiver() ? getBase()->getLocStart() :getReceiverLocation(); } - SourceLocation getLocEnd() const LLVM_READONLY { return IdLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return IdLoc; } // Iterators child_range children() { @@ -838,11 +858,13 @@ public: SourceLocation getRBracket() const { return RBracket; } void setRBracket(SourceLocation RB) { RBracket = RB; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SubExprs[BASE]->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return RBracket; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RBracket; } Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); } void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; } @@ -1395,8 +1417,10 @@ public: RBracLoc = R.getEnd(); } - SourceLocation getLocStart() const LLVM_READONLY { return LBracLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RBracLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LBracLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RBracLoc; } // Iterators child_range children(); @@ -1472,7 +1496,8 @@ public: SourceLocation getOpLoc() const { return OpLoc; } void setOpLoc(SourceLocation L) { OpLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getBase()->getLocStart(); } @@ -1480,7 +1505,8 @@ public: return getBase()->getLocEnd(); } - SourceLocation getLocEnd() const LLVM_READONLY { return IsaMemberLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return IsaMemberLoc; } SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; } @@ -1549,10 +1575,14 @@ public: child_range children() { return child_range(&Operand, &Operand+1); } // Source locations are determined by the subexpression. - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return Operand->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { return Operand->getLocEnd();} + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return Operand->getLocEnd(); + } SourceLocation getExprLoc() const LLVM_READONLY { return getSubExpr()->getExprLoc(); @@ -1611,9 +1641,11 @@ public: /// The location of the bridge keyword. SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSubExpr()->getLocEnd(); } @@ -1651,8 +1683,10 @@ public: explicit ObjCAvailabilityCheckExpr(EmptyShell Shell) : Expr(ObjCAvailabilityCheckExprClass, Shell) {} - SourceLocation getLocStart() const { return AtLoc; } - SourceLocation getLocEnd() const { return RParen; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const { return RParen; } SourceRange getSourceRange() const { return {AtLoc, RParen}; } /// This may be '*', in which case this should fold to true. diff --git a/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h b/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h index 2b4b5ec4d0e4..c8b0fff7ffa1 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h +++ b/contrib/llvm/tools/clang/include/clang/AST/ExprOpenMP.h @@ -101,10 +101,12 @@ public: /// Set length of the array section. void setLength(Expr *E) { SubExprs[LENGTH] = E; } - 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 RBracketLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RBracketLoc; } SourceLocation getColonLoc() const { return ColonLoc; } void setColonLoc(SourceLocation L) { ColonLoc = L; } diff --git a/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h b/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h index 419dbe52fab6..2b34575d9f6c 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h +++ b/contrib/llvm/tools/clang/include/clang/AST/OpenMPClause.h @@ -64,10 +64,12 @@ protected: public: /// Returns the starting location of the clause. - SourceLocation getLocStart() const { return StartLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { return StartLoc; } /// Returns the ending location of the clause. - SourceLocation getLocEnd() const { return EndLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const { return EndLoc; } /// Sets the starting location of the clause. void setLocStart(SourceLocation Loc) { StartLoc = Loc; } diff --git a/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h b/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h index 8327efc750fd..0ab592e7c80f 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h +++ b/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h @@ -101,8 +101,10 @@ public: } 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(); } const char *getBriefText(const ASTContext &Context) const { if (BriefTextValid) diff --git a/contrib/llvm/tools/clang/include/clang/AST/Stmt.h b/contrib/llvm/tools/clang/include/clang/AST/Stmt.h index aa0f88b71023..c957cccfe223 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/Stmt.h +++ b/contrib/llvm/tools/clang/include/clang/AST/Stmt.h @@ -398,8 +398,10 @@ public: /// value objects created/interpreted by SourceManager. We assume AST /// clients will have a pointer to the respective SourceManager. SourceRange getSourceRange() const LLVM_READONLY; - 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; // global temp stats (until we have a per-module visitor) static void addStmtClass(const StmtClass s); @@ -522,12 +524,13 @@ public: DeclGroupRef getDeclGroup() { return DG; } void setDeclGroup(DeclGroupRef DGR) { DG = DGR; } - SourceLocation getStartLoc() const { return StartLoc; } + SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } void setStartLoc(SourceLocation L) { StartLoc = L; } SourceLocation getEndLoc() const { return EndLoc; } void setEndLoc(SourceLocation L) { EndLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return StartLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return StartLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return EndLoc; } static bool classof(const Stmt *T) { @@ -595,8 +598,10 @@ public: bool hasLeadingEmptyMacro() const { return HasLeadingEmptyMacro; } - SourceLocation getLocStart() const LLVM_READONLY { return SemiLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SemiLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SemiLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SemiLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == NullStmtClass; @@ -695,8 +700,10 @@ public: return const_reverse_body_iterator(body_begin()); } - SourceLocation getLocStart() const LLVM_READONLY { return LBraceLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RBraceLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LBraceLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RBraceLoc; } SourceLocation getLBracLoc() const { return LBraceLoc; } SourceLocation getRBracLoc() const { return RBraceLoc; } @@ -744,8 +751,10 @@ public: return const_cast<SwitchCase*>(this)->getSubStmt(); } - SourceLocation getLocStart() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == CaseStmtClass || @@ -797,9 +806,11 @@ public: void setLHS(Expr *Val) { SubExprs[LHS] = reinterpret_cast<Stmt*>(Val); } void setRHS(Expr *Val) { SubExprs[RHS] = reinterpret_cast<Stmt*>(Val); } - SourceLocation getLocStart() const LLVM_READONLY { return KeywordLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { // Handle deeply nested case statements with iteration instead of recursion. const CaseStmt *CS = this; while (const auto *CS2 = dyn_cast<CaseStmt>(CS->getSubStmt())) @@ -838,8 +849,12 @@ public: SourceLocation getColonLoc() const { return ColonLoc; } void setColonLoc(SourceLocation L) { ColonLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubStmt->getLocEnd(); + } static bool classof(const Stmt *T) { return T->getStmtClass() == DefaultStmtClass; @@ -849,7 +864,7 @@ public: child_range children() { return child_range(&SubStmt, &SubStmt+1); } }; -inline SourceLocation SwitchCase::getLocEnd() const { +inline SourceLocation SwitchCase::getEndLoc() const { if (const auto *CS = dyn_cast<CaseStmt>(this)) return CS->getLocEnd(); return cast<DefaultStmt>(this)->getLocEnd(); @@ -882,8 +897,12 @@ public: void setIdentLoc(SourceLocation L) { IdentLoc = L; } void setSubStmt(Stmt *SS) { SubStmt = SS; } - SourceLocation getLocStart() const LLVM_READONLY { return IdentLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return IdentLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubStmt->getLocEnd(); + } child_range children() { return child_range(&SubStmt, &SubStmt+1); } @@ -937,8 +956,12 @@ public: Stmt *getSubStmt() { return SubStmt; } const Stmt *getSubStmt() const { return SubStmt; } - SourceLocation getLocStart() const LLVM_READONLY { return AttrLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AttrLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubStmt->getLocEnd(); + } child_range children() { return child_range(&SubStmt, &SubStmt + 1); } @@ -1005,9 +1028,11 @@ public: bool isObjCAvailabilityCheck() const; - SourceLocation getLocStart() const LLVM_READONLY { return IfLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return IfLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { if (SubExprs[ELSE]) return SubExprs[ELSE]->getLocEnd(); else @@ -1100,9 +1125,11 @@ public: /// have been explicitly covered. bool isAllEnumCasesCovered() const { return FirstCase.getInt(); } - SourceLocation getLocStart() const LLVM_READONLY { return SwitchLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return SwitchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY] ? SubExprs[BODY]->getLocEnd() : SubExprs[COND]->getLocEnd(); } @@ -1156,9 +1183,11 @@ public: SourceLocation getWhileLoc() const { return WhileLoc; } void setWhileLoc(SourceLocation L) { WhileLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return WhileLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return WhileLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getLocEnd(); } @@ -1206,8 +1235,10 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return DoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return DoLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == DoStmtClass; @@ -1276,9 +1307,11 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation L) { RParenLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return ForLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getLocEnd(); } @@ -1313,8 +1346,10 @@ public: SourceLocation getLabelLoc() const { return LabelLoc; } void setLabelLoc(SourceLocation L) { LabelLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return GotoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return LabelLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == GotoStmtClass; @@ -1358,8 +1393,10 @@ public: return const_cast<IndirectGotoStmt*>(this)->getConstantTarget(); } - SourceLocation getLocStart() const LLVM_READONLY { return GotoLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Target->getLocEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return GotoLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Target->getLocEnd(); } static bool classof(const Stmt *T) { return T->getStmtClass() == IndirectGotoStmtClass; @@ -1382,8 +1419,10 @@ public: SourceLocation getContinueLoc() const { return ContinueLoc; } void setContinueLoc(SourceLocation L) { ContinueLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return ContinueLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return ContinueLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return ContinueLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return ContinueLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == ContinueStmtClass; @@ -1411,8 +1450,10 @@ public: SourceLocation getBreakLoc() const { return BreakLoc; } void setBreakLoc(SourceLocation L) { BreakLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return BreakLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return BreakLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return BreakLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return BreakLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == BreakStmtClass; @@ -1462,9 +1503,11 @@ public: const VarDecl *getNRVOCandidate() const { return NRVOCandidate; } void setNRVOCandidate(const VarDecl *Var) { NRVOCandidate = Var; } - SourceLocation getLocStart() const LLVM_READONLY { return RetLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return RetLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RetExpr ? RetExpr->getLocEnd() : RetLoc; } @@ -1519,8 +1562,10 @@ public: bool isVolatile() const { return IsVolatile; } void setVolatile(bool V) { IsVolatile = V; } - SourceLocation getLocStart() const LLVM_READONLY { return {}; } - SourceLocation getLocEnd() const LLVM_READONLY { return {}; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return {}; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return {}; } //===--- Asm String Analysis ---===// @@ -1801,8 +1846,10 @@ public: return Clobbers[i]; } - SourceLocation getLocStart() const LLVM_READONLY { return AsmLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return RParenLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == GCCAsmStmtClass; @@ -1899,8 +1946,9 @@ private: ArrayRef<Expr*> Exprs, ArrayRef<StringRef> Clobbers); public: - SourceLocation getLocStart() const LLVM_READONLY { return AsmLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return EndLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AsmLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } static bool classof(const Stmt *T) { return T->getStmtClass() == MSAsmStmtClass; @@ -1929,7 +1977,8 @@ public: Expr *FilterExpr, Stmt *Block); - SourceLocation getLocStart() const LLVM_READONLY { return getExceptLoc(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getExceptLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getExceptLoc() const { return Loc; } @@ -1967,7 +2016,8 @@ public: SourceLocation FinallyLoc, Stmt *Block); - SourceLocation getLocStart() const LLVM_READONLY { return getFinallyLoc(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getFinallyLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getFinallyLoc() const { return Loc; } @@ -2006,7 +2056,8 @@ public: SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler); - SourceLocation getLocStart() const LLVM_READONLY { return getTryLoc(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getTryLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getTryLoc() const { return TryLoc; } @@ -2047,8 +2098,10 @@ public: SourceLocation getLeaveLoc() const { return LeaveLoc; } void setLeaveLoc(SourceLocation L) { LeaveLoc = L; } - SourceLocation getLocStart() const LLVM_READONLY { return LeaveLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return LeaveLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return LeaveLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return LeaveLoc; } static bool classof(const Stmt *T) { return T->getStmtClass() == SEHLeaveStmtClass; @@ -2261,11 +2314,13 @@ public: return capture_init_begin() + NumCaptures; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getCapturedStmt()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getCapturedStmt()->getLocEnd(); } diff --git a/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h b/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h index 34553741eb38..e53203bf8a3e 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h +++ b/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h @@ -41,8 +41,10 @@ public: CXXCatchStmt(EmptyShell Empty) : Stmt(CXXCatchStmtClass), ExceptionDecl(nullptr), HandlerBlock(nullptr) {} - SourceLocation getLocStart() const LLVM_READONLY { return CatchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return CatchLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return HandlerBlock->getLocEnd(); } @@ -86,7 +88,8 @@ public: static CXXTryStmt *Create(const ASTContext &C, EmptyShell Empty, unsigned numHandlers); - SourceLocation getLocStart() const LLVM_READONLY { return getTryLoc(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getTryLoc(); } SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } SourceLocation getTryLoc() const { return TryLoc; } @@ -194,8 +197,10 @@ public: SourceLocation getColonLoc() const { return ColonLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - SourceLocation getLocStart() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getLocEnd(); } @@ -280,8 +285,12 @@ public: return reinterpret_cast<CompoundStmt *>(SubStmt); } - SourceLocation getLocStart() const LLVM_READONLY { return KeywordLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubStmt->getLocEnd(); + } child_range children() { return child_range(&SubStmt, &SubStmt+1); @@ -399,11 +408,13 @@ public: return {getStoredStmts() + SubStmt::FirstParamMove, NumParams}; } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return getBody() ? getBody()->getLocStart() : getPromiseDecl()->getLocStart(); } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getBody() ? getBody()->getLocEnd() : getPromiseDecl()->getLocEnd(); } @@ -464,8 +475,10 @@ public: bool isImplicit() const { return IsImplicit; } void setIsImplicit(bool value = true) { IsImplicit = value; } - SourceLocation getLocStart() const LLVM_READONLY { return CoreturnLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return CoreturnLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getOperand() ? getOperand()->getLocEnd() : getLocStart(); } diff --git a/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h b/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h index 0b2cc78b65be..8cb06a50b8cd 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h +++ b/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h @@ -55,8 +55,10 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return ForLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return SubExprs[BODY]->getLocEnd(); } @@ -104,8 +106,10 @@ public: SourceLocation getRParenLoc() const { return RParenLoc; } void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return AtCatchLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return Body->getLocEnd(); } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtCatchLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Body->getLocEnd(); } bool hasEllipsis() const { return getCatchParamDecl() == nullptr; } @@ -133,8 +137,10 @@ public: Stmt *getFinallyBody() { return AtFinallyStmt; } void setFinallyBody(Stmt *S) { AtFinallyStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return AtFinallyLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtFinallyLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return AtFinallyStmt->getLocEnd(); } @@ -238,8 +244,10 @@ public: getStmts()[1 + NumCatchStmts] = S; } - SourceLocation getLocStart() const LLVM_READONLY { return AtTryLoc; } - SourceLocation getLocEnd() const LLVM_READONLY; + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY; static bool classof(const Stmt *T) { return T->getStmtClass() == ObjCAtTryStmtClass; @@ -295,8 +303,10 @@ public: } void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; } - SourceLocation getLocStart() const LLVM_READONLY { return AtSynchronizedLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return getSynchBody()->getLocEnd(); } @@ -329,8 +339,10 @@ public: SourceLocation getThrowLoc() const LLVM_READONLY { return AtThrowLoc; } void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; } - SourceLocation getLocStart() const LLVM_READONLY { return AtThrowLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return Throw ? Throw->getLocEnd() : AtThrowLoc; } @@ -357,8 +369,12 @@ public: Stmt *getSubStmt() { return SubStmt; } void setSubStmt(Stmt *S) { SubStmt = S; } - SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } - SourceLocation getLocEnd() const LLVM_READONLY { return SubStmt->getLocEnd();} + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { + return SubStmt->getLocEnd(); + } SourceLocation getAtLoc() const { return AtLoc; } void setAtLoc(SourceLocation Loc) { AtLoc = Loc; } diff --git a/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h b/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h index d23375e7606b..21a26b824704 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h +++ b/contrib/llvm/tools/clang/include/clang/AST/StmtOpenMP.h @@ -165,9 +165,11 @@ public: } /// Returns starting location of directive kind. - SourceLocation getLocStart() const { return StartLoc; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { return StartLoc; } /// Returns ending location of directive. - SourceLocation getLocEnd() const { return EndLoc; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const { return EndLoc; } /// Set starting location of directive kind. /// diff --git a/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h b/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h index 915ec58a5144..b3fb447b1ece 100644 --- a/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h +++ b/contrib/llvm/tools/clang/include/clang/Analysis/CloneDetection.h @@ -122,7 +122,8 @@ public: /// Returns the start sourcelocation of the first statement in this sequence. /// /// This method should only be called on a non-empty StmtSequence object. - SourceLocation getStartLoc() const; + SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const; /// Returns the end sourcelocation of the last statement in this sequence. /// diff --git a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def index cc400c0697f9..a9aaadca8489 100644 --- a/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def +++ b/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86_64.def @@ -31,6 +31,8 @@ TARGET_HEADER_BUILTIN(_mul128, "LLiLLiLLiLLi*", "nch", "intrin.h", ALL_MS TARGET_HEADER_BUILTIN(_umul128, "ULLiULLiULLiULLi*", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__faststorefence, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__shiftleft128, "ULLiULLiULLiUc", "nch", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__shiftright128, "ULLiULLiULLiUc", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_InterlockedAnd64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_InterlockedDecrement64, "LLiLLiD*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") diff --git a/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h b/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h index 2e70203c6cc0..67fb98ade940 100644 --- a/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h +++ b/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h @@ -505,8 +505,10 @@ public: const CXXScopeSpec &getTypeSpecScope() const { return TypeScope; } 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(); } SourceLocation getTypeSpecWidthLoc() const { return TSWRange.getBegin(); } SourceRange getTypeSpecWidthRange() const { return TSWRange; } @@ -1120,8 +1122,10 @@ public: SourceRange getSourceRange() const LLVM_READONLY { return SourceRange(StartLocation, EndLocation); } - SourceLocation getLocStart() const LLVM_READONLY { return StartLocation; } - SourceLocation getLocEnd() const LLVM_READONLY { return EndLocation; } + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return StartLocation; } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return EndLocation; } }; /// A set of tokens that has been cached for later parsing. @@ -1870,8 +1874,10 @@ public: /// Get the source range that spans this declarator. 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(); } void SetSourceRange(SourceRange R) { Range = R; } /// SetRangeBegin - Set the start of the source range to Loc, unless it's diff --git a/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp b/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp index 01fd10429fc1..18ba3b13b365 100644 --- a/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp +++ b/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp @@ -931,7 +931,7 @@ ObjCMethodDecl *ObjCMethodDecl::getCanonicalDecl() { return this; } -SourceLocation ObjCMethodDecl::getLocEnd() const { +SourceLocation ObjCMethodDecl::getEndLoc() const { if (Stmt *Body = getBody()) return Body->getLocEnd(); return DeclEndLoc; diff --git a/contrib/llvm/tools/clang/lib/AST/Expr.cpp b/contrib/llvm/tools/clang/lib/AST/Expr.cpp index 7556c76c38bd..50cff156d248 100644 --- a/contrib/llvm/tools/clang/lib/AST/Expr.cpp +++ b/contrib/llvm/tools/clang/lib/AST/Expr.cpp @@ -447,12 +447,12 @@ DeclRefExpr *DeclRefExpr::CreateEmpty(const ASTContext &Context, return new (Mem) DeclRefExpr(EmptyShell()); } -SourceLocation DeclRefExpr::getLocStart() const { +SourceLocation DeclRefExpr::getBeginLoc() const { if (hasQualifier()) return getQualifierLoc().getBeginLoc(); return getNameInfo().getLocStart(); } -SourceLocation DeclRefExpr::getLocEnd() const { +SourceLocation DeclRefExpr::getEndLoc() const { if (hasExplicitTemplateArgs()) return getRAngleLoc(); return getNameInfo().getLocEnd(); @@ -1358,7 +1358,7 @@ QualType CallExpr::getCallReturnType(const ASTContext &Ctx) const { return FnType->getReturnType(); } -SourceLocation CallExpr::getLocStart() const { +SourceLocation CallExpr::getBeginLoc() const { if (isa<CXXOperatorCallExpr>(this)) return cast<CXXOperatorCallExpr>(this)->getLocStart(); @@ -1367,7 +1367,7 @@ SourceLocation CallExpr::getLocStart() const { begin = getArg(0)->getLocStart(); return begin; } -SourceLocation CallExpr::getLocEnd() const { +SourceLocation CallExpr::getEndLoc() const { if (isa<CXXOperatorCallExpr>(this)) return cast<CXXOperatorCallExpr>(this)->getLocEnd(); @@ -1529,7 +1529,7 @@ MemberExpr *MemberExpr::Create( return E; } -SourceLocation MemberExpr::getLocStart() const { +SourceLocation MemberExpr::getBeginLoc() const { if (isImplicitAccess()) { if (hasQualifier()) return getQualifierLoc().getBeginLoc(); @@ -1543,7 +1543,7 @@ SourceLocation MemberExpr::getLocStart() const { return BaseStartLoc; return MemberLoc; } -SourceLocation MemberExpr::getLocEnd() const { +SourceLocation MemberExpr::getEndLoc() const { SourceLocation EndLoc = getMemberNameInfo().getEndLoc(); if (hasExplicitTemplateArgs()) EndLoc = getRAngleLoc(); @@ -2039,7 +2039,7 @@ bool InitListExpr::isIdiomaticZeroInitializer(const LangOptions &LangOpts) const return Lit && Lit->getValue() == 0; } -SourceLocation InitListExpr::getLocStart() const { +SourceLocation InitListExpr::getBeginLoc() const { if (InitListExpr *SyntacticForm = getSyntacticForm()) return SyntacticForm->getLocStart(); SourceLocation Beg = LBraceLoc; @@ -2057,7 +2057,7 @@ SourceLocation InitListExpr::getLocStart() const { return Beg; } -SourceLocation InitListExpr::getLocEnd() const { +SourceLocation InitListExpr::getEndLoc() const { if (InitListExpr *SyntacticForm = getSyntacticForm()) return SyntacticForm->getLocEnd(); SourceLocation End = RBraceLoc; @@ -3870,7 +3870,7 @@ SourceRange DesignatedInitExpr::getDesignatorsSourceRange() const { DIE->getDesignator(size()-1)->getLocEnd()); } -SourceLocation DesignatedInitExpr::getLocStart() const { +SourceLocation DesignatedInitExpr::getBeginLoc() const { SourceLocation StartLoc; auto *DIE = const_cast<DesignatedInitExpr *>(this); Designator &First = *DIE->getDesignator(0); @@ -3885,7 +3885,7 @@ SourceLocation DesignatedInitExpr::getLocStart() const { return StartLoc; } -SourceLocation DesignatedInitExpr::getLocEnd() const { +SourceLocation DesignatedInitExpr::getEndLoc() const { return getInit()->getLocEnd(); } @@ -3944,11 +3944,11 @@ DesignatedInitUpdateExpr::DesignatedInitUpdateExpr(const ASTContext &C, BaseAndUpdaterExprs[1] = ILE; } -SourceLocation DesignatedInitUpdateExpr::getLocStart() const { +SourceLocation DesignatedInitUpdateExpr::getBeginLoc() const { return getBase()->getLocStart(); } -SourceLocation DesignatedInitUpdateExpr::getLocEnd() const { +SourceLocation DesignatedInitUpdateExpr::getEndLoc() const { return getBase()->getLocEnd(); } diff --git a/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp b/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp index 93d68ec8e0b2..cc4c631553be 100644 --- a/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp +++ b/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp @@ -89,7 +89,7 @@ QualType CXXUuidofExpr::getTypeOperand(ASTContext &Context) const { } // CXXScalarValueInitExpr -SourceLocation CXXScalarValueInitExpr::getLocStart() const { +SourceLocation CXXScalarValueInitExpr::getBeginLoc() const { return TypeInfo ? TypeInfo->getTypeLoc().getBeginLoc() : RParenLoc; } @@ -250,7 +250,7 @@ QualType CXXPseudoDestructorExpr::getDestroyedType() const { return QualType(); } -SourceLocation CXXPseudoDestructorExpr::getLocEnd() const { +SourceLocation CXXPseudoDestructorExpr::getEndLoc() const { SourceLocation End = DestroyedType.getLocation(); if (TypeSourceInfo *TInfo = DestroyedType.getTypeSourceInfo()) End = TInfo->getTypeLoc().getLocalSourceRange().getEnd(); @@ -450,13 +450,13 @@ DependentScopeDeclRefExpr::CreateEmpty(const ASTContext &C, return E; } -SourceLocation CXXConstructExpr::getLocStart() const { +SourceLocation CXXConstructExpr::getBeginLoc() const { if (isa<CXXTemporaryObjectExpr>(this)) return cast<CXXTemporaryObjectExpr>(this)->getLocStart(); return Loc; } -SourceLocation CXXConstructExpr::getLocEnd() const { +SourceLocation CXXConstructExpr::getEndLoc() const { if (isa<CXXTemporaryObjectExpr>(this)) return cast<CXXTemporaryObjectExpr>(this)->getLocEnd(); @@ -707,11 +707,11 @@ CXXFunctionalCastExpr::CreateEmpty(const ASTContext &C, unsigned PathSize) { return new (Buffer) CXXFunctionalCastExpr(EmptyShell(), PathSize); } -SourceLocation CXXFunctionalCastExpr::getLocStart() const { +SourceLocation CXXFunctionalCastExpr::getBeginLoc() const { return getTypeInfoAsWritten()->getTypeLoc().getLocStart(); } -SourceLocation CXXFunctionalCastExpr::getLocEnd() const { +SourceLocation CXXFunctionalCastExpr::getEndLoc() const { return RParenLoc.isValid() ? RParenLoc : getSubExpr()->getLocEnd(); } @@ -792,11 +792,11 @@ CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(const ASTContext &C, CXXConstructExpr::CK_Complete, ParenOrBraceRange), Type(TSI) {} -SourceLocation CXXTemporaryObjectExpr::getLocStart() const { +SourceLocation CXXTemporaryObjectExpr::getBeginLoc() const { return Type->getTypeLoc().getBeginLoc(); } -SourceLocation CXXTemporaryObjectExpr::getLocEnd() const { +SourceLocation CXXTemporaryObjectExpr::getEndLoc() const { SourceLocation Loc = getParenOrBraceRange().getEnd(); if (Loc.isInvalid() && getNumArgs()) Loc = getArg(getNumArgs()-1)->getLocEnd(); @@ -1120,7 +1120,7 @@ CXXUnresolvedConstructExpr::CreateEmpty(const ASTContext &C, unsigned NumArgs) { return new (Mem) CXXUnresolvedConstructExpr(Empty, NumArgs); } -SourceLocation CXXUnresolvedConstructExpr::getLocStart() const { +SourceLocation CXXUnresolvedConstructExpr::getBeginLoc() const { return Type->getTypeLoc().getBeginLoc(); } diff --git a/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp b/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp index 40281481f1d1..d5332ba7db54 100644 --- a/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp +++ b/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp @@ -29,6 +29,7 @@ #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/JamCRC.h" +#include "llvm/Support/xxhash.h" #include "llvm/Support/MD5.h" #include "llvm/Support/MathExtras.h" @@ -127,10 +128,10 @@ class MicrosoftMangleContextImpl : public MicrosoftMangleContext { llvm::DenseMap<const CXXRecordDecl *, unsigned> LambdaIds; llvm::DenseMap<const NamedDecl *, unsigned> SEHFilterIds; llvm::DenseMap<const NamedDecl *, unsigned> SEHFinallyIds; + SmallString<16> AnonymousNamespaceHash; public: - MicrosoftMangleContextImpl(ASTContext &Context, DiagnosticsEngine &Diags) - : MicrosoftMangleContext(Context, Diags) {} + MicrosoftMangleContextImpl(ASTContext &Context, DiagnosticsEngine &Diags); bool shouldMangleCXXName(const NamedDecl *D) override; bool shouldMangleStringLiteral(const StringLiteral *SL) override; void mangleCXXName(const NamedDecl *D, raw_ostream &Out) override; @@ -238,6 +239,12 @@ public: return Result.first->second; } + /// Return a character sequence that is (somewhat) unique to the TU suitable + /// for mangling anonymous namespaces. + StringRef getAnonymousNamespaceHash() const { + return AnonymousNamespaceHash; + } + private: void mangleInitFiniStub(const VarDecl *D, char CharCode, raw_ostream &Out); }; @@ -371,6 +378,34 @@ private: }; } +MicrosoftMangleContextImpl::MicrosoftMangleContextImpl(ASTContext &Context, + DiagnosticsEngine &Diags) + : MicrosoftMangleContext(Context, Diags) { + // To mangle anonymous namespaces, hash the path to the main source file. The + // path should be whatever (probably relative) path was passed on the command + // line. The goal is for the compiler to produce the same output regardless of + // working directory, so use the uncanonicalized relative path. + // + // It's important to make the mangled names unique because, when CodeView + // debug info is in use, the debugger uses mangled type names to distinguish + // between otherwise identically named types in anonymous namespaces. + // + // These symbols are always internal, so there is no need for the hash to + // match what MSVC produces. For the same reason, clang is free to change the + // hash at any time without breaking compatibility with old versions of clang. + // The generated names are intended to look similar to what MSVC generates, + // which are something like "?A0x01234567@". + SourceManager &SM = Context.getSourceManager(); + if (const FileEntry *FE = SM.getFileEntryForID(SM.getMainFileID())) { + // Truncate the hash so we get 8 characters of hexadecimal. + uint32_t TruncatedHash = uint32_t(xxHash64(FE->getName())); + AnonymousNamespaceHash = llvm::utohexstr(TruncatedHash); + } else { + // If we don't have a path to the main file, we'll just use 0. + AnonymousNamespaceHash = "0"; + } +} + bool MicrosoftMangleContextImpl::shouldMangleCXXName(const NamedDecl *D) { if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { LanguageLinkage L = FD->getLanguageLinkage(); @@ -785,7 +820,7 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, if (const NamespaceDecl *NS = dyn_cast<NamespaceDecl>(ND)) { if (NS->isAnonymousNamespace()) { - Out << "?A@"; + Out << "?A0x" << Context.getAnonymousNamespaceHash() << '@'; break; } } @@ -905,8 +940,14 @@ void MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, case DeclarationName::ObjCZeroArgSelector: case DeclarationName::ObjCOneArgSelector: - case DeclarationName::ObjCMultiArgSelector: - llvm_unreachable("Can't mangle Objective-C selector names here!"); + case DeclarationName::ObjCMultiArgSelector: { + // This is reachable only when constructing an outlined SEH finally + // block. Nothing depends on this mangling and it's used only with + // functinos with internal linkage. + llvm::SmallString<64> Name; + mangleSourceName(Name.str()); + break; + } case DeclarationName::CXXConstructorName: if (isStructorDecl(ND)) { diff --git a/contrib/llvm/tools/clang/lib/AST/Stmt.cpp b/contrib/llvm/tools/clang/lib/AST/Stmt.cpp index a041006c905e..64a7a196140e 100644 --- a/contrib/llvm/tools/clang/lib/AST/Stmt.cpp +++ b/contrib/llvm/tools/clang/lib/AST/Stmt.cpp @@ -275,8 +275,8 @@ SourceRange Stmt::getSourceRange() const { llvm_unreachable("unknown statement kind!"); } -SourceLocation Stmt::getLocStart() const { -// llvm::errs() << "getLocStart() for " << getStmtClassName() << "\n"; +SourceLocation Stmt::getBeginLoc() const { + // llvm::errs() << "getBeginLoc() for " << getStmtClassName() << "\n"; switch (getStmtClass()) { case Stmt::NoStmtClass: llvm_unreachable("statement without class"); #define ABSTRACT_STMT(type) @@ -288,7 +288,7 @@ SourceLocation Stmt::getLocStart() const { llvm_unreachable("unknown statement kind"); } -SourceLocation Stmt::getLocEnd() const { +SourceLocation Stmt::getEndLoc() const { switch (getStmtClass()) { case Stmt::NoStmtClass: llvm_unreachable("statement without class"); #define ABSTRACT_STMT(type) diff --git a/contrib/llvm/tools/clang/lib/AST/StmtObjC.cpp b/contrib/llvm/tools/clang/lib/AST/StmtObjC.cpp index eea03f64c2fe..cc4b2308a08b 100644 --- a/contrib/llvm/tools/clang/lib/AST/StmtObjC.cpp +++ b/contrib/llvm/tools/clang/lib/AST/StmtObjC.cpp @@ -64,7 +64,7 @@ ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(const ASTContext &Context, return new (Mem) ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally); } -SourceLocation ObjCAtTryStmt::getLocEnd() const { +SourceLocation ObjCAtTryStmt::getEndLoc() const { if (HasFinally) return getFinallyStmt()->getLocEnd(); if (NumCatchStmts) diff --git a/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp b/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp index 8912b3b76751..c0b9b5c0823a 100644 --- a/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp +++ b/contrib/llvm/tools/clang/lib/Analysis/CloneDetection.cpp @@ -77,7 +77,7 @@ ASTContext &StmtSequence::getASTContext() const { return D->getASTContext(); } -SourceLocation StmtSequence::getStartLoc() const { +SourceLocation StmtSequence::getBeginLoc() const { return front()->getLocStart(); } diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp index e99121c46d9b..669a3be0e6e1 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp @@ -10361,6 +10361,27 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID, return Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent, llvm::SyncScope::System); } + case X86::BI__shiftleft128: + case X86::BI__shiftright128: { + // FIXME: Once fshl/fshr no longer add an unneeded and and cmov, do this: + // llvm::Function *F = CGM.getIntrinsic( + // BuiltinID == X86::BI__shiftleft128 ? Intrinsic::fshl : Intrinsic::fshr, + // Int64Ty); + // Ops[2] = Builder.CreateZExt(Ops[2], Int64Ty); + // return Builder.CreateCall(F, Ops); + llvm::Type *Int128Ty = Builder.getInt128Ty(); + Value *Val = Builder.CreateOr( + Builder.CreateShl(Builder.CreateZExt(Ops[1], Int128Ty), 64), + Builder.CreateZExt(Ops[0], Int128Ty)); + Value *Amt = Builder.CreateAnd(Builder.CreateZExt(Ops[2], Int128Ty), + llvm::ConstantInt::get(Int128Ty, 0x3f)); + Value *Res; + if (BuiltinID == X86::BI__shiftleft128) + Res = Builder.CreateLShr(Builder.CreateShl(Val, Amt), 64); + else + Res = Builder.CreateLShr(Val, Amt); + return Builder.CreateTrunc(Res, Int64Ty); + } case X86::BI_ReadWriteBarrier: case X86::BI_ReadBarrier: case X86::BI_WriteBarrier: { diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp index f168dd02ead1..93a1859de720 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp @@ -2408,6 +2408,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { // A DeclRefExpr for a reference initialized by a constant expression can // appear without being odr-used. Directly emit the constant initializer. const Expr *Init = VD->getAnyInitializer(VD); + const auto *BD = dyn_cast_or_null<BlockDecl>(CurCodeDecl); if (Init && !isa<ParmVarDecl>(VD) && VD->getType()->isReferenceType() && VD->isUsableInConstantExpressions(getContext()) && VD->checkInitIsICE() && @@ -2417,7 +2418,7 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { (LocalDeclMap.count(VD->getCanonicalDecl()) || CapturedStmtInfo->lookup(VD->getCanonicalDecl()))) || LambdaCaptureFields.lookup(VD->getCanonicalDecl()) || - isa<BlockDecl>(CurCodeDecl)))) { + (BD && BD->capturesVariable(VD))))) { llvm::Constant *Val = ConstantEmitter(*this).emitAbstract(E->getLocation(), *VD->evaluateValue(), diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp index 8c5e0df0969b..155ee6c6af12 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp @@ -2539,15 +2539,17 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction( if (getLangOpts().OpenMPIsDevice && OpenMPRuntime && !OpenMPRuntime->markAsGlobalTarget(GD) && FD->isDefined() && !DontDefer && !IsForDefinition) { - const FunctionDecl *FDDef = FD->getDefinition(); - GlobalDecl GDDef; - if (const auto *CD = dyn_cast<CXXConstructorDecl>(FDDef)) - GDDef = GlobalDecl(CD, GD.getCtorType()); - else if (const auto *DD = dyn_cast<CXXDestructorDecl>(FDDef)) - GDDef = GlobalDecl(DD, GD.getDtorType()); - else - GDDef = GlobalDecl(FDDef); - addDeferredDeclToEmit(GDDef); + if (const FunctionDecl *FDDef = FD->getDefinition()) + if (getContext().DeclMustBeEmitted(FDDef)) { + GlobalDecl GDDef; + if (const auto *CD = dyn_cast<CXXConstructorDecl>(FDDef)) + GDDef = GlobalDecl(CD, GD.getCtorType()); + else if (const auto *DD = dyn_cast<CXXDestructorDecl>(FDDef)) + GDDef = GlobalDecl(DD, GD.getDtorType()); + else + GDDef = GlobalDecl(FDDef); + addDeferredDeclToEmit(GDDef); + } } if (FD->isMultiVersion()) { diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp index 2d8446463594..389d29e467b7 100644 --- a/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/contrib/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -67,7 +67,8 @@ public: void setStartLoc(SourceLocation Loc) { LocStart = Loc; } - SourceLocation getStartLoc() const { + SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const { assert(LocStart && "Region has no start location"); return *LocStart; } diff --git a/contrib/llvm/tools/clang/lib/Headers/intrin.h b/contrib/llvm/tools/clang/lib/Headers/intrin.h index 91914214e299..edb947eef659 100644 --- a/contrib/llvm/tools/clang/lib/Headers/intrin.h +++ b/contrib/llvm/tools/clang/lib/Headers/intrin.h @@ -863,20 +863,6 @@ __nop(void) { __asm__ volatile ("nop"); } #endif -#if defined(__x86_64__) -static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS -__shiftleft128(unsigned __int64 __l, unsigned __int64 __h, unsigned char __d) { - unsigned __int128 __val = ((unsigned __int128)__h << 64) | __l; - unsigned __int128 __res = __val << (__d & 63); - return (unsigned __int64)(__res >> 64); -} -static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS -__shiftright128(unsigned __int64 __l, unsigned __int64 __h, unsigned char __d) { - unsigned __int128 __val = ((unsigned __int128)__h << 64) | __l; - unsigned __int128 __res = __val >> (__d & 63); - return (unsigned __int64)__res; -} -#endif /*----------------------------------------------------------------------------*\ |* Privileged intrinsics diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp index 93dbeab5b034..718a5e1ccefa 100644 --- a/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp @@ -6121,11 +6121,13 @@ class FormatStringLiteral { StartToken, StartTokenByteOffset); } - SourceLocation getLocStart() const LLVM_READONLY { + SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); } + SourceLocation getBeginLoc() const LLVM_READONLY { return FExpr->getLocStart().getLocWithOffset(Offset); } - SourceLocation getLocEnd() const LLVM_READONLY { return FExpr->getLocEnd(); } + SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); } + SourceLocation getEndLoc() const LLVM_READONLY { return FExpr->getLocEnd(); } }; } // namespace diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp index 01ef86c656bb..5070996d50e0 100644 --- a/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp @@ -6942,6 +6942,10 @@ void Sema::checkInitializerLifetime(const InitializedEntity &Entity, } else if (isa<BlockExpr>(L)) { Diag(DiagLoc, diag::err_ret_local_block) << DiagRange; } else if (isa<AddrLabelExpr>(L)) { + // Don't warn when returning a label from a statement expression. + // Leaving the scope doesn't end its lifetime. + if (LK == LK_StmtExprResult) + return false; Diag(DiagLoc, diag::warn_ret_addr_label) << DiagRange; } else { Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) diff --git a/contrib/llvm/tools/lld/docs/ReleaseNotes.rst b/contrib/llvm/tools/lld/docs/ReleaseNotes.rst index 58f47980893a..203826a089a7 100644 --- a/contrib/llvm/tools/lld/docs/ReleaseNotes.rst +++ b/contrib/llvm/tools/lld/docs/ReleaseNotes.rst @@ -24,7 +24,15 @@ Non-comprehensive list of changes in this release ELF Improvements ---------------- -* Item 1. +* lld is now able to overcome MIPS GOT entries number limitation + and generate multi-GOT if necessary. + +* lld is now able to produce MIPS position-independent executable (PIE). + +* Fixed MIPS TLS GOT entries for local symbols in shared libraries. + +* Fixed calculation of MIPS GP relative relocations + in case of relocatable output. COFF Improvements ----------------- diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 0f13fd743889..9f8b12bd7308 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "339999" +#define SVN_REVISION "340910" diff --git a/lib/clang/include/clang/Config/config.h b/lib/clang/include/clang/Config/config.h index f972f8ebde41..49b99a6e0483 100644 --- a/lib/clang/include/clang/Config/config.h +++ b/lib/clang/include/clang/Config/config.h @@ -62,7 +62,7 @@ #define CLANG_HAVE_RLIMITS 1 /* The LLVM product name and version */ -#define BACKEND_PACKAGE_STRING "LLVM 7.0.0svn" +#define BACKEND_PACKAGE_STRING "LLVM 7.0.0" /* Linker version detected at compile time. */ /* #undef HOST_LINK_VERSION */ diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 20c5d901d3c6..dbb721da2a32 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -7,4 +7,4 @@ #define LLD_REPOSITORY_STRING "FreeBSD" // <Upstream revision at import>-<Local identifier in __FreeBSD_version style> -#define LLD_REVISION_STRING "339999-1200005" +#define LLD_REVISION_STRING "340910-1200005" diff --git a/lib/clang/include/llvm/Support/DataTypes.h b/lib/clang/include/llvm/Support/DataTypes.h deleted file mode 100644 index d48e83df38ef..000000000000 --- a/lib/clang/include/llvm/Support/DataTypes.h +++ /dev/null @@ -1,136 +0,0 @@ -/* $FreeBSD$ */ -/*===-- include/Support/DataTypes.h - Define fixed size types -----*- C -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This file contains definitions to figure out the size of _HOST_ data types.*| -|* This file is important because different host OS's define different macros,*| -|* which makes portability tough. This file exports the following *| -|* definitions: *| -|* *| -|* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| -|* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| -|* *| -|* No library is required when using these functions. *| -|* *| -|*===----------------------------------------------------------------------===*/ - -/* Please leave this file C-compatible. */ - -#ifndef SUPPORT_DATATYPES_H -#define SUPPORT_DATATYPES_H - -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_UINT64_T 1 -#define HAVE_U_INT64_T 1 - -#ifdef __cplusplus -#include <cmath> -#else -#include <math.h> -#endif - -#ifdef __cplusplus -#include <cinttypes> -#else -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#endif - -#ifdef __cplusplus -#include <cstdint> -#else -#ifdef HAVE_STDINT_H -#include <stdint.h> -#else -#error "Compiler must provide an implementation of stdint.h" -#endif -#endif - -#ifndef _MSC_VER - -#if !defined(UINT32_MAX) -# error "The standard header <cstdint> is not C++11 compliant. Must #define "\ - "__STDC_LIMIT_MACROS before #including Support/DataTypes.h" -#endif - -#if !defined(UINT32_C) -# error "The standard header <cstdint> is not C++11 compliant. Must #define "\ - "__STDC_CONSTANT_MACROS before #including Support/DataTypes.h" -#endif - -/* Note that <inttypes.h> includes <stdint.h>, if this is a C99 system. */ -#include <sys/types.h> - -#ifdef _AIX -// GCC is strict about defining large constants: they must have LL modifier. -#undef INT64_MAX -#undef INT64_MIN -#endif - -/* Handle incorrect definition of uint64_t as u_int64_t */ -#ifndef HAVE_UINT64_T -#ifdef HAVE_U_INT64_T -typedef u_int64_t uint64_t; -#else -# error "Don't have a definition for uint64_t on this platform" -#endif -#endif - -#else /* _MSC_VER */ -#ifdef __cplusplus -#include <cstddef> -#include <cstdlib> -#else -#include <stddef.h> -#include <stdlib.h> -#endif -#include <sys/types.h> - -#if defined(_WIN64) -typedef signed __int64 ssize_t; -#else -typedef signed int ssize_t; -#endif /* _WIN64 */ - -#ifndef HAVE_INTTYPES_H -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#define PRIX64 "I64X" - -#define PRId32 "d" -#define PRIi32 "i" -#define PRIo32 "o" -#define PRIu32 "u" -#define PRIx32 "x" -#define PRIX32 "X" -#endif /* HAVE_INTTYPES_H */ - -#endif /* _MSC_VER */ - -/* Set defaults for constants which we cannot find. */ -#if !defined(INT64_MAX) -# define INT64_MAX 9223372036854775807LL -#endif -#if !defined(INT64_MIN) -# define INT64_MIN ((-INT64_MAX)-1) -#endif -#if !defined(UINT64_MAX) -# define UINT64_MAX 0xffffffffffffffffULL -#endif - -#ifndef HUGE_VALF -#define HUGE_VALF (float)HUGE_VAL -#endif - -#endif /* SUPPORT_DATATYPES_H */ diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index d16d9c27dfb3..7b753fecb595 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "svn-r335540" +#define LLVM_REVISION "svn-r340910" |
