Date: Tue, 22 Jan 2019 20:15:02 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r343314 - in projects/clang800-import/contrib/llvm/tools/clang: include/clang/Basic lib/Basic lib/CodeGen lib/Sema Message-ID: <201901222015.x0MKF2ce032242@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Tue Jan 22 20:15:01 2019 New Revision: 343314 URL: https://svnweb.freebsd.org/changeset/base/343314 Log: Merge clang release_80 branch r351543, and resolve conflicts. Modified: projects/clang800-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td projects/clang800-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp projects/clang800-import/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Directory Properties: projects/clang800-import/contrib/llvm/tools/clang/ (props changed) Modified: projects/clang800-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- projects/clang800-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Jan 22 20:13:43 2019 (r343313) +++ projects/clang800-import/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Tue Jan 22 20:15:01 2019 (r343314) @@ -274,6 +274,10 @@ def warn_riscv_interrupt_attribute : Warning< "RISC-V 'interrupt' attribute only applies to functions that have " "%select{no parameters|a 'void' return type}0">, InGroup<IgnoredAttributes>; +def warn_msp430_interrupt_attribute : Warning< + "MSP430 'interrupt' attribute only applies to functions that have " + "%select{no parameters|a 'void' return type}0">, + InGroup<IgnoredAttributes>; def warn_unused_parameter : Warning<"unused parameter %0">, InGroup<UnusedParameter>, DefaultIgnore; def warn_unused_variable : Warning<"unused variable %0">, Modified: projects/clang800-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- projects/clang800-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp Tue Jan 22 20:13:43 2019 (r343313) +++ projects/clang800-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp Tue Jan 22 20:15:01 2019 (r343314) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/trunk/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp ============================================================================== --- projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp Tue Jan 22 20:13:43 2019 (r343313) +++ projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp Tue Jan 22 20:15:01 2019 (r343314) @@ -2463,10 +2463,12 @@ ItaniumCXXABI::getOrCreateThreadLocalWrapper(const Var CGM.SetLLVMFunctionAttributesForDefinition(nullptr, Wrapper); // Always resolve references to the wrapper at link time. - if (!Wrapper->hasLocalLinkage() && !(isThreadWrapperReplaceable(VD, CGM) && - !llvm::GlobalVariable::isLinkOnceLinkage(Wrapper->getLinkage()) && - !llvm::GlobalVariable::isWeakODRLinkage(Wrapper->getLinkage()))) - Wrapper->setVisibility(llvm::GlobalValue::HiddenVisibility); + if (!Wrapper->hasLocalLinkage()) + if (!isThreadWrapperReplaceable(VD, CGM) || + llvm::GlobalVariable::isLinkOnceLinkage(Wrapper->getLinkage()) || + llvm::GlobalVariable::isWeakODRLinkage(Wrapper->getLinkage()) || + VD->getVisibility() == HiddenVisibility) + Wrapper->setVisibility(llvm::GlobalValue::HiddenVisibility); if (isThreadWrapperReplaceable(VD, CGM)) { Wrapper->setCallingConv(llvm::CallingConv::CXX_FAST_TLS); Modified: projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Tue Jan 22 20:13:43 2019 (r343313) +++ projects/clang800-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Tue Jan 22 20:15:01 2019 (r343314) @@ -6774,21 +6774,19 @@ void MSP430TargetCodeGenInfo::setTargetAttributes( if (GV->isDeclaration()) return; if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { - if (const MSP430InterruptAttr *attr = FD->getAttr<MSP430InterruptAttr>()) { - // Handle 'interrupt' attribute: - llvm::Function *F = cast<llvm::Function>(GV); + const auto *InterruptAttr = FD->getAttr<MSP430InterruptAttr>(); + if (!InterruptAttr) + return; - // Step 1: Set ISR calling convention. - F->setCallingConv(llvm::CallingConv::MSP430_INTR); + // Handle 'interrupt' attribute: + llvm::Function *F = cast<llvm::Function>(GV); - // Step 2: Add attributes goodness. - F->addFnAttr(llvm::Attribute::NoInline); + // Step 1: Set ISR calling convention. + F->setCallingConv(llvm::CallingConv::MSP430_INTR); - // Step 3: Emit ISR vector alias. - unsigned Num = attr->getNumber() / 2; - llvm::GlobalAlias::create(llvm::Function::ExternalLinkage, - "__isr_" + Twine(Num), F); - } + // Step 2: Add attributes goodness. + F->addFnAttr(llvm::Attribute::NoInline); + F->addFnAttr("interrupt", llvm::utostr(InterruptAttr->getNumber())); } } Modified: projects/clang800-import/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp ============================================================================== --- projects/clang800-import/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Tue Jan 22 20:13:43 2019 (r343313) +++ projects/clang800-import/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp Tue Jan 22 20:15:01 2019 (r343314) @@ -5377,6 +5377,27 @@ static void handleARMInterruptAttr(Sema &S, Decl *D, c } static void handleMSP430InterruptAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + // MSP430 'interrupt' attribute is applied to + // a function with no parameters and void return type. + if (!isFunctionOrMethod(D)) { + S.Diag(D->getLocation(), diag::warn_attribute_wrong_decl_type) + << "'interrupt'" << ExpectedFunctionOrMethod; + return; + } + + if (hasFunctionProto(D) && getFunctionOrMethodNumParams(D) != 0) { + S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute) + << 0; + return; + } + + if (!getFunctionOrMethodResultType(D)->isVoidType()) { + S.Diag(D->getLocation(), diag::warn_msp430_interrupt_attribute) + << 1; + return; + } + + // The attribute takes one integer argument. if (!checkAttributeNumArgs(S, AL, 1)) return; @@ -5386,8 +5407,6 @@ static void handleMSP430InterruptAttr(Sema &S, Decl *D return; } - // FIXME: Check for decl - it should be void ()(void). - Expr *NumParamsExpr = static_cast<Expr *>(AL.getArgAsExpr(0)); llvm::APSInt NumParams(32); if (!NumParamsExpr->isIntegerConstantExpr(NumParams, S.Context)) { @@ -5396,9 +5415,9 @@ static void handleMSP430InterruptAttr(Sema &S, Decl *D << NumParamsExpr->getSourceRange(); return; } - + // The argument should be in range 0..63. unsigned Num = NumParams.getLimitedValue(255); - if ((Num & 1) || Num > 30) { + if (Num > 63) { S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_bounds) << AL << (int)NumParams.getSExtValue() << NumParamsExpr->getSourceRange(); @@ -7346,13 +7365,11 @@ ShouldDiagnoseAvailabilityInContext(Sema &S, Availabil return true; } else if (K == AR_Unavailable) { // It is perfectly fine to refer to an 'unavailable' Objective-C method - // when it's actually defined and is referenced from within the - // @implementation itself. In this context, we interpret unavailable as a - // form of access control. + // when it is referenced from within the @implementation itself. In this + // context, we interpret unavailable as a form of access control. if (const auto *MD = dyn_cast<ObjCMethodDecl>(OffendingDecl)) { if (const auto *Impl = dyn_cast<ObjCImplDecl>(C)) { - if (MD->getClassInterface() == Impl->getClassInterface() && - MD->isDefined()) + if (MD->getClassInterface() == Impl->getClassInterface()) return true; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901222015.x0MKF2ce032242>