diff options
Diffstat (limited to 'include/clang/Basic')
92 files changed, 0 insertions, 37752 deletions
diff --git a/include/clang/Basic/ABI.h b/include/clang/Basic/ABI.h deleted file mode 100644 index 75e9faf..0000000 --- a/include/clang/Basic/ABI.h +++ /dev/null @@ -1,211 +0,0 @@ -//===----- ABI.h - ABI related declarations ---------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Enums/classes describing ABI related information about constructors, -/// destructors and thunks. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_ABI_H -#define LLVM_CLANG_BASIC_ABI_H - -#include "llvm/Support/DataTypes.h" -#include <cstring> - -namespace clang { - -/// \brief C++ constructor types. -enum CXXCtorType { - Ctor_Complete, ///< Complete object ctor - Ctor_Base, ///< Base object ctor - Ctor_Comdat, ///< The COMDAT used for ctors - Ctor_CopyingClosure, ///< Copying closure variant of a ctor - Ctor_DefaultClosure, ///< Default closure variant of a ctor -}; - -/// \brief C++ destructor types. -enum CXXDtorType { - Dtor_Deleting, ///< Deleting dtor - Dtor_Complete, ///< Complete object dtor - Dtor_Base, ///< Base object dtor - Dtor_Comdat ///< The COMDAT used for dtors -}; - -/// \brief A return adjustment. -struct ReturnAdjustment { - /// \brief The non-virtual adjustment from the derived object to its - /// nearest virtual base. - int64_t NonVirtual; - - /// \brief Holds the ABI-specific information about the virtual return - /// adjustment, if needed. - union VirtualAdjustment { - // Itanium ABI - struct { - /// \brief The offset (in bytes), relative to the address point - /// of the virtual base class offset. - int64_t VBaseOffsetOffset; - } Itanium; - - // Microsoft ABI - struct { - /// \brief The offset (in bytes) of the vbptr, relative to the beginning - /// of the derived class. - uint32_t VBPtrOffset; - - /// \brief Index of the virtual base in the vbtable. - uint32_t VBIndex; - } Microsoft; - - VirtualAdjustment() { - memset(this, 0, sizeof(*this)); - } - - bool Equals(const VirtualAdjustment &Other) const { - return memcmp(this, &Other, sizeof(Other)) == 0; - } - - bool isEmpty() const { - VirtualAdjustment Zero; - return Equals(Zero); - } - - bool Less(const VirtualAdjustment &RHS) const { - return memcmp(this, &RHS, sizeof(RHS)) < 0; - } - } Virtual; - - ReturnAdjustment() : NonVirtual(0) {} - - bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); } - - friend bool operator==(const ReturnAdjustment &LHS, - const ReturnAdjustment &RHS) { - return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual); - } - - friend bool operator!=(const ReturnAdjustment &LHS, const ReturnAdjustment &RHS) { - return !(LHS == RHS); - } - - friend bool operator<(const ReturnAdjustment &LHS, - const ReturnAdjustment &RHS) { - if (LHS.NonVirtual < RHS.NonVirtual) - return true; - - return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual); - } -}; - -/// \brief A \c this pointer adjustment. -struct ThisAdjustment { - /// \brief The non-virtual adjustment from the derived object to its - /// nearest virtual base. - int64_t NonVirtual; - - /// \brief Holds the ABI-specific information about the virtual this - /// adjustment, if needed. - union VirtualAdjustment { - // Itanium ABI - struct { - /// \brief The offset (in bytes), relative to the address point, - /// of the virtual call offset. - int64_t VCallOffsetOffset; - } Itanium; - - struct { - /// \brief The offset of the vtordisp (in bytes), relative to the ECX. - int32_t VtordispOffset; - - /// \brief The offset of the vbptr of the derived class (in bytes), - /// relative to the ECX after vtordisp adjustment. - int32_t VBPtrOffset; - - /// \brief The offset (in bytes) of the vbase offset in the vbtable. - int32_t VBOffsetOffset; - } Microsoft; - - VirtualAdjustment() { - memset(this, 0, sizeof(*this)); - } - - bool Equals(const VirtualAdjustment &Other) const { - return memcmp(this, &Other, sizeof(Other)) == 0; - } - - bool isEmpty() const { - VirtualAdjustment Zero; - return Equals(Zero); - } - - bool Less(const VirtualAdjustment &RHS) const { - return memcmp(this, &RHS, sizeof(RHS)) < 0; - } - } Virtual; - - ThisAdjustment() : NonVirtual(0) { } - - bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); } - - friend bool operator==(const ThisAdjustment &LHS, - const ThisAdjustment &RHS) { - return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual); - } - - friend bool operator!=(const ThisAdjustment &LHS, const ThisAdjustment &RHS) { - return !(LHS == RHS); - } - - friend bool operator<(const ThisAdjustment &LHS, - const ThisAdjustment &RHS) { - if (LHS.NonVirtual < RHS.NonVirtual) - return true; - - return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual); - } -}; - -class CXXMethodDecl; - -/// \brief The \c this pointer adjustment as well as an optional return -/// adjustment for a thunk. -struct ThunkInfo { - /// \brief The \c this pointer adjustment. - ThisAdjustment This; - - /// \brief The return adjustment. - ReturnAdjustment Return; - - /// \brief Holds a pointer to the overridden method this thunk is for, - /// if needed by the ABI to distinguish different thunks with equal - /// adjustments. Otherwise, null. - /// CAUTION: In the unlikely event you need to sort ThunkInfos, consider using - /// an ABI-specific comparator. - const CXXMethodDecl *Method; - - ThunkInfo() : Method(nullptr) { } - - ThunkInfo(const ThisAdjustment &This, const ReturnAdjustment &Return, - const CXXMethodDecl *Method = nullptr) - : This(This), Return(Return), Method(Method) {} - - friend bool operator==(const ThunkInfo &LHS, const ThunkInfo &RHS) { - return LHS.This == RHS.This && LHS.Return == RHS.Return && - LHS.Method == RHS.Method; - } - - bool isEmpty() const { - return This.isEmpty() && Return.isEmpty() && Method == nullptr; - } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/AddressSpaces.h b/include/clang/Basic/AddressSpaces.h deleted file mode 100644 index 8dd7566..0000000 --- a/include/clang/Basic/AddressSpaces.h +++ /dev/null @@ -1,51 +0,0 @@ -//===--- AddressSpaces.h - Language-specific address spaces -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Provides definitions for the various language-specific address -/// spaces. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_ADDRESSSPACES_H -#define LLVM_CLANG_BASIC_ADDRESSSPACES_H - -namespace clang { - -namespace LangAS { - -/// \brief Defines the set of possible language-specific address spaces. -/// -/// This uses a high starting offset so as not to conflict with any address -/// space used by a target. -enum ID { - Offset = 0xFFFF00, - - opencl_global = Offset, - opencl_local, - opencl_constant, - opencl_generic, - - cuda_device, - cuda_constant, - cuda_shared, - - Last, - Count = Last-Offset -}; - -/// The type of a lookup table which maps from language-specific address spaces -/// to target-specific ones. -typedef unsigned Map[Count]; - -} - -} - -#endif diff --git a/include/clang/Basic/AllDiagnostics.h b/include/clang/Basic/AllDiagnostics.h deleted file mode 100644 index 18a2b8a..0000000 --- a/include/clang/Basic/AllDiagnostics.h +++ /dev/null @@ -1,40 +0,0 @@ -//===--- AllDiagnostics.h - Aggregate Diagnostic headers --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Includes all the separate Diagnostic headers & some related helpers. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_ALLDIAGNOSTICS_H -#define LLVM_CLANG_BASIC_ALLDIAGNOSTICS_H - -#include "clang/AST/ASTDiagnostic.h" -#include "clang/AST/CommentDiagnostic.h" -#include "clang/Analysis/AnalysisDiagnostic.h" -#include "clang/Driver/DriverDiagnostic.h" -#include "clang/Frontend/FrontendDiagnostic.h" -#include "clang/Lex/LexDiagnostic.h" -#include "clang/Parse/ParseDiagnostic.h" -#include "clang/Sema/SemaDiagnostic.h" -#include "clang/Serialization/SerializationDiagnostic.h" - -namespace clang { -template <size_t SizeOfStr, typename FieldType> -class StringSizerHelper { - char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1]; -public: - enum { Size = SizeOfStr }; -}; -} // end namespace clang - -#define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \ - fieldTy>::Size - -#endif diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td deleted file mode 100644 index d5ba722..0000000 --- a/include/clang/Basic/Attr.td +++ /dev/null @@ -1,2172 +0,0 @@ -//==--- Attr.td - attribute definitions -----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// The documentation is organized by category. Attributes can have category- -// specific documentation that is collated within the larger document. -class DocumentationCategory<string name> { - string Name = name; - code Content = [{}]; -} -def DocCatFunction : DocumentationCategory<"Function Attributes">; -def DocCatVariable : DocumentationCategory<"Variable Attributes">; -def DocCatType : DocumentationCategory<"Type Attributes">; -def DocCatStmt : DocumentationCategory<"Statement Attributes">; -// Attributes listed under the Undocumented category do not generate any public -// documentation. Ideally, this category should be used for internal-only -// attributes which contain no spellings. -def DocCatUndocumented : DocumentationCategory<"Undocumented">; - -class DocDeprecated<string replacement = ""> { - // If the Replacement field is empty, no replacement will be listed with the - // documentation. Otherwise, the documentation will specify the attribute has - // been superseded by this replacement. - string Replacement = replacement; -} - -// Specifies the documentation to be associated with the given category. -class Documentation { - DocumentationCategory Category; - code Content; - - // If the heading is empty, one may be picked automatically. If the attribute - // only has one spelling, no heading is required as the attribute's sole - // spelling is sufficient. If all spellings are semantically common, the - // heading will be the semantic spelling. If the spellings are not - // semantically common and no heading is provided, an error will be emitted. - string Heading = ""; - - // When set, specifies that the attribute is deprecated and can optionally - // specify a replacement attribute. - DocDeprecated Deprecated; -} - -// Specifies that the attribute is explicitly undocumented. This can be a -// helpful placeholder for the attribute while working on the implementation, -// but should not be used once feature work has been completed. -def Undocumented : Documentation { - let Category = DocCatUndocumented; -} - -include "clang/Basic/AttrDocs.td" - -// An attribute's subject is whatever it appertains to. In this file, it is -// more accurately a list of things that an attribute can appertain to. All -// Decls and Stmts are possibly AttrSubjects (even though the syntax may not -// allow attributes on a given Decl or Stmt). -class AttrSubject; - -include "clang/Basic/DeclNodes.td" -include "clang/Basic/StmtNodes.td" - -// A subset-subject is an AttrSubject constrained to operate only on some subset -// of that subject. -// -// The code fragment is a boolean expression that will confirm that the subject -// meets the requirements; the subject will have the name S, and will have the -// type specified by the base. It should be a simple boolean expression. -class SubsetSubject<AttrSubject base, code check> : AttrSubject { - AttrSubject Base = base; - code CheckCode = check; -} - -// This is the type of a variable which C++11 allows alignas(...) to appertain -// to. -def NormalVar : SubsetSubject<Var, - [{S->getStorageClass() != VarDecl::Register && - S->getKind() != Decl::ImplicitParam && - S->getKind() != Decl::ParmVar && - S->getKind() != Decl::NonTypeTemplateParm}]>; -def NonBitField : SubsetSubject<Field, - [{!S->isBitField()}]>; - -def ObjCInstanceMethod : SubsetSubject<ObjCMethod, - [{S->isInstanceMethod()}]>; - -def ObjCInterfaceDeclInitMethod : SubsetSubject<ObjCMethod, - [{S->getMethodFamily() == OMF_init && - (isa<ObjCInterfaceDecl>(S->getDeclContext()) || - (isa<ObjCCategoryDecl>(S->getDeclContext()) && - cast<ObjCCategoryDecl>(S->getDeclContext())->IsClassExtension()))}]>; - -def Struct : SubsetSubject<Record, - [{!S->isUnion()}]>; - -def TLSVar : SubsetSubject<Var, - [{S->getTLSKind() != 0}]>; - -def SharedVar : SubsetSubject<Var, - [{S->hasGlobalStorage() && !S->getTLSKind()}]>; - -def GlobalVar : SubsetSubject<Var, - [{S->hasGlobalStorage()}]>; - -// FIXME: this hack is needed because DeclNodes.td defines the base Decl node -// type to be a class, not a definition. This makes it impossible to create an -// attribute subject which accepts a Decl. Normally, this is not a problem, -// because the attribute can have no Subjects clause to accomplish this. But in -// the case of a SubsetSubject, there's no way to express it without this hack. -def DeclBase : AttrSubject; -def FunctionLike : SubsetSubject<DeclBase, - [{S->getFunctionType(false) != nullptr}]>; - -def OpenCLKernelFunction : SubsetSubject<Function, [{ - S->hasAttr<OpenCLKernelAttr>() -}]>; - -// HasFunctionProto is a more strict version of FunctionLike, so it should -// never be specified in a Subjects list along with FunctionLike (due to the -// inclusive nature of subject testing). -def HasFunctionProto : SubsetSubject<DeclBase, - [{(S->getFunctionType(true) != nullptr && - isa<FunctionProtoType>(S->getFunctionType())) || - isa<ObjCMethodDecl>(S) || - isa<BlockDecl>(S)}]>; - -// A single argument to an attribute -class Argument<string name, bit optional, bit fake = 0> { - string Name = name; - bit Optional = optional; - - /// A fake argument is used to store and serialize additional information - /// in an attribute without actually changing its parsing or pretty-printing. - bit Fake = fake; -} - -class BoolArgument<string name, bit opt = 0> : Argument<name, opt>; -class IdentifierArgument<string name, bit opt = 0> : Argument<name, opt>; -class IntArgument<string name, bit opt = 0> : Argument<name, opt>; -class StringArgument<string name, bit opt = 0> : Argument<name, opt>; -class ExprArgument<string name, bit opt = 0> : Argument<name, opt>; -class FunctionArgument<string name, bit opt = 0> : Argument<name, opt>; -class TypeArgument<string name, bit opt = 0> : Argument<name, opt>; -class UnsignedArgument<string name, bit opt = 0> : Argument<name, opt>; -class VariadicUnsignedArgument<string name> : Argument<name, 1>; -class VariadicExprArgument<string name> : Argument<name, 1>; -class VariadicStringArgument<string name> : Argument<name, 1>; - -// A version of the form major.minor[.subminor]. -class VersionArgument<string name, bit opt = 0> : Argument<name, opt>; - -// This one's a doozy, so it gets its own special type -// It can be an unsigned integer, or a type. Either can -// be dependent. -class AlignedArgument<string name, bit opt = 0> : Argument<name, opt>; - -// A bool argument with a default value -class DefaultBoolArgument<string name, bit default> : BoolArgument<name, 1> { - bit Default = default; -} - -// An integer argument with a default value -class DefaultIntArgument<string name, int default> : IntArgument<name, 1> { - int Default = default; -} - -// This argument is more complex, it includes the enumerator type name, -// a list of strings to accept, and a list of enumerators to map them to. -class EnumArgument<string name, string type, list<string> values, - list<string> enums, bit opt = 0, bit fake = 0> - : Argument<name, opt, fake> { - string Type = type; - list<string> Values = values; - list<string> Enums = enums; -} - -// FIXME: There should be a VariadicArgument type that takes any other type -// of argument and generates the appropriate type. -class VariadicEnumArgument<string name, string type, list<string> values, - list<string> enums> : Argument<name, 1> { - string Type = type; - list<string> Values = values; - list<string> Enums = enums; -} - -// This handles one spelling of an attribute. -class Spelling<string name, string variety> { - string Name = name; - string Variety = variety; - bit KnownToGCC; -} - -class GNU<string name> : Spelling<name, "GNU">; -class Declspec<string name> : Spelling<name, "Declspec">; -class CXX11<string namespace, string name, int version = 1> - : Spelling<name, "CXX11"> { - string Namespace = namespace; - int Version = version; -} -class Keyword<string name> : Spelling<name, "Keyword">; -class Pragma<string namespace, string name> : Spelling<name, "Pragma"> { - string Namespace = namespace; -} - -// The GCC spelling implies GNU<name, "GNU"> and CXX11<"gnu", name> and also -// sets KnownToGCC to 1. This spelling should be used for any GCC-compatible -// attributes. -class GCC<string name> : Spelling<name, "GCC"> { - let KnownToGCC = 1; -} - -class Accessor<string name, list<Spelling> spellings> { - string Name = name; - list<Spelling> Spellings = spellings; -} - -class SubjectDiag<bit warn> { - bit Warn = warn; -} -def WarnDiag : SubjectDiag<1>; -def ErrorDiag : SubjectDiag<0>; - -class SubjectList<list<AttrSubject> subjects, SubjectDiag diag = WarnDiag, - string customDiag = ""> { - list<AttrSubject> Subjects = subjects; - SubjectDiag Diag = diag; - string CustomDiag = customDiag; -} - -class LangOpt<string name, bit negated = 0> { - string Name = name; - bit Negated = negated; -} -def MicrosoftExt : LangOpt<"MicrosoftExt">; -def Borland : LangOpt<"Borland">; -def CUDA : LangOpt<"CUDA">; -def COnly : LangOpt<"CPlusPlus", 1>; - -// Defines targets for target-specific attributes. The list of strings should -// specify architectures for which the target applies, based off the ArchType -// enumeration in Triple.h. -class TargetArch<list<string> arches> { - list<string> Arches = arches; - list<string> OSes; - list<string> CXXABIs; -} -def TargetARM : TargetArch<["arm", "thumb"]>; -def TargetMips : TargetArch<["mips", "mipsel"]>; -def TargetMSP430 : TargetArch<["msp430"]>; -def TargetX86 : TargetArch<["x86"]>; -def TargetWindows : TargetArch<["x86", "x86_64", "arm", "thumb"]> { - let OSes = ["Win32"]; -} -def TargetMicrosoftCXXABI : TargetArch<["x86", "x86_64", "arm", "thumb"]> { - let CXXABIs = ["Microsoft"]; -} - -class Attr { - // The various ways in which an attribute can be spelled in source - list<Spelling> Spellings; - // The things to which an attribute can appertain - SubjectList Subjects; - // The arguments allowed on an attribute - list<Argument> Args = []; - // Accessors which should be generated for the attribute. - list<Accessor> Accessors = []; - // Set to true for attributes with arguments which require delayed parsing. - bit LateParsed = 0; - // Set to false to prevent an attribute from being propagated from a template - // to the instantiation. - bit Clone = 1; - // Set to true for attributes which must be instantiated within templates - bit TemplateDependent = 0; - // Set to true for attributes that have a corresponding AST node. - bit ASTNode = 1; - // Set to true for attributes which have handler in Sema. - bit SemaHandler = 1; - // Set to true for attributes that are completely ignored. - bit Ignored = 0; - // Set to true if the attribute's parsing does not match its semantic - // content. Eg) It parses 3 args, but semantically takes 4 args. Opts out of - // common attribute error checking. - bit HasCustomParsing = 0; - // Set to true if all of the attribute's arguments should be parsed in an - // unevaluated context. - bit ParseArgumentsAsUnevaluated = 0; - // Set to true if this attribute can be duplicated on a subject when merging - // attributes. By default, attributes are not merged. - bit DuplicatesAllowedWhileMerging = 0; - // Lists language options, one of which is required to be true for the - // attribute to be applicable. If empty, no language options are required. - list<LangOpt> LangOpts = []; - // Any additional text that should be included verbatim in the class. - // Note: Any additional data members will leak and should be constructed - // externally on the ASTContext. - code AdditionalMembers = [{}]; - // Any documentation that should be associated with the attribute. Since an - // attribute may be documented under multiple categories, more than one - // Documentation entry may be listed. - list<Documentation> Documentation; -} - -/// A type attribute is not processed on a declaration or a statement. -class TypeAttr : Attr { - // By default, type attributes do not get an AST node. - let ASTNode = 0; -} - -/// An inheritable attribute is inherited by later redeclarations. -class InheritableAttr : Attr; - -/// A target-specific attribute. This class is meant to be used as a mixin -/// with InheritableAttr or Attr depending on the attribute's needs. -class TargetSpecificAttr<TargetArch target> { - TargetArch Target = target; - // Attributes are generally required to have unique spellings for their names - // so that the parser can determine what kind of attribute it has parsed. - // However, target-specific attributes are special in that the attribute only - // "exists" for a given target. So two target-specific attributes can share - // the same name when they exist in different targets. To support this, a - // Kind can be explicitly specified for a target-specific attribute. This - // corresponds to the AttributeList::AT_* enum that is generated and it - // should contain a shared value between the attributes. - // - // Target-specific attributes which use this feature should ensure that the - // spellings match exactly betweeen the attributes, and if the arguments or - // subjects differ, should specify HasCustomParsing = 1 and implement their - // own parsing and semantic handling requirements as-needed. - string ParseKind; -} - -/// An inheritable parameter attribute is inherited by later -/// redeclarations, even when it's written on a parameter. -class InheritableParamAttr : InheritableAttr; - -/// An ignored attribute, which we parse but discard with no checking. -class IgnoredAttr : Attr { - let Ignored = 1; - let ASTNode = 0; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -// -// Attributes begin here -// - -def AddressSpace : TypeAttr { - let Spellings = [GNU<"address_space">]; - let Args = [IntArgument<"AddressSpace">]; - let Documentation = [Undocumented]; -} - -def Alias : Attr { - let Spellings = [GCC<"alias">]; - let Args = [StringArgument<"Aliasee">]; - let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag, - "ExpectedFunctionGlobalVarMethodOrProperty">; - let Documentation = [Undocumented]; -} - -def Aligned : InheritableAttr { - let Spellings = [GCC<"aligned">, Declspec<"align">, Keyword<"alignas">, - Keyword<"_Alignas">]; -// let Subjects = SubjectList<[NonBitField, NormalVar, Tag]>; - let Args = [AlignedArgument<"Alignment", 1>]; - let Accessors = [Accessor<"isGNU", [GCC<"aligned">]>, - Accessor<"isC11", [Keyword<"_Alignas">]>, - Accessor<"isAlignas", [Keyword<"alignas">, - Keyword<"_Alignas">]>, - Accessor<"isDeclspec",[Declspec<"align">]>]; - let Documentation = [Undocumented]; -} - -def AlignValue : Attr { - let Spellings = [ - // Unfortunately, this is semantically an assertion, not a directive - // (something else must ensure the alignment), so aligned_value is a - // probably a better name. We might want to add an aligned_value spelling in - // the future (and a corresponding C++ attribute), but this can be done - // later once we decide if we also want them to have slightly-different - // semantics than Intel's align_value. - GNU<"align_value"> - // Intel's compiler on Windows also supports: - // , Declspec<"align_value"> - ]; - let Args = [ExprArgument<"Alignment">]; - let Subjects = SubjectList<[Var, TypedefName], WarnDiag, - "ExpectedVariableOrTypedef">; - let Documentation = [AlignValueDocs]; -} - -def AlignMac68k : InheritableAttr { - // This attribute has no spellings as it is only ever created implicitly. - let Spellings = []; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def AlwaysInline : InheritableAttr { - let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def TLSModel : InheritableAttr { - let Spellings = [GCC<"tls_model">]; - let Subjects = SubjectList<[TLSVar], ErrorDiag, "ExpectedTLSVar">; - let Args = [StringArgument<"Model">]; - let Documentation = [TLSModelDocs]; -} - -def AnalyzerNoReturn : InheritableAttr { - let Spellings = [GNU<"analyzer_noreturn">]; - let Documentation = [Undocumented]; -} - -def Annotate : InheritableParamAttr { - let Spellings = [GNU<"annotate">]; - let Args = [StringArgument<"Annotation">]; - let Documentation = [Undocumented]; -} - -def ARMInterrupt : InheritableAttr, TargetSpecificAttr<TargetARM> { - // NOTE: If you add any additional spellings, MSP430Interrupt's and - // MipsInterrupt's spellings must match. - let Spellings = [GNU<"interrupt">]; - let Args = [EnumArgument<"Interrupt", "InterruptType", - ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", ""], - ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", "Generic"], - 1>]; - let ParseKind = "Interrupt"; - let HasCustomParsing = 1; - let Documentation = [ARMInterruptDocs]; -} - -def AsmLabel : InheritableAttr { - let Spellings = [Keyword<"asm">, Keyword<"__asm__">]; - let Args = [StringArgument<"Label">]; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def Availability : InheritableAttr { - let Spellings = [GNU<"availability">]; - let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">, - VersionArgument<"deprecated">, VersionArgument<"obsoleted">, - BoolArgument<"unavailable">, StringArgument<"message">]; - let AdditionalMembers = -[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) { - return llvm::StringSwitch<llvm::StringRef>(Platform) - .Case("android", "Android") - .Case("ios", "iOS") - .Case("macosx", "OS X") - .Case("tvos", "tvOS") - .Case("watchos", "watchOS") - .Case("ios_app_extension", "iOS (App Extension)") - .Case("macosx_app_extension", "OS X (App Extension)") - .Case("tvos_app_extension", "tvOS (App Extension)") - .Case("watchos_app_extension", "watchOS (App Extension)") - .Default(llvm::StringRef()); -} }]; - let HasCustomParsing = 1; - let DuplicatesAllowedWhileMerging = 1; -// let Subjects = SubjectList<[Named]>; - let Documentation = [AvailabilityDocs]; -} - -def Blocks : InheritableAttr { - let Spellings = [GNU<"blocks">]; - let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>]; - let Documentation = [Undocumented]; -} - -def Bounded : IgnoredAttr { - let Spellings = [GNU<"bounded">]; -} - -def CarriesDependency : InheritableParamAttr { - let Spellings = [GNU<"carries_dependency">, - CXX11<"","carries_dependency", 200809>]; - let Subjects = SubjectList<[ParmVar, ObjCMethod, Function], ErrorDiag>; - let Documentation = [CarriesDependencyDocs]; -} - -def CDecl : InheritableAttr { - let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; -} - -// cf_audited_transfer indicates that the given function has been -// audited and has been marked with the appropriate cf_consumed and -// cf_returns_retained attributes. It is generally applied by -// '#pragma clang arc_cf_code_audited' rather than explicitly. -def CFAuditedTransfer : InheritableAttr { - let Spellings = [GNU<"cf_audited_transfer">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -// cf_unknown_transfer is an explicit opt-out of cf_audited_transfer. -// It indicates that the function has unknown or unautomatable -// transfer semantics. -def CFUnknownTransfer : InheritableAttr { - let Spellings = [GNU<"cf_unknown_transfer">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def CFReturnsRetained : InheritableAttr { - let Spellings = [GNU<"cf_returns_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; - let Documentation = [Undocumented]; -} - -def CFReturnsNotRetained : InheritableAttr { - let Spellings = [GNU<"cf_returns_not_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; - let Documentation = [Undocumented]; -} - -def CFConsumed : InheritableParamAttr { - let Spellings = [GNU<"cf_consumed">]; - let Subjects = SubjectList<[ParmVar]>; - let Documentation = [Undocumented]; -} - -def Cleanup : InheritableAttr { - let Spellings = [GCC<"cleanup">]; - let Args = [FunctionArgument<"FunctionDecl">]; - let Subjects = SubjectList<[Var]>; - let Documentation = [Undocumented]; -} - -def Cold : InheritableAttr { - let Spellings = [GCC<"cold">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def Common : InheritableAttr { - let Spellings = [GCC<"common">]; - let Subjects = SubjectList<[Var]>; - let Documentation = [Undocumented]; -} - -def Const : InheritableAttr { - let Spellings = [GCC<"const">, GCC<"__const">]; - let Documentation = [Undocumented]; -} - -def Constructor : InheritableAttr { - let Spellings = [GCC<"constructor">]; - let Args = [DefaultIntArgument<"Priority", 65535>]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def CUDAConstant : InheritableAttr { - let Spellings = [GNU<"constant">]; - let Subjects = SubjectList<[Var]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def CUDACudartBuiltin : IgnoredAttr { - let Spellings = [GNU<"cudart_builtin">]; - let LangOpts = [CUDA]; -} - -def CUDADevice : InheritableAttr { - let Spellings = [GNU<"device">]; - let Subjects = SubjectList<[Function, Var]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def CUDADeviceBuiltin : IgnoredAttr { - let Spellings = [GNU<"device_builtin">]; - let LangOpts = [CUDA]; -} - -def CUDADeviceBuiltinSurfaceType : IgnoredAttr { - let Spellings = [GNU<"device_builtin_surface_type">]; - let LangOpts = [CUDA]; -} - -def CUDADeviceBuiltinTextureType : IgnoredAttr { - let Spellings = [GNU<"device_builtin_texture_type">]; - let LangOpts = [CUDA]; -} - -def CUDAGlobal : InheritableAttr { - let Spellings = [GNU<"global">]; - let Subjects = SubjectList<[Function]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def CUDAHost : InheritableAttr { - let Spellings = [GNU<"host">]; - let Subjects = SubjectList<[Function]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def CUDAInvalidTarget : InheritableAttr { - let Spellings = []; - let Subjects = SubjectList<[Function]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def CUDALaunchBounds : InheritableAttr { - let Spellings = [GNU<"launch_bounds">]; - let Args = [ExprArgument<"MaxThreads">, ExprArgument<"MinBlocks", 1>]; - let LangOpts = [CUDA]; - let Subjects = SubjectList<[ObjCMethod, FunctionLike], WarnDiag, - "ExpectedFunctionOrMethod">; - // An AST node is created for this attribute, but is not used by other parts - // of the compiler. However, this node needs to exist in the AST because - // non-LLVM backends may be relying on the attribute's presence. - let Documentation = [Undocumented]; -} - -def CUDAShared : InheritableAttr { - let Spellings = [GNU<"shared">]; - let Subjects = SubjectList<[Var]>; - let LangOpts = [CUDA]; - let Documentation = [Undocumented]; -} - -def C11NoReturn : InheritableAttr { - let Spellings = [Keyword<"_Noreturn">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let SemaHandler = 0; - let Documentation = [C11NoReturnDocs]; -} - -def CXX11NoReturn : InheritableAttr { - let Spellings = [CXX11<"","noreturn", 200809>]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [CXX11NoReturnDocs]; -} - -def OpenCLKernel : InheritableAttr { - let Spellings = [Keyword<"__kernel">, Keyword<"kernel">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -// This attribute is both a type attribute, and a declaration attribute (for -// parameter variables). -def OpenCLImageAccess : Attr { - let Spellings = [Keyword<"__read_only">, Keyword<"read_only">, - Keyword<"__write_only">, Keyword<"write_only">, - Keyword<"__read_write">, Keyword<"read_write">]; - let Subjects = SubjectList<[ParmVar], ErrorDiag>; - let Accessors = [Accessor<"isReadOnly", [Keyword<"__read_only">, - Keyword<"read_only">]>, - Accessor<"isReadWrite", [Keyword<"__read_write">, - Keyword<"read_write">]>, - Accessor<"isWriteOnly", [Keyword<"__write_only">, - Keyword<"write_only">]>]; - let Documentation = [Undocumented]; -} - -def OpenCLPrivateAddressSpace : TypeAttr { - let Spellings = [Keyword<"__private">, Keyword<"private">]; - let Documentation = [OpenCLAddressSpacePrivateDocs]; -} - -def OpenCLGlobalAddressSpace : TypeAttr { - let Spellings = [Keyword<"__global">, Keyword<"global">]; - let Documentation = [OpenCLAddressSpaceGlobalDocs]; -} - -def OpenCLLocalAddressSpace : TypeAttr { - let Spellings = [Keyword<"__local">, Keyword<"local">]; - let Documentation = [OpenCLAddressSpaceLocalDocs]; -} - -def OpenCLConstantAddressSpace : TypeAttr { - let Spellings = [Keyword<"__constant">, Keyword<"constant">]; - let Documentation = [OpenCLAddressSpaceConstantDocs]; -} - -def OpenCLGenericAddressSpace : TypeAttr { - let Spellings = [Keyword<"__generic">, Keyword<"generic">]; - let Documentation = [OpenCLAddressSpaceGenericDocs]; -} - -def Deprecated : InheritableAttr { - let Spellings = [GCC<"deprecated">, Declspec<"deprecated">, - CXX11<"","deprecated", 201309>]; - let Args = [StringArgument<"Message", 1>]; - let Documentation = [Undocumented]; -} - -def Destructor : InheritableAttr { - let Spellings = [GCC<"destructor">]; - let Args = [DefaultIntArgument<"Priority", 65535>]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def EnableIf : InheritableAttr { - let Spellings = [GNU<"enable_if">]; - let Subjects = SubjectList<[Function]>; - let Args = [ExprArgument<"Cond">, StringArgument<"Message">]; - let TemplateDependent = 1; - let Documentation = [EnableIfDocs]; -} - -def ExtVectorType : Attr { - let Spellings = [GNU<"ext_vector_type">]; - let Subjects = SubjectList<[TypedefName], ErrorDiag>; - let Args = [ExprArgument<"NumElements">]; - let ASTNode = 0; - let Documentation = [Undocumented]; -} - -def FallThrough : Attr { - let Spellings = [CXX11<"clang", "fallthrough">]; -// let Subjects = [NullStmt]; - let Documentation = [FallthroughDocs]; -} - -def FastCall : InheritableAttr { - let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">, - Keyword<"_fastcall">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [FastCallDocs]; -} - -def Final : InheritableAttr { - let Spellings = [Keyword<"final">, Keyword<"sealed">]; - let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>]; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def MinSize : InheritableAttr { - let Spellings = [GNU<"minsize">]; - let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def FlagEnum : InheritableAttr { - let Spellings = [GNU<"flag_enum">]; - let Subjects = SubjectList<[Enum]>; - let Documentation = [FlagEnumDocs]; - let LangOpts = [COnly]; -} - -def Flatten : InheritableAttr { - let Spellings = [GCC<"flatten">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [FlattenDocs]; -} - -def Format : InheritableAttr { - let Spellings = [GCC<"format">]; - let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">, - IntArgument<"FirstArg">]; - let Subjects = SubjectList<[ObjCMethod, Block, HasFunctionProto], WarnDiag, - "ExpectedFunctionWithProtoType">; - let Documentation = [FormatDocs]; -} - -def FormatArg : InheritableAttr { - let Spellings = [GCC<"format_arg">]; - let Args = [IntArgument<"FormatIdx">]; - let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag, - "ExpectedFunctionWithProtoType">; - let Documentation = [Undocumented]; -} - -def GNUInline : InheritableAttr { - let Spellings = [GCC<"gnu_inline">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def Hot : InheritableAttr { - let Spellings = [GCC<"hot">]; - let Subjects = SubjectList<[Function]>; - // An AST node is created for this attribute, but not actually used beyond - // semantic checking for mutual exclusion with the Cold attribute. - let Documentation = [Undocumented]; -} - -def IBAction : InheritableAttr { - let Spellings = [GNU<"ibaction">]; - let Subjects = SubjectList<[ObjCInstanceMethod], WarnDiag, - "ExpectedObjCInstanceMethod">; - // An AST node is created for this attribute, but is not used by other parts - // of the compiler. However, this node needs to exist in the AST because - // external tools rely on it. - let Documentation = [Undocumented]; -} - -def IBOutlet : InheritableAttr { - let Spellings = [GNU<"iboutlet">]; -// let Subjects = [ObjCIvar, ObjCProperty]; - let Documentation = [Undocumented]; -} - -def IBOutletCollection : InheritableAttr { - let Spellings = [GNU<"iboutletcollection">]; - let Args = [TypeArgument<"Interface", 1>]; -// let Subjects = [ObjCIvar, ObjCProperty]; - let Documentation = [Undocumented]; -} - -def Restrict : InheritableAttr { - let Spellings = [Declspec<"restrict">, GCC<"malloc">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def MaxFieldAlignment : InheritableAttr { - // This attribute has no spellings as it is only ever created implicitly. - let Spellings = []; - let Args = [UnsignedArgument<"Alignment">]; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def MayAlias : InheritableAttr { - // FIXME: this is a type attribute in GCC, but a declaration attribute here. - let Spellings = [GCC<"may_alias">]; - let Documentation = [Undocumented]; -} - -def MSABI : InheritableAttr { - let Spellings = [GCC<"ms_abi">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [MSABIDocs]; -} - -def MSP430Interrupt : InheritableAttr, TargetSpecificAttr<TargetMSP430> { - // NOTE: If you add any additional spellings, ARMInterrupt's and - // MipsInterrupt's spellings must match. - let Spellings = [GNU<"interrupt">]; - let Args = [UnsignedArgument<"Number">]; - let ParseKind = "Interrupt"; - let HasCustomParsing = 1; - let Documentation = [Undocumented]; -} - -def Mips16 : InheritableAttr, TargetSpecificAttr<TargetMips> { - let Spellings = [GCC<"mips16">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def MipsInterrupt : InheritableAttr, TargetSpecificAttr<TargetMips> { - // NOTE: If you add any additional spellings, ARMInterrupt's and - // MSP430Interrupt's spellings must match. - let Spellings = [GNU<"interrupt">]; - let Subjects = SubjectList<[Function]>; - let Args = [EnumArgument<"Interrupt", "InterruptType", - ["vector=sw0", "vector=sw1", "vector=hw0", - "vector=hw1", "vector=hw2", "vector=hw3", - "vector=hw4", "vector=hw5", "eic", ""], - ["sw0", "sw1", "hw0", "hw1", "hw2", "hw3", - "hw4", "hw5", "eic", "eic"] - >]; - let ParseKind = "Interrupt"; - let Documentation = [MipsInterruptDocs]; -} - -def Mode : Attr { - let Spellings = [GCC<"mode">]; - let Args = [IdentifierArgument<"Mode">]; - let Documentation = [Undocumented]; -} - -def Naked : InheritableAttr { - let Spellings = [GCC<"naked">, Declspec<"naked">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def NeonPolyVectorType : TypeAttr { - let Spellings = [GNU<"neon_polyvector_type">]; - let Args = [IntArgument<"NumElements">]; - let Documentation = [Undocumented]; -} - -def NeonVectorType : TypeAttr { - let Spellings = [GNU<"neon_vector_type">]; - let Args = [IntArgument<"NumElements">]; - let Documentation = [Undocumented]; -} - -def ReturnsTwice : InheritableAttr { - let Spellings = [GCC<"returns_twice">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def DisableTailCalls : InheritableAttr { - let Spellings = [GNU<"disable_tail_calls">, - CXX11<"clang", "disable_tail_calls">]; - let Subjects = SubjectList<[Function, ObjCMethod]>; - let Documentation = [DisableTailCallsDocs]; -} - -def NoAlias : InheritableAttr { - let Spellings = [Declspec<"noalias">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [NoAliasDocs]; -} - -def NoCommon : InheritableAttr { - let Spellings = [GCC<"nocommon">]; - let Subjects = SubjectList<[Var]>; - let Documentation = [Undocumented]; -} - -def NoDebug : InheritableAttr { - let Spellings = [GCC<"nodebug">]; - let Documentation = [Undocumented]; -} - -def NoDuplicate : InheritableAttr { - let Spellings = [GNU<"noduplicate">, CXX11<"clang", "noduplicate">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [NoDuplicateDocs]; -} - -def NoInline : InheritableAttr { - let Spellings = [GCC<"noinline">, Declspec<"noinline">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def NoMips16 : InheritableAttr, TargetSpecificAttr<TargetMips> { - let Spellings = [GCC<"nomips16">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -// This is not a TargetSpecificAttr so that is silently accepted and -// ignored on other targets as encouraged by the OpenCL spec. -// -// See OpenCL 1.2 6.11.5: "It is our intention that a particular -// implementation of OpenCL be free to ignore all attributes and the -// resulting executable binary will produce the same result." -// -// However, only AMD GPU targets will emit the corresponding IR -// attribute. -// -// FIXME: This provides a sub-optimal error message if you attempt to -// use this in CUDA, since CUDA does not use the same terminology. -def AMDGPUNumVGPR : InheritableAttr { - let Spellings = [GNU<"amdgpu_num_vgpr">]; - let Args = [UnsignedArgument<"NumVGPR">]; - let Documentation = [AMDGPUNumVGPRDocs]; - -// FIXME: This should be for OpenCLKernelFunction, but is not to -// workaround needing to see kernel attribute before others to know if -// this should be rejected on non-kernels. - let Subjects = SubjectList<[Function], ErrorDiag, - "ExpectedKernelFunction">; -} - -def AMDGPUNumSGPR : InheritableAttr { - let Spellings = [GNU<"amdgpu_num_sgpr">]; - let Args = [UnsignedArgument<"NumSGPR">]; - let Documentation = [AMDGPUNumSGPRDocs]; - let Subjects = SubjectList<[Function], ErrorDiag, - "ExpectedKernelFunction">; -} - -def NoSplitStack : InheritableAttr { - let Spellings = [GCC<"no_split_stack">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [NoSplitStackDocs]; -} - -def NonNull : InheritableAttr { - let Spellings = [GCC<"nonnull">]; - let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag, - "ExpectedFunctionMethodOrParameter">; - let Args = [VariadicUnsignedArgument<"Args">]; - let AdditionalMembers = -[{bool isNonNull(unsigned idx) const { - if (!args_size()) - return true; - for (const auto &V : args()) - if (V == idx) - return true; - return false; - } }]; - // FIXME: We should merge duplicates into a single nonnull attribute. - let DuplicatesAllowedWhileMerging = 1; - let Documentation = [NonNullDocs]; -} - -def ReturnsNonNull : InheritableAttr { - let Spellings = [GCC<"returns_nonnull">]; - let Subjects = SubjectList<[ObjCMethod, Function], WarnDiag, - "ExpectedFunctionOrMethod">; - let Documentation = [ReturnsNonNullDocs]; -} - -// pass_object_size(N) indicates that the parameter should have -// __builtin_object_size with Type=N evaluated on the parameter at the callsite. -def PassObjectSize : InheritableParamAttr { - let Spellings = [GNU<"pass_object_size">]; - let Args = [IntArgument<"Type">]; - let Subjects = SubjectList<[ParmVar]>; - let Documentation = [PassObjectSizeDocs]; -} - -// Nullability type attributes. -def TypeNonNull : TypeAttr { - let Spellings = [Keyword<"_Nonnull">]; - let Documentation = [TypeNonNullDocs]; -} - -def TypeNullable : TypeAttr { - let Spellings = [Keyword<"_Nullable">]; - let Documentation = [TypeNullableDocs]; -} - -def TypeNullUnspecified : TypeAttr { - let Spellings = [Keyword<"_Null_unspecified">]; - let Documentation = [TypeNullUnspecifiedDocs]; -} - -def ObjCKindOf : TypeAttr { - let Spellings = [Keyword<"__kindof">]; - let Documentation = [Undocumented]; -} - -def AssumeAligned : InheritableAttr { - let Spellings = [GCC<"assume_aligned">]; - let Subjects = SubjectList<[ObjCMethod, Function]>; - let Args = [ExprArgument<"Alignment">, ExprArgument<"Offset", 1>]; - let Documentation = [AssumeAlignedDocs]; -} - -def NoReturn : InheritableAttr { - let Spellings = [GCC<"noreturn">, Declspec<"noreturn">]; - // FIXME: Does GCC allow this on the function instead? - let Documentation = [Undocumented]; -} - -def NoInstrumentFunction : InheritableAttr { - let Spellings = [GCC<"no_instrument_function">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def NotTailCalled : InheritableAttr { - let Spellings = [GNU<"not_tail_called">, CXX11<"clang", "not_tail_called">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [NotTailCalledDocs]; -} - -def NoThrow : InheritableAttr { - let Spellings = [GCC<"nothrow">, Declspec<"nothrow">]; - let Documentation = [Undocumented]; -} - -def NvWeak : IgnoredAttr { - let Spellings = [GNU<"nv_weak">]; - let LangOpts = [CUDA]; -} - -def ObjCBridge : InheritableAttr { - let Spellings = [GNU<"objc_bridge">]; - let Subjects = SubjectList<[Record, TypedefName], ErrorDiag, - "ExpectedStructOrUnionOrTypedef">; - let Args = [IdentifierArgument<"BridgedType">]; - let Documentation = [Undocumented]; -} - -def ObjCBridgeMutable : InheritableAttr { - let Spellings = [GNU<"objc_bridge_mutable">]; - let Subjects = SubjectList<[Record], ErrorDiag>; - let Args = [IdentifierArgument<"BridgedType">]; - let Documentation = [Undocumented]; -} - -def ObjCBridgeRelated : InheritableAttr { - let Spellings = [GNU<"objc_bridge_related">]; - let Subjects = SubjectList<[Record], ErrorDiag>; - let Args = [IdentifierArgument<"RelatedClass">, - IdentifierArgument<"ClassMethod", 1>, - IdentifierArgument<"InstanceMethod", 1>]; - let HasCustomParsing = 1; - let Documentation = [Undocumented]; -} - -def NSReturnsRetained : InheritableAttr { - let Spellings = [GNU<"ns_returns_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; - let Documentation = [Undocumented]; -} - -def NSReturnsNotRetained : InheritableAttr { - let Spellings = [GNU<"ns_returns_not_retained">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; - let Documentation = [Undocumented]; -} - -def NSReturnsAutoreleased : InheritableAttr { - let Spellings = [GNU<"ns_returns_autoreleased">]; -// let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; - let Documentation = [Undocumented]; -} - -def NSConsumesSelf : InheritableAttr { - let Spellings = [GNU<"ns_consumes_self">]; - let Subjects = SubjectList<[ObjCMethod]>; - let Documentation = [Undocumented]; -} - -def NSConsumed : InheritableParamAttr { - let Spellings = [GNU<"ns_consumed">]; - let Subjects = SubjectList<[ParmVar]>; - let Documentation = [Undocumented]; -} - -def ObjCException : InheritableAttr { - let Spellings = [GNU<"objc_exception">]; - let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCMethodFamily : InheritableAttr { - let Spellings = [GNU<"objc_method_family">]; - let Subjects = SubjectList<[ObjCMethod], ErrorDiag>; - let Args = [EnumArgument<"Family", "FamilyKind", - ["none", "alloc", "copy", "init", "mutableCopy", "new"], - ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init", - "OMF_mutableCopy", "OMF_new"]>]; - let Documentation = [ObjCMethodFamilyDocs]; -} - -def ObjCNSObject : InheritableAttr { - let Spellings = [GNU<"NSObject">]; - let Documentation = [Undocumented]; -} - -def ObjCIndependentClass : InheritableAttr { - let Spellings = [GNU<"objc_independent_class">]; - let Documentation = [Undocumented]; -} - -def ObjCPreciseLifetime : InheritableAttr { - let Spellings = [GNU<"objc_precise_lifetime">]; - let Subjects = SubjectList<[Var], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCReturnsInnerPointer : InheritableAttr { - let Spellings = [GNU<"objc_returns_inner_pointer">]; - let Subjects = SubjectList<[ObjCMethod, ObjCProperty], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCRequiresSuper : InheritableAttr { - let Spellings = [GNU<"objc_requires_super">]; - let Subjects = SubjectList<[ObjCMethod], ErrorDiag>; - let Documentation = [ObjCRequiresSuperDocs]; -} - -def ObjCRootClass : InheritableAttr { - let Spellings = [GNU<"objc_root_class">]; - let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCExplicitProtocolImpl : InheritableAttr { - let Spellings = [GNU<"objc_protocol_requires_explicit_implementation">]; - let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCDesignatedInitializer : Attr { - let Spellings = [GNU<"objc_designated_initializer">]; - let Subjects = SubjectList<[ObjCInterfaceDeclInitMethod], ErrorDiag, - "ExpectedObjCInterfaceDeclInitMethod">; - let Documentation = [Undocumented]; -} - -def ObjCRuntimeName : Attr { - let Spellings = [GNU<"objc_runtime_name">]; - let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag>; - let Args = [StringArgument<"MetadataName">]; - let Documentation = [ObjCRuntimeNameDocs]; -} - -def ObjCBoxable : Attr { - let Spellings = [GNU<"objc_boxable">]; - let Subjects = SubjectList<[Record], ErrorDiag, "ExpectedStructOrUnion">; - let Documentation = [ObjCBoxableDocs]; -} - -def OptimizeNone : InheritableAttr { - let Spellings = [GNU<"optnone">, CXX11<"clang", "optnone">]; - let Subjects = SubjectList<[Function, ObjCMethod]>; - let Documentation = [OptnoneDocs]; -} - -def Overloadable : Attr { - let Spellings = [GNU<"overloadable">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [OverloadableDocs]; -} - -def Override : InheritableAttr { - let Spellings = [Keyword<"override">]; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def Ownership : InheritableAttr { - let Spellings = [GNU<"ownership_holds">, GNU<"ownership_returns">, - GNU<"ownership_takes">]; - let Accessors = [Accessor<"isHolds", [GNU<"ownership_holds">]>, - Accessor<"isReturns", [GNU<"ownership_returns">]>, - Accessor<"isTakes", [GNU<"ownership_takes">]>]; - let AdditionalMembers = [{ - enum OwnershipKind { Holds, Returns, Takes }; - OwnershipKind getOwnKind() const { - return isHolds() ? Holds : - isTakes() ? Takes : - Returns; - } - }]; - let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">]; - let Subjects = SubjectList<[HasFunctionProto], WarnDiag, - "ExpectedFunctionWithProtoType">; - let Documentation = [Undocumented]; -} - -def Packed : InheritableAttr { - let Spellings = [GCC<"packed">]; -// let Subjects = [Tag, Field]; - let Documentation = [Undocumented]; -} - -def IntelOclBicc : InheritableAttr { - let Spellings = [GNU<"intel_ocl_bicc">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; -} - -def Pcs : InheritableAttr { - let Spellings = [GCC<"pcs">]; - let Args = [EnumArgument<"PCS", "PCSType", - ["aapcs", "aapcs-vfp"], - ["AAPCS", "AAPCS_VFP"]>]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [PcsDocs]; -} - -def Pure : InheritableAttr { - let Spellings = [GCC<"pure">]; - let Documentation = [Undocumented]; -} - -def Regparm : TypeAttr { - let Spellings = [GCC<"regparm">]; - let Args = [UnsignedArgument<"NumParams">]; - let Documentation = [RegparmDocs]; -} - -def ReqdWorkGroupSize : InheritableAttr { - let Spellings = [GNU<"reqd_work_group_size">]; - let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">, - UnsignedArgument<"ZDim">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def WorkGroupSizeHint : InheritableAttr { - let Spellings = [GNU<"work_group_size_hint">]; - let Args = [UnsignedArgument<"XDim">, - UnsignedArgument<"YDim">, - UnsignedArgument<"ZDim">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def InitPriority : InheritableAttr { - let Spellings = [GNU<"init_priority">]; - let Args = [UnsignedArgument<"Priority">]; - let Subjects = SubjectList<[Var], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def Section : InheritableAttr { - let Spellings = [GCC<"section">, Declspec<"allocate">]; - let Args = [StringArgument<"Name">]; - let Subjects = SubjectList<[Function, GlobalVar, - ObjCMethod, ObjCProperty], ErrorDiag, - "ExpectedFunctionGlobalVarMethodOrProperty">; - let Documentation = [SectionDocs]; -} - -def Sentinel : InheritableAttr { - let Spellings = [GCC<"sentinel">]; - let Args = [DefaultIntArgument<"Sentinel", 0>, - DefaultIntArgument<"NullPos", 0>]; -// let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>; - let Documentation = [Undocumented]; -} - -def StdCall : InheritableAttr { - let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [StdCallDocs]; -} - -def SysVABI : InheritableAttr { - let Spellings = [GCC<"sysv_abi">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; -} - -def ThisCall : InheritableAttr { - let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">, - Keyword<"_thiscall">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [ThisCallDocs]; -} - -def VectorCall : InheritableAttr { - let Spellings = [GNU<"vectorcall">, Keyword<"__vectorcall">, - Keyword<"_vectorcall">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [VectorCallDocs]; -} - -def Pascal : InheritableAttr { - let Spellings = [GNU<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">]; -// let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; -} - -def Target : InheritableAttr { - let Spellings = [GCC<"target">]; - let Args = [StringArgument<"featuresStr">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [TargetDocs]; - let AdditionalMembers = [{ - typedef std::pair<std::vector<std::string>, StringRef> ParsedTargetAttr; - ParsedTargetAttr parse() const { - ParsedTargetAttr Ret; - SmallVector<StringRef, 1> AttrFeatures; - getFeaturesStr().split(AttrFeatures, ","); - - // Grab the various features and prepend a "+" to turn on the feature to - // the backend and add them to our existing set of features. - for (auto &Feature : AttrFeatures) { - // Go ahead and trim whitespace rather than either erroring or - // accepting it weirdly. - Feature = Feature.trim(); - - // We don't support cpu tuning this way currently. - // TODO: Support the fpmath option. It will require checking - // overall feature validity for the function with the rest of the - // attributes on the function. - if (Feature.startswith("fpmath=") || Feature.startswith("tune=")) - continue; - - // While we're here iterating check for a different target cpu. - if (Feature.startswith("arch=")) - Ret.second = Feature.split("=").second.trim(); - else if (Feature.startswith("no-")) - Ret.first.push_back("-" + Feature.split("-").second.str()); - else - Ret.first.push_back("+" + Feature.str()); - } - return Ret; - } - }]; -} - -def TransparentUnion : InheritableAttr { - let Spellings = [GCC<"transparent_union">]; -// let Subjects = SubjectList<[Record, TypedefName]>; - let Documentation = [Undocumented]; -} - -def Unavailable : InheritableAttr { - let Spellings = [GNU<"unavailable">]; - let Args = [StringArgument<"Message", 1>, - EnumArgument<"ImplicitReason", "ImplicitReason", - ["", "", "", ""], - ["IR_None", - "IR_ARCForbiddenType", - "IR_ForbiddenWeak", - "IR_ARCForbiddenConversion", - "IR_ARCInitReturnsUnrelated", - "IR_ARCFieldWithOwnership"], 1, /*fake*/ 1>]; - let Documentation = [Undocumented]; -} - -def ArcWeakrefUnavailable : InheritableAttr { - let Spellings = [GNU<"objc_arc_weak_reference_unavailable">]; - let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def ObjCGC : TypeAttr { - let Spellings = [GNU<"objc_gc">]; - let Args = [IdentifierArgument<"Kind">]; - let Documentation = [Undocumented]; -} - -def ObjCOwnership : InheritableAttr { - let Spellings = [GNU<"objc_ownership">]; - let Args = [IdentifierArgument<"Kind">]; - let ASTNode = 0; - let Documentation = [Undocumented]; -} - -def ObjCRequiresPropertyDefs : InheritableAttr { - let Spellings = [GNU<"objc_requires_property_definitions">]; - let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def Unused : InheritableAttr { - let Spellings = [GCC<"unused">]; - let Subjects = SubjectList<[Var, ObjCIvar, Type, Label, Field, ObjCMethod, - FunctionLike], WarnDiag, - "ExpectedVariableFunctionOrLabel">; - let Documentation = [Undocumented]; -} - -def Used : InheritableAttr { - let Spellings = [GCC<"used">]; - let Documentation = [Undocumented]; -} - -def Uuid : InheritableAttr { - let Spellings = [Declspec<"uuid">]; - let Args = [StringArgument<"Guid">]; -// let Subjects = SubjectList<[CXXRecord]>; - let LangOpts = [MicrosoftExt, Borland]; - let Documentation = [Undocumented]; -} - -def VectorSize : TypeAttr { - let Spellings = [GCC<"vector_size">]; - let Args = [ExprArgument<"NumBytes">]; - let Documentation = [Undocumented]; -} - -def VecTypeHint : InheritableAttr { - let Spellings = [GNU<"vec_type_hint">]; - let Args = [TypeArgument<"TypeHint">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def Visibility : InheritableAttr { - let Clone = 0; - let Spellings = [GCC<"visibility">]; - let Args = [EnumArgument<"Visibility", "VisibilityType", - ["default", "hidden", "internal", "protected"], - ["Default", "Hidden", "Hidden", "Protected"]>]; - let Documentation = [Undocumented]; -} - -def TypeVisibility : InheritableAttr { - let Clone = 0; - let Spellings = [GNU<"type_visibility">, CXX11<"clang", "type_visibility">]; - let Args = [EnumArgument<"Visibility", "VisibilityType", - ["default", "hidden", "internal", "protected"], - ["Default", "Hidden", "Hidden", "Protected"]>]; -// let Subjects = [Tag, ObjCInterface, Namespace]; - let Documentation = [Undocumented]; -} - -def VecReturn : InheritableAttr { - let Spellings = [GNU<"vecreturn">]; - let Subjects = SubjectList<[CXXRecord], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def WarnUnused : InheritableAttr { - let Spellings = [GNU<"warn_unused">]; - let Subjects = SubjectList<[Record]>; - let Documentation = [Undocumented]; -} - -def WarnUnusedResult : InheritableAttr { - let Spellings = [GCC<"warn_unused_result">, - CXX11<"clang", "warn_unused_result">]; - let Subjects = SubjectList<[ObjCMethod, CXXRecord, FunctionLike], WarnDiag, - "ExpectedFunctionMethodOrClass">; - let Documentation = [Undocumented]; -} - -def Weak : InheritableAttr { - let Spellings = [GCC<"weak">]; - let Subjects = SubjectList<[Var, Function, CXXRecord]>; - let Documentation = [Undocumented]; -} - -def WeakImport : InheritableAttr { - let Spellings = [GNU<"weak_import">]; - let Documentation = [Undocumented]; -} - -def WeakRef : InheritableAttr { - let Spellings = [GCC<"weakref">]; - // A WeakRef that has an argument is treated as being an AliasAttr - let Args = [StringArgument<"Aliasee", 1>]; - let Subjects = SubjectList<[Var, Function], ErrorDiag>; - let Documentation = [Undocumented]; -} - -def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr<TargetX86> { - let Spellings = [GNU<"force_align_arg_pointer">]; - // Technically, this appertains to a FunctionDecl, but the target-specific - // code silently allows anything function-like (such as typedefs or function - // pointers), but does not apply the attribute to them. - let Documentation = [Undocumented]; -} - -def NoSanitize : InheritableAttr { - let Spellings = [GNU<"no_sanitize">, CXX11<"clang", "no_sanitize">]; - let Args = [VariadicStringArgument<"Sanitizers">]; - let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>; - let Documentation = [NoSanitizeDocs]; - let AdditionalMembers = [{ - SanitizerMask getMask() const { - SanitizerMask Mask = 0; - for (auto SanitizerName : sanitizers()) { - SanitizerMask ParsedMask = - parseSanitizerValue(SanitizerName, /*AllowGroups=*/true); - Mask |= expandSanitizerGroups(ParsedMask); - } - return Mask; - } - }]; -} - -// Attributes to disable a specific sanitizer. No new sanitizers should be added -// to this list; the no_sanitize attribute should be extended instead. -def NoSanitizeSpecific : InheritableAttr { - let Spellings = [GCC<"no_address_safety_analysis">, - GCC<"no_sanitize_address">, - GCC<"no_sanitize_thread">, - GNU<"no_sanitize_memory">]; - let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs, - NoSanitizeMemoryDocs]; - let ASTNode = 0; -} - -// C/C++ Thread safety attributes (e.g. for deadlock, data race checking) - -def GuardedVar : InheritableAttr { - let Spellings = [GNU<"guarded_var">]; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def PtGuardedVar : InheritableAttr { - let Spellings = [GNU<"pt_guarded_var">]; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def Lockable : InheritableAttr { - let Spellings = [GNU<"lockable">]; - let Subjects = SubjectList<[Record]>; - let Documentation = [Undocumented]; - let ASTNode = 0; // Replaced by Capability -} - -def ScopedLockable : InheritableAttr { - let Spellings = [GNU<"scoped_lockable">]; - let Subjects = SubjectList<[Record]>; - let Documentation = [Undocumented]; -} - -def Capability : InheritableAttr { - let Spellings = [GNU<"capability">, CXX11<"clang", "capability">, - GNU<"shared_capability">, - CXX11<"clang", "shared_capability">]; - let Subjects = SubjectList<[Record, TypedefName], ErrorDiag, - "ExpectedStructOrUnionOrTypedef">; - let Args = [StringArgument<"Name">]; - let Accessors = [Accessor<"isShared", - [GNU<"shared_capability">, - CXX11<"clang","shared_capability">]>]; - let Documentation = [Undocumented]; - let AdditionalMembers = [{ - bool isMutex() const { return getName().equals_lower("mutex"); } - bool isRole() const { return getName().equals_lower("role"); } - }]; -} - -def AssertCapability : InheritableAttr { - let Spellings = [GNU<"assert_capability">, - CXX11<"clang", "assert_capability">, - GNU<"assert_shared_capability">, - CXX11<"clang", "assert_shared_capability">]; - let Subjects = SubjectList<[Function]>; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Args = [ExprArgument<"Expr">]; - let Accessors = [Accessor<"isShared", - [GNU<"assert_shared_capability">, - CXX11<"clang", "assert_shared_capability">]>]; - let Documentation = [AssertCapabilityDocs]; -} - -def AcquireCapability : InheritableAttr { - let Spellings = [GNU<"acquire_capability">, - CXX11<"clang", "acquire_capability">, - GNU<"acquire_shared_capability">, - CXX11<"clang", "acquire_shared_capability">, - GNU<"exclusive_lock_function">, - GNU<"shared_lock_function">]; - let Subjects = SubjectList<[Function]>; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Args = [VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"acquire_shared_capability">, - CXX11<"clang", "acquire_shared_capability">, - GNU<"shared_lock_function">]>]; - let Documentation = [AcquireCapabilityDocs]; -} - -def TryAcquireCapability : InheritableAttr { - let Spellings = [GNU<"try_acquire_capability">, - CXX11<"clang", "try_acquire_capability">, - GNU<"try_acquire_shared_capability">, - CXX11<"clang", "try_acquire_shared_capability">]; - let Subjects = SubjectList<[Function], - ErrorDiag>; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"try_acquire_shared_capability">, - CXX11<"clang", "try_acquire_shared_capability">]>]; - let Documentation = [TryAcquireCapabilityDocs]; -} - -def ReleaseCapability : InheritableAttr { - let Spellings = [GNU<"release_capability">, - CXX11<"clang", "release_capability">, - GNU<"release_shared_capability">, - CXX11<"clang", "release_shared_capability">, - GNU<"release_generic_capability">, - CXX11<"clang", "release_generic_capability">, - GNU<"unlock_function">]; - let Subjects = SubjectList<[Function]>; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Args = [VariadicExprArgument<"Args">]; - let Accessors = [Accessor<"isShared", - [GNU<"release_shared_capability">, - CXX11<"clang", "release_shared_capability">]>, - Accessor<"isGeneric", - [GNU<"release_generic_capability">, - CXX11<"clang", "release_generic_capability">, - GNU<"unlock_function">]>]; - let Documentation = [ReleaseCapabilityDocs]; -} - -def RequiresCapability : InheritableAttr { - let Spellings = [GNU<"requires_capability">, - CXX11<"clang", "requires_capability">, - GNU<"exclusive_locks_required">, - GNU<"requires_shared_capability">, - CXX11<"clang", "requires_shared_capability">, - GNU<"shared_locks_required">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">, - GNU<"shared_locks_required">, - CXX11<"clang","requires_shared_capability">]>]; - let Documentation = [Undocumented]; -} - -def NoThreadSafetyAnalysis : InheritableAttr { - let Spellings = [GNU<"no_thread_safety_analysis">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def GuardedBy : InheritableAttr { - let Spellings = [GNU<"guarded_by">]; - let Args = [ExprArgument<"Arg">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def PtGuardedBy : InheritableAttr { - let Spellings = [GNU<"pt_guarded_by">]; - let Args = [ExprArgument<"Arg">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def AcquiredAfter : InheritableAttr { - let Spellings = [GNU<"acquired_after">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def AcquiredBefore : InheritableAttr { - let Spellings = [GNU<"acquired_before">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Field, SharedVar], WarnDiag, - "ExpectedFieldOrGlobalVar">; - let Documentation = [Undocumented]; -} - -def AssertExclusiveLock : InheritableAttr { - let Spellings = [GNU<"assert_exclusive_lock">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def AssertSharedLock : InheritableAttr { - let Spellings = [GNU<"assert_shared_lock">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -// The first argument is an integer or boolean value specifying the return value -// of a successful lock acquisition. -def ExclusiveTrylockFunction : InheritableAttr { - let Spellings = [GNU<"exclusive_trylock_function">]; - let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -// The first argument is an integer or boolean value specifying the return value -// of a successful lock acquisition. -def SharedTrylockFunction : InheritableAttr { - let Spellings = [GNU<"shared_trylock_function">]; - let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def LockReturned : InheritableAttr { - let Spellings = [GNU<"lock_returned">]; - let Args = [ExprArgument<"Arg">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -def LocksExcluded : InheritableAttr { - let Spellings = [GNU<"locks_excluded">]; - let Args = [VariadicExprArgument<"Args">]; - let LateParsed = 1; - let TemplateDependent = 1; - let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; -} - -// C/C++ consumed attributes. - -def Consumable : InheritableAttr { - let Spellings = [GNU<"consumable">]; - let Subjects = SubjectList<[CXXRecord]>; - let Args = [EnumArgument<"DefaultState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; - let Documentation = [ConsumableDocs]; -} - -def ConsumableAutoCast : InheritableAttr { - let Spellings = [GNU<"consumable_auto_cast_state">]; - let Subjects = SubjectList<[CXXRecord]>; - let Documentation = [Undocumented]; -} - -def ConsumableSetOnRead : InheritableAttr { - let Spellings = [GNU<"consumable_set_state_on_read">]; - let Subjects = SubjectList<[CXXRecord]>; - let Documentation = [Undocumented]; -} - -def CallableWhen : InheritableAttr { - let Spellings = [GNU<"callable_when">]; - let Subjects = SubjectList<[CXXMethod]>; - let Args = [VariadicEnumArgument<"CallableStates", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; - let Documentation = [CallableWhenDocs]; -} - -def ParamTypestate : InheritableAttr { - let Spellings = [GNU<"param_typestate">]; - let Subjects = SubjectList<[ParmVar]>; - let Args = [EnumArgument<"ParamState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; - let Documentation = [ParamTypestateDocs]; -} - -def ReturnTypestate : InheritableAttr { - let Spellings = [GNU<"return_typestate">]; - let Subjects = SubjectList<[Function, ParmVar]>; - let Args = [EnumArgument<"State", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; - let Documentation = [ReturnTypestateDocs]; -} - -def SetTypestate : InheritableAttr { - let Spellings = [GNU<"set_typestate">]; - let Subjects = SubjectList<[CXXMethod]>; - let Args = [EnumArgument<"NewState", "ConsumedState", - ["unknown", "consumed", "unconsumed"], - ["Unknown", "Consumed", "Unconsumed"]>]; - let Documentation = [SetTypestateDocs]; -} - -def TestTypestate : InheritableAttr { - let Spellings = [GNU<"test_typestate">]; - let Subjects = SubjectList<[CXXMethod]>; - let Args = [EnumArgument<"TestState", "ConsumedState", - ["consumed", "unconsumed"], - ["Consumed", "Unconsumed"]>]; - let Documentation = [TestTypestateDocs]; -} - -// Type safety attributes for `void *' pointers and type tags. - -def ArgumentWithTypeTag : InheritableAttr { - let Spellings = [GNU<"argument_with_type_tag">, - GNU<"pointer_with_type_tag">]; - let Args = [IdentifierArgument<"ArgumentKind">, - UnsignedArgument<"ArgumentIdx">, - UnsignedArgument<"TypeTagIdx">, - BoolArgument<"IsPointer">]; - let HasCustomParsing = 1; - let Documentation = [ArgumentWithTypeTagDocs, PointerWithTypeTagDocs]; -} - -def TypeTagForDatatype : InheritableAttr { - let Spellings = [GNU<"type_tag_for_datatype">]; - let Args = [IdentifierArgument<"ArgumentKind">, - TypeArgument<"MatchingCType">, - BoolArgument<"LayoutCompatible">, - BoolArgument<"MustBeNull">]; -// let Subjects = SubjectList<[Var], ErrorDiag>; - let HasCustomParsing = 1; - let Documentation = [TypeTagForDatatypeDocs]; -} - -// Microsoft-related attributes - -def MSNoVTable : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> { - let Spellings = [Declspec<"novtable">]; - let Subjects = SubjectList<[CXXRecord]>; - let Documentation = [MSNoVTableDocs]; -} - -def : IgnoredAttr { - let Spellings = [Declspec<"property">]; -} - -def MSStruct : InheritableAttr { - let Spellings = [GCC<"ms_struct">]; - let Subjects = SubjectList<[Record]>; - let Documentation = [Undocumented]; -} - -def DLLExport : InheritableAttr, TargetSpecificAttr<TargetWindows> { - let Spellings = [Declspec<"dllexport">, GCC<"dllexport">]; - let Subjects = SubjectList<[Function, Var, CXXRecord]>; - let Documentation = [Undocumented]; -} - -def DLLImport : InheritableAttr, TargetSpecificAttr<TargetWindows> { - let Spellings = [Declspec<"dllimport">, GCC<"dllimport">]; - let Subjects = SubjectList<[Function, Var, CXXRecord]>; - let Documentation = [Undocumented]; -} - -def SelectAny : InheritableAttr { - let Spellings = [Declspec<"selectany">]; - let LangOpts = [MicrosoftExt]; - let Documentation = [Undocumented]; -} - -def Thread : Attr { - let Spellings = [Declspec<"thread">]; - let LangOpts = [MicrosoftExt]; - let Documentation = [ThreadDocs]; - let Subjects = SubjectList<[Var]>; -} - -def Win64 : IgnoredAttr { - let Spellings = [Keyword<"__w64">]; - let LangOpts = [MicrosoftExt]; -} - -def Ptr32 : TypeAttr { - let Spellings = [Keyword<"__ptr32">]; - let Documentation = [Undocumented]; -} - -def Ptr64 : TypeAttr { - let Spellings = [Keyword<"__ptr64">]; - let Documentation = [Undocumented]; -} - -def SPtr : TypeAttr { - let Spellings = [Keyword<"__sptr">]; - let Documentation = [Undocumented]; -} - -def UPtr : TypeAttr { - let Spellings = [Keyword<"__uptr">]; - let Documentation = [Undocumented]; -} - -def MSInheritance : InheritableAttr { - let LangOpts = [MicrosoftExt]; - let Args = [DefaultBoolArgument<"BestCase", 1>]; - let Spellings = [Keyword<"__single_inheritance">, - Keyword<"__multiple_inheritance">, - Keyword<"__virtual_inheritance">, - Keyword<"__unspecified_inheritance">]; - let AdditionalMembers = [{ - static bool hasVBPtrOffsetField(Spelling Inheritance) { - return Inheritance == Keyword_unspecified_inheritance; - } - - // Only member pointers to functions need a this adjustment, since it can be - // combined with the field offset for data pointers. - static bool hasNVOffsetField(bool IsMemberFunction, Spelling Inheritance) { - return IsMemberFunction && Inheritance >= Keyword_multiple_inheritance; - } - - static bool hasVBTableOffsetField(Spelling Inheritance) { - return Inheritance >= Keyword_virtual_inheritance; - } - - static bool hasOnlyOneField(bool IsMemberFunction, - Spelling Inheritance) { - if (IsMemberFunction) - return Inheritance <= Keyword_single_inheritance; - return Inheritance <= Keyword_multiple_inheritance; - } - }]; - let Documentation = [MSInheritanceDocs]; -} - -def MSVtorDisp : InheritableAttr { - // This attribute has no spellings as it is only ever created implicitly. - let Spellings = []; - let Args = [UnsignedArgument<"vdm">]; - let SemaHandler = 0; - - let AdditionalMembers = [{ - enum Mode { - Never, - ForVBaseOverride, - ForVFTable - }; - - Mode getVtorDispMode() const { return Mode(vdm); } - }]; - let Documentation = [Undocumented]; -} - -def InitSeg : Attr { - let Spellings = [Pragma<"", "init_seg">]; - let Args = [StringArgument<"Section">]; - let SemaHandler = 0; - let Documentation = [InitSegDocs]; - let AdditionalMembers = [{ - void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const { - OS << '(' << getSection() << ')'; - } - }]; -} - -def Unaligned : IgnoredAttr { - let Spellings = [Keyword<"__unaligned">]; -} - -def LoopHint : Attr { - /// #pragma clang loop <option> directive - /// vectorize: vectorizes loop operations if State == Enable. - /// vectorize_width: vectorize loop operations with width 'Value'. - /// interleave: interleave multiple loop iterations if State == Enable. - /// interleave_count: interleaves 'Value' loop interations. - /// unroll: fully unroll loop if State == Enable. - /// unroll_count: unrolls loop 'Value' times. - - /// #pragma unroll <argument> directive - /// <no arg>: fully unrolls loop. - /// boolean: fully unrolls loop if State == Enable. - /// expression: unrolls loop 'Value' times. - - let Spellings = [Pragma<"clang", "loop">, Pragma<"", "unroll">, - Pragma<"", "nounroll">]; - - /// State of the loop optimization specified by the spelling. - let Args = [EnumArgument<"Option", "OptionType", - ["vectorize", "vectorize_width", "interleave", "interleave_count", - "unroll", "unroll_count"], - ["Vectorize", "VectorizeWidth", "Interleave", "InterleaveCount", - "Unroll", "UnrollCount"]>, - EnumArgument<"State", "LoopHintState", - ["enable", "disable", "numeric", "assume_safety", "full"], - ["Enable", "Disable", "Numeric", "AssumeSafety", "Full"]>, - ExprArgument<"Value">]; - - let AdditionalMembers = [{ - static const char *getOptionName(int Option) { - switch(Option) { - case Vectorize: return "vectorize"; - case VectorizeWidth: return "vectorize_width"; - case Interleave: return "interleave"; - case InterleaveCount: return "interleave_count"; - case Unroll: return "unroll"; - case UnrollCount: return "unroll_count"; - } - llvm_unreachable("Unhandled LoopHint option."); - } - - void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const { - unsigned SpellingIndex = getSpellingListIndex(); - // For "#pragma unroll" and "#pragma nounroll" the string "unroll" or - // "nounroll" is already emitted as the pragma name. - if (SpellingIndex == Pragma_nounroll) - return; - else if (SpellingIndex == Pragma_unroll) { - OS << getValueString(Policy); - return; - } - - assert(SpellingIndex == Pragma_clang_loop && "Unexpected spelling"); - OS << getOptionName(option) << getValueString(Policy); - } - - // Return a string containing the loop hint argument including the - // enclosing parentheses. - std::string getValueString(const PrintingPolicy &Policy) const { - std::string ValueName; - llvm::raw_string_ostream OS(ValueName); - OS << "("; - if (state == Numeric) - value->printPretty(OS, nullptr, Policy); - else if (state == Enable) - OS << "enable"; - else if (state == Full) - OS << "full"; - else if (state == AssumeSafety) - OS << "assume_safety"; - else - OS << "disable"; - OS << ")"; - return OS.str(); - } - - // Return a string suitable for identifying this attribute in diagnostics. - std::string getDiagnosticName(const PrintingPolicy &Policy) const { - unsigned SpellingIndex = getSpellingListIndex(); - if (SpellingIndex == Pragma_nounroll) - return "#pragma nounroll"; - else if (SpellingIndex == Pragma_unroll) - return "#pragma unroll" + (option == UnrollCount ? getValueString(Policy) : ""); - - assert(SpellingIndex == Pragma_clang_loop && "Unexpected spelling"); - return getOptionName(option) + getValueString(Policy); - } - }]; - - let Documentation = [LoopHintDocs, UnrollHintDocs]; -} - -def CapturedRecord : InheritableAttr { - // This attribute has no spellings as it is only ever created implicitly. - let Spellings = []; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def OMPThreadPrivateDecl : InheritableAttr { - // This attribute has no spellings as it is only ever created implicitly. - let Spellings = []; - let SemaHandler = 0; - let Documentation = [Undocumented]; -} - -def InternalLinkage : InheritableAttr { - let Spellings = [GNU<"internal_linkage">, CXX11<"clang", "internal_linkage">]; - let Subjects = SubjectList<[Var, Function, CXXRecord]>; - let Documentation = [InternalLinkageDocs]; -} diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td deleted file mode 100644 index 2567d55..0000000 --- a/include/clang/Basic/AttrDocs.td +++ /dev/null @@ -1,1861 +0,0 @@ -//==--- AttrDocs.td - Attribute documentation ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===---------------------------------------------------------------------===// - -def GlobalDocumentation { - code Intro =[{.. - ------------------------------------------------------------------- - NOTE: This file is automatically generated by running clang-tblgen - -gen-attr-docs. Do not edit this file by hand!! - ------------------------------------------------------------------- - -=================== -Attributes in Clang -=================== -.. contents:: - :local: - -Introduction -============ - -This page lists the attributes currently supported by Clang. -}]; -} - -def SectionDocs : Documentation { - let Category = DocCatVariable; - let Content = [{ -The ``section`` attribute allows you to specify a specific section a -global variable or function should be in after translation. - }]; - let Heading = "section (gnu::section, __declspec(allocate))"; -} - -def InitSegDocs : Documentation { - let Category = DocCatVariable; - let Content = [{ -The attribute applied by ``pragma init_seg()`` controls the section into -which global initialization function pointers are emitted. It is only -available with ``-fms-extensions``. Typically, this function pointer is -emitted into ``.CRT$XCU`` on Windows. The user can change the order of -initialization by using a different section name with the same -``.CRT$XC`` prefix and a suffix that sorts lexicographically before or -after the standard ``.CRT$XCU`` sections. See the init_seg_ -documentation on MSDN for more information. - -.. _init_seg: http://msdn.microsoft.com/en-us/library/7977wcck(v=vs.110).aspx - }]; -} - -def TLSModelDocs : Documentation { - let Category = DocCatVariable; - let Content = [{ -The ``tls_model`` attribute allows you to specify which thread-local storage -model to use. It accepts the following strings: - -* global-dynamic -* local-dynamic -* initial-exec -* local-exec - -TLS models are mutually exclusive. - }]; -} - -def ThreadDocs : Documentation { - let Category = DocCatVariable; - let Content = [{ -The ``__declspec(thread)`` attribute declares a variable with thread local -storage. It is available under the ``-fms-extensions`` flag for MSVC -compatibility. See the documentation for `__declspec(thread)`_ on MSDN. - -.. _`__declspec(thread)`: http://msdn.microsoft.com/en-us/library/9w1sdazb.aspx - -In Clang, ``__declspec(thread)`` is generally equivalent in functionality to the -GNU ``__thread`` keyword. The variable must not have a destructor and must have -a constant initializer, if any. The attribute only applies to variables -declared with static storage duration, such as globals, class static data -members, and static locals. - }]; -} - -def CarriesDependencyDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``carries_dependency`` attribute specifies dependency propagation into and -out of functions. - -When specified on a function or Objective-C method, the ``carries_dependency`` -attribute means that the return value carries a dependency out of the function, -so that the implementation need not constrain ordering upon return from that -function. Implementations of the function and its caller may choose to preserve -dependencies instead of emitting memory ordering instructions such as fences. - -Note, this attribute does not change the meaning of the program, but may result -in generation of more efficient code. - }]; -} - -def C11NoReturnDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -A function declared as ``_Noreturn`` shall not return to its caller. The -compiler will generate a diagnostic for a function declared as ``_Noreturn`` -that appears to be capable of returning to its caller. - }]; -} - -def CXX11NoReturnDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -A function declared as ``[[noreturn]]`` shall not return to its caller. The -compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` -that appears to be capable of returning to its caller. - }]; -} - -def AssertCapabilityDocs : Documentation { - let Category = DocCatFunction; - let Heading = "assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability)"; - let Content = [{ -Marks a function that dynamically tests whether a capability is held, and halts -the program if it is not held. - }]; -} - -def AcquireCapabilityDocs : Documentation { - let Category = DocCatFunction; - let Heading = "acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability)"; - let Content = [{ -Marks a function as acquiring a capability. - }]; -} - -def TryAcquireCapabilityDocs : Documentation { - let Category = DocCatFunction; - let Heading = "try_acquire_capability (try_acquire_shared_capability, clang::try_acquire_capability, clang::try_acquire_shared_capability)"; - let Content = [{ -Marks a function that attempts to acquire a capability. This function may fail to -actually acquire the capability; they accept a Boolean value determining -whether acquiring the capability means success (true), or failing to acquire -the capability means success (false). - }]; -} - -def ReleaseCapabilityDocs : Documentation { - let Category = DocCatFunction; - let Heading = "release_capability (release_shared_capability, clang::release_capability, clang::release_shared_capability)"; - let Content = [{ -Marks a function as releasing a capability. - }]; -} - -def AssumeAlignedDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Use ``__attribute__((assume_aligned(<alignment>[,<offset>]))`` on a function -declaration to specify that the return value of the function (which must be a -pointer type) has the specified offset, in bytes, from an address with the -specified alignment. The offset is taken to be zero if omitted. - -.. code-block:: c++ - - // The returned pointer value has 32-byte alignment. - void *a() __attribute__((assume_aligned (32))); - - // The returned pointer value is 4 bytes greater than an address having - // 32-byte alignment. - void *b() __attribute__((assume_aligned (32, 4))); - -Note that this attribute provides information to the compiler regarding a -condition that the code already ensures is true. It does not cause the compiler -to enforce the provided alignment assumption. - }]; -} - -def EnableIfDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -.. Note:: Some features of this attribute are experimental. The meaning of - multiple enable_if attributes on a single declaration is subject to change in - a future version of clang. Also, the ABI is not standardized and the name - mangling may change in future versions. To avoid that, use asm labels. - -The ``enable_if`` attribute can be placed on function declarations to control -which overload is selected based on the values of the function's arguments. -When combined with the ``overloadable`` attribute, this feature is also -available in C. - -.. code-block:: c++ - - int isdigit(int c); - int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - - void foo(char c) { - isdigit(c); - isdigit(10); - isdigit(-10); // results in a compile-time error. - } - -The enable_if attribute takes two arguments, the first is an expression written -in terms of the function parameters, the second is a string explaining why this -overload candidate could not be selected to be displayed in diagnostics. The -expression is part of the function signature for the purposes of determining -whether it is a redeclaration (following the rules used when determining -whether a C++ template specialization is ODR-equivalent), but is not part of -the type. - -The enable_if expression is evaluated as if it were the body of a -bool-returning constexpr function declared with the arguments of the function -it is being applied to, then called with the parameters at the call site. If the -result is false or could not be determined through constant expression -evaluation, then this overload will not be chosen and the provided string may -be used in a diagnostic if the compile fails as a result. - -Because the enable_if expression is an unevaluated context, there are no global -state changes, nor the ability to pass information from the enable_if -expression to the function body. For example, suppose we want calls to -strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of -strbuf) only if the size of strbuf can be determined: - -.. code-block:: c++ - - __attribute__((always_inline)) - static inline size_t strnlen(const char *s, size_t maxlen) - __attribute__((overloadable)) - __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), - "chosen when the buffer size is known but 'maxlen' is not"))) - { - return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); - } - -Multiple enable_if attributes may be applied to a single declaration. In this -case, the enable_if expressions are evaluated from left to right in the -following manner. First, the candidates whose enable_if expressions evaluate to -false or cannot be evaluated are discarded. If the remaining candidates do not -share ODR-equivalent enable_if expressions, the overload resolution is -ambiguous. Otherwise, enable_if overload resolution continues with the next -enable_if attribute on the candidates that have not been discarded and have -remaining enable_if attributes. In this way, we pick the most specific -overload out of a number of viable overloads using enable_if. - -.. code-block:: c++ - - void f() __attribute__((enable_if(true, ""))); // #1 - void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - - void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 - void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 - -In this example, a call to f() is always resolved to #2, as the first enable_if -expression is ODR-equivalent for both declarations, but #1 does not have another -enable_if expression to continue evaluating, so the next round of evaluation has -only a single candidate. In a call to g(1, 1), the call is ambiguous even though -#2 has more enable_if attributes, because the first enable_if expressions are -not ODR-equivalent. - -Query for this feature with ``__has_attribute(enable_if)``. - }]; -} - -def PassObjectSizeDocs : Documentation { - let Category = DocCatVariable; // Technically it's a parameter doc, but eh. - let Content = [{ -.. Note:: The mangling of functions with parameters that are annotated with - ``pass_object_size`` is subject to change. You can get around this by - using ``__asm__("foo")`` to explicitly name your functions, thus preserving - your ABI; also, non-overloadable C functions with ``pass_object_size`` are - not mangled. - -The ``pass_object_size(Type)`` attribute can be placed on function parameters to -instruct clang to call ``__builtin_object_size(param, Type)`` at each callsite -of said function, and implicitly pass the result of this call in as an invisible -argument of type ``size_t`` directly after the parameter annotated with -``pass_object_size``. Clang will also replace any calls to -``__builtin_object_size(param, Type)`` in the function by said implicit -parameter. - -Example usage: - -.. code-block:: c - - int bzero1(char *const p __attribute__((pass_object_size(0)))) - __attribute__((noinline)) { - int i = 0; - for (/**/; i < (int)__builtin_object_size(p, 0); ++i) { - p[i] = 0; - } - return i; - } - - int main() { - char chars[100]; - int n = bzero1(&chars[0]); - assert(n == sizeof(chars)); - return 0; - } - -If successfully evaluating ``__builtin_object_size(param, Type)`` at the -callsite is not possible, then the "failed" value is passed in. So, using the -definition of ``bzero1`` from above, the following code would exit cleanly: - -.. code-block:: c - - int main2(int argc, char *argv[]) { - int n = bzero1(argv); - assert(n == -1); - return 0; - } - -``pass_object_size`` plays a part in overload resolution. If two overload -candidates are otherwise equally good, then the overload with one or more -parameters with ``pass_object_size`` is preferred. This implies that the choice -between two identical overloads both with ``pass_object_size`` on one or more -parameters will always be ambiguous; for this reason, having two such overloads -is illegal. For example: - -.. code-block:: c++ - - #define PS(N) __attribute__((pass_object_size(N))) - // OK - void Foo(char *a, char *b); // Overload A - // OK -- overload A has no parameters with pass_object_size. - void Foo(char *a PS(0), char *b PS(0)); // Overload B - // Error -- Same signature (sans pass_object_size) as overload B, and both - // overloads have one or more parameters with the pass_object_size attribute. - void Foo(void *a PS(0), void *b); - - // OK - void Bar(void *a PS(0)); // Overload C - // OK - void Bar(char *c PS(1)); // Overload D - - void main() { - char known[10], *unknown; - Foo(unknown, unknown); // Calls overload B - Foo(known, unknown); // Calls overload B - Foo(unknown, known); // Calls overload B - Foo(known, known); // Calls overload B - - Bar(known); // Calls overload D - Bar(unknown); // Calls overload D - } - -Currently, ``pass_object_size`` is a bit restricted in terms of its usage: - -* Only one use of ``pass_object_size`` is allowed per parameter. - -* It is an error to take the address of a function with ``pass_object_size`` on - any of its parameters. If you wish to do this, you can create an overload - without ``pass_object_size`` on any parameters. - -* It is an error to apply the ``pass_object_size`` attribute to parameters that - are not pointers. Additionally, any parameter that ``pass_object_size`` is - applied to must be marked ``const`` at its function's definition. - }]; -} - -def OverloadableDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Clang provides support for C++ function overloading in C. Function overloading -in C is introduced using the ``overloadable`` attribute. For example, one -might provide several overloaded versions of a ``tgsin`` function that invokes -the appropriate standard function computing the sine of a value with ``float``, -``double``, or ``long double`` precision: - -.. code-block:: c - - #include <math.h> - float __attribute__((overloadable)) tgsin(float x) { return sinf(x); } - double __attribute__((overloadable)) tgsin(double x) { return sin(x); } - long double __attribute__((overloadable)) tgsin(long double x) { return sinl(x); } - -Given these declarations, one can call ``tgsin`` with a ``float`` value to -receive a ``float`` result, with a ``double`` to receive a ``double`` result, -etc. Function overloading in C follows the rules of C++ function overloading -to pick the best overload given the call arguments, with a few C-specific -semantics: - -* Conversion from ``float`` or ``double`` to ``long double`` is ranked as a - floating-point promotion (per C99) rather than as a floating-point conversion - (as in C++). - -* A conversion from a pointer of type ``T*`` to a pointer of type ``U*`` is - considered a pointer conversion (with conversion rank) if ``T`` and ``U`` are - compatible types. - -* A conversion from type ``T`` to a value of type ``U`` is permitted if ``T`` - and ``U`` are compatible types. This conversion is given "conversion" rank. - -The declaration of ``overloadable`` functions is restricted to function -declarations and definitions. Most importantly, if any function with a given -name is given the ``overloadable`` attribute, then all function declarations -and definitions with that name (and in that scope) must have the -``overloadable`` attribute. This rule even applies to redeclarations of -functions whose original declaration had the ``overloadable`` attribute, e.g., - -.. code-block:: c - - int f(int) __attribute__((overloadable)); - float f(float); // error: declaration of "f" must have the "overloadable" attribute - - int g(int) __attribute__((overloadable)); - int g(int) { } // error: redeclaration of "g" must also have the "overloadable" attribute - -Functions marked ``overloadable`` must have prototypes. Therefore, the -following code is ill-formed: - -.. code-block:: c - - int h() __attribute__((overloadable)); // error: h does not have a prototype - -However, ``overloadable`` functions are allowed to use a ellipsis even if there -are no named parameters (as is permitted in C++). This feature is particularly -useful when combined with the ``unavailable`` attribute: - -.. code-block:: c++ - - void honeypot(...) __attribute__((overloadable, unavailable)); // calling me is an error - -Functions declared with the ``overloadable`` attribute have their names mangled -according to the same rules as C++ function names. For example, the three -``tgsin`` functions in our motivating example get the mangled names -``_Z5tgsinf``, ``_Z5tgsind``, and ``_Z5tgsine``, respectively. There are two -caveats to this use of name mangling: - -* Future versions of Clang may change the name mangling of functions overloaded - in C, so you should not depend on an specific mangling. To be completely - safe, we strongly urge the use of ``static inline`` with ``overloadable`` - functions. - -* The ``overloadable`` attribute has almost no meaning when used in C++, - because names will already be mangled and functions are already overloadable. - However, when an ``overloadable`` function occurs within an ``extern "C"`` - linkage specification, it's name *will* be mangled in the same way as it - would in C. - -Query for this feature with ``__has_extension(attribute_overloadable)``. - }]; -} - -def ObjCMethodFamilyDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Many methods in Objective-C have conventional meanings determined by their -selectors. It is sometimes useful to be able to mark a method as having a -particular conventional meaning despite not having the right selector, or as -not having the conventional meaning that its selector would suggest. For these -use cases, we provide an attribute to specifically describe the "method family" -that a method belongs to. - -**Usage**: ``__attribute__((objc_method_family(X)))``, where ``X`` is one of -``none``, ``alloc``, ``copy``, ``init``, ``mutableCopy``, or ``new``. This -attribute can only be placed at the end of a method declaration: - -.. code-block:: objc - - - (NSString *)initMyStringValue __attribute__((objc_method_family(none))); - -Users who do not wish to change the conventional meaning of a method, and who -merely want to document its non-standard retain and release semantics, should -use the retaining behavior attributes (``ns_returns_retained``, -``ns_returns_not_retained``, etc). - -Query for this feature with ``__has_attribute(objc_method_family)``. - }]; -} - -def NoDuplicateDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``noduplicate`` attribute can be placed on function declarations to control -whether function calls to this function can be duplicated or not as a result of -optimizations. This is required for the implementation of functions with -certain special requirements, like the OpenCL "barrier" function, that might -need to be run concurrently by all the threads that are executing in lockstep -on the hardware. For example this attribute applied on the function -"nodupfunc" in the code below avoids that: - -.. code-block:: c - - void nodupfunc() __attribute__((noduplicate)); - // Setting it as a C++11 attribute is also valid - // void nodupfunc() [[clang::noduplicate]]; - void foo(); - void bar(); - - nodupfunc(); - if (a > n) { - foo(); - } else { - bar(); - } - -gets possibly modified by some optimizations into code similar to this: - -.. code-block:: c - - if (a > n) { - nodupfunc(); - foo(); - } else { - nodupfunc(); - bar(); - } - -where the call to "nodupfunc" is duplicated and sunk into the two branches -of the condition. - }]; -} - -def NoSplitStackDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``no_split_stack`` attribute disables the emission of the split stack -preamble for a particular function. It has no effect if ``-fsplit-stack`` -is not specified. - }]; -} - -def ObjCRequiresSuperDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Some Objective-C classes allow a subclass to override a particular method in a -parent class but expect that the overriding method also calls the overridden -method in the parent class. For these cases, we provide an attribute to -designate that a method requires a "call to ``super``" in the overriding -method in the subclass. - -**Usage**: ``__attribute__((objc_requires_super))``. This attribute can only -be placed at the end of a method declaration: - -.. code-block:: objc - - - (void)foo __attribute__((objc_requires_super)); - -This attribute can only be applied the method declarations within a class, and -not a protocol. Currently this attribute does not enforce any placement of -where the call occurs in the overriding method (such as in the case of -``-dealloc`` where the call must appear at the end). It checks only that it -exists. - -Note that on both OS X and iOS that the Foundation framework provides a -convenience macro ``NS_REQUIRES_SUPER`` that provides syntactic sugar for this -attribute: - -.. code-block:: objc - - - (void)foo NS_REQUIRES_SUPER; - -This macro is conditionally defined depending on the compiler's support for -this attribute. If the compiler does not support the attribute the macro -expands to nothing. - -Operationally, when a method has this annotation the compiler will warn if the -implementation of an override in a subclass does not call super. For example: - -.. code-block:: objc - - warning: method possibly missing a [super AnnotMeth] call - - (void) AnnotMeth{}; - ^ - }]; -} - -def ObjCRuntimeNameDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -By default, the Objective-C interface or protocol identifier is used -in the metadata name for that object. The `objc_runtime_name` -attribute allows annotated interfaces or protocols to use the -specified string argument in the object's metadata name instead of the -default name. - -**Usage**: ``__attribute__((objc_runtime_name("MyLocalName")))``. This attribute -can only be placed before an @protocol or @interface declaration: - -.. code-block:: objc - - __attribute__((objc_runtime_name("MyLocalName"))) - @interface Message - @end - - }]; -} - -def ObjCBoxableDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Structs and unions marked with the ``objc_boxable`` attribute can be used -with the Objective-C boxed expression syntax, ``@(...)``. - -**Usage**: ``__attribute__((objc_boxable))``. This attribute -can only be placed on a declaration of a trivially-copyable struct or union: - -.. code-block:: objc - - struct __attribute__((objc_boxable)) some_struct { - int i; - }; - union __attribute__((objc_boxable)) some_union { - int i; - float f; - }; - typedef struct __attribute__((objc_boxable)) _some_struct some_struct; - - // ... - - some_struct ss; - NSValue *boxed = @(ss); - - }]; -} - -def AvailabilityDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``availability`` attribute can be placed on declarations to describe the -lifecycle of that declaration relative to operating system versions. Consider -the function declaration for a hypothetical function ``f``: - -.. code-block:: c++ - - void f(void) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6,obsoleted=10.7))); - -The availability attribute states that ``f`` was introduced in Mac OS X 10.4, -deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information -is used by Clang to determine when it is safe to use ``f``: for example, if -Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` -succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call -succeeds but Clang emits a warning specifying that the function is deprecated. -Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call -fails because ``f()`` is no longer available. - -The availability attribute is a comma-separated list starting with the -platform name and then including clauses specifying important milestones in the -declaration's lifetime (in any order) along with additional information. Those -clauses can be: - -introduced=\ *version* - The first version in which this declaration was introduced. - -deprecated=\ *version* - The first version in which this declaration was deprecated, meaning that - users should migrate away from this API. - -obsoleted=\ *version* - The first version in which this declaration was obsoleted, meaning that it - was removed completely and can no longer be used. - -unavailable - This declaration is never available on this platform. - -message=\ *string-literal* - Additional message text that Clang will provide when emitting a warning or - error about use of a deprecated or obsoleted declaration. Useful to direct - users to replacement APIs. - -Multiple availability attributes can be placed on a declaration, which may -correspond to different platforms. Only the availability attribute with the -platform corresponding to the target platform will be used; any others will be -ignored. If no availability attribute specifies availability for the current -target platform, the availability attributes are ignored. Supported platforms -are: - -``ios`` - Apple's iOS operating system. The minimum deployment target is specified by - the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` - command-line arguments. - -``macosx`` - Apple's Mac OS X operating system. The minimum deployment target is - specified by the ``-mmacosx-version-min=*version*`` command-line argument. - -``tvos`` - Apple's tvOS operating system. The minimum deployment target is specified by - the ``-mtvos-version-min=*version*`` command-line argument. - -``watchos`` - Apple's watchOS operating system. The minimum deployment target is specified by - the ``-mwatchos-version-min=*version*`` command-line argument. - -A declaration can be used even when deploying back to a platform version prior -to when the declaration was introduced. When this happens, the declaration is -`weakly linked -<https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html>`_, -as if the ``weak_import`` attribute were added to the declaration. A -weakly-linked declaration may or may not be present a run-time, and a program -can determine whether the declaration is present by checking whether the -address of that declaration is non-NULL. - -If there are multiple declarations of the same entity, the availability -attributes must either match on a per-platform basis or later -declarations must not have availability attributes for that -platform. For example: - -.. code-block:: c - - void g(void) __attribute__((availability(macosx,introduced=10.4))); - void g(void) __attribute__((availability(macosx,introduced=10.4))); // okay, matches - void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform - void g(void); // okay, inherits both macosx and ios availability from above. - void g(void) __attribute__((availability(macosx,introduced=10.5))); // error: mismatch - -When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: - -.. code-block:: objc - - @interface A - - (id)method __attribute__((availability(macosx,introduced=10.4))); - - (id)method2 __attribute__((availability(macosx,introduced=10.4))); - @end - - @interface B : A - - (id)method __attribute__((availability(macosx,introduced=10.3))); // okay: method moved into base class later - - (id)method __attribute__((availability(macosx,introduced=10.5))); // error: this method was available via the base class in 10.4 - @end - }]; -} - -def FallthroughDocs : Documentation { - let Category = DocCatStmt; - let Content = [{ -The ``clang::fallthrough`` attribute is used along with the -``-Wimplicit-fallthrough`` argument to annotate intentional fall-through -between switch labels. It can only be applied to a null statement placed at a -point of execution between any statement and the next switch label. It is -common to mark these places with a specific comment, but this attribute is -meant to replace comments with a more strict annotation, which can be checked -by the compiler. This attribute doesn't change semantics of the code and can -be used wherever an intended fall-through occurs. It is designed to mimic -control-flow statements like ``break;``, so it can be placed in most places -where ``break;`` can, but only if there are no statements on the execution path -between it and the next switch label. - -Here is an example: - -.. code-block:: c++ - - // compile with -Wimplicit-fallthrough - switch (n) { - case 22: - case 33: // no warning: no statements between case labels - f(); - case 44: // warning: unannotated fall-through - g(); - [[clang::fallthrough]]; - case 55: // no warning - if (x) { - h(); - break; - } - else { - i(); - [[clang::fallthrough]]; - } - case 66: // no warning - p(); - [[clang::fallthrough]]; // warning: fallthrough annotation does not - // directly precede case label - q(); - case 77: // warning: unannotated fall-through - r(); - } - }]; -} - -def ARMInterruptDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on -ARM targets. This attribute may be attached to a function definition and -instructs the backend to generate appropriate function entry/exit code so that -it can be used directly as an interrupt service routine. - -The parameter passed to the interrupt attribute is optional, but if -provided it must be a string literal with one of the following values: "IRQ", -"FIQ", "SWI", "ABORT", "UNDEF". - -The semantics are as follows: - -- If the function is AAPCS, Clang instructs the backend to realign the stack to - 8 bytes on entry. This is a general requirement of the AAPCS at public - interfaces, but may not hold when an exception is taken. Doing this allows - other AAPCS functions to be called. -- If the CPU is M-class this is all that needs to be done since the architecture - itself is designed in such a way that functions obeying the normal AAPCS ABI - constraints are valid exception handlers. -- If the CPU is not M-class, the prologue and epilogue are modified to save all - non-banked registers that are used, so that upon return the user-mode state - will not be corrupted. Note that to avoid unnecessary overhead, only - general-purpose (integer) registers are saved in this way. If VFP operations - are needed, that state must be saved manually. - - Specifically, interrupt kinds other than "FIQ" will save all core registers - except "lr" and "sp". "FIQ" interrupts will save r0-r7. -- If the CPU is not M-class, the return instruction is changed to one of the - canonical sequences permitted by the architecture for exception return. Where - possible the function itself will make the necessary "lr" adjustments so that - the "preferred return address" is selected. - - Unfortunately the compiler is unable to make this guarantee for an "UNDEF" - handler, where the offset from "lr" to the preferred return address depends on - the execution state of the code which generated the exception. In this case - a sequence equivalent to "movs pc, lr" will be used. - }]; -} - -def MipsInterruptDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Clang supports the GNU style ``__attribute__((interrupt("ARGUMENT")))`` attribute on -MIPS targets. This attribute may be attached to a function definition and instructs -the backend to generate appropriate function entry/exit code so that it can be used -directly as an interrupt service routine. - -By default, the compiler will produce a function prologue and epilogue suitable for -an interrupt service routine that handles an External Interrupt Controller (eic) -generated interrupt. This behaviour can be explicitly requested with the "eic" -argument. - -Otherwise, for use with vectored interrupt mode, the argument passed should be -of the form "vector=LEVEL" where LEVEL is one of the following values: -"sw0", "sw1", "hw0", "hw1", "hw2", "hw3", "hw4", "hw5". The compiler will -then set the interrupt mask to the corresponding level which will mask all -interrupts up to and including the argument. - -The semantics are as follows: - -- The prologue is modified so that the Exception Program Counter (EPC) and - Status coprocessor registers are saved to the stack. The interrupt mask is - set so that the function can only be interrupted by a higher priority - interrupt. The epilogue will restore the previous values of EPC and Status. - -- The prologue and epilogue are modified to save and restore all non-kernel - registers as necessary. - -- The FPU is disabled in the prologue, as the floating pointer registers are not - spilled to the stack. - -- The function return sequence is changed to use an exception return instruction. - -- The parameter sets the interrupt mask for the function corresponding to the - interrupt level specified. If no mask is specified the interrupt mask - defaults to "eic". - }]; -} - -def TargetDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Clang supports the GNU style ``__attribute__((target("OPTIONS")))`` attribute. -This attribute may be attached to a function definition and instructs -the backend to use different code generation options than were passed on the -command line. - -The current set of options correspond to the existing "subtarget features" for -the target with or without a "-mno-" in front corresponding to the absence -of the feature, as well as ``arch="CPU"`` which will change the default "CPU" -for the function. - -Example "subtarget features" from the x86 backend include: "mmx", "sse", "sse4.2", -"avx", "xop" and largely correspond to the machine specific options handled by -the front end. -}]; -} - -def DocCatAMDGPURegisterAttributes : - DocumentationCategory<"AMD GPU Register Attributes"> { - let Content = [{ -Clang supports attributes for controlling register usage on AMD GPU -targets. These attributes may be attached to a kernel function -definition and is an optimization hint to the backend for the maximum -number of registers to use. This is useful in cases where register -limited occupancy is known to be an important factor for the -performance for the kernel. - -The semantics are as follows: - -- The backend will attempt to limit the number of used registers to - the specified value, but the exact number used is not - guaranteed. The number used may be rounded up to satisfy the - allocation requirements or ABI constraints of the subtarget. For - example, on Southern Islands VGPRs may only be allocated in - increments of 4, so requesting a limit of 39 VGPRs will really - attempt to use up to 40. Requesting more registers than the - subtarget supports will truncate to the maximum allowed. The backend - may also use fewer registers than requested whenever possible. - -- 0 implies the default no limit on register usage. - -- Ignored on older VLIW subtargets which did not have separate scalar - and vector registers, R600 through Northern Islands. - -}]; -} - - -def AMDGPUNumVGPRDocs : Documentation { - let Category = DocCatAMDGPURegisterAttributes; - let Content = [{ -Clang supports the -``__attribute__((amdgpu_num_vgpr(<num_registers>)))`` attribute on AMD -Southern Islands GPUs and later for controlling the number of vector -registers. A typical value would be between 4 and 256 in increments -of 4. -}]; -} - -def AMDGPUNumSGPRDocs : Documentation { - let Category = DocCatAMDGPURegisterAttributes; - let Content = [{ - -Clang supports the -``__attribute__((amdgpu_num_sgpr(<num_registers>)))`` attribute on AMD -Southern Islands GPUs and later for controlling the number of scalar -registers. A typical value would be between 8 and 104 in increments of -8. - -Due to common instruction constraints, an additional 2-4 SGPRs are -typically required for internal use depending on features used. This -value is a hint for the total number of SGPRs to use, and not the -number of user SGPRs, so no special consideration needs to be given -for these. -}]; -} - -def DocCatCallingConvs : DocumentationCategory<"Calling Conventions"> { - let Content = [{ -Clang supports several different calling conventions, depending on the target -platform and architecture. The calling convention used for a function determines -how parameters are passed, how results are returned to the caller, and other -low-level details of calling a function. - }]; -} - -def PcsDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On ARM targets, this attribute can be used to select calling conventions -similar to ``stdcall`` on x86. Valid parameter values are "aapcs" and -"aapcs-vfp". - }]; -} - -def RegparmDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On 32-bit x86 targets, the regparm attribute causes the compiler to pass -the first three integer parameters in EAX, EDX, and ECX instead of on the -stack. This attribute has no effect on variadic functions, and all parameters -are passed via the stack as normal. - }]; -} - -def SysVABIDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On Windows x86_64 targets, this attribute changes the calling convention of a -function to match the default convention used on Sys V targets such as Linux, -Mac, and BSD. This attribute has no effect on other targets. - }]; -} - -def MSABIDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On non-Windows x86_64 targets, this attribute changes the calling convention of -a function to match the default convention used on Windows x86_64. This -attribute has no effect on Windows targets or non-x86_64 targets. - }]; -} - -def StdCallDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On 32-bit x86 targets, this attribute changes the calling convention of a -function to clear parameters off of the stack on return. This convention does -not support variadic calls or unprototyped functions in C, and has no effect on -x86_64 targets. This calling convention is used widely by the Windows API and -COM applications. See the documentation for `__stdcall`_ on MSDN. - -.. _`__stdcall`: http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx - }]; -} - -def FastCallDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On 32-bit x86 targets, this attribute changes the calling convention of a -function to use ECX and EDX as register parameters and clear parameters off of -the stack on return. This convention does not support variadic calls or -unprototyped functions in C, and has no effect on x86_64 targets. This calling -convention is supported primarily for compatibility with existing code. Users -seeking register parameters should use the ``regparm`` attribute, which does -not require callee-cleanup. See the documentation for `__fastcall`_ on MSDN. - -.. _`__fastcall`: http://msdn.microsoft.com/en-us/library/6xa169sk.aspx - }]; -} - -def ThisCallDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On 32-bit x86 targets, this attribute changes the calling convention of a -function to use ECX for the first parameter (typically the implicit ``this`` -parameter of C++ methods) and clear parameters off of the stack on return. This -convention does not support variadic calls or unprototyped functions in C, and -has no effect on x86_64 targets. See the documentation for `__thiscall`_ on -MSDN. - -.. _`__thiscall`: http://msdn.microsoft.com/en-us/library/ek8tkfbw.aspx - }]; -} - -def VectorCallDocs : Documentation { - let Category = DocCatCallingConvs; - let Content = [{ -On 32-bit x86 *and* x86_64 targets, this attribute changes the calling -convention of a function to pass vector parameters in SSE registers. - -On 32-bit x86 targets, this calling convention is similar to ``__fastcall``. -The first two integer parameters are passed in ECX and EDX. Subsequent integer -parameters are passed in memory, and callee clears the stack. On x86_64 -targets, the callee does *not* clear the stack, and integer parameters are -passed in RCX, RDX, R8, and R9 as is done for the default Windows x64 calling -convention. - -On both 32-bit x86 and x86_64 targets, vector and floating point arguments are -passed in XMM0-XMM5. Homogenous vector aggregates of up to four elements are -passed in sequential SSE registers if enough are available. If AVX is enabled, -256 bit vectors are passed in YMM0-YMM5. Any vector or aggregate type that -cannot be passed in registers for any reason is passed by reference, which -allows the caller to align the parameter memory. - -See the documentation for `__vectorcall`_ on MSDN for more details. - -.. _`__vectorcall`: http://msdn.microsoft.com/en-us/library/dn375768.aspx - }]; -} - -def DocCatConsumed : DocumentationCategory<"Consumed Annotation Checking"> { - let Content = [{ -Clang supports additional attributes for checking basic resource management -properties, specifically for unique objects that have a single owning reference. -The following attributes are currently supported, although **the implementation -for these annotations is currently in development and are subject to change.** - }]; -} - -def SetTypestateDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -Annotate methods that transition an object into a new state with -``__attribute__((set_typestate(new_state)))``. The new state must be -unconsumed, consumed, or unknown. - }]; -} - -def CallableWhenDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -Use ``__attribute__((callable_when(...)))`` to indicate what states a method -may be called in. Valid states are unconsumed, consumed, or unknown. Each -argument to this attribute must be a quoted string. E.g.: - -``__attribute__((callable_when("unconsumed", "unknown")))`` - }]; -} - -def TestTypestateDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -Use ``__attribute__((test_typestate(tested_state)))`` to indicate that a method -returns true if the object is in the specified state.. - }]; -} - -def ParamTypestateDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -This attribute specifies expectations about function parameters. Calls to an -function with annotated parameters will issue a warning if the corresponding -argument isn't in the expected state. The attribute is also used to set the -initial state of the parameter when analyzing the function's body. - }]; -} - -def ReturnTypestateDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -The ``return_typestate`` attribute can be applied to functions or parameters. -When applied to a function the attribute specifies the state of the returned -value. The function's body is checked to ensure that it always returns a value -in the specified state. On the caller side, values returned by the annotated -function are initialized to the given state. - -When applied to a function parameter it modifies the state of an argument after -a call to the function returns. The function's body is checked to ensure that -the parameter is in the expected state before returning. - }]; -} - -def ConsumableDocs : Documentation { - let Category = DocCatConsumed; - let Content = [{ -Each ``class`` that uses any of the typestate annotations must first be marked -using the ``consumable`` attribute. Failure to do so will result in a warning. - -This attribute accepts a single parameter that must be one of the following: -``unknown``, ``consumed``, or ``unconsumed``. - }]; -} - -def NoSanitizeDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -Use the ``no_sanitize`` attribute on a function declaration to specify -that a particular instrumentation or set of instrumentations should not be -applied to that function. The attribute takes a list of string literals, -which have the same meaning as values accepted by the ``-fno-sanitize=`` -flag. For example, ``__attribute__((no_sanitize("address", "thread")))`` -specifies that AddressSanitizer and ThreadSanitizer should not be applied -to the function. - -See :ref:`Controlling Code Generation <controlling-code-generation>` for a -full list of supported sanitizer flags. - }]; -} - -def NoSanitizeAddressDocs : Documentation { - let Category = DocCatFunction; - // This function has multiple distinct spellings, and so it requires a custom - // heading to be specified. The most common spelling is sufficient. - let Heading = "no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address)"; - let Content = [{ -.. _langext-address_sanitizer: - -Use ``__attribute__((no_sanitize_address))`` on a function declaration to -specify that address safety instrumentation (e.g. AddressSanitizer) should -not be applied to that function. - }]; -} - -def NoSanitizeThreadDocs : Documentation { - let Category = DocCatFunction; - let Heading = "no_sanitize_thread"; - let Content = [{ -.. _langext-thread_sanitizer: - -Use ``__attribute__((no_sanitize_thread))`` on a function declaration to -specify that checks for data races on plain (non-atomic) memory accesses should -not be inserted by ThreadSanitizer. The function is still instrumented by the -tool to avoid false positives and provide meaningful stack traces. - }]; -} - -def NoSanitizeMemoryDocs : Documentation { - let Category = DocCatFunction; - let Heading = "no_sanitize_memory"; - let Content = [{ -.. _langext-memory_sanitizer: - -Use ``__attribute__((no_sanitize_memory))`` on a function declaration to -specify that checks for uninitialized memory should not be inserted -(e.g. by MemorySanitizer). The function may still be instrumented by the tool -to avoid false positives in other places. - }]; -} - -def DocCatTypeSafety : DocumentationCategory<"Type Safety Checking"> { - let Content = [{ -Clang supports additional attributes to enable checking type safety properties -that can't be enforced by the C type system. Use cases include: - -* MPI library implementations, where these attributes enable checking that - the buffer type matches the passed ``MPI_Datatype``; -* for HDF5 library there is a similar use case to MPI; -* checking types of variadic functions' arguments for functions like - ``fcntl()`` and ``ioctl()``. - -You can detect support for these attributes with ``__has_attribute()``. For -example: - -.. code-block:: c++ - - #if defined(__has_attribute) - # if __has_attribute(argument_with_type_tag) && \ - __has_attribute(pointer_with_type_tag) && \ - __has_attribute(type_tag_for_datatype) - # define ATTR_MPI_PWT(buffer_idx, type_idx) __attribute__((pointer_with_type_tag(mpi,buffer_idx,type_idx))) - /* ... other macros ... */ - # endif - #endif - - #if !defined(ATTR_MPI_PWT) - # define ATTR_MPI_PWT(buffer_idx, type_idx) - #endif - - int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) - ATTR_MPI_PWT(1,3); - }]; -} - -def ArgumentWithTypeTagDocs : Documentation { - let Category = DocCatTypeSafety; - let Heading = "argument_with_type_tag"; - let Content = [{ -Use ``__attribute__((argument_with_type_tag(arg_kind, arg_idx, -type_tag_idx)))`` on a function declaration to specify that the function -accepts a type tag that determines the type of some other argument. -``arg_kind`` is an identifier that should be used when annotating all -applicable type tags. - -This attribute is primarily useful for checking arguments of variadic functions -(``pointer_with_type_tag`` can be used in most non-variadic cases). - -For example: - -.. code-block:: c++ - - int fcntl(int fd, int cmd, ...) - __attribute__(( argument_with_type_tag(fcntl,3,2) )); - }]; -} - -def PointerWithTypeTagDocs : Documentation { - let Category = DocCatTypeSafety; - let Heading = "pointer_with_type_tag"; - let Content = [{ -Use ``__attribute__((pointer_with_type_tag(ptr_kind, ptr_idx, type_tag_idx)))`` -on a function declaration to specify that the function accepts a type tag that -determines the pointee type of some other pointer argument. - -For example: - -.. code-block:: c++ - - int MPI_Send(void *buf, int count, MPI_Datatype datatype /*, other args omitted */) - __attribute__(( pointer_with_type_tag(mpi,1,3) )); - }]; -} - -def TypeTagForDatatypeDocs : Documentation { - let Category = DocCatTypeSafety; - let Content = [{ -Clang supports annotating type tags of two forms. - -* **Type tag that is an expression containing a reference to some declared - identifier.** Use ``__attribute__((type_tag_for_datatype(kind, type)))`` on a - declaration with that identifier: - - .. code-block:: c++ - - extern struct mpi_datatype mpi_datatype_int - __attribute__(( type_tag_for_datatype(mpi,int) )); - #define MPI_INT ((MPI_Datatype) &mpi_datatype_int) - -* **Type tag that is an integral literal.** Introduce a ``static const`` - variable with a corresponding initializer value and attach - ``__attribute__((type_tag_for_datatype(kind, type)))`` on that declaration, - for example: - - .. code-block:: c++ - - #define MPI_INT ((MPI_Datatype) 42) - static const MPI_Datatype mpi_datatype_int - __attribute__(( type_tag_for_datatype(mpi,int) )) = 42 - -The attribute also accepts an optional third argument that determines how the -expression is compared to the type tag. There are two supported flags: - -* ``layout_compatible`` will cause types to be compared according to - layout-compatibility rules (C++11 [class.mem] p 17, 18). This is - implemented to support annotating types like ``MPI_DOUBLE_INT``. - - For example: - - .. code-block:: c++ - - /* In mpi.h */ - struct internal_mpi_double_int { double d; int i; }; - extern struct mpi_datatype mpi_datatype_double_int - __attribute__(( type_tag_for_datatype(mpi, struct internal_mpi_double_int, layout_compatible) )); - - #define MPI_DOUBLE_INT ((MPI_Datatype) &mpi_datatype_double_int) - - /* In user code */ - struct my_pair { double a; int b; }; - struct my_pair *buffer; - MPI_Send(buffer, 1, MPI_DOUBLE_INT /*, ... */); // no warning - - struct my_int_pair { int a; int b; } - struct my_int_pair *buffer2; - MPI_Send(buffer2, 1, MPI_DOUBLE_INT /*, ... */); // warning: actual buffer element - // type 'struct my_int_pair' - // doesn't match specified MPI_Datatype - -* ``must_be_null`` specifies that the expression should be a null pointer - constant, for example: - - .. code-block:: c++ - - /* In mpi.h */ - extern struct mpi_datatype mpi_datatype_null - __attribute__(( type_tag_for_datatype(mpi, void, must_be_null) )); - - #define MPI_DATATYPE_NULL ((MPI_Datatype) &mpi_datatype_null) - - /* In user code */ - MPI_Send(buffer, 1, MPI_DATATYPE_NULL /*, ... */); // warning: MPI_DATATYPE_NULL - // was specified but buffer - // is not a null pointer - }]; -} - -def FlattenDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``flatten`` attribute causes calls within the attributed function to -be inlined unless it is impossible to do so, for example if the body of the -callee is unavailable or if the callee has the ``noinline`` attribute. - }]; -} - -def FormatDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ - -Clang supports the ``format`` attribute, which indicates that the function -accepts a ``printf`` or ``scanf``-like format string and corresponding -arguments or a ``va_list`` that contains these arguments. - -Please see `GCC documentation about format attribute -<http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html>`_ to find details -about attribute syntax. - -Clang implements two kinds of checks with this attribute. - -#. Clang checks that the function with the ``format`` attribute is called with - a format string that uses format specifiers that are allowed, and that - arguments match the format string. This is the ``-Wformat`` warning, it is - on by default. - -#. Clang checks that the format string argument is a literal string. This is - the ``-Wformat-nonliteral`` warning, it is off by default. - - Clang implements this mostly the same way as GCC, but there is a difference - for functions that accept a ``va_list`` argument (for example, ``vprintf``). - GCC does not emit ``-Wformat-nonliteral`` warning for calls to such - functions. Clang does not warn if the format string comes from a function - parameter, where the function is annotated with a compatible attribute, - otherwise it warns. For example: - - .. code-block:: c - - __attribute__((__format__ (__scanf__, 1, 3))) - void foo(const char* s, char *buf, ...) { - va_list ap; - va_start(ap, buf); - - vprintf(s, ap); // warning: format string is not a string literal - } - - In this case we warn because ``s`` contains a format string for a - ``scanf``-like function, but it is passed to a ``printf``-like function. - - If the attribute is removed, clang still warns, because the format string is - not a string literal. - - Another example: - - .. code-block:: c - - __attribute__((__format__ (__printf__, 1, 3))) - void foo(const char* s, char *buf, ...) { - va_list ap; - va_start(ap, buf); - - vprintf(s, ap); // warning - } - - In this case Clang does not warn because the format string ``s`` and - the corresponding arguments are annotated. If the arguments are - incorrect, the caller of ``foo`` will receive a warning. - }]; -} - -def AlignValueDocs : Documentation { - let Category = DocCatType; - let Content = [{ -The align_value attribute can be added to the typedef of a pointer type or the -declaration of a variable of pointer or reference type. It specifies that the -pointer will point to, or the reference will bind to, only objects with at -least the provided alignment. This alignment value must be some positive power -of 2. - - .. code-block:: c - - typedef double * aligned_double_ptr __attribute__((align_value(64))); - void foo(double & x __attribute__((align_value(128)), - aligned_double_ptr y) { ... } - -If the pointer value does not have the specified alignment at runtime, the -behavior of the program is undefined. - }]; -} - -def FlagEnumDocs : Documentation { - let Category = DocCatType; - let Content = [{ -This attribute can be added to an enumerator to signal to the compiler that it -is intended to be used as a flag type. This will cause the compiler to assume -that the range of the type includes all of the values that you can get by -manipulating bits of the enumerator when issuing warnings. - }]; -} - -def MSInheritanceDocs : Documentation { - let Category = DocCatType; - let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance"; - let Content = [{ -This collection of keywords is enabled under ``-fms-extensions`` and controls -the pointer-to-member representation used on ``*-*-win32`` targets. - -The ``*-*-win32`` targets utilize a pointer-to-member representation which -varies in size and alignment depending on the definition of the underlying -class. - -However, this is problematic when a forward declaration is only available and -no definition has been made yet. In such cases, Clang is forced to utilize the -most general representation that is available to it. - -These keywords make it possible to use a pointer-to-member representation other -than the most general one regardless of whether or not the definition will ever -be present in the current translation unit. - -This family of keywords belong between the ``class-key`` and ``class-name``: - -.. code-block:: c++ - - struct __single_inheritance S; - int S::*i; - struct S {}; - -This keyword can be applied to class templates but only has an effect when used -on full specializations: - -.. code-block:: c++ - - template <typename T, typename U> struct __single_inheritance A; // warning: inheritance model ignored on primary template - template <typename T> struct __multiple_inheritance A<T, T>; // warning: inheritance model ignored on partial specialization - template <> struct __single_inheritance A<int, float>; - -Note that choosing an inheritance model less general than strictly necessary is -an error: - -.. code-block:: c++ - - struct __multiple_inheritance S; // error: inheritance model does not match definition - int S::*i; - struct S {}; -}]; -} - -def MSNoVTableDocs : Documentation { - let Category = DocCatType; - let Content = [{ -This attribute can be added to a class declaration or definition to signal to -the compiler that constructors and destructors will not reference the virtual -function table. It is only supported when using the Microsoft C++ ABI. - }]; -} - -def OptnoneDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``optnone`` attribute suppresses essentially all optimizations -on a function or method, regardless of the optimization level applied to -the compilation unit as a whole. This is particularly useful when you -need to debug a particular function, but it is infeasible to build the -entire application without optimization. Avoiding optimization on the -specified function can improve the quality of the debugging information -for that function. - -This attribute is incompatible with the ``always_inline`` and ``minsize`` -attributes. - }]; -} - -def LoopHintDocs : Documentation { - let Category = DocCatStmt; - let Heading = "#pragma clang loop"; - let Content = [{ -The ``#pragma clang loop`` directive allows loop optimization hints to be -specified for the subsequent loop. The directive allows vectorization, -interleaving, and unrolling to be enabled or disabled. Vector width as well -as interleave and unrolling count can be manually specified. See -`language extensions -<http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations>`_ -for details. - }]; -} - -def UnrollHintDocs : Documentation { - let Category = DocCatStmt; - let Heading = "#pragma unroll, #pragma nounroll"; - let Content = [{ -Loop unrolling optimization hints can be specified with ``#pragma unroll`` and -``#pragma nounroll``. The pragma is placed immediately before a for, while, -do-while, or c++11 range-based for loop. - -Specifying ``#pragma unroll`` without a parameter directs the loop unroller to -attempt to fully unroll the loop if the trip count is known at compile time and -attempt to partially unroll the loop if the trip count is not known at compile -time: - -.. code-block:: c++ - - #pragma unroll - for (...) { - ... - } - -Specifying the optional parameter, ``#pragma unroll _value_``, directs the -unroller to unroll the loop ``_value_`` times. The parameter may optionally be -enclosed in parentheses: - -.. code-block:: c++ - - #pragma unroll 16 - for (...) { - ... - } - - #pragma unroll(16) - for (...) { - ... - } - -Specifying ``#pragma nounroll`` indicates that the loop should not be unrolled: - -.. code-block:: c++ - - #pragma nounroll - for (...) { - ... - } - -``#pragma unroll`` and ``#pragma unroll _value_`` have identical semantics to -``#pragma clang loop unroll(full)`` and -``#pragma clang loop unroll_count(_value_)`` respectively. ``#pragma nounroll`` -is equivalent to ``#pragma clang loop unroll(disable)``. See -`language extensions -<http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations>`_ -for further details including limitations of the unroll hints. - }]; -} - -def DocOpenCLAddressSpaces : DocumentationCategory<"OpenCL Address Spaces"> { - let Content = [{ -The address space qualifier may be used to specify the region of memory that is -used to allocate the object. OpenCL supports the following address spaces: -__generic(generic), __global(global), __local(local), __private(private), -__constant(constant). - - .. code-block:: c - - __constant int c = ...; - - __generic int* foo(global int* g) { - __local int* l; - private int p; - ... - return l; - } - -More details can be found in the OpenCL C language Spec v2.0, Section 6.5. - }]; -} - -def OpenCLAddressSpaceGenericDocs : Documentation { - let Category = DocOpenCLAddressSpaces; - let Content = [{ -The generic address space attribute is only available with OpenCL v2.0 and later. -It can be used with pointer types. Variables in global and local scope and -function parameters in non-kernel functions can have the generic address space -type attribute. It is intended to be a placeholder for any other address space -except for '__constant' in OpenCL code which can be used with multiple address -spaces. - }]; -} - -def OpenCLAddressSpaceConstantDocs : Documentation { - let Category = DocOpenCLAddressSpaces; - let Content = [{ -The constant address space attribute signals that an object is located in -a constant (non-modifiable) memory region. It is available to all work items. -Any type can be annotated with the constant address space attribute. Objects -with the constant address space qualifier can be declared in any scope and must -have an initializer. - }]; -} - -def OpenCLAddressSpaceGlobalDocs : Documentation { - let Category = DocOpenCLAddressSpaces; - let Content = [{ -The global address space attribute specifies that an object is allocated in -global memory, which is accessible by all work items. The content stored in this -memory area persists between kernel executions. Pointer types to the global -address space are allowed as function parameters or local variables. Starting -with OpenCL v2.0, the global address space can be used with global (program -scope) variables and static local variable as well. - }]; -} - -def OpenCLAddressSpaceLocalDocs : Documentation { - let Category = DocOpenCLAddressSpaces; - let Content = [{ -The local address space specifies that an object is allocated in the local (work -group) memory area, which is accessible to all work items in the same work -group. The content stored in this memory region is not accessible after -the kernel execution ends. In a kernel function scope, any variable can be in -the local address space. In other scopes, only pointer types to the local address -space are allowed. Local address space variables cannot have an initializer. - }]; -} - -def OpenCLAddressSpacePrivateDocs : Documentation { - let Category = DocOpenCLAddressSpaces; - let Content = [{ -The private address space specifies that an object is allocated in the private -(work item) memory. Other work items cannot access the same memory area and its -content is destroyed after work item execution ends. Local variables can be -declared in the private address space. Function arguments are always in the -private address space. Kernel function arguments of a pointer or an array type -cannot point to the private address space. - }]; -} - -def NullabilityDocs : DocumentationCategory<"Nullability Attributes"> { - let Content = [{ -Whether a particular pointer may be "null" is an important concern when working with pointers in the C family of languages. The various nullability attributes indicate whether a particular pointer can be null or not, which makes APIs more expressive and can help static analysis tools identify bugs involving null pointers. Clang supports several kinds of nullability attributes: the ``nonnull`` and ``returns_nonnull`` attributes indicate which function or method parameters and result types can never be null, while nullability type qualifiers indicate which pointer types can be null (``_Nullable``) or cannot be null (``_Nonnull``). - -The nullability (type) qualifiers express whether a value of a given pointer type can be null (the ``_Nullable`` qualifier), doesn't have a defined meaning for null (the ``_Nonnull`` qualifier), or for which the purpose of null is unclear (the ``_Null_unspecified`` qualifier). Because nullability qualifiers are expressed within the type system, they are more general than the ``nonnull`` and ``returns_nonnull`` attributes, allowing one to express (for example) a nullable pointer to an array of nonnull pointers. Nullability qualifiers are written to the right of the pointer to which they apply. For example: - - .. code-block:: c - - // No meaningful result when 'ptr' is null (here, it happens to be undefined behavior). - int fetch(int * _Nonnull ptr) { return *ptr; } - - // 'ptr' may be null. - int fetch_or_zero(int * _Nullable ptr) { - return ptr ? *ptr : 0; - } - - // A nullable pointer to non-null pointers to const characters. - const char *join_strings(const char * _Nonnull * _Nullable strings, unsigned n); - -In Objective-C, there is an alternate spelling for the nullability qualifiers that can be used in Objective-C methods and properties using context-sensitive, non-underscored keywords. For example: - - .. code-block:: objective-c - - @interface NSView : NSResponder - - (nullable NSView *)ancestorSharedWithView:(nonnull NSView *)aView; - @property (assign, nullable) NSView *superview; - @property (readonly, nonnull) NSArray *subviews; - @end - }]; -} - -def TypeNonNullDocs : Documentation { - let Category = NullabilityDocs; - let Content = [{ -The ``_Nonnull`` nullability qualifier indicates that null is not a meaningful value for a value of the ``_Nonnull`` pointer type. For example, given a declaration such as: - - .. code-block:: c - - int fetch(int * _Nonnull ptr); - -a caller of ``fetch`` should not provide a null value, and the compiler will produce a warning if it sees a literal null value passed to ``fetch``. Note that, unlike the declaration attribute ``nonnull``, the presence of ``_Nonnull`` does not imply that passing null is undefined behavior: ``fetch`` is free to consider null undefined behavior or (perhaps for backward-compatibility reasons) defensively handle null. - }]; -} - -def TypeNullableDocs : Documentation { - let Category = NullabilityDocs; - let Content = [{ -The ``_Nullable`` nullability qualifier indicates that a value of the ``_Nullable`` pointer type can be null. For example, given: - - .. code-block:: c - - int fetch_or_zero(int * _Nullable ptr); - -a caller of ``fetch_or_zero`` can provide null. - }]; -} - -def TypeNullUnspecifiedDocs : Documentation { - let Category = NullabilityDocs; - let Content = [{ -The ``_Null_unspecified`` nullability qualifier indicates that neither the ``_Nonnull`` nor ``_Nullable`` qualifiers make sense for a particular pointer type. It is used primarily to indicate that the role of null with specific pointers in a nullability-annotated header is unclear, e.g., due to overly-complex implementations or historical factors with a long-lived API. - }]; -} - -def NonNullDocs : Documentation { - let Category = NullabilityDocs; - let Content = [{ -The ``nonnull`` attribute indicates that some function parameters must not be null, and can be used in several different ways. It's original usage (`from GCC <https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes>`_) is as a function (or Objective-C method) attribute that specifies which parameters of the function are nonnull in a comma-separated list. For example: - - .. code-block:: c - - extern void * my_memcpy (void *dest, const void *src, size_t len) - __attribute__((nonnull (1, 2))); - -Here, the ``nonnull`` attribute indicates that parameters 1 and 2 -cannot have a null value. Omitting the parenthesized list of parameter indices means that all parameters of pointer type cannot be null: - - .. code-block:: c - - extern void * my_memcpy (void *dest, const void *src, size_t len) - __attribute__((nonnull)); - -Clang also allows the ``nonnull`` attribute to be placed directly on a function (or Objective-C method) parameter, eliminating the need to specify the parameter index ahead of type. For example: - - .. code-block:: c - - extern void * my_memcpy (void *dest __attribute__((nonnull)), - const void *src __attribute__((nonnull)), size_t len); - -Note that the ``nonnull`` attribute indicates that passing null to a non-null parameter is undefined behavior, which the optimizer may take advantage of to, e.g., remove null checks. The ``_Nonnull`` type qualifier indicates that a pointer cannot be null in a more general manner (because it is part of the type system) and does not imply undefined behavior, making it more widely applicable. - }]; -} - -def ReturnsNonNullDocs : Documentation { - let Category = NullabilityDocs; - let Content = [{ -The ``returns_nonnull`` attribute indicates that a particular function (or Objective-C method) always returns a non-null pointer. For example, a particular system ``malloc`` might be defined to terminate a process when memory is not available rather than returning a null pointer: - - .. code-block:: c - - extern void * malloc (size_t size) __attribute__((returns_nonnull)); - -The ``returns_nonnull`` attribute implies that returning a null pointer is undefined behavior, which the optimizer may take advantage of. The ``_Nonnull`` type qualifier indicates that a pointer cannot be null in a more general manner (because it is part of the type system) and does not imply undefined behavior, making it more widely applicable -}]; -} - -def NoAliasDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``noalias`` attribute indicates that the only memory accesses inside -function are loads and stores from objects pointed to by its pointer-typed -arguments, with arbitrary offsets. - }]; -} - -def NotTailCalledDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``not_tail_called`` attribute prevents tail-call optimization on statically bound calls. It has no effect on indirect calls. Virtual functions, objective-c methods, and functions marked as ``always_inline`` cannot be marked as ``not_tail_called``. - -For example, it prevents tail-call optimization in the following case: - - .. code-block: c - - int __attribute__((not_tail_called)) foo1(int); - - int foo2(int a) { - return foo1(a); // No tail-call optimization on direct calls. - } - -However, it doesn't prevent tail-call optimization in this case: - - .. code-block: c - - int __attribute__((not_tail_called)) foo1(int); - - int foo2(int a) { - int (*fn)(int) = &foo1; - - // not_tail_called has no effect on an indirect call even if the call can be - // resolved at compile time. - return (*fn)(a); - } - -Marking virtual functions as ``not_tail_called`` is an error: - - .. code-block: c++ - - class Base { - public: - // not_tail_called on a virtual function is an error. - [[clang::not_tail_called]] virtual int foo1(); - - virtual int foo2(); - - // Non-virtual functions can be marked ``not_tail_called``. - [[clang::not_tail_called]] int foo3(); - }; - - class Derived1 : public Base { - public: - int foo1() override; - - // not_tail_called on a virtual function is an error. - [[clang::not_tail_called]] int foo2() override; - }; - }]; -} - -def InternalLinkageDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``internal_linkage`` attribute changes the linkage type of the declaration to internal. -This is similar to C-style ``static``, but can be used on classes and class methods. When applied to a class definition, -this attribute affects all methods and static data members of that class. -This can be used to contain the ABI of a C++ library by excluding unwanted class methods from the export tables. - }]; -} - -def DisableTailCallsDocs : Documentation { - let Category = DocCatFunction; - let Content = [{ -The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. - -For example: - - .. code-block:: c - - int callee(int); - - int foo(int a) __attribute__((disable_tail_calls)) { - return callee(a); // This call is not tail-call optimized. - } - -Marking virtual functions as ``disable_tail_calls`` is legal. - - .. code-block: c++ - - int callee(int); - - class Base { - public: - [[clang::disable_tail_calls]] virtual int foo1() { - return callee(); // This call is not tail-call optimized. - } - }; - - class Derived1 : public Base { - public: - int foo1() override { - return callee(); // This call is tail-call optimized. - } - }; - - }]; -} diff --git a/include/clang/Basic/AttrKinds.h b/include/clang/Basic/AttrKinds.h deleted file mode 100644 index f0b0a64..0000000 --- a/include/clang/Basic/AttrKinds.h +++ /dev/null @@ -1,34 +0,0 @@ -//===----- Attr.h - Enum values for C Attribute Kinds ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::attr::Kind enum. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_ATTRKINDS_H -#define LLVM_CLANG_BASIC_ATTRKINDS_H - -namespace clang { - -namespace attr { - -// \brief A list of all the recognized kinds of attributes. -enum Kind { -#define ATTR(X) X, -#define LAST_INHERITABLE_ATTR(X) X, LAST_INHERITABLE = X, -#define LAST_INHERITABLE_PARAM_ATTR(X) X, LAST_INHERITABLE_PARAM = X, -#include "clang/Basic/AttrList.inc" - NUM_ATTRS -}; - -} // end namespace attr -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Attributes.h b/include/clang/Basic/Attributes.h deleted file mode 100644 index a2b8684..0000000 --- a/include/clang/Basic/Attributes.h +++ /dev/null @@ -1,39 +0,0 @@ -//===--- Attributes.h - Attributes header -----------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_ATTRIBUTES_H -#define LLVM_CLANG_BASIC_ATTRIBUTES_H - -#include "clang/Basic/LangOptions.h" -#include "clang/Basic/TargetInfo.h" - -namespace clang { - -class IdentifierInfo; - -enum class AttrSyntax { - /// Is the identifier known as a GNU-style attribute? - GNU, - /// Is the identifier known as a __declspec-style attribute? - Declspec, - // Is the identifier known as a C++-style attribute? - CXX, - // Is the identifier known as a pragma attribute? - Pragma -}; - -/// \brief Return the version number associated with the attribute if we -/// recognize and implement the attribute specified by the given information. -int hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope, - const IdentifierInfo *Attr, const TargetInfo &Target, - const LangOptions &LangOpts); - -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_ATTRIBUTES_H diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def deleted file mode 100644 index 4f474eb..0000000 --- a/include/clang/Basic/Builtins.def +++ /dev/null @@ -1,1257 +0,0 @@ -//===--- Builtins.def - Builtin function info database ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the standard builtin function database. Users of this file -// must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// FIXME: This should really be a .td file, but that requires modifying tblgen. -// Perhaps tblgen should have plugins. - -// The first value provided to the macro specifies the function name of the -// builtin, and results in a clang::builtin::BIXX enum value for XX. - -// The second value provided to the macro specifies the type of the function -// (result value, then each argument) as follows: -// v -> void -// b -> boolean -// c -> char -// s -> short -// i -> int -// h -> half -// f -> float -// d -> double -// z -> size_t -// F -> constant CFString -// G -> id -// H -> SEL -// M -> struct objc_super -// a -> __builtin_va_list -// A -> "reference" to __builtin_va_list -// V -> Vector, followed by the number of elements and the base type. -// E -> ext_vector, followed by the number of elements and the base type. -// X -> _Complex, followed by the base type. -// Y -> ptrdiff_t -// P -> FILE -// J -> jmp_buf -// SJ -> sigjmp_buf -// K -> ucontext_t -// p -> pid_t -// . -> "...". This may only occur at the end of the function list. -// -// Types may be prefixed with the following modifiers: -// L -> long (e.g. Li for 'long int') -// LL -> long long -// LLL -> __int128_t (e.g. LLLi) -// W -> int64_t -// S -> signed -// U -> unsigned -// I -> Required to constant fold to an integer constant expression. -// -// Types may be postfixed with the following modifiers: -// * -> pointer (optionally followed by an address space number, if no address -// space is specified than any address space will be accepted) -// & -> reference (optionally followed by an address space number) -// C -> const -// D -> volatile - -// The third value provided to the macro specifies information about attributes -// of the function. These must be kept in sync with the predicates in the -// Builtin::Context class. Currently we have: -// n -> nothrow -// r -> noreturn -// c -> const -// t -> signature is meaningless, use custom typechecking -// F -> this is a libc/libm function with a '__builtin_' prefix added. -// f -> this is a libc/libm function without the '__builtin_' prefix. It can -// be followed by ':headername:' to state which header this function -// comes from. -// i -> this is a runtime library implemented function without the -// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc. -// p:N: -> this is a printf-like function whose Nth argument is the format -// string. -// P:N: -> similar to the p:N: attribute, but the function is like vprintf -// in that it accepts its arguments as a va_list rather than -// through an ellipsis -// s:N: -> this is a scanf-like function whose Nth argument is the format -// string. -// S:N: -> similar to the s:N: attribute, but the function is like vscanf -// in that it accepts its arguments as a va_list rather than -// through an ellipsis -// e -> const, but only when -fmath-errno=0 -// j -> returns_twice (like setjmp) -// u -> arguments are not evaluated for their side-effects -// FIXME: gcc has nonnull - -#if defined(BUILTIN) && !defined(LIBBUILTIN) -# define LIBBUILTIN(ID, TYPE, ATTRS, HEADER, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) -#endif - -#if defined(BUILTIN) && !defined(LANGBUILTIN) -# define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) -#endif - -// Standard libc/libm functions: -BUILTIN(__builtin_atan2 , "ddd" , "Fnc") -BUILTIN(__builtin_atan2f, "fff" , "Fnc") -BUILTIN(__builtin_atan2l, "LdLdLd", "Fnc") -BUILTIN(__builtin_abs , "ii" , "ncF") -BUILTIN(__builtin_copysign, "ddd", "ncF") -BUILTIN(__builtin_copysignf, "fff", "ncF") -BUILTIN(__builtin_copysignl, "LdLdLd", "ncF") -BUILTIN(__builtin_fabs , "dd" , "ncF") -BUILTIN(__builtin_fabsf, "ff" , "ncF") -BUILTIN(__builtin_fabsl, "LdLd", "ncF") -BUILTIN(__builtin_fmod , "ddd" , "Fnc") -BUILTIN(__builtin_fmodf, "fff" , "Fnc") -BUILTIN(__builtin_fmodl, "LdLdLd", "Fnc") -BUILTIN(__builtin_frexp , "ddi*" , "Fn") -BUILTIN(__builtin_frexpf, "ffi*" , "Fn") -BUILTIN(__builtin_frexpl, "LdLdi*", "Fn") -BUILTIN(__builtin_huge_val, "d", "nc") -BUILTIN(__builtin_huge_valf, "f", "nc") -BUILTIN(__builtin_huge_vall, "Ld", "nc") -BUILTIN(__builtin_inf , "d" , "nc") -BUILTIN(__builtin_inff , "f" , "nc") -BUILTIN(__builtin_infl , "Ld" , "nc") -BUILTIN(__builtin_labs , "LiLi" , "Fnc") -BUILTIN(__builtin_llabs, "LLiLLi", "Fnc") -BUILTIN(__builtin_ldexp , "ddi" , "Fnc") -BUILTIN(__builtin_ldexpf, "ffi" , "Fnc") -BUILTIN(__builtin_ldexpl, "LdLdi", "Fnc") -BUILTIN(__builtin_modf , "ddd*" , "Fn") -BUILTIN(__builtin_modff, "fff*" , "Fn") -BUILTIN(__builtin_modfl, "LdLdLd*", "Fn") -BUILTIN(__builtin_nan, "dcC*" , "ncF") -BUILTIN(__builtin_nanf, "fcC*" , "ncF") -BUILTIN(__builtin_nanl, "LdcC*", "ncF") -BUILTIN(__builtin_nans, "dcC*" , "ncF") -BUILTIN(__builtin_nansf, "fcC*" , "ncF") -BUILTIN(__builtin_nansl, "LdcC*", "ncF") -BUILTIN(__builtin_powi , "ddi" , "Fnc") -BUILTIN(__builtin_powif, "ffi" , "Fnc") -BUILTIN(__builtin_powil, "LdLdi", "Fnc") -BUILTIN(__builtin_pow , "ddd" , "Fnc") -BUILTIN(__builtin_powf, "fff" , "Fnc") -BUILTIN(__builtin_powl, "LdLdLd", "Fnc") - -// Standard unary libc/libm functions with double/float/long double variants: -BUILTIN(__builtin_acos , "dd" , "Fnc") -BUILTIN(__builtin_acosf, "ff" , "Fnc") -BUILTIN(__builtin_acosl, "LdLd", "Fnc") -BUILTIN(__builtin_acosh , "dd" , "Fnc") -BUILTIN(__builtin_acoshf, "ff" , "Fnc") -BUILTIN(__builtin_acoshl, "LdLd", "Fnc") -BUILTIN(__builtin_asin , "dd" , "Fnc") -BUILTIN(__builtin_asinf, "ff" , "Fnc") -BUILTIN(__builtin_asinl, "LdLd", "Fnc") -BUILTIN(__builtin_asinh , "dd" , "Fnc") -BUILTIN(__builtin_asinhf, "ff" , "Fnc") -BUILTIN(__builtin_asinhl, "LdLd", "Fnc") -BUILTIN(__builtin_atan , "dd" , "Fnc") -BUILTIN(__builtin_atanf, "ff" , "Fnc") -BUILTIN(__builtin_atanl, "LdLd", "Fnc") -BUILTIN(__builtin_atanh , "dd", "Fnc") -BUILTIN(__builtin_atanhf, "ff", "Fnc") -BUILTIN(__builtin_atanhl, "LdLd", "Fnc") -BUILTIN(__builtin_cbrt , "dd", "Fnc") -BUILTIN(__builtin_cbrtf, "ff", "Fnc") -BUILTIN(__builtin_cbrtl, "LdLd", "Fnc") -BUILTIN(__builtin_ceil , "dd" , "Fnc") -BUILTIN(__builtin_ceilf, "ff" , "Fnc") -BUILTIN(__builtin_ceill, "LdLd", "Fnc") -BUILTIN(__builtin_cos , "dd" , "Fnc") -BUILTIN(__builtin_cosf, "ff" , "Fnc") -BUILTIN(__builtin_cosh , "dd" , "Fnc") -BUILTIN(__builtin_coshf, "ff" , "Fnc") -BUILTIN(__builtin_coshl, "LdLd", "Fnc") -BUILTIN(__builtin_cosl, "LdLd", "Fnc") -BUILTIN(__builtin_erf , "dd", "Fnc") -BUILTIN(__builtin_erff, "ff", "Fnc") -BUILTIN(__builtin_erfl, "LdLd", "Fnc") -BUILTIN(__builtin_erfc , "dd", "Fnc") -BUILTIN(__builtin_erfcf, "ff", "Fnc") -BUILTIN(__builtin_erfcl, "LdLd", "Fnc") -BUILTIN(__builtin_exp , "dd" , "Fnc") -BUILTIN(__builtin_expf, "ff" , "Fnc") -BUILTIN(__builtin_expl, "LdLd", "Fnc") -BUILTIN(__builtin_exp2 , "dd" , "Fnc") -BUILTIN(__builtin_exp2f, "ff" , "Fnc") -BUILTIN(__builtin_exp2l, "LdLd", "Fnc") -BUILTIN(__builtin_expm1 , "dd", "Fnc") -BUILTIN(__builtin_expm1f, "ff", "Fnc") -BUILTIN(__builtin_expm1l, "LdLd", "Fnc") -BUILTIN(__builtin_fdim, "ddd", "Fnc") -BUILTIN(__builtin_fdimf, "fff", "Fnc") -BUILTIN(__builtin_fdiml, "LdLdLd", "Fnc") -BUILTIN(__builtin_floor , "dd" , "Fnc") -BUILTIN(__builtin_floorf, "ff" , "Fnc") -BUILTIN(__builtin_floorl, "LdLd", "Fnc") -BUILTIN(__builtin_fma, "dddd", "Fnc") -BUILTIN(__builtin_fmaf, "ffff", "Fnc") -BUILTIN(__builtin_fmal, "LdLdLdLd", "Fnc") -BUILTIN(__builtin_fmax, "ddd", "Fnc") -BUILTIN(__builtin_fmaxf, "fff", "Fnc") -BUILTIN(__builtin_fmaxl, "LdLdLd", "Fnc") -BUILTIN(__builtin_fmin, "ddd", "Fnc") -BUILTIN(__builtin_fminf, "fff", "Fnc") -BUILTIN(__builtin_fminl, "LdLdLd", "Fnc") -BUILTIN(__builtin_hypot , "ddd" , "Fnc") -BUILTIN(__builtin_hypotf, "fff" , "Fnc") -BUILTIN(__builtin_hypotl, "LdLdLd", "Fnc") -BUILTIN(__builtin_ilogb , "id", "Fnc") -BUILTIN(__builtin_ilogbf, "if", "Fnc") -BUILTIN(__builtin_ilogbl, "iLd", "Fnc") -BUILTIN(__builtin_lgamma , "dd", "Fnc") -BUILTIN(__builtin_lgammaf, "ff", "Fnc") -BUILTIN(__builtin_lgammal, "LdLd", "Fnc") -BUILTIN(__builtin_llrint, "LLid", "Fnc") -BUILTIN(__builtin_llrintf, "LLif", "Fnc") -BUILTIN(__builtin_llrintl, "LLiLd", "Fnc") -BUILTIN(__builtin_llround , "LLid", "Fnc") -BUILTIN(__builtin_llroundf, "LLif", "Fnc") -BUILTIN(__builtin_llroundl, "LLiLd", "Fnc") -BUILTIN(__builtin_log , "dd" , "Fnc") -BUILTIN(__builtin_log10 , "dd" , "Fnc") -BUILTIN(__builtin_log10f, "ff" , "Fnc") -BUILTIN(__builtin_log10l, "LdLd", "Fnc") -BUILTIN(__builtin_log1p , "dd" , "Fnc") -BUILTIN(__builtin_log1pf, "ff" , "Fnc") -BUILTIN(__builtin_log1pl, "LdLd", "Fnc") -BUILTIN(__builtin_log2, "dd" , "Fnc") -BUILTIN(__builtin_log2f, "ff" , "Fnc") -BUILTIN(__builtin_log2l, "LdLd" , "Fnc") -BUILTIN(__builtin_logb , "dd", "Fnc") -BUILTIN(__builtin_logbf, "ff", "Fnc") -BUILTIN(__builtin_logbl, "LdLd", "Fnc") -BUILTIN(__builtin_logf, "ff" , "Fnc") -BUILTIN(__builtin_logl, "LdLd", "Fnc") -BUILTIN(__builtin_lrint , "Lid", "Fnc") -BUILTIN(__builtin_lrintf, "Lif", "Fnc") -BUILTIN(__builtin_lrintl, "LiLd", "Fnc") -BUILTIN(__builtin_lround , "Lid", "Fnc") -BUILTIN(__builtin_lroundf, "Lif", "Fnc") -BUILTIN(__builtin_lroundl, "LiLd", "Fnc") -BUILTIN(__builtin_nearbyint , "dd", "Fnc") -BUILTIN(__builtin_nearbyintf, "ff", "Fnc") -BUILTIN(__builtin_nearbyintl, "LdLd", "Fnc") -BUILTIN(__builtin_nextafter , "ddd", "Fnc") -BUILTIN(__builtin_nextafterf, "fff", "Fnc") -BUILTIN(__builtin_nextafterl, "LdLdLd", "Fnc") -BUILTIN(__builtin_nexttoward , "ddLd", "Fnc") -BUILTIN(__builtin_nexttowardf, "ffLd", "Fnc") -BUILTIN(__builtin_nexttowardl, "LdLdLd", "Fnc") -BUILTIN(__builtin_remainder , "ddd", "Fnc") -BUILTIN(__builtin_remainderf, "fff", "Fnc") -BUILTIN(__builtin_remainderl, "LdLdLd", "Fnc") -BUILTIN(__builtin_remquo , "dddi*", "Fn") -BUILTIN(__builtin_remquof, "fffi*", "Fn") -BUILTIN(__builtin_remquol, "LdLdLdi*", "Fn") -BUILTIN(__builtin_rint , "dd", "Fnc") -BUILTIN(__builtin_rintf, "ff", "Fnc") -BUILTIN(__builtin_rintl, "LdLd", "Fnc") -BUILTIN(__builtin_round, "dd" , "Fnc") -BUILTIN(__builtin_roundf, "ff" , "Fnc") -BUILTIN(__builtin_roundl, "LdLd" , "Fnc") -BUILTIN(__builtin_scalbln , "ddLi", "Fnc") -BUILTIN(__builtin_scalblnf, "ffLi", "Fnc") -BUILTIN(__builtin_scalblnl, "LdLdLi", "Fnc") -BUILTIN(__builtin_scalbn , "ddi", "Fnc") -BUILTIN(__builtin_scalbnf, "ffi", "Fnc") -BUILTIN(__builtin_scalbnl, "LdLdi", "Fnc") -BUILTIN(__builtin_sin , "dd" , "Fnc") -BUILTIN(__builtin_sinf, "ff" , "Fnc") -BUILTIN(__builtin_sinh , "dd" , "Fnc") -BUILTIN(__builtin_sinhf, "ff" , "Fnc") -BUILTIN(__builtin_sinhl, "LdLd", "Fnc") -BUILTIN(__builtin_sinl, "LdLd", "Fnc") -BUILTIN(__builtin_sqrt , "dd" , "Fnc") -BUILTIN(__builtin_sqrtf, "ff" , "Fnc") -BUILTIN(__builtin_sqrtl, "LdLd", "Fnc") -BUILTIN(__builtin_tan , "dd" , "Fnc") -BUILTIN(__builtin_tanf, "ff" , "Fnc") -BUILTIN(__builtin_tanh , "dd" , "Fnc") -BUILTIN(__builtin_tanhf, "ff" , "Fnc") -BUILTIN(__builtin_tanhl, "LdLd", "Fnc") -BUILTIN(__builtin_tanl, "LdLd", "Fnc") -BUILTIN(__builtin_tgamma , "dd", "Fnc") -BUILTIN(__builtin_tgammaf, "ff", "Fnc") -BUILTIN(__builtin_tgammal, "LdLd", "Fnc") -BUILTIN(__builtin_trunc , "dd", "Fnc") -BUILTIN(__builtin_truncf, "ff", "Fnc") -BUILTIN(__builtin_truncl, "LdLd", "Fnc") - -// C99 complex builtins -BUILTIN(__builtin_cabs, "dXd", "Fnc") -BUILTIN(__builtin_cabsf, "fXf", "Fnc") -BUILTIN(__builtin_cabsl, "LdXLd", "Fnc") -BUILTIN(__builtin_cacos, "XdXd", "Fnc") -BUILTIN(__builtin_cacosf, "XfXf", "Fnc") -BUILTIN(__builtin_cacosh, "XdXd", "Fnc") -BUILTIN(__builtin_cacoshf, "XfXf", "Fnc") -BUILTIN(__builtin_cacoshl, "XLdXLd", "Fnc") -BUILTIN(__builtin_cacosl, "XLdXLd", "Fnc") -BUILTIN(__builtin_carg, "dXd", "Fnc") -BUILTIN(__builtin_cargf, "fXf", "Fnc") -BUILTIN(__builtin_cargl, "LdXLd", "Fnc") -BUILTIN(__builtin_casin, "XdXd", "Fnc") -BUILTIN(__builtin_casinf, "XfXf", "Fnc") -BUILTIN(__builtin_casinh, "XdXd", "Fnc") -BUILTIN(__builtin_casinhf, "XfXf", "Fnc") -BUILTIN(__builtin_casinhl, "XLdXLd", "Fnc") -BUILTIN(__builtin_casinl, "XLdXLd", "Fnc") -BUILTIN(__builtin_catan, "XdXd", "Fnc") -BUILTIN(__builtin_catanf, "XfXf", "Fnc") -BUILTIN(__builtin_catanh, "XdXd", "Fnc") -BUILTIN(__builtin_catanhf, "XfXf", "Fnc") -BUILTIN(__builtin_catanhl, "XLdXLd", "Fnc") -BUILTIN(__builtin_catanl, "XLdXLd", "Fnc") -BUILTIN(__builtin_ccos, "XdXd", "Fnc") -BUILTIN(__builtin_ccosf, "XfXf", "Fnc") -BUILTIN(__builtin_ccosl, "XLdXLd", "Fnc") -BUILTIN(__builtin_ccosh, "XdXd", "Fnc") -BUILTIN(__builtin_ccoshf, "XfXf", "Fnc") -BUILTIN(__builtin_ccoshl, "XLdXLd", "Fnc") -BUILTIN(__builtin_cexp, "XdXd", "Fnc") -BUILTIN(__builtin_cexpf, "XfXf", "Fnc") -BUILTIN(__builtin_cexpl, "XLdXLd", "Fnc") -BUILTIN(__builtin_cimag, "dXd", "Fnc") -BUILTIN(__builtin_cimagf, "fXf", "Fnc") -BUILTIN(__builtin_cimagl, "LdXLd", "Fnc") -BUILTIN(__builtin_conj, "XdXd", "Fnc") -BUILTIN(__builtin_conjf, "XfXf", "Fnc") -BUILTIN(__builtin_conjl, "XLdXLd", "Fnc") -BUILTIN(__builtin_clog, "XdXd", "Fnc") -BUILTIN(__builtin_clogf, "XfXf", "Fnc") -BUILTIN(__builtin_clogl, "XLdXLd", "Fnc") -BUILTIN(__builtin_cproj, "XdXd", "Fnc") -BUILTIN(__builtin_cprojf, "XfXf", "Fnc") -BUILTIN(__builtin_cprojl, "XLdXLd", "Fnc") -BUILTIN(__builtin_cpow, "XdXdXd", "Fnc") -BUILTIN(__builtin_cpowf, "XfXfXf", "Fnc") -BUILTIN(__builtin_cpowl, "XLdXLdXLd", "Fnc") -BUILTIN(__builtin_creal, "dXd", "Fnc") -BUILTIN(__builtin_crealf, "fXf", "Fnc") -BUILTIN(__builtin_creall, "LdXLd", "Fnc") -BUILTIN(__builtin_csin, "XdXd", "Fnc") -BUILTIN(__builtin_csinf, "XfXf", "Fnc") -BUILTIN(__builtin_csinl, "XLdXLd", "Fnc") -BUILTIN(__builtin_csinh, "XdXd", "Fnc") -BUILTIN(__builtin_csinhf, "XfXf", "Fnc") -BUILTIN(__builtin_csinhl, "XLdXLd", "Fnc") -BUILTIN(__builtin_csqrt, "XdXd", "Fnc") -BUILTIN(__builtin_csqrtf, "XfXf", "Fnc") -BUILTIN(__builtin_csqrtl, "XLdXLd", "Fnc") -BUILTIN(__builtin_ctan, "XdXd", "Fnc") -BUILTIN(__builtin_ctanf, "XfXf", "Fnc") -BUILTIN(__builtin_ctanl, "XLdXLd", "Fnc") -BUILTIN(__builtin_ctanh, "XdXd", "Fnc") -BUILTIN(__builtin_ctanhf, "XfXf", "Fnc") -BUILTIN(__builtin_ctanhl, "XLdXLd", "Fnc") - -// FP Comparisons. -BUILTIN(__builtin_isgreater , "i.", "Fnc") -BUILTIN(__builtin_isgreaterequal, "i.", "Fnc") -BUILTIN(__builtin_isless , "i.", "Fnc") -BUILTIN(__builtin_islessequal , "i.", "Fnc") -BUILTIN(__builtin_islessgreater , "i.", "Fnc") -BUILTIN(__builtin_isunordered , "i.", "Fnc") - -// Unary FP classification -BUILTIN(__builtin_fpclassify, "iiiii.", "Fnc") -BUILTIN(__builtin_isfinite, "i.", "Fnc") -BUILTIN(__builtin_isinf, "i.", "Fnc") -BUILTIN(__builtin_isinf_sign, "i.", "Fnc") -BUILTIN(__builtin_isnan, "i.", "Fnc") -BUILTIN(__builtin_isnormal, "i.", "Fnc") - -// FP signbit builtins -BUILTIN(__builtin_signbit, "i.", "Fnc") -BUILTIN(__builtin_signbitf, "if", "Fnc") -BUILTIN(__builtin_signbitl, "iLd", "Fnc") - -// Builtins for arithmetic. -BUILTIN(__builtin_clzs , "iUs" , "nc") -BUILTIN(__builtin_clz , "iUi" , "nc") -BUILTIN(__builtin_clzl , "iULi" , "nc") -BUILTIN(__builtin_clzll, "iULLi", "nc") -// TODO: int clzimax(uintmax_t) -BUILTIN(__builtin_ctzs , "iUs" , "nc") -BUILTIN(__builtin_ctz , "iUi" , "nc") -BUILTIN(__builtin_ctzl , "iULi" , "nc") -BUILTIN(__builtin_ctzll, "iULLi", "nc") -// TODO: int ctzimax(uintmax_t) -BUILTIN(__builtin_ffs , "ii" , "Fnc") -BUILTIN(__builtin_ffsl , "iLi" , "Fnc") -BUILTIN(__builtin_ffsll, "iLLi", "Fnc") -BUILTIN(__builtin_parity , "iUi" , "nc") -BUILTIN(__builtin_parityl , "iULi" , "nc") -BUILTIN(__builtin_parityll, "iULLi", "nc") -BUILTIN(__builtin_popcount , "iUi" , "nc") -BUILTIN(__builtin_popcountl , "iULi" , "nc") -BUILTIN(__builtin_popcountll, "iULLi", "nc") - -// FIXME: These type signatures are not correct for targets with int != 32-bits -// or with ULL != 64-bits. -BUILTIN(__builtin_bswap16, "UsUs", "nc") -BUILTIN(__builtin_bswap32, "UiUi", "nc") -BUILTIN(__builtin_bswap64, "ULLiULLi", "nc") - -// Random GCC builtins -BUILTIN(__builtin_constant_p, "i.", "nctu") -BUILTIN(__builtin_classify_type, "i.", "nctu") -BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc") -BUILTIN(__builtin___NSStringMakeConstantString, "FC*cC*", "nc") -BUILTIN(__builtin_va_start, "vA.", "nt") -BUILTIN(__builtin_va_end, "vA", "n") -BUILTIN(__builtin_va_copy, "vAA", "n") -BUILTIN(__builtin_stdarg_start, "vA.", "n") -BUILTIN(__builtin_assume_aligned, "v*vC*z.", "nc") -BUILTIN(__builtin_bcmp, "iv*v*z", "Fn") -BUILTIN(__builtin_bcopy, "vv*v*z", "n") -BUILTIN(__builtin_bzero, "vv*z", "nF") -BUILTIN(__builtin_fprintf, "iP*cC*.", "Fp:1:") -BUILTIN(__builtin_memchr, "v*vC*iz", "nF") -BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF") -BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF") -BUILTIN(__builtin_memmove, "v*v*vC*z", "nF") -BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF") -BUILTIN(__builtin_memset, "v*v*iz", "nF") -BUILTIN(__builtin_printf, "icC*.", "Fp:0:") -BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF") -BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF") -BUILTIN(__builtin_strcasecmp, "icC*cC*", "nF") -BUILTIN(__builtin_strcat, "c*c*cC*", "nF") -BUILTIN(__builtin_strchr, "c*cC*i", "nF") -BUILTIN(__builtin_strcmp, "icC*cC*", "nF") -BUILTIN(__builtin_strcpy, "c*c*cC*", "nF") -BUILTIN(__builtin_strcspn, "zcC*cC*", "nF") -BUILTIN(__builtin_strdup, "c*cC*", "nF") -BUILTIN(__builtin_strlen, "zcC*", "nF") -BUILTIN(__builtin_strncasecmp, "icC*cC*z", "nF") -BUILTIN(__builtin_strncat, "c*c*cC*z", "nF") -BUILTIN(__builtin_strncmp, "icC*cC*z", "nF") -BUILTIN(__builtin_strncpy, "c*c*cC*z", "nF") -BUILTIN(__builtin_strndup, "c*cC*z", "nF") -BUILTIN(__builtin_strpbrk, "c*cC*cC*", "nF") -BUILTIN(__builtin_strrchr, "c*cC*i", "nF") -BUILTIN(__builtin_strspn, "zcC*cC*", "nF") -BUILTIN(__builtin_strstr, "c*cC*cC*", "nF") -BUILTIN(__builtin_return_address, "v*IUi", "n") -BUILTIN(__builtin_extract_return_addr, "v*v*", "n") -BUILTIN(__builtin_frame_address, "v*IUi", "n") -BUILTIN(__builtin___clear_cache, "vc*c*", "n") -BUILTIN(__builtin_flt_rounds, "i", "nc") -BUILTIN(__builtin_setjmp, "iv**", "j") -BUILTIN(__builtin_longjmp, "vv**i", "r") -BUILTIN(__builtin_unwind_init, "v", "") -BUILTIN(__builtin_eh_return_data_regno, "iIi", "nc") -BUILTIN(__builtin_snprintf, "ic*zcC*.", "nFp:2:") -BUILTIN(__builtin_vsprintf, "ic*cC*a", "nFP:1:") -BUILTIN(__builtin_vsnprintf, "ic*zcC*a", "nFP:2:") - -// GCC exception builtins -BUILTIN(__builtin_eh_return, "vzv*", "r") // FIXME: Takes intptr_t, not size_t! -BUILTIN(__builtin_frob_return_addr, "v*v*", "n") -BUILTIN(__builtin_dwarf_cfa, "v*", "n") -BUILTIN(__builtin_init_dwarf_reg_size_table, "vv*", "n") -BUILTIN(__builtin_dwarf_sp_column, "Ui", "n") -BUILTIN(__builtin_extend_pointer, "ULLiv*", "n") // _Unwind_Word == uint64_t - -// GCC Object size checking builtins -BUILTIN(__builtin_object_size, "zvC*i", "nu") -BUILTIN(__builtin___memcpy_chk, "v*v*vC*zz", "nF") -BUILTIN(__builtin___memccpy_chk, "v*v*vC*izz", "nF") -BUILTIN(__builtin___memmove_chk, "v*v*vC*zz", "nF") -BUILTIN(__builtin___mempcpy_chk, "v*v*vC*zz", "nF") -BUILTIN(__builtin___memset_chk, "v*v*izz", "nF") -BUILTIN(__builtin___stpcpy_chk, "c*c*cC*z", "nF") -BUILTIN(__builtin___strcat_chk, "c*c*cC*z", "nF") -BUILTIN(__builtin___strcpy_chk, "c*c*cC*z", "nF") -BUILTIN(__builtin___strlcat_chk, "zc*cC*zz", "nF") -BUILTIN(__builtin___strlcpy_chk, "zc*cC*zz", "nF") -BUILTIN(__builtin___strncat_chk, "c*c*cC*zz", "nF") -BUILTIN(__builtin___strncpy_chk, "c*c*cC*zz", "nF") -BUILTIN(__builtin___stpncpy_chk, "c*c*cC*zz", "nF") -BUILTIN(__builtin___snprintf_chk, "ic*zizcC*.", "Fp:4:") -BUILTIN(__builtin___sprintf_chk, "ic*izcC*.", "Fp:3:") -BUILTIN(__builtin___vsnprintf_chk, "ic*zizcC*a", "FP:4:") -BUILTIN(__builtin___vsprintf_chk, "ic*izcC*a", "FP:3:") -BUILTIN(__builtin___fprintf_chk, "iP*icC*.", "Fp:2:") -BUILTIN(__builtin___printf_chk, "iicC*.", "Fp:1:") -BUILTIN(__builtin___vfprintf_chk, "iP*icC*a", "FP:2:") -BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:") - -BUILTIN(__builtin_unpredictable, "LiLi" , "nc") -BUILTIN(__builtin_expect, "LiLiLi" , "nc") -BUILTIN(__builtin_prefetch, "vvC*.", "nc") -BUILTIN(__builtin_readcyclecounter, "ULLi", "n") -BUILTIN(__builtin_trap, "v", "nr") -BUILTIN(__builtin_debugtrap, "v", "n") -BUILTIN(__builtin_unreachable, "v", "nr") -BUILTIN(__builtin_shufflevector, "v." , "nc") -BUILTIN(__builtin_convertvector, "v." , "nct") -BUILTIN(__builtin_alloca, "v*z" , "Fn") -BUILTIN(__builtin_call_with_static_chain, "v.", "nt") - -// "Overloaded" Atomic operator builtins. These are overloaded to support data -// types of i8, i16, i32, i64, and i128. The front-end sees calls to the -// non-suffixed version of these (which has a bogus type) and transforms them to -// the right overloaded version in Sema (plus casts). - -// FIXME: These assume that char -> i8, short -> i16, int -> i32, -// long long -> i64. - -BUILTIN(__sync_fetch_and_add, "v.", "t") -BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "nt") -BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "nt") -BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "nt") -BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "nt") -BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "nt") - -BUILTIN(__sync_fetch_and_sub, "v.", "t") -BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "nt") -BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "nt") -BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "nt") -BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "nt") -BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "nt") - -BUILTIN(__sync_fetch_and_or, "v.", "t") -BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "nt") -BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "nt") -BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "nt") -BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "nt") -BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "nt") - -BUILTIN(__sync_fetch_and_and, "v.", "t") -BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "tn") -BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "tn") -BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "tn") -BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_fetch_and_xor, "v.", "t") -BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "tn") -BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "tn") -BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "tn") -BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_fetch_and_nand, "v.", "t") -BUILTIN(__sync_fetch_and_nand_1, "ccD*c.", "tn") -BUILTIN(__sync_fetch_and_nand_2, "ssD*s.", "tn") -BUILTIN(__sync_fetch_and_nand_4, "iiD*i.", "tn") -BUILTIN(__sync_fetch_and_nand_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_fetch_and_nand_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_add_and_fetch, "v.", "t") -BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_sub_and_fetch, "v.", "t") -BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_or_and_fetch, "v.", "t") -BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_and_and_fetch, "v.", "t") -BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_xor_and_fetch, "v.", "t") -BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_nand_and_fetch, "v.", "t") -BUILTIN(__sync_nand_and_fetch_1, "ccD*c.", "tn") -BUILTIN(__sync_nand_and_fetch_2, "ssD*s.", "tn") -BUILTIN(__sync_nand_and_fetch_4, "iiD*i.", "tn") -BUILTIN(__sync_nand_and_fetch_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_nand_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_bool_compare_and_swap, "v.", "t") -BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "tn") -BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "tn") -BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "tn") -BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "tn") -BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "tn") - -BUILTIN(__sync_val_compare_and_swap, "v.", "t") -BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "tn") -BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "tn") -BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "tn") -BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "tn") -BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "tn") - -BUILTIN(__sync_lock_test_and_set, "v.", "t") -BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "tn") -BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "tn") -BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "tn") -BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "tn") - -BUILTIN(__sync_lock_release, "v.", "t") -BUILTIN(__sync_lock_release_1, "vcD*.", "tn") -BUILTIN(__sync_lock_release_2, "vsD*.", "tn") -BUILTIN(__sync_lock_release_4, "viD*.", "tn") -BUILTIN(__sync_lock_release_8, "vLLiD*.", "tn") -BUILTIN(__sync_lock_release_16, "vLLLiD*.", "tn") - -BUILTIN(__sync_swap, "v.", "t") -BUILTIN(__sync_swap_1, "ccD*c.", "tn") -BUILTIN(__sync_swap_2, "ssD*s.", "tn") -BUILTIN(__sync_swap_4, "iiD*i.", "tn") -BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "tn") -BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "tn") - -// Some of our atomics builtins are handled by AtomicExpr rather than -// as normal builtin CallExprs. This macro is used for such builtins. -#ifndef ATOMIC_BUILTIN -#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) BUILTIN(ID, TYPE, ATTRS) -#endif - -// C11 _Atomic operations for <stdatomic.h>. -ATOMIC_BUILTIN(__c11_atomic_init, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_load, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_store, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_exchange, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_compare_exchange_strong, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_compare_exchange_weak, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_fetch_add, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_fetch_sub, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_fetch_and, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_fetch_or, "v.", "t") -ATOMIC_BUILTIN(__c11_atomic_fetch_xor, "v.", "t") -BUILTIN(__c11_atomic_thread_fence, "vi", "n") -BUILTIN(__c11_atomic_signal_fence, "vi", "n") -BUILTIN(__c11_atomic_is_lock_free, "iz", "n") - -// GNU atomic builtins. -ATOMIC_BUILTIN(__atomic_load, "v.", "t") -ATOMIC_BUILTIN(__atomic_load_n, "v.", "t") -ATOMIC_BUILTIN(__atomic_store, "v.", "t") -ATOMIC_BUILTIN(__atomic_store_n, "v.", "t") -ATOMIC_BUILTIN(__atomic_exchange, "v.", "t") -ATOMIC_BUILTIN(__atomic_exchange_n, "v.", "t") -ATOMIC_BUILTIN(__atomic_compare_exchange, "v.", "t") -ATOMIC_BUILTIN(__atomic_compare_exchange_n, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_add, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_sub, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_and, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_or, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_xor, "v.", "t") -ATOMIC_BUILTIN(__atomic_fetch_nand, "v.", "t") -ATOMIC_BUILTIN(__atomic_add_fetch, "v.", "t") -ATOMIC_BUILTIN(__atomic_sub_fetch, "v.", "t") -ATOMIC_BUILTIN(__atomic_and_fetch, "v.", "t") -ATOMIC_BUILTIN(__atomic_or_fetch, "v.", "t") -ATOMIC_BUILTIN(__atomic_xor_fetch, "v.", "t") -ATOMIC_BUILTIN(__atomic_nand_fetch, "v.", "t") -BUILTIN(__atomic_test_and_set, "bvD*i", "n") -BUILTIN(__atomic_clear, "vvD*i", "n") -BUILTIN(__atomic_thread_fence, "vi", "n") -BUILTIN(__atomic_signal_fence, "vi", "n") -BUILTIN(__atomic_always_lock_free, "izvCD*", "n") -BUILTIN(__atomic_is_lock_free, "izvCD*", "n") - -#undef ATOMIC_BUILTIN - -// Non-overloaded atomic builtins. -BUILTIN(__sync_synchronize, "v.", "n") -// GCC does not support these, they are a Clang extension. -BUILTIN(__sync_fetch_and_min, "iiD*i", "n") -BUILTIN(__sync_fetch_and_max, "iiD*i", "n") -BUILTIN(__sync_fetch_and_umin, "UiUiD*Ui", "n") -BUILTIN(__sync_fetch_and_umax, "UiUiD*Ui", "n") - -// Random libc builtins. -BUILTIN(__builtin_abort, "v", "Fnr") -BUILTIN(__builtin_index, "c*cC*i", "Fn") -BUILTIN(__builtin_rindex, "c*cC*i", "Fn") - -// Microsoft builtins. These are only active with -fms-extensions. -LANGBUILTIN(_alloca, "v*z", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__assume, "vb", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__debugbreak, "v", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__exception_code, "ULi", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_exception_code, "ULi", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__exception_info, "v*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_exception_info, "v*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__abnormal_termination, "i", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_abnormal_termination, "i", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__GetExceptionInfo, "v*.", "ntu", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedCompareExchange, "LiLiD*LiLi", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedCompareExchangePointer, "v*v*D*v*v*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedDecrement, "LiLiD*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedExchangeAdd, "LiLiD*Li", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedExchange, "LiLiD*Li", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedExchangePointer, "v*v*D*v*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_InterlockedIncrement, "LiLiD*", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__noop, "i.", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__readfsdword, "ULiULi", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__va_start, "vc**.", "nt", ALL_MS_LANGUAGES) - -// Microsoft library builtins. -LIBBUILTIN(_setjmpex, "iJ", "fj", "setjmpex.h", ALL_MS_LANGUAGES) - -// C99 library functions -// C99 stdlib.h -LIBBUILTIN(abort, "v", "fr", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(_Exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(malloc, "v*z", "f", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h", ALL_LANGUAGES) -// C99 string.h -LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(memcmp, "ivC*vC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(memmove, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strcpy, "c*c*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strncpy, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strcmp, "icC*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strncmp, "icC*cC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strcat, "c*c*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strncat, "c*c*cC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strxfrm, "zc*cC*z", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(memchr, "v*vC*iz", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strchr, "c*cC*i", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strcspn, "zcC*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strpbrk, "c*cC*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strrchr, "c*cC*i", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strspn, "zcC*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strstr, "c*cC*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strtok, "c*c*cC*", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(memset, "v*v*iz", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strerror, "c*i", "f", "string.h", ALL_LANGUAGES) -LIBBUILTIN(strlen, "zcC*", "f", "string.h", ALL_LANGUAGES) -// C99 stdio.h -LIBBUILTIN(printf, "icC*.", "fp:0:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(sprintf, "ic*cC*.", "fp:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vprintf, "icC*a", "fP:0:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vfprintf, "i.", "fP:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vsnprintf, "ic*zcC*a", "fP:2:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vsprintf, "ic*cC*a", "fP:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(scanf, "icC*R.", "fs:0:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(fscanf, "iP*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(sscanf, "icC*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vscanf, "icC*Ra", "fS:0:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vfscanf, "iP*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES) -LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES) -// C99 -// In some systems setjmp is a macro that expands to _setjmp. We undefine -// it here to avoid having two identical LIBBUILTIN entries. -#undef setjmp -LIBBUILTIN(setjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(longjmp, "vJi", "fr", "setjmp.h", ALL_LANGUAGES) - -// Non-C library functions, active in GNU mode only. -// Functions with (returns_twice) attribute (marked as "j") are still active in -// all languages, because losing this attribute would result in miscompilation -// when these functions are used in non-GNU mode. PR16138. -LIBBUILTIN(alloca, "v*z", "f", "stdlib.h", ALL_GNU_LANGUAGES) -// POSIX string.h -LIBBUILTIN(stpcpy, "c*c*cC*", "f", "string.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(stpncpy, "c*c*cC*z", "f", "string.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(strdup, "c*cC*", "f", "string.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(strndup, "c*cC*z", "f", "string.h", ALL_GNU_LANGUAGES) -// POSIX strings.h -LIBBUILTIN(index, "c*cC*i", "f", "strings.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(bzero, "vv*z", "f", "strings.h", ALL_GNU_LANGUAGES) -// In some systems str[n]casejmp is a macro that expands to _str[n]icmp. -// We undefine then here to avoid wrong name. -#undef strcasecmp -#undef strncasecmp -LIBBUILTIN(strcasecmp, "icC*cC*", "f", "strings.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_GNU_LANGUAGES) -// POSIX unistd.h -LIBBUILTIN(_exit, "vi", "fr", "unistd.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(vfork, "p", "fj", "unistd.h", ALL_LANGUAGES) -// POSIX setjmp.h - -LIBBUILTIN(_setjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(__sigsetjmp, "iSJi", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(sigsetjmp, "iSJi", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(setjmp_syscall, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(savectx, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(qsetjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(getcontext, "iK*", "fj", "setjmp.h", ALL_LANGUAGES) - -LIBBUILTIN(_longjmp, "vJi", "fr", "setjmp.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(siglongjmp, "vSJi", "fr", "setjmp.h", ALL_GNU_LANGUAGES) -// non-standard but very common -LIBBUILTIN(strlcpy, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES) -LIBBUILTIN(strlcat, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES) -// id objc_msgSend(id, SEL, ...) -LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG) -// long double objc_msgSend_fpret(id self, SEL op, ...) -LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG) -// _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...) -LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG) -// void objc_msgSend_stret (id, SEL, ...) -LIBBUILTIN(objc_msgSend_stret, "vGH.", "f", "objc/message.h", OBJC_LANG) -// id objc_msgSendSuper(struct objc_super *super, SEL op, ...) -LIBBUILTIN(objc_msgSendSuper, "GM*H.", "f", "objc/message.h", OBJC_LANG) -// void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...) -LIBBUILTIN(objc_msgSendSuper_stret, "vM*H.", "f", "objc/message.h", OBJC_LANG) -// id objc_getClass(const char *name) -LIBBUILTIN(objc_getClass, "GcC*", "f", "objc/runtime.h", OBJC_LANG) -// id objc_getMetaClass(const char *name) -LIBBUILTIN(objc_getMetaClass, "GcC*", "f", "objc/runtime.h", OBJC_LANG) -// void objc_enumerationMutation(id) -LIBBUILTIN(objc_enumerationMutation, "vG", "f", "objc/runtime.h", OBJC_LANG) - -// id objc_read_weak(id *location) -LIBBUILTIN(objc_read_weak, "GG*", "f", "objc/objc-auto.h", OBJC_LANG) -// id objc_assign_weak(id value, id *location) -LIBBUILTIN(objc_assign_weak, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG) -// id objc_assign_ivar(id value, id dest, ptrdiff_t offset) -LIBBUILTIN(objc_assign_ivar, "GGGY", "f", "objc/objc-auto.h", OBJC_LANG) -// id objc_assign_global(id val, id *dest) -LIBBUILTIN(objc_assign_global, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG) -// id objc_assign_strongCast(id val, id *dest -LIBBUILTIN(objc_assign_strongCast, "GGG*", "f", "objc/objc-auto.h", OBJC_LANG) - -// id objc_exception_extract(void *localExceptionData) -LIBBUILTIN(objc_exception_extract, "Gv*", "f", "objc/objc-exception.h", OBJC_LANG) -// void objc_exception_try_enter(void *localExceptionData) -LIBBUILTIN(objc_exception_try_enter, "vv*", "f", "objc/objc-exception.h", OBJC_LANG) -// void objc_exception_try_exit(void *localExceptionData) -LIBBUILTIN(objc_exception_try_exit, "vv*", "f", "objc/objc-exception.h", OBJC_LANG) -// int objc_exception_match(Class exceptionClass, id exception) -LIBBUILTIN(objc_exception_match, "iGG", "f", "objc/objc-exception.h", OBJC_LANG) -// void objc_exception_throw(id exception) -LIBBUILTIN(objc_exception_throw, "vG", "f", "objc/objc-exception.h", OBJC_LANG) - -// int objc_sync_enter(id obj) -LIBBUILTIN(objc_sync_enter, "iG", "f", "objc/objc-sync.h", OBJC_LANG) -// int objc_sync_exit(id obj) -LIBBUILTIN(objc_sync_exit, "iG", "f", "objc/objc-sync.h", OBJC_LANG) - -BUILTIN(__builtin_objc_memmove_collectable, "v*v*vC*z", "nF") - -// void NSLog(NSString *fmt, ...) -LIBBUILTIN(NSLog, "vG.", "fp:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG) -// void NSLogv(NSString *fmt, va_list args) -LIBBUILTIN(NSLogv, "vGa", "fP:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG) - -// Builtin math library functions -LIBBUILTIN(atan2, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atan2f, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atan2l, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(abs, "ii", "fnc", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(labs, "LiLi", "fnc", "stdlib.h", ALL_LANGUAGES) -LIBBUILTIN(llabs, "LLiLLi", "fnc", "stdlib.h", ALL_LANGUAGES) - -LIBBUILTIN(copysign, "ddd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(copysignf, "fff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(copysignl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fabs, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fabsf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fabsl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fmod, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmodf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmodl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(frexp, "ddi*", "fn", "math.h", ALL_LANGUAGES) -LIBBUILTIN(frexpf, "ffi*", "fn", "math.h", ALL_LANGUAGES) -LIBBUILTIN(frexpl, "LdLdi*", "fn", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(ldexp, "ddi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ldexpf, "ffi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ldexpl, "LdLdi", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(modf, "ddd*", "fn", "math.h", ALL_LANGUAGES) -LIBBUILTIN(modff, "fff*", "fn", "math.h", ALL_LANGUAGES) -LIBBUILTIN(modfl, "LdLdLd*", "fn", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(nan, "dcC*", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nanf, "fcC*", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nanl, "LdcC*", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(pow, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(powf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(powl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(acos, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(acosf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(acosl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(acosh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(acoshf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(acoshl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(asin, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(asinf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(asinl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(asinh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(asinhf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(asinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(atan, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atanf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atanl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(atanh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atanhf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(atanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(cbrt, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(cbrtf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(cbrtl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(ceil, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ceilf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ceill, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(cos, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(cosf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(cosl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(cosh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(coshf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(coshl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(erf, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(erff, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(erfl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(erfc, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(erfcf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(erfcl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(exp, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(expf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(expl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(exp2, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(exp2f, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(exp2l, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(expm1, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(expm1f, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(expm1l, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fdim, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fdimf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fdiml, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(floor, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(floorf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(floorl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fma, "dddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmaf, "ffff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmal, "LdLdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fmax, "ddd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmaxf, "fff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fmaxl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(fmin, "ddd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fminf, "fff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(fminl, "LdLdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(hypot, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(hypotf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(hypotl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(ilogb, "id", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ilogbf, "if", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(ilogbl, "iLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(lgamma, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lgammaf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lgammal, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(llrint, "LLid", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(llrintf, "LLif", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(llrintl, "LLiLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(llround, "LLid", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(llroundf, "LLif", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(llroundl, "LLiLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(log, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(logf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(logl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(log10, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log10f, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log10l, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(log1p, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log1pf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log1pl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(log2, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log2f, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(log2l, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(logb, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(logbf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(logbl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(lrint, "Lid", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lrintf, "Lif", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lrintl, "LiLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(lround, "Lid", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lroundf, "Lif", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(lroundl, "LiLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(nearbyint, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nearbyintf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nearbyintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(nextafter, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nextafterf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nextafterl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(nexttoward, "ddLd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nexttowardf, "ffLd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(nexttowardl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(remainder, "ddd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(remainderf, "fff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(remainderl, "LdLdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(rint, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(rintf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(rintl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(round, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(roundl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(scalbln, "ddLi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(scalblnf, "ffLi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(scalblnl, "LdLdLi", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(scalbn, "ddi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(scalbnf, "ffi", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(scalbnl, "LdLdi", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(sin, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(sinh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinhf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinhl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(sqrt, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sqrtf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sqrtl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(tan, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tanf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tanl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(tanh, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tanhf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tanhl, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(tgamma, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tgammaf, "ff", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(tgammal, "LdLd", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(trunc, "dd", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(truncf, "ff", "fnc", "math.h", ALL_LANGUAGES) -LIBBUILTIN(truncl, "LdLd", "fnc", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(cabs, "dXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cabsf, "fXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cabsl, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cacos, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cacosf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cacosl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cacosh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cacoshf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cacoshl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(carg, "dXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cargf, "fXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cargl, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(casin, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(casinf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(casinl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(casinh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(casinhf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(casinhl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(catan, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(catanf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(catanl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(catanh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(catanhf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(catanhl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(ccos, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ccosf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ccosl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(ccosh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ccoshf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ccoshl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cexp, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cexpf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cexpl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cimag, "dXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cimagf, "fXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cimagl, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(conj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(conjf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(conjl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(clog, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(clogf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(clogl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cproj, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cprojf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cprojl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(cpow, "XdXdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cpowf, "XfXfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(cpowl, "XLdXLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(creal, "dXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(crealf, "fXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(creall, "LdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(csin, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csinf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csinl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(csinh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csinhf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csinhl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(csqrt, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csqrtf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(csqrtl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(ctan, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ctanf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ctanl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -LIBBUILTIN(ctanh, "XdXd", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ctanhf, "XfXf", "fnc", "complex.h", ALL_LANGUAGES) -LIBBUILTIN(ctanhl, "XLdXLd", "fnc", "complex.h", ALL_LANGUAGES) - -// __sinpi and friends are OS X specific library functions, but otherwise much -// like the standard (non-complex) sin (etc). -LIBBUILTIN(__sinpi, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(__sinpif, "ff", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(__cospi, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(__cospif, "ff", "fne", "math.h", ALL_LANGUAGES) - -LIBBUILTIN(__tanpi, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(__tanpif, "ff", "fne", "math.h", ALL_LANGUAGES) - -// Similarly, __exp10 is OS X only -LIBBUILTIN(__exp10, "dd", "fne", "math.h", ALL_LANGUAGES) -LIBBUILTIN(__exp10f, "ff", "fne", "math.h", ALL_LANGUAGES) - -// Blocks runtime Builtin math library functions -LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES) -LIBBUILTIN(_Block_object_dispose, "vvC*iC", "f", "Blocks.h", ALL_LANGUAGES) -// FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock. - -// Annotation function -BUILTIN(__builtin_annotation, "v.", "tn") - -// Invariants -BUILTIN(__builtin_assume, "vb", "n") - -// Multiprecision Arithmetic Builtins. -BUILTIN(__builtin_addcb, "UcUcCUcCUcCUc*", "n") -BUILTIN(__builtin_addcs, "UsUsCUsCUsCUs*", "n") -BUILTIN(__builtin_addc, "UiUiCUiCUiCUi*", "n") -BUILTIN(__builtin_addcl, "ULiULiCULiCULiCULi*", "n") -BUILTIN(__builtin_addcll, "ULLiULLiCULLiCULLiCULLi*", "n") -BUILTIN(__builtin_subcb, "UcUcCUcCUcCUc*", "n") -BUILTIN(__builtin_subcs, "UsUsCUsCUsCUs*", "n") -BUILTIN(__builtin_subc, "UiUiCUiCUiCUi*", "n") -BUILTIN(__builtin_subcl, "ULiULiCULiCULiCULi*", "n") -BUILTIN(__builtin_subcll, "ULLiULLiCULLiCULLiCULLi*", "n") - -// Checked Arithmetic Builtins for Security. -BUILTIN(__builtin_add_overflow, "v.", "nt") -BUILTIN(__builtin_sub_overflow, "v.", "nt") -BUILTIN(__builtin_mul_overflow, "v.", "nt") -BUILTIN(__builtin_uadd_overflow, "bUiCUiCUi*", "n") -BUILTIN(__builtin_uaddl_overflow, "bULiCULiCULi*", "n") -BUILTIN(__builtin_uaddll_overflow, "bULLiCULLiCULLi*", "n") -BUILTIN(__builtin_usub_overflow, "bUiCUiCUi*", "n") -BUILTIN(__builtin_usubl_overflow, "bULiCULiCULi*", "n") -BUILTIN(__builtin_usubll_overflow, "bULLiCULLiCULLi*", "n") -BUILTIN(__builtin_umul_overflow, "bUiCUiCUi*", "n") -BUILTIN(__builtin_umull_overflow, "bULiCULiCULi*", "n") -BUILTIN(__builtin_umulll_overflow, "bULLiCULLiCULLi*", "n") -BUILTIN(__builtin_sadd_overflow, "bSiCSiCSi*", "n") -BUILTIN(__builtin_saddl_overflow, "bSLiCSLiCSLi*", "n") -BUILTIN(__builtin_saddll_overflow, "bSLLiCSLLiCSLLi*", "n") -BUILTIN(__builtin_ssub_overflow, "bSiCSiCSi*", "n") -BUILTIN(__builtin_ssubl_overflow, "bSLiCSLiCSLi*", "n") -BUILTIN(__builtin_ssubll_overflow, "bSLLiCSLLiCSLLi*", "n") -BUILTIN(__builtin_smul_overflow, "bSiCSiCSi*", "n") -BUILTIN(__builtin_smull_overflow, "bSLiCSLiCSLi*", "n") -BUILTIN(__builtin_smulll_overflow, "bSLLiCSLLiCSLLi*", "n") - -// Clang builtins (not available in GCC). -BUILTIN(__builtin_addressof, "v*v&", "nct") -BUILTIN(__builtin_operator_new, "v*z", "c") -BUILTIN(__builtin_operator_delete, "vv*", "n") - -// Safestack builtins -BUILTIN(__builtin___get_unsafe_stack_start, "v*", "Fn") -BUILTIN(__builtin___get_unsafe_stack_ptr, "v*", "Fn") - -// Nontemporal loads/stores builtins -BUILTIN(__builtin_nontemporal_store, "v.", "t") -BUILTIN(__builtin_nontemporal_load, "v.", "t") - -#undef BUILTIN -#undef LIBBUILTIN -#undef LANGBUILTIN diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h deleted file mode 100644 index c0a6af9..0000000 --- a/include/clang/Basic/Builtins.h +++ /dev/null @@ -1,220 +0,0 @@ -//===--- Builtins.h - Builtin function header -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines enum values for all the target-independent builtin -/// functions. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_BUILTINS_H -#define LLVM_CLANG_BASIC_BUILTINS_H - -#include "llvm/ADT/ArrayRef.h" -#include <cstring> - -// VC++ defines 'alloca' as an object-like macro, which interferes with our -// builtins. -#undef alloca - -namespace clang { -class TargetInfo; -class IdentifierTable; -class ASTContext; -class QualType; -class LangOptions; - -enum LanguageID { - GNU_LANG = 0x1, // builtin requires GNU mode. - C_LANG = 0x2, // builtin for c only. - CXX_LANG = 0x4, // builtin for cplusplus only. - OBJC_LANG = 0x8, // builtin for objective-c and objective-c++ - MS_LANG = 0x10, // builtin requires MS mode. - ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages. - ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode. - ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG // builtin requires MS mode. -}; - -namespace Builtin { -enum ID { - NotBuiltin = 0, // This is not a builtin function. -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/Builtins.def" - FirstTSBuiltin -}; - -struct Info { - const char *Name, *Type, *Attributes, *HeaderName; - LanguageID Langs; - const char *Features; -}; - -/// \brief Holds information about both target-independent and -/// target-specific builtins, allowing easy queries by clients. -/// -/// Builtins from an optional auxiliary target are stored in -/// AuxTSRecords. Their IDs are shifted up by TSRecords.size() and need to -/// be translated back with getAuxBuiltinID() before use. -class Context { - llvm::ArrayRef<Info> TSRecords; - llvm::ArrayRef<Info> AuxTSRecords; - -public: - Context() {} - - /// \brief Perform target-specific initialization - /// \param AuxTarget Target info to incorporate builtins from. May be nullptr. - void InitializeTarget(const TargetInfo &Target, const TargetInfo *AuxTarget); - - /// \brief Mark the identifiers for all the builtins with their - /// appropriate builtin ID # and mark any non-portable builtin identifiers as - /// such. - void initializeBuiltins(IdentifierTable &Table, const LangOptions& LangOpts); - - /// \brief Return the identifier name for the specified builtin, - /// e.g. "__builtin_abs". - const char *getName(unsigned ID) const { - return getRecord(ID).Name; - } - - /// \brief Get the type descriptor string for the specified builtin. - const char *getTypeString(unsigned ID) const { - return getRecord(ID).Type; - } - - /// \brief Return true if this function is a target-specific builtin - bool isTSBuiltin(unsigned ID) const { - return ID >= Builtin::FirstTSBuiltin; - } - - /// \brief Return true if this function has no side effects and doesn't - /// read memory. - bool isConst(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'c') != nullptr; - } - - /// \brief Return true if we know this builtin never throws an exception. - bool isNoThrow(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'n') != nullptr; - } - - /// \brief Return true if we know this builtin never returns. - bool isNoReturn(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'r') != nullptr; - } - - /// \brief Return true if we know this builtin can return twice. - bool isReturnsTwice(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'j') != nullptr; - } - - /// \brief Returns true if this builtin does not perform the side-effects - /// of its arguments. - bool isUnevaluated(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'u') != nullptr; - } - - /// \brief Return true if this is a builtin for a libc/libm function, - /// with a "__builtin_" prefix (e.g. __builtin_abs). - bool isLibFunction(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'F') != nullptr; - } - - /// \brief Determines whether this builtin is a predefined libc/libm - /// function, such as "malloc", where we know the signature a - /// priori. - bool isPredefinedLibFunction(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'f') != nullptr; - } - - /// \brief Determines whether this builtin is a predefined compiler-rt/libgcc - /// function, such as "__clear_cache", where we know the signature a - /// priori. - bool isPredefinedRuntimeFunction(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'i') != nullptr; - } - - /// \brief Determines whether this builtin has custom typechecking. - bool hasCustomTypechecking(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 't') != nullptr; - } - - /// \brief Determines whether this builtin has a result or any arguments which - /// are pointer types. - bool hasPtrArgsOrResult(unsigned ID) const { - return strchr(getRecord(ID).Type, '*') != nullptr; - } - - /// \brief Completely forget that the given ID was ever considered a builtin, - /// e.g., because the user provided a conflicting signature. - void forgetBuiltin(unsigned ID, IdentifierTable &Table); - - /// \brief If this is a library function that comes from a specific - /// header, retrieve that header name. - const char *getHeaderName(unsigned ID) const { - return getRecord(ID).HeaderName; - } - - /// \brief Determine whether this builtin is like printf in its - /// formatting rules and, if so, set the index to the format string - /// argument and whether this function as a va_list argument. - bool isPrintfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - - /// \brief Determine whether this builtin is like scanf in its - /// formatting rules and, if so, set the index to the format string - /// argument and whether this function as a va_list argument. - bool isScanfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - - /// \brief Return true if this function has no side effects and doesn't - /// read memory, except for possibly errno. - /// - /// Such functions can be const when the MathErrno lang option is disabled. - bool isConstWithoutErrno(unsigned ID) const { - return strchr(getRecord(ID).Attributes, 'e') != nullptr; - } - - const char *getRequiredFeatures(unsigned ID) const { - return getRecord(ID).Features; - } - - /// \brief Return true if builtin ID belongs to AuxTarget. - bool isAuxBuiltinID(unsigned ID) const { - return ID >= (Builtin::FirstTSBuiltin + TSRecords.size()); - } - - /// Return real buitin ID (i.e. ID it would have furing compilation - /// for AuxTarget). - unsigned getAuxBuiltinID(unsigned ID) const { return ID - TSRecords.size(); } - - /// Returns true if this is a libc/libm function without the '__builtin_' - /// prefix. - static bool isBuiltinFunc(const char *Name); - -private: - const Info &getRecord(unsigned ID) const; - - /// \brief Is this builtin supported according to the given language options? - bool builtinIsSupported(const Builtin::Info &BuiltinInfo, - const LangOptions &LangOpts); - - /// \brief Helper function for isPrintfLike and isScanfLike. - bool isLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg, - const char *Fmt) const; -}; - -} - -/// \brief Kinds of BuiltinTemplateDecl. -enum BuiltinTemplateKind : int { - /// \brief This names the __make_integer_seq BuiltinTemplateDecl. - BTK__make_integer_seq -}; - -} // end namespace clang -#endif diff --git a/include/clang/Basic/BuiltinsAArch64.def b/include/clang/Basic/BuiltinsAArch64.def deleted file mode 100644 index b440443..0000000 --- a/include/clang/Basic/BuiltinsAArch64.def +++ /dev/null @@ -1,65 +0,0 @@ -//==- BuiltinsAArch64.def - AArch64 Builtin function database ----*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the AArch64-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// In libgcc -BUILTIN(__clear_cache, "vv*v*", "i") - -BUILTIN(__builtin_arm_ldrex, "v.", "t") -BUILTIN(__builtin_arm_ldaex, "v.", "t") -BUILTIN(__builtin_arm_strex, "i.", "t") -BUILTIN(__builtin_arm_stlex, "i.", "t") -BUILTIN(__builtin_arm_clrex, "v", "") - -// Bit manipulation -BUILTIN(__builtin_arm_rbit, "UiUi", "nc") -BUILTIN(__builtin_arm_rbit64, "LUiLUi", "nc") - -// HINT -BUILTIN(__builtin_arm_nop, "v", "") -BUILTIN(__builtin_arm_yield, "v", "") -BUILTIN(__builtin_arm_wfe, "v", "") -BUILTIN(__builtin_arm_wfi, "v", "") -BUILTIN(__builtin_arm_sev, "v", "") -BUILTIN(__builtin_arm_sevl, "v", "") - -// CRC32 -BUILTIN(__builtin_arm_crc32b, "UiUiUc", "nc") -BUILTIN(__builtin_arm_crc32cb, "UiUiUc", "nc") -BUILTIN(__builtin_arm_crc32h, "UiUiUs", "nc") -BUILTIN(__builtin_arm_crc32ch, "UiUiUs", "nc") -BUILTIN(__builtin_arm_crc32w, "UiUiUi", "nc") -BUILTIN(__builtin_arm_crc32cw, "UiUiUi", "nc") -BUILTIN(__builtin_arm_crc32d, "UiUiLUi", "nc") -BUILTIN(__builtin_arm_crc32cd, "UiUiLUi", "nc") - -// Memory barrier -BUILTIN(__builtin_arm_dmb, "vUi", "nc") -BUILTIN(__builtin_arm_dsb, "vUi", "nc") -BUILTIN(__builtin_arm_isb, "vUi", "nc") - -// Prefetch -BUILTIN(__builtin_arm_prefetch, "vvC*UiUiUiUi", "nc") - -// System Registers -BUILTIN(__builtin_arm_rsr, "UicC*", "nc") -BUILTIN(__builtin_arm_rsr64, "LUicC*", "nc") -BUILTIN(__builtin_arm_rsrp, "v*cC*", "nc") -BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc") -BUILTIN(__builtin_arm_wsr64, "vcC*LUi", "nc") -BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") -BUILTIN(__builtin_thread_pointer, "v*", "nc") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsAMDGPU.def b/include/clang/Basic/BuiltinsAMDGPU.def deleted file mode 100644 index bb9931f..0000000 --- a/include/clang/Basic/BuiltinsAMDGPU.def +++ /dev/null @@ -1,36 +0,0 @@ -//==- BuiltinsAMDGPU.def - AMDGPU Builtin function database ------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the R600-specific builtin function database. Users of this -// file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -BUILTIN(__builtin_amdgpu_div_scale, "dddbb*", "n") -BUILTIN(__builtin_amdgpu_div_scalef, "fffbb*", "n") -BUILTIN(__builtin_amdgpu_div_fmas, "ddddb", "nc") -BUILTIN(__builtin_amdgpu_div_fmasf, "ffffb", "nc") -BUILTIN(__builtin_amdgpu_div_fixup, "dddd", "nc") -BUILTIN(__builtin_amdgpu_div_fixupf, "ffff", "nc") -BUILTIN(__builtin_amdgpu_trig_preop, "ddi", "nc") -BUILTIN(__builtin_amdgpu_trig_preopf, "ffi", "nc") -BUILTIN(__builtin_amdgpu_rcp, "dd", "nc") -BUILTIN(__builtin_amdgpu_rcpf, "ff", "nc") -BUILTIN(__builtin_amdgpu_rsq, "dd", "nc") -BUILTIN(__builtin_amdgpu_rsqf, "ff", "nc") -BUILTIN(__builtin_amdgpu_rsq_clamped, "dd", "nc") -BUILTIN(__builtin_amdgpu_rsq_clampedf, "ff", "nc") -BUILTIN(__builtin_amdgpu_ldexp, "ddi", "nc") -BUILTIN(__builtin_amdgpu_ldexpf, "ffi", "nc") -BUILTIN(__builtin_amdgpu_class, "bdi", "nc") -BUILTIN(__builtin_amdgpu_classf, "bfi", "nc") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def deleted file mode 100644 index 3e8e2bf..0000000 --- a/include/clang/Basic/BuiltinsARM.def +++ /dev/null @@ -1,114 +0,0 @@ -//===--- BuiltinsARM.def - ARM Builtin function database ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the ARM-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -#if defined(BUILTIN) && !defined(LANGBUILTIN) -# define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) -#endif - -// In libgcc -BUILTIN(__clear_cache, "vv*v*", "i") -BUILTIN(__builtin_thread_pointer, "v*", "") - -// Saturating arithmetic -BUILTIN(__builtin_arm_qadd, "iii", "nc") -BUILTIN(__builtin_arm_qsub, "iii", "nc") -BUILTIN(__builtin_arm_ssat, "iiUi", "nc") -BUILTIN(__builtin_arm_usat, "UiUiUi", "nc") - -// Bit manipulation -BUILTIN(__builtin_arm_rbit, "UiUi", "nc") - -// Store and load exclusive -BUILTIN(__builtin_arm_ldrexd, "LLUiv*", "") -BUILTIN(__builtin_arm_strexd, "iLLUiv*", "") - -BUILTIN(__builtin_arm_ldrex, "v.", "t") -BUILTIN(__builtin_arm_ldaex, "v.", "t") -BUILTIN(__builtin_arm_strex, "i.", "t") -BUILTIN(__builtin_arm_stlex, "i.", "t") -BUILTIN(__builtin_arm_clrex, "v", "") - -// VFP -BUILTIN(__builtin_arm_get_fpscr, "Ui", "nc") -BUILTIN(__builtin_arm_set_fpscr, "vUi", "nc") -BUILTIN(__builtin_arm_vcvtr_f, "ffi", "nc") -BUILTIN(__builtin_arm_vcvtr_d, "fdi", "nc") - -// Coprocessor -BUILTIN(__builtin_arm_mcr, "vUIiUIiUiUIiUIiUIi", "") -BUILTIN(__builtin_arm_mcr2, "vUIiUIiUiUIiUIiUIi", "") -BUILTIN(__builtin_arm_mrc, "UiUIiUIiUIiUIiUIi", "") -BUILTIN(__builtin_arm_mrc2, "UiUIiUIiUIiUIiUIi", "") -BUILTIN(__builtin_arm_cdp, "vUiUiUiUiUiUi", "") -BUILTIN(__builtin_arm_cdp2, "vUiUiUiUiUiUi", "") -BUILTIN(__builtin_arm_mcrr, "vUIiUIiUiUiUIi", "") -BUILTIN(__builtin_arm_mcrr2, "vUIiUIiUiUiUIi", "") - -// CRC32 -BUILTIN(__builtin_arm_crc32b, "UiUiUc", "nc") -BUILTIN(__builtin_arm_crc32cb, "UiUiUc", "nc") -BUILTIN(__builtin_arm_crc32h, "UiUiUs", "nc") -BUILTIN(__builtin_arm_crc32ch, "UiUiUs", "nc") -BUILTIN(__builtin_arm_crc32w, "UiUiUi", "nc") -BUILTIN(__builtin_arm_crc32cw, "UiUiUi", "nc") -BUILTIN(__builtin_arm_crc32d, "UiUiLLUi", "nc") -BUILTIN(__builtin_arm_crc32cd, "UiUiLLUi", "nc") - -// HINT -BUILTIN(__builtin_arm_nop, "v", "") -BUILTIN(__builtin_arm_yield, "v", "") -BUILTIN(__builtin_arm_wfe, "v", "") -BUILTIN(__builtin_arm_wfi, "v", "") -BUILTIN(__builtin_arm_sev, "v", "") -BUILTIN(__builtin_arm_sevl, "v", "") -BUILTIN(__builtin_arm_dbg, "vUi", "") - -// Data barrier -BUILTIN(__builtin_arm_dmb, "vUi", "nc") -BUILTIN(__builtin_arm_dsb, "vUi", "nc") -BUILTIN(__builtin_arm_isb, "vUi", "nc") - -// Prefetch -BUILTIN(__builtin_arm_prefetch, "vvC*UiUi", "nc") - -// System registers (ACLE) -BUILTIN(__builtin_arm_rsr, "UicC*", "nc") -BUILTIN(__builtin_arm_rsr64, "LLUicC*", "nc") -BUILTIN(__builtin_arm_rsrp, "v*cC*", "nc") -BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc") -BUILTIN(__builtin_arm_wsr64, "vcC*LLUi", "nc") -BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") - -// MSVC -LANGBUILTIN(__emit, "vIUiC", "", ALL_MS_LANGUAGES) - -LANGBUILTIN(__yield, "v", "", ALL_MS_LANGUAGES) -LANGBUILTIN(__wfe, "v", "", ALL_MS_LANGUAGES) -LANGBUILTIN(__wfi, "v", "", ALL_MS_LANGUAGES) -LANGBUILTIN(__sev, "v", "", ALL_MS_LANGUAGES) -LANGBUILTIN(__sevl, "v", "", ALL_MS_LANGUAGES) - -LANGBUILTIN(__dmb, "vUi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__dsb, "vUi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__isb, "vUi", "nc", ALL_MS_LANGUAGES) -LANGBUILTIN(__ldrexd, "WiWiCD*", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveFromCoprocessor, "UiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveFromCoprocessor2, "UiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveToCoprocessor, "vUiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) -LANGBUILTIN(_MoveToCoprocessor2, "vUiIUiIUiIUiIUiIUi", "", ALL_MS_LANGUAGES) - -#undef BUILTIN -#undef LANGBUILTIN diff --git a/include/clang/Basic/BuiltinsHexagon.def b/include/clang/Basic/BuiltinsHexagon.def deleted file mode 100644 index c071a46..0000000 --- a/include/clang/Basic/BuiltinsHexagon.def +++ /dev/null @@ -1,878 +0,0 @@ -//===-- BuiltinsHexagon.def - Hexagon Builtin function database --*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the Hexagon-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// The builtins below are not autogenerated from iset.py. -// Make sure you do not overwrite these. - -BUILTIN(__builtin_SI_to_SXTHI_asrh, "ii", "") -BUILTIN(__builtin_circ_ldd, "LLi*LLi*LLi*ii", "") - -// The builtins above are not autogenerated from iset.py. -// Make sure you do not overwrite these. - -BUILTIN(__builtin_HEXAGON_C2_cmpeq,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgt,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgtu,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpeqp,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_C2_cmpgtp,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_C2_cmpgtup,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_rcmpeqi,"iii","") -BUILTIN(__builtin_HEXAGON_A4_rcmpneqi,"iii","") -BUILTIN(__builtin_HEXAGON_A4_rcmpeq,"iii","") -BUILTIN(__builtin_HEXAGON_A4_rcmpneq,"iii","") -BUILTIN(__builtin_HEXAGON_C2_bitsset,"bii","") -BUILTIN(__builtin_HEXAGON_C2_bitsclr,"bii","") -BUILTIN(__builtin_HEXAGON_C4_nbitsset,"bii","") -BUILTIN(__builtin_HEXAGON_C4_nbitsclr,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpeqi,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgti,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgtui,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgei,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpgeui,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmplt,"bii","") -BUILTIN(__builtin_HEXAGON_C2_cmpltu,"bii","") -BUILTIN(__builtin_HEXAGON_C2_bitsclri,"bii","") -BUILTIN(__builtin_HEXAGON_C4_nbitsclri,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmpneqi,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmpltei,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmplteui,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmpneq,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmplte,"bii","") -BUILTIN(__builtin_HEXAGON_C4_cmplteu,"bii","") -BUILTIN(__builtin_HEXAGON_C2_and,"bii","") -BUILTIN(__builtin_HEXAGON_C2_or,"bii","") -BUILTIN(__builtin_HEXAGON_C2_xor,"bii","") -BUILTIN(__builtin_HEXAGON_C2_andn,"bii","") -BUILTIN(__builtin_HEXAGON_C2_not,"bi","") -BUILTIN(__builtin_HEXAGON_C2_orn,"bii","") -BUILTIN(__builtin_HEXAGON_C4_and_and,"biii","") -BUILTIN(__builtin_HEXAGON_C4_and_or,"biii","") -BUILTIN(__builtin_HEXAGON_C4_or_and,"biii","") -BUILTIN(__builtin_HEXAGON_C4_or_or,"biii","") -BUILTIN(__builtin_HEXAGON_C4_and_andn,"biii","") -BUILTIN(__builtin_HEXAGON_C4_and_orn,"biii","") -BUILTIN(__builtin_HEXAGON_C4_or_andn,"biii","") -BUILTIN(__builtin_HEXAGON_C4_or_orn,"biii","") -BUILTIN(__builtin_HEXAGON_C2_pxfer_map,"bi","") -BUILTIN(__builtin_HEXAGON_C2_any8,"bi","") -BUILTIN(__builtin_HEXAGON_C2_all8,"bi","") -BUILTIN(__builtin_HEXAGON_C2_vitpack,"iii","") -BUILTIN(__builtin_HEXAGON_C2_mux,"iiii","") -BUILTIN(__builtin_HEXAGON_C2_muxii,"iiii","") -BUILTIN(__builtin_HEXAGON_C2_muxir,"iiii","") -BUILTIN(__builtin_HEXAGON_C2_muxri,"iiii","") -BUILTIN(__builtin_HEXAGON_C2_vmux,"LLiiLLiLLi","") -BUILTIN(__builtin_HEXAGON_C2_mask,"LLii","") -BUILTIN(__builtin_HEXAGON_A2_vcmpbeq,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_vcmpbeqi,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmpbeq_any,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vcmpbgtu,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_vcmpbgtui,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmpbgt,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_vcmpbgti,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbeq,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbeqi,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbgtu,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbgtui,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbgt,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpbgti,"bii","") -BUILTIN(__builtin_HEXAGON_A2_vcmpheq,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vcmphgt,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vcmphgtu,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_vcmpheqi,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmphgti,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmphgtui,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_cmpheq,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmphgt,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmphgtu,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmpheqi,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmphgti,"bii","") -BUILTIN(__builtin_HEXAGON_A4_cmphgtui,"bii","") -BUILTIN(__builtin_HEXAGON_A2_vcmpweq,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vcmpwgt,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vcmpwgtu,"bLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_vcmpweqi,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmpwgti,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_vcmpwgtui,"bLLii","") -BUILTIN(__builtin_HEXAGON_A4_boundscheck,"biLLi","") -BUILTIN(__builtin_HEXAGON_A4_tlbmatch,"bLLii","") -BUILTIN(__builtin_HEXAGON_C2_tfrpr,"ii","") -BUILTIN(__builtin_HEXAGON_C2_tfrrp,"bi","") -BUILTIN(__builtin_HEXAGON_C4_fastcorner9,"bii","") -BUILTIN(__builtin_HEXAGON_C4_fastcorner9_not,"bii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s0,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s1,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s0,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s1,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s0,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s1,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s0,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s1,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s0,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s1,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s0,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s1,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s0,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s1,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s0,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s1,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s0,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s1,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpysmi,"iii","") -BUILTIN(__builtin_HEXAGON_M2_macsip,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_macsin,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyss_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyss_acc_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyss_nac_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_s0,"ULLiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_acc_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_nac_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_up,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_up_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpy_up_s1_sat,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpyu_up,"Uiii","") -BUILTIN(__builtin_HEXAGON_M2_mpysu_up,"iii","") -BUILTIN(__builtin_HEXAGON_M2_dpmpyss_rnd_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M4_mac_up_s1_sat,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_nac_up_s1_sat,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_mpyi,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mpyui,"iii","") -BUILTIN(__builtin_HEXAGON_M2_maci,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_acci,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_accii,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_nacci,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_naccii,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_subacc,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_mpyrr_addr,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_mpyri_addr_u2,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_mpyri_addr,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_mpyri_addi,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_mpyrr_addi,"iiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmac2s_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmac2s_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2su_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2su_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmac2su_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmac2su_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0pack,"iii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1pack,"iii","") -BUILTIN(__builtin_HEXAGON_M2_vmac2,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vmac2es_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vmac2es_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vmac2es,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrmac_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrmpy_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s0,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s1,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vrmpybuu,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vrmacbuu,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vrmpybsu,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vrmacbsu,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vmpybuu,"LLiii","") -BUILTIN(__builtin_HEXAGON_M5_vmpybsu,"LLiii","") -BUILTIN(__builtin_HEXAGON_M5_vmacbuu,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M5_vmacbsu,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M5_vdmpybsu,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M5_vdmacbsu,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmacs_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmacs_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmpys_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vdmpys_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s0,"iii","") -BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_cmacs_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmacs_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmacsc_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmacsc_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmpys_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmpys_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmpysc_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmpysc_s1,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_cnacs_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cnacs_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cnacsc_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cnacsc_s1,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpys_acc_s1,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1rp,"iLLii","") -BUILTIN(__builtin_HEXAGON_M2_mmacls_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacls_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmachs_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmachs_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyl_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyl_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyh_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyh_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacls_rs0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacls_rs1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmachs_rs0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmachs_rs1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_acc_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_acc_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_acc_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_acc_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_hmmpyl_rs1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_hmmpyh_rs1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_hmmpyl_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_hmmpyh_s1,"iii","") -BUILTIN(__builtin_HEXAGON_M2_mmaculs_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmaculs_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyul_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyul_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs1,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs1,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0c,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0c,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_cmaci_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmacr_s0,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0c,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0c,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_cmpyi_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M2_cmpyr_s0,"LLiii","") -BUILTIN(__builtin_HEXAGON_M4_cmpyi_wh,"iLLii","") -BUILTIN(__builtin_HEXAGON_M4_cmpyr_wh,"iLLii","") -BUILTIN(__builtin_HEXAGON_M4_cmpyi_whc,"iLLii","") -BUILTIN(__builtin_HEXAGON_M4_cmpyr_whc,"iLLii","") -BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_i,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_r,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_i,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_r,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_i,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_r,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vcrotate,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S4_vrcrotate_acc,"LLiLLiLLiii","") -BUILTIN(__builtin_HEXAGON_S4_vrcrotate,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_S2_vcnegh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_vrcnegh,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_M4_pmpyw,"LLiii","") -BUILTIN(__builtin_HEXAGON_M4_vpmpyh,"LLiii","") -BUILTIN(__builtin_HEXAGON_M4_pmpyw_acc,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_M4_vpmpyh_acc,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_A2_add,"iii","") -BUILTIN(__builtin_HEXAGON_A2_sub,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addsat,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subsat,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addi,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_l16_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_l16_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_l16_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_l16_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_lh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_hh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_lh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_lh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_hh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_lh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_aslh,"ii","") -BUILTIN(__builtin_HEXAGON_A2_asrh,"ii","") -BUILTIN(__builtin_HEXAGON_A2_addp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_addpsat,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_addsp,"LLiiLLi","") -BUILTIN(__builtin_HEXAGON_A2_subp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_neg,"ii","") -BUILTIN(__builtin_HEXAGON_A2_negsat,"ii","") -BUILTIN(__builtin_HEXAGON_A2_abs,"ii","") -BUILTIN(__builtin_HEXAGON_A2_abssat,"ii","") -BUILTIN(__builtin_HEXAGON_A2_vconj,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_negp,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_absp,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_max,"iii","") -BUILTIN(__builtin_HEXAGON_A2_maxu,"Uiii","") -BUILTIN(__builtin_HEXAGON_A2_min,"iii","") -BUILTIN(__builtin_HEXAGON_A2_minu,"Uiii","") -BUILTIN(__builtin_HEXAGON_A2_maxp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_maxup,"ULLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_minp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_minup,"ULLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_tfr,"ii","") -BUILTIN(__builtin_HEXAGON_A2_tfrsi,"ii","") -BUILTIN(__builtin_HEXAGON_A2_tfrp,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_tfrpi,"LLii","") -BUILTIN(__builtin_HEXAGON_A2_zxtb,"ii","") -BUILTIN(__builtin_HEXAGON_A2_sxtb,"ii","") -BUILTIN(__builtin_HEXAGON_A2_zxth,"ii","") -BUILTIN(__builtin_HEXAGON_A2_sxth,"ii","") -BUILTIN(__builtin_HEXAGON_A2_combinew,"LLiii","") -BUILTIN(__builtin_HEXAGON_A4_combineri,"LLiii","") -BUILTIN(__builtin_HEXAGON_A4_combineir,"LLiii","") -BUILTIN(__builtin_HEXAGON_A2_combineii,"LLiii","") -BUILTIN(__builtin_HEXAGON_A2_combine_hh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_combine_hl,"iii","") -BUILTIN(__builtin_HEXAGON_A2_combine_lh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_combine_ll,"iii","") -BUILTIN(__builtin_HEXAGON_A2_tfril,"iii","") -BUILTIN(__builtin_HEXAGON_A2_tfrih,"iii","") -BUILTIN(__builtin_HEXAGON_A2_and,"iii","") -BUILTIN(__builtin_HEXAGON_A2_or,"iii","") -BUILTIN(__builtin_HEXAGON_A2_xor,"iii","") -BUILTIN(__builtin_HEXAGON_A2_not,"ii","") -BUILTIN(__builtin_HEXAGON_M2_xor_xacc,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_xor_xacc,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_andn,"iii","") -BUILTIN(__builtin_HEXAGON_A4_orn,"iii","") -BUILTIN(__builtin_HEXAGON_A4_andnp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_ornp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_addaddi,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_subaddi,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_and_and,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_and_andn,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_and_or,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_and_xor,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_or_and,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_or_andn,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_or_or,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_or_xor,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_or_andix,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_or_andi,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_or_ori,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_xor_and,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_xor_or,"iiii","") -BUILTIN(__builtin_HEXAGON_M4_xor_andn,"iiii","") -BUILTIN(__builtin_HEXAGON_A2_subri,"iii","") -BUILTIN(__builtin_HEXAGON_A2_andir,"iii","") -BUILTIN(__builtin_HEXAGON_A2_orir,"iii","") -BUILTIN(__builtin_HEXAGON_A2_andp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_orp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_xorp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_notp,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_sxtw,"LLii","") -BUILTIN(__builtin_HEXAGON_A2_sat,"iLLi","") -BUILTIN(__builtin_HEXAGON_A2_roundsat,"iLLi","") -BUILTIN(__builtin_HEXAGON_A2_sath,"ii","") -BUILTIN(__builtin_HEXAGON_A2_satuh,"ii","") -BUILTIN(__builtin_HEXAGON_A2_satub,"ii","") -BUILTIN(__builtin_HEXAGON_A2_satb,"ii","") -BUILTIN(__builtin_HEXAGON_A2_vaddub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddb_map,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddubs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddhs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vadduhs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A5_vaddhubs,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vaddws,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxaddsubw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxsubaddw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxaddsubh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxsubaddh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxaddsubhr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_vxsubaddhr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_svavgh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svavghs,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svnavgh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svaddh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svaddhs,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svadduhs,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svsubh,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svsubhs,"iii","") -BUILTIN(__builtin_HEXAGON_A2_svsubuhs,"iii","") -BUILTIN(__builtin_HEXAGON_A2_vraddub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vraddub_acc,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vraddh,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vradduh,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubb_map,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsububs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubhs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubuhs,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vsubws,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vabsh,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vabshsat,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vabsw,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vabswsat,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vabsdiffw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_M2_vabsdiffh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vrsadub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vrsadub_acc,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavguh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavgh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavgw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgwr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavgwr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgwcr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavgwcr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavghcr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavghcr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavguw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavguwr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavgubr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavguhr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vavghr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vnavghr,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_round_ri,"iii","") -BUILTIN(__builtin_HEXAGON_A4_round_rr,"iii","") -BUILTIN(__builtin_HEXAGON_A4_round_ri_sat,"iii","") -BUILTIN(__builtin_HEXAGON_A4_round_rr_sat,"iii","") -BUILTIN(__builtin_HEXAGON_A4_cround_ri,"iii","") -BUILTIN(__builtin_HEXAGON_A4_cround_rr,"iii","") -BUILTIN(__builtin_HEXAGON_A4_vrminh,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrmaxh,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrminuh,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrmaxuh,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrminw,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrmaxw,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrminuw,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A4_vrmaxuw,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_A2_vminb,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxb,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vminub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxub,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vminh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vminuh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxuh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vminw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vminuw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A2_vmaxuw,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_A4_modwrapu,"iii","") -BUILTIN(__builtin_HEXAGON_F2_sfadd,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sfsub,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sfmpy,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sffma,"ffff","") -BUILTIN(__builtin_HEXAGON_F2_sffma_sc,"ffffi","") -BUILTIN(__builtin_HEXAGON_F2_sffms,"ffff","") -BUILTIN(__builtin_HEXAGON_F2_sffma_lib,"ffff","") -BUILTIN(__builtin_HEXAGON_F2_sffms_lib,"ffff","") -BUILTIN(__builtin_HEXAGON_F2_sfcmpeq,"bff","") -BUILTIN(__builtin_HEXAGON_F2_sfcmpgt,"bff","") -BUILTIN(__builtin_HEXAGON_F2_sfcmpge,"bff","") -BUILTIN(__builtin_HEXAGON_F2_sfcmpuo,"bff","") -BUILTIN(__builtin_HEXAGON_F2_sfmax,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sfmin,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sfclass,"bfi","") -BUILTIN(__builtin_HEXAGON_F2_sfimm_p,"fi","") -BUILTIN(__builtin_HEXAGON_F2_sfimm_n,"fi","") -BUILTIN(__builtin_HEXAGON_F2_sffixupn,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sffixupd,"fff","") -BUILTIN(__builtin_HEXAGON_F2_sffixupr,"ff","") -BUILTIN(__builtin_HEXAGON_F2_dfadd,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dfsub,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dfmpy,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dffma,"dddd","") -BUILTIN(__builtin_HEXAGON_F2_dffms,"dddd","") -BUILTIN(__builtin_HEXAGON_F2_dffma_lib,"dddd","") -BUILTIN(__builtin_HEXAGON_F2_dffms_lib,"dddd","") -BUILTIN(__builtin_HEXAGON_F2_dffma_sc,"ddddi","") -BUILTIN(__builtin_HEXAGON_F2_dfmax,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dfmin,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dfcmpeq,"bdd","") -BUILTIN(__builtin_HEXAGON_F2_dfcmpgt,"bdd","") -BUILTIN(__builtin_HEXAGON_F2_dfcmpge,"bdd","") -BUILTIN(__builtin_HEXAGON_F2_dfcmpuo,"bdd","") -BUILTIN(__builtin_HEXAGON_F2_dfclass,"bdi","") -BUILTIN(__builtin_HEXAGON_F2_dfimm_p,"di","") -BUILTIN(__builtin_HEXAGON_F2_dfimm_n,"di","") -BUILTIN(__builtin_HEXAGON_F2_dffixupn,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dffixupd,"ddd","") -BUILTIN(__builtin_HEXAGON_F2_dffixupr,"dd","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2df,"df","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2sf,"fd","") -BUILTIN(__builtin_HEXAGON_F2_conv_uw2sf,"fi","") -BUILTIN(__builtin_HEXAGON_F2_conv_uw2df,"di","") -BUILTIN(__builtin_HEXAGON_F2_conv_w2sf,"fi","") -BUILTIN(__builtin_HEXAGON_F2_conv_w2df,"di","") -BUILTIN(__builtin_HEXAGON_F2_conv_ud2sf,"fLLi","") -BUILTIN(__builtin_HEXAGON_F2_conv_ud2df,"dLLi","") -BUILTIN(__builtin_HEXAGON_F2_conv_d2sf,"fLLi","") -BUILTIN(__builtin_HEXAGON_F2_conv_d2df,"dLLi","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2uw,"if","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2w,"if","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2ud,"LLif","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2d,"LLif","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2uw,"id","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2w,"id","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2ud,"LLid","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2d,"LLid","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2uw_chop,"if","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2w_chop,"if","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2ud_chop,"LLif","") -BUILTIN(__builtin_HEXAGON_F2_conv_sf2d_chop,"LLif","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2uw_chop,"id","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2w_chop,"id","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2ud_chop,"LLid","") -BUILTIN(__builtin_HEXAGON_F2_conv_df2d_chop,"LLid","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_p_xor,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_p_xor,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_xor,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_xor,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_r_sat,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_r_sat,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_acc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p_acc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_nac,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p_nac,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_xacc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_xacc,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_xacc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p_xacc,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_and,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_or,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p_and,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_p_or,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_r_sat,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd_goodsyntax,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_rnd,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_p_rnd_goodsyntax,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S4_lsli,"iii","") -BUILTIN(__builtin_HEXAGON_S2_addasl_rrri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_andi_asl_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_ori_asl_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_addi_asl_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_subi_asl_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_andi_lsr_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_ori_lsr_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_addi_lsr_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S4_subi_lsr_ri,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_valignib,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_valignrb,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_vspliceib,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_vsplicerb,"LLiLLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_vsplatrh,"LLii","") -BUILTIN(__builtin_HEXAGON_S2_vsplatrb,"ii","") -BUILTIN(__builtin_HEXAGON_S2_insert,"iiiii","") -BUILTIN(__builtin_HEXAGON_S2_tableidxb_goodsyntax,"iiiii","") -BUILTIN(__builtin_HEXAGON_S2_tableidxh_goodsyntax,"iiiii","") -BUILTIN(__builtin_HEXAGON_S2_tableidxw_goodsyntax,"iiiii","") -BUILTIN(__builtin_HEXAGON_S2_tableidxd_goodsyntax,"iiiii","") -BUILTIN(__builtin_HEXAGON_A4_bitspliti,"LLiii","") -BUILTIN(__builtin_HEXAGON_A4_bitsplit,"LLiii","") -BUILTIN(__builtin_HEXAGON_S4_extract,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_extractu,"iiii","") -BUILTIN(__builtin_HEXAGON_S2_insertp,"LLiLLiLLiii","") -BUILTIN(__builtin_HEXAGON_S4_extractp,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_S2_extractup,"LLiLLiii","") -BUILTIN(__builtin_HEXAGON_S2_insert_rp,"iiiLLi","") -BUILTIN(__builtin_HEXAGON_S4_extract_rp,"iiLLi","") -BUILTIN(__builtin_HEXAGON_S2_extractu_rp,"iiLLi","") -BUILTIN(__builtin_HEXAGON_S2_insertp_rp,"LLiLLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S4_extractp_rp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_extractup_rp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_tstbit_i,"bii","") -BUILTIN(__builtin_HEXAGON_S4_ntstbit_i,"bii","") -BUILTIN(__builtin_HEXAGON_S2_setbit_i,"iii","") -BUILTIN(__builtin_HEXAGON_S2_togglebit_i,"iii","") -BUILTIN(__builtin_HEXAGON_S2_clrbit_i,"iii","") -BUILTIN(__builtin_HEXAGON_S2_tstbit_r,"bii","") -BUILTIN(__builtin_HEXAGON_S4_ntstbit_r,"bii","") -BUILTIN(__builtin_HEXAGON_S2_setbit_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_togglebit_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_clrbit_r,"iii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S5_asrhub_rnd_sat_goodsyntax,"iLLii","") -BUILTIN(__builtin_HEXAGON_S5_asrhub_sat,"iLLii","") -BUILTIN(__builtin_HEXAGON_S5_vasrhrnd_goodsyntax,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_vh,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_i_svw_trun,"iLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_svw_trun,"iLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_i_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_i_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asr_r_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_asl_r_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsr_r_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_lsl_r_vw,"LLiLLii","") -BUILTIN(__builtin_HEXAGON_S2_vrndpackwh,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vrndpackwhs,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsxtbh,"LLii","") -BUILTIN(__builtin_HEXAGON_S2_vzxtbh,"LLii","") -BUILTIN(__builtin_HEXAGON_S2_vsathub,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_svsathub,"ii","") -BUILTIN(__builtin_HEXAGON_S2_svsathb,"ii","") -BUILTIN(__builtin_HEXAGON_S2_vsathb,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vtrunohb,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vtrunewh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vtrunowh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vtrunehb,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsxthw,"LLii","") -BUILTIN(__builtin_HEXAGON_S2_vzxthw,"LLii","") -BUILTIN(__builtin_HEXAGON_S2_vsatwh,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsatwuh,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_packhl,"LLiii","") -BUILTIN(__builtin_HEXAGON_A2_swiz,"ii","") -BUILTIN(__builtin_HEXAGON_S2_vsathub_nopack,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsathb_nopack,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsatwh_nopack,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_vsatwuh_nopack,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_shuffob,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_shuffeb,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_shuffoh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_shuffeh,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S5_popcountp,"iLLi","") -BUILTIN(__builtin_HEXAGON_S4_parity,"iii","") -BUILTIN(__builtin_HEXAGON_S2_parityp,"iLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_lfsp,"LLiLLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_clbnorm,"ii","") -BUILTIN(__builtin_HEXAGON_S4_clbaddi,"iii","") -BUILTIN(__builtin_HEXAGON_S4_clbpnorm,"iLLi","") -BUILTIN(__builtin_HEXAGON_S4_clbpaddi,"iLLii","") -BUILTIN(__builtin_HEXAGON_S2_clb,"ii","") -BUILTIN(__builtin_HEXAGON_S2_cl0,"ii","") -BUILTIN(__builtin_HEXAGON_S2_cl1,"ii","") -BUILTIN(__builtin_HEXAGON_S2_clbp,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_cl0p,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_cl1p,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_brev,"ii","") -BUILTIN(__builtin_HEXAGON_S2_brevp,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_ct0,"ii","") -BUILTIN(__builtin_HEXAGON_S2_ct1,"ii","") -BUILTIN(__builtin_HEXAGON_S2_ct0p,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_ct1p,"iLLi","") -BUILTIN(__builtin_HEXAGON_S2_interleave,"LLiLLi","") -BUILTIN(__builtin_HEXAGON_S2_deinterleave,"LLiLLi","") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsLe64.def b/include/clang/Basic/BuiltinsLe64.def deleted file mode 100644 index 5328606..0000000 --- a/include/clang/Basic/BuiltinsLe64.def +++ /dev/null @@ -1,19 +0,0 @@ -//==- BuiltinsLe64.def - Le64 Builtin function database ----------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the Le64-specific builtin function database. Users of this -// file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -BUILTIN(__clear_cache, "vv*v*", "i") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsMips.def b/include/clang/Basic/BuiltinsMips.def deleted file mode 100644 index 2d217f7..0000000 --- a/include/clang/Basic/BuiltinsMips.def +++ /dev/null @@ -1,900 +0,0 @@ -//===-- BuiltinsMips.def - Mips Builtin function database --------*- C++ -*-==// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the MIPS-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// MIPS DSP Rev 1 - -// Add/subtract with optional saturation -BUILTIN(__builtin_mips_addu_qb, "V4ScV4ScV4Sc", "n") -BUILTIN(__builtin_mips_addu_s_qb, "V4ScV4ScV4Sc", "n") -BUILTIN(__builtin_mips_subu_qb, "V4ScV4ScV4Sc", "n") -BUILTIN(__builtin_mips_subu_s_qb, "V4ScV4ScV4Sc", "n") - -BUILTIN(__builtin_mips_addq_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_addq_s_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_subq_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_subq_s_ph, "V2sV2sV2s", "n") - -BUILTIN(__builtin_mips_madd, "LLiLLiii", "nc") -BUILTIN(__builtin_mips_maddu, "LLiLLiUiUi", "nc") -BUILTIN(__builtin_mips_msub, "LLiLLiii", "nc") -BUILTIN(__builtin_mips_msubu, "LLiLLiUiUi", "nc") - -BUILTIN(__builtin_mips_addq_s_w, "iii", "n") -BUILTIN(__builtin_mips_subq_s_w, "iii", "n") - -BUILTIN(__builtin_mips_addsc, "iii", "n") -BUILTIN(__builtin_mips_addwc, "iii", "n") - -BUILTIN(__builtin_mips_modsub, "iii", "nc") - -BUILTIN(__builtin_mips_raddu_w_qb, "iV4Sc", "nc") - -BUILTIN(__builtin_mips_absq_s_ph, "V2sV2s", "n") -BUILTIN(__builtin_mips_absq_s_w, "ii", "n") - -BUILTIN(__builtin_mips_precrq_qb_ph, "V4ScV2sV2s", "nc") -BUILTIN(__builtin_mips_precrqu_s_qb_ph, "V4ScV2sV2s", "n") -BUILTIN(__builtin_mips_precrq_ph_w, "V2sii", "nc") -BUILTIN(__builtin_mips_precrq_rs_ph_w, "V2sii", "n") -BUILTIN(__builtin_mips_preceq_w_phl, "iV2s", "nc") -BUILTIN(__builtin_mips_preceq_w_phr, "iV2s", "nc") -BUILTIN(__builtin_mips_precequ_ph_qbl, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_precequ_ph_qbr, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_precequ_ph_qbla, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_precequ_ph_qbra, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_preceu_ph_qbl, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_preceu_ph_qbr, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_preceu_ph_qbla, "V2sV4Sc", "nc") -BUILTIN(__builtin_mips_preceu_ph_qbra, "V2sV4Sc", "nc") - -BUILTIN(__builtin_mips_shll_qb, "V4ScV4Sci", "n") -BUILTIN(__builtin_mips_shrl_qb, "V4ScV4Sci", "nc") -BUILTIN(__builtin_mips_shll_ph, "V2sV2si", "n") -BUILTIN(__builtin_mips_shll_s_ph, "V2sV2si", "n") -BUILTIN(__builtin_mips_shra_ph, "V2sV2si", "nc") -BUILTIN(__builtin_mips_shra_r_ph, "V2sV2si", "nc") -BUILTIN(__builtin_mips_shll_s_w, "iii", "n") -BUILTIN(__builtin_mips_shra_r_w, "iii", "nc") -BUILTIN(__builtin_mips_shilo, "LLiLLii", "nc") - -BUILTIN(__builtin_mips_muleu_s_ph_qbl, "V2sV4ScV2s", "n") -BUILTIN(__builtin_mips_muleu_s_ph_qbr, "V2sV4ScV2s", "n") -BUILTIN(__builtin_mips_mulq_rs_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_muleq_s_w_phl, "iV2sV2s", "n") -BUILTIN(__builtin_mips_muleq_s_w_phr, "iV2sV2s", "n") -BUILTIN(__builtin_mips_mulsaq_s_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_maq_s_w_phl, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_maq_s_w_phr, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_maq_sa_w_phl, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_maq_sa_w_phr, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_mult, "LLiii", "nc") -BUILTIN(__builtin_mips_multu, "LLiUiUi", "nc") - -BUILTIN(__builtin_mips_dpau_h_qbl, "LLiLLiV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_dpau_h_qbr, "LLiLLiV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_dpsu_h_qbl, "LLiLLiV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_dpsu_h_qbr, "LLiLLiV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_dpaq_s_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_dpsq_s_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_dpaq_sa_l_w, "LLiLLiii", "n") -BUILTIN(__builtin_mips_dpsq_sa_l_w, "LLiLLiii", "n") - -BUILTIN(__builtin_mips_cmpu_eq_qb, "vV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpu_lt_qb, "vV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpu_le_qb, "vV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpgu_eq_qb, "iV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpgu_lt_qb, "iV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpgu_le_qb, "iV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmp_eq_ph, "vV2sV2s", "n") -BUILTIN(__builtin_mips_cmp_lt_ph, "vV2sV2s", "n") -BUILTIN(__builtin_mips_cmp_le_ph, "vV2sV2s", "n") - -BUILTIN(__builtin_mips_extr_s_h, "iLLii", "n") -BUILTIN(__builtin_mips_extr_w, "iLLii", "n") -BUILTIN(__builtin_mips_extr_rs_w, "iLLii", "n") -BUILTIN(__builtin_mips_extr_r_w, "iLLii", "n") -BUILTIN(__builtin_mips_extp, "iLLii", "n") -BUILTIN(__builtin_mips_extpdp, "iLLii", "n") - -BUILTIN(__builtin_mips_wrdsp, "viIi", "n") -BUILTIN(__builtin_mips_rddsp, "iIi", "n") -BUILTIN(__builtin_mips_insv, "iii", "n") -BUILTIN(__builtin_mips_bitrev, "ii", "nc") -BUILTIN(__builtin_mips_packrl_ph, "V2sV2sV2s", "nc") -BUILTIN(__builtin_mips_repl_qb, "V4Sci", "nc") -BUILTIN(__builtin_mips_repl_ph, "V2si", "nc") -BUILTIN(__builtin_mips_pick_qb, "V4ScV4ScV4Sc", "n") -BUILTIN(__builtin_mips_pick_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_mthlip, "LLiLLii", "n") -BUILTIN(__builtin_mips_bposge32, "i", "n") -BUILTIN(__builtin_mips_lbux, "iv*i", "n") -BUILTIN(__builtin_mips_lhx, "iv*i", "n") -BUILTIN(__builtin_mips_lwx, "iv*i", "n") - -// MIPS DSP Rev 2 - -BUILTIN(__builtin_mips_absq_s_qb, "V4ScV4Sc", "n") - -BUILTIN(__builtin_mips_addqh_ph, "V2sV2sV2s", "nc") -BUILTIN(__builtin_mips_addqh_r_ph, "V2sV2sV2s", "nc") -BUILTIN(__builtin_mips_addqh_w, "iii", "nc") -BUILTIN(__builtin_mips_addqh_r_w, "iii", "nc") - -BUILTIN(__builtin_mips_addu_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_addu_s_ph, "V2sV2sV2s", "n") - -BUILTIN(__builtin_mips_adduh_qb, "V4ScV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_adduh_r_qb, "V4ScV4ScV4Sc", "nc") - -BUILTIN(__builtin_mips_append, "iiiIi", "nc") -BUILTIN(__builtin_mips_balign, "iiiIi", "nc") - -BUILTIN(__builtin_mips_cmpgdu_eq_qb, "iV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpgdu_lt_qb, "iV4ScV4Sc", "n") -BUILTIN(__builtin_mips_cmpgdu_le_qb, "iV4ScV4Sc", "n") - -BUILTIN(__builtin_mips_dpa_w_ph, "LLiLLiV2sV2s", "nc") -BUILTIN(__builtin_mips_dps_w_ph, "LLiLLiV2sV2s", "nc") - -BUILTIN(__builtin_mips_dpaqx_s_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_dpaqx_sa_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_dpax_w_ph, "LLiLLiV2sV2s", "nc") -BUILTIN(__builtin_mips_dpsx_w_ph, "LLiLLiV2sV2s", "nc") -BUILTIN(__builtin_mips_dpsqx_s_w_ph, "LLiLLiV2sV2s", "n") -BUILTIN(__builtin_mips_dpsqx_sa_w_ph, "LLiLLiV2sV2s", "n") - -BUILTIN(__builtin_mips_mul_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_mul_s_ph, "V2sV2sV2s", "n") - -BUILTIN(__builtin_mips_mulq_rs_w, "iii", "n") -BUILTIN(__builtin_mips_mulq_s_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_mulq_s_w, "iii", "n") -BUILTIN(__builtin_mips_mulsa_w_ph, "LLiLLiV2sV2s", "nc") - -BUILTIN(__builtin_mips_precr_qb_ph, "V4ScV2sV2s", "n") -BUILTIN(__builtin_mips_precr_sra_ph_w, "V2siiIi", "nc") -BUILTIN(__builtin_mips_precr_sra_r_ph_w, "V2siiIi", "nc") - -BUILTIN(__builtin_mips_prepend, "iiiIi", "nc") - -BUILTIN(__builtin_mips_shra_qb, "V4ScV4Sci", "nc") -BUILTIN(__builtin_mips_shra_r_qb, "V4ScV4Sci", "nc") -BUILTIN(__builtin_mips_shrl_ph, "V2sV2si", "nc") - -BUILTIN(__builtin_mips_subqh_ph, "V2sV2sV2s", "nc") -BUILTIN(__builtin_mips_subqh_r_ph, "V2sV2sV2s", "nc") -BUILTIN(__builtin_mips_subqh_w, "iii", "nc") -BUILTIN(__builtin_mips_subqh_r_w, "iii", "nc") - -BUILTIN(__builtin_mips_subu_ph, "V2sV2sV2s", "n") -BUILTIN(__builtin_mips_subu_s_ph, "V2sV2sV2s", "n") - -BUILTIN(__builtin_mips_subuh_qb, "V4ScV4ScV4Sc", "nc") -BUILTIN(__builtin_mips_subuh_r_qb, "V4ScV4ScV4Sc", "nc") - -// MIPS MSA - -BUILTIN(__builtin_msa_add_a_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_add_a_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_add_a_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_add_a_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_adds_a_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_adds_a_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_adds_a_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_adds_a_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_adds_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_adds_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_adds_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_adds_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_adds_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_adds_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_adds_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_adds_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_addv_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_addv_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_addv_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_addv_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_addvi_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_addvi_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_addvi_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_addvi_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_and_v, "V16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_andi_b, "V16UcV16UcIUi", "nc") - -BUILTIN(__builtin_msa_asub_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_asub_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_asub_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_asub_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_asub_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_asub_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_asub_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_asub_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_ave_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_ave_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_ave_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_ave_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_ave_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_ave_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_ave_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_ave_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_aver_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_aver_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_aver_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_aver_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_aver_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_aver_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_aver_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_aver_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_bclr_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_bclr_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_bclr_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_bclr_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_bclri_b, "V16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_bclri_h, "V8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_bclri_w, "V4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_bclri_d, "V2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_binsl_b, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_binsl_h, "V8UsV8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_binsl_w, "V4UiV4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_binsl_d, "V2ULLiV2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_binsli_b, "V16UcV16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_binsli_h, "V8UsV8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_binsli_w, "V4UiV4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_binsli_d, "V2ULLiV2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_binsr_b, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_binsr_h, "V8UsV8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_binsr_w, "V4UiV4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_binsr_d, "V2ULLiV2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_binsri_b, "V16UcV16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_binsri_h, "V8UsV8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_binsri_w, "V4UiV4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_binsri_d, "V2ULLiV2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_bmnz_v, "V16UcV16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_bmnzi_b, "V16UcV16UcV16UcIUi", "nc") - -BUILTIN(__builtin_msa_bmz_v, "V16UcV16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_bmzi_b, "V16UcV16UcV16UcIUi", "nc") - -BUILTIN(__builtin_msa_bneg_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_bneg_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_bneg_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_bneg_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_bnegi_b, "V16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_bnegi_h, "V8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_bnegi_w, "V4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_bnegi_d, "V2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_bnz_b, "iV16Uc", "nc") -BUILTIN(__builtin_msa_bnz_h, "iV8Us", "nc") -BUILTIN(__builtin_msa_bnz_w, "iV4Ui", "nc") -BUILTIN(__builtin_msa_bnz_d, "iV2ULLi", "nc") - -BUILTIN(__builtin_msa_bnz_v, "iV16Uc", "nc") - -BUILTIN(__builtin_msa_bsel_v, "V16UcV16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_bseli_b, "V16UcV16UcV16UcIUi", "nc") - -BUILTIN(__builtin_msa_bset_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_bset_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_bset_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_bset_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_bseti_b, "V16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_bseti_h, "V8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_bseti_w, "V4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_bseti_d, "V2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_bz_b, "iV16Uc", "nc") -BUILTIN(__builtin_msa_bz_h, "iV8Us", "nc") -BUILTIN(__builtin_msa_bz_w, "iV4Ui", "nc") -BUILTIN(__builtin_msa_bz_d, "iV2ULLi", "nc") - -BUILTIN(__builtin_msa_bz_v, "iV16Uc", "nc") - -BUILTIN(__builtin_msa_ceq_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_ceq_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_ceq_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_ceq_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_ceqi_b, "V16ScV16ScISi", "nc") -BUILTIN(__builtin_msa_ceqi_h, "V8SsV8SsISi", "nc") -BUILTIN(__builtin_msa_ceqi_w, "V4SiV4SiISi", "nc") -BUILTIN(__builtin_msa_ceqi_d, "V2SLLiV2SLLiISi", "nc") - -BUILTIN(__builtin_msa_cfcmsa, "iIi", "n") - -BUILTIN(__builtin_msa_cle_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_cle_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_cle_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_cle_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_cle_u_b, "V16ScV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_cle_u_h, "V8SsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_cle_u_w, "V4SiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_cle_u_d, "V2SLLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_clei_s_b, "V16ScV16ScISi", "nc") -BUILTIN(__builtin_msa_clei_s_h, "V8SsV8SsISi", "nc") -BUILTIN(__builtin_msa_clei_s_w, "V4SiV4SiISi", "nc") -BUILTIN(__builtin_msa_clei_s_d, "V2SLLiV2SLLiISi", "nc") - -BUILTIN(__builtin_msa_clei_u_b, "V16ScV16UcIUi", "nc") -BUILTIN(__builtin_msa_clei_u_h, "V8SsV8UsIUi", "nc") -BUILTIN(__builtin_msa_clei_u_w, "V4SiV4UiIUi", "nc") -BUILTIN(__builtin_msa_clei_u_d, "V2SLLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_clt_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_clt_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_clt_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_clt_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_clt_u_b, "V16ScV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_clt_u_h, "V8SsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_clt_u_w, "V4SiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_clt_u_d, "V2SLLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_clti_s_b, "V16ScV16ScISi", "nc") -BUILTIN(__builtin_msa_clti_s_h, "V8SsV8SsISi", "nc") -BUILTIN(__builtin_msa_clti_s_w, "V4SiV4SiISi", "nc") -BUILTIN(__builtin_msa_clti_s_d, "V2SLLiV2SLLiISi", "nc") - -BUILTIN(__builtin_msa_clti_u_b, "V16ScV16UcIUi", "nc") -BUILTIN(__builtin_msa_clti_u_h, "V8SsV8UsIUi", "nc") -BUILTIN(__builtin_msa_clti_u_w, "V4SiV4UiIUi", "nc") -BUILTIN(__builtin_msa_clti_u_d, "V2SLLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_copy_s_b, "iV16ScIUi", "nc") -BUILTIN(__builtin_msa_copy_s_h, "iV8SsIUi", "nc") -BUILTIN(__builtin_msa_copy_s_w, "iV4SiIUi", "nc") -BUILTIN(__builtin_msa_copy_s_d, "LLiV2SLLiIUi", "nc") - -BUILTIN(__builtin_msa_copy_u_b, "iV16UcIUi", "nc") -BUILTIN(__builtin_msa_copy_u_h, "iV8UsIUi", "nc") -BUILTIN(__builtin_msa_copy_u_w, "iV4UiIUi", "nc") -BUILTIN(__builtin_msa_copy_u_d, "LLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_ctcmsa, "vIii", "n") - -BUILTIN(__builtin_msa_div_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_div_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_div_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_div_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_div_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_div_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_div_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_div_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_dotp_s_h, "V8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_dotp_s_w, "V4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_dotp_s_d, "V2SLLiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_dotp_u_h, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_dotp_u_w, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_msa_dotp_u_d, "V2ULLiV4UiV4Ui", "nc") - -BUILTIN(__builtin_msa_dpadd_s_h, "V8SsV8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_dpadd_s_w, "V4SiV4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_dpadd_s_d, "V2SLLiV2SLLiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_dpadd_u_h, "V8UsV8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_dpadd_u_w, "V4UiV4UiV8UsV8Us", "nc") -BUILTIN(__builtin_msa_dpadd_u_d, "V2ULLiV2ULLiV4UiV4Ui", "nc") - -BUILTIN(__builtin_msa_dpsub_s_h, "V8SsV8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_dpsub_s_w, "V4SiV4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_dpsub_s_d, "V2SLLiV2SLLiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_dpsub_u_h, "V8UsV8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_dpsub_u_w, "V4UiV4UiV8UsV8Us", "nc") -BUILTIN(__builtin_msa_dpsub_u_d, "V2ULLiV2ULLiV4UiV4Ui", "nc") - -BUILTIN(__builtin_msa_fadd_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fadd_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcaf_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcaf_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fceq_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fceq_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fclass_w, "V4iV4f", "nc") -BUILTIN(__builtin_msa_fclass_d, "V2LLiV2d", "nc") - -BUILTIN(__builtin_msa_fcle_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcle_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fclt_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fclt_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcne_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcne_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcor_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcor_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcueq_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcueq_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcule_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcule_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcult_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcult_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcun_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcun_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fcune_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fcune_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fdiv_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fdiv_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fexdo_h, "V8hV4fV4f", "nc") -BUILTIN(__builtin_msa_fexdo_w, "V4fV2dV2d", "nc") - -BUILTIN(__builtin_msa_fexp2_w, "V4fV4fV4i", "nc") -BUILTIN(__builtin_msa_fexp2_d, "V2dV2dV2LLi", "nc") - -BUILTIN(__builtin_msa_fexupl_w, "V4fV8h", "nc") -BUILTIN(__builtin_msa_fexupl_d, "V2dV4f", "nc") - -BUILTIN(__builtin_msa_fexupr_w, "V4fV8h", "nc") -BUILTIN(__builtin_msa_fexupr_d, "V2dV4f", "nc") - -BUILTIN(__builtin_msa_ffint_s_w, "V4fV4Si", "nc") -BUILTIN(__builtin_msa_ffint_s_d, "V2dV2SLLi", "nc") - -BUILTIN(__builtin_msa_ffint_u_w, "V4fV4Ui", "nc") -BUILTIN(__builtin_msa_ffint_u_d, "V2dV2ULLi", "nc") - -// ffql uses integers since long _Fract is not implemented -BUILTIN(__builtin_msa_ffql_w, "V4fV8Ss", "nc") -BUILTIN(__builtin_msa_ffql_d, "V2dV4Si", "nc") - -// ffqr uses integers since long _Fract is not implemented -BUILTIN(__builtin_msa_ffqr_w, "V4fV8Ss", "nc") -BUILTIN(__builtin_msa_ffqr_d, "V2dV4Si", "nc") - -BUILTIN(__builtin_msa_fill_b, "V16Sci", "nc") -BUILTIN(__builtin_msa_fill_h, "V8Ssi", "nc") -BUILTIN(__builtin_msa_fill_w, "V4Sii", "nc") -BUILTIN(__builtin_msa_fill_d, "V2SLLiLLi", "nc") - -BUILTIN(__builtin_msa_flog2_w, "V4fV4f", "nc") -BUILTIN(__builtin_msa_flog2_d, "V2dV2d", "nc") - -BUILTIN(__builtin_msa_fmadd_w, "V4fV4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmadd_d, "V2dV2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmax_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmax_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmax_a_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmax_a_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmin_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmin_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmin_a_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmin_a_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmsub_w, "V4fV4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmsub_d, "V2dV2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fmul_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fmul_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_frint_w, "V4fV4f", "nc") -BUILTIN(__builtin_msa_frint_d, "V2dV2d", "nc") - -BUILTIN(__builtin_msa_frcp_w, "V4fV4f", "nc") -BUILTIN(__builtin_msa_frcp_d, "V2dV2d", "nc") - -BUILTIN(__builtin_msa_frsqrt_w, "V4fV4f", "nc") -BUILTIN(__builtin_msa_frsqrt_d, "V2dV2d", "nc") - -BUILTIN(__builtin_msa_fsaf_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsaf_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fseq_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fseq_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsle_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsle_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fslt_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fslt_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsne_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsne_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsor_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsor_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsqrt_w, "V4fV4f", "nc") -BUILTIN(__builtin_msa_fsqrt_d, "V2dV2d", "nc") - -BUILTIN(__builtin_msa_fsub_w, "V4fV4fV4f", "nc") -BUILTIN(__builtin_msa_fsub_d, "V2dV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsueq_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsueq_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsule_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsule_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsult_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsult_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsun_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsun_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_fsune_w, "V4iV4fV4f", "nc") -BUILTIN(__builtin_msa_fsune_d, "V2LLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_ftint_s_w, "V4SiV4f", "nc") -BUILTIN(__builtin_msa_ftint_s_d, "V2SLLiV2d", "nc") - -BUILTIN(__builtin_msa_ftint_u_w, "V4UiV4f", "nc") -BUILTIN(__builtin_msa_ftint_u_d, "V2ULLiV2d", "nc") - -BUILTIN(__builtin_msa_ftq_h, "V4UiV4fV4f", "nc") -BUILTIN(__builtin_msa_ftq_w, "V2ULLiV2dV2d", "nc") - -BUILTIN(__builtin_msa_ftrunc_s_w, "V4SiV4f", "nc") -BUILTIN(__builtin_msa_ftrunc_s_d, "V2SLLiV2d", "nc") - -BUILTIN(__builtin_msa_ftrunc_u_w, "V4UiV4f", "nc") -BUILTIN(__builtin_msa_ftrunc_u_d, "V2ULLiV2d", "nc") - -BUILTIN(__builtin_msa_hadd_s_h, "V8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_hadd_s_w, "V4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_hadd_s_d, "V2SLLiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_hadd_u_h, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_hadd_u_w, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_msa_hadd_u_d, "V2ULLiV4UiV4Ui", "nc") - -BUILTIN(__builtin_msa_hsub_s_h, "V8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_hsub_s_w, "V4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_hsub_s_d, "V2SLLiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_hsub_u_h, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_hsub_u_w, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_msa_hsub_u_d, "V2ULLiV4UiV4Ui", "nc") - -BUILTIN(__builtin_msa_ilvev_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_ilvev_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_ilvev_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_ilvev_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_ilvl_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_ilvl_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_ilvl_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_ilvl_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_ilvod_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_ilvod_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_ilvod_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_ilvod_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_ilvr_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_ilvr_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_ilvr_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_ilvr_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_insert_b, "V16ScV16ScIUii", "nc") -BUILTIN(__builtin_msa_insert_h, "V8SsV8SsIUii", "nc") -BUILTIN(__builtin_msa_insert_w, "V4SiV4SiIUii", "nc") -BUILTIN(__builtin_msa_insert_d, "V2SLLiV2SLLiIUiLLi", "nc") - -BUILTIN(__builtin_msa_insve_b, "V16ScV16ScIUiV16Sc", "nc") -BUILTIN(__builtin_msa_insve_h, "V8SsV8SsIUiV8Ss", "nc") -BUILTIN(__builtin_msa_insve_w, "V4SiV4SiIUiV4Si", "nc") -BUILTIN(__builtin_msa_insve_d, "V2SLLiV2SLLiIUiV2SLLi", "nc") - -BUILTIN(__builtin_msa_ld_b, "V16Scv*Ii", "nc") -BUILTIN(__builtin_msa_ld_h, "V8Ssv*Ii", "nc") -BUILTIN(__builtin_msa_ld_w, "V4Siv*Ii", "nc") -BUILTIN(__builtin_msa_ld_d, "V2SLLiv*Ii", "nc") - -BUILTIN(__builtin_msa_ldi_b, "V16cIi", "nc") -BUILTIN(__builtin_msa_ldi_h, "V8sIi", "nc") -BUILTIN(__builtin_msa_ldi_w, "V4iIi", "nc") -BUILTIN(__builtin_msa_ldi_d, "V2LLiIi", "nc") - -BUILTIN(__builtin_msa_madd_q_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_madd_q_w, "V4SiV4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_maddr_q_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_maddr_q_w, "V4SiV4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_maddv_b, "V16ScV16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_maddv_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_maddv_w, "V4SiV4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_maddv_d, "V2SLLiV2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_max_a_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_max_a_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_max_a_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_max_a_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_max_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_max_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_max_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_max_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_max_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_max_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_max_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_max_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_maxi_s_b, "V16ScV16ScIi", "nc") -BUILTIN(__builtin_msa_maxi_s_h, "V8SsV8SsIi", "nc") -BUILTIN(__builtin_msa_maxi_s_w, "V4SiV4SiIi", "nc") -BUILTIN(__builtin_msa_maxi_s_d, "V2SLLiV2SLLiIi", "nc") - -BUILTIN(__builtin_msa_maxi_u_b, "V16UcV16UcIi", "nc") -BUILTIN(__builtin_msa_maxi_u_h, "V8UsV8UsIi", "nc") -BUILTIN(__builtin_msa_maxi_u_w, "V4UiV4UiIi", "nc") -BUILTIN(__builtin_msa_maxi_u_d, "V2ULLiV2ULLiIi", "nc") - -BUILTIN(__builtin_msa_min_a_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_min_a_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_min_a_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_min_a_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_min_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_min_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_min_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_min_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_min_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_min_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_min_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_min_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_mini_s_b, "V16ScV16ScIi", "nc") -BUILTIN(__builtin_msa_mini_s_h, "V8SsV8SsIi", "nc") -BUILTIN(__builtin_msa_mini_s_w, "V4SiV4SiIi", "nc") -BUILTIN(__builtin_msa_mini_s_d, "V2SLLiV2SLLiIi", "nc") - -BUILTIN(__builtin_msa_mini_u_b, "V16UcV16UcIi", "nc") -BUILTIN(__builtin_msa_mini_u_h, "V8UsV8UsIi", "nc") -BUILTIN(__builtin_msa_mini_u_w, "V4UiV4UiIi", "nc") -BUILTIN(__builtin_msa_mini_u_d, "V2ULLiV2ULLiIi", "nc") - -BUILTIN(__builtin_msa_mod_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_mod_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_mod_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_mod_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_mod_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_mod_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_mod_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_mod_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_move_v, "V16ScV16Sc", "nc") - -BUILTIN(__builtin_msa_msub_q_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_msub_q_w, "V4SiV4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_msubr_q_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_msubr_q_w, "V4SiV4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_msubv_b, "V16ScV16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_msubv_h, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_msubv_w, "V4SiV4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_msubv_d, "V2SLLiV2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_mul_q_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_mul_q_w, "V4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_mulr_q_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_mulr_q_w, "V4SiV4SiV4Si", "nc") - -BUILTIN(__builtin_msa_mulv_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_mulv_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_mulv_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_mulv_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_nloc_b, "V16ScV16Sc", "nc") -BUILTIN(__builtin_msa_nloc_h, "V8SsV8Ss", "nc") -BUILTIN(__builtin_msa_nloc_w, "V4SiV4Si", "nc") -BUILTIN(__builtin_msa_nloc_d, "V2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_nlzc_b, "V16ScV16Sc", "nc") -BUILTIN(__builtin_msa_nlzc_h, "V8SsV8Ss", "nc") -BUILTIN(__builtin_msa_nlzc_w, "V4SiV4Si", "nc") -BUILTIN(__builtin_msa_nlzc_d, "V2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_nor_v, "V16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_nori_b, "V16UcV16cIUi", "nc") - -BUILTIN(__builtin_msa_or_v, "V16UcV16UcV16Uc", "nc") - -BUILTIN(__builtin_msa_ori_b, "V16UcV16UcIUi", "nc") - -BUILTIN(__builtin_msa_pckev_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_pckev_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_pckev_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_pckev_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_pckod_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_pckod_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_pckod_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_pckod_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_pcnt_b, "V16ScV16Sc", "nc") -BUILTIN(__builtin_msa_pcnt_h, "V8SsV8Ss", "nc") -BUILTIN(__builtin_msa_pcnt_w, "V4SiV4Si", "nc") -BUILTIN(__builtin_msa_pcnt_d, "V2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_sat_s_b, "V16ScV16ScIUi", "nc") -BUILTIN(__builtin_msa_sat_s_h, "V8SsV8SsIUi", "nc") -BUILTIN(__builtin_msa_sat_s_w, "V4SiV4SiIUi", "nc") -BUILTIN(__builtin_msa_sat_s_d, "V2SLLiV2SLLiIUi", "nc") - -BUILTIN(__builtin_msa_sat_u_b, "V16UcV16UcIUi", "nc") -BUILTIN(__builtin_msa_sat_u_h, "V8UsV8UsIUi", "nc") -BUILTIN(__builtin_msa_sat_u_w, "V4UiV4UiIUi", "nc") -BUILTIN(__builtin_msa_sat_u_d, "V2ULLiV2ULLiIUi", "nc") - -BUILTIN(__builtin_msa_shf_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_shf_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_shf_w, "V4iV4iIUi", "nc") - -BUILTIN(__builtin_msa_sld_b, "V16cV16cV16cUi", "nc") -BUILTIN(__builtin_msa_sld_h, "V8sV8sV8sUi", "nc") -BUILTIN(__builtin_msa_sld_w, "V4iV4iV4iUi", "nc") -BUILTIN(__builtin_msa_sld_d, "V2LLiV2LLiV2LLiUi", "nc") - -BUILTIN(__builtin_msa_sldi_b, "V16cV16cV16cIUi", "nc") -BUILTIN(__builtin_msa_sldi_h, "V8sV8sV8sIUi", "nc") -BUILTIN(__builtin_msa_sldi_w, "V4iV4iV4iIUi", "nc") -BUILTIN(__builtin_msa_sldi_d, "V2LLiV2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_sll_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_sll_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_sll_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_sll_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_slli_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_slli_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_slli_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_slli_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_splat_b, "V16cV16cUi", "nc") -BUILTIN(__builtin_msa_splat_h, "V8sV8sUi", "nc") -BUILTIN(__builtin_msa_splat_w, "V4iV4iUi", "nc") -BUILTIN(__builtin_msa_splat_d, "V2LLiV2LLiUi", "nc") - -BUILTIN(__builtin_msa_splati_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_splati_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_splati_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_splati_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_sra_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_sra_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_sra_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_sra_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_srai_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_srai_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_srai_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_srai_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_srar_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_srar_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_srar_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_srar_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_srari_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_srari_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_srari_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_srari_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_srl_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_srl_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_srl_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_srl_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_srli_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_srli_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_srli_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_srli_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_srlr_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_srlr_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_srlr_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_srlr_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_srlri_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_srlri_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_srlri_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_srlri_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_st_b, "vV16Scv*Ii", "nc") -BUILTIN(__builtin_msa_st_h, "vV8Ssv*Ii", "nc") -BUILTIN(__builtin_msa_st_w, "vV4Siv*Ii", "nc") -BUILTIN(__builtin_msa_st_d, "vV2SLLiv*Ii", "nc") - -BUILTIN(__builtin_msa_subs_s_b, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_msa_subs_s_h, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_msa_subs_s_w, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_msa_subs_s_d, "V2SLLiV2SLLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_subs_u_b, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_subs_u_h, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_subs_u_w, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_subs_u_d, "V2ULLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_subsus_u_b, "V16UcV16UcV16Sc", "nc") -BUILTIN(__builtin_msa_subsus_u_h, "V8UsV8UsV8Ss", "nc") -BUILTIN(__builtin_msa_subsus_u_w, "V4UiV4UiV4Si", "nc") -BUILTIN(__builtin_msa_subsus_u_d, "V2ULLiV2ULLiV2SLLi", "nc") - -BUILTIN(__builtin_msa_subsuu_s_b, "V16ScV16UcV16Uc", "nc") -BUILTIN(__builtin_msa_subsuu_s_h, "V8SsV8UsV8Us", "nc") -BUILTIN(__builtin_msa_subsuu_s_w, "V4SiV4UiV4Ui", "nc") -BUILTIN(__builtin_msa_subsuu_s_d, "V2SLLiV2ULLiV2ULLi", "nc") - -BUILTIN(__builtin_msa_subv_b, "V16cV16cV16c", "nc") -BUILTIN(__builtin_msa_subv_h, "V8sV8sV8s", "nc") -BUILTIN(__builtin_msa_subv_w, "V4iV4iV4i", "nc") -BUILTIN(__builtin_msa_subv_d, "V2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_subvi_b, "V16cV16cIUi", "nc") -BUILTIN(__builtin_msa_subvi_h, "V8sV8sIUi", "nc") -BUILTIN(__builtin_msa_subvi_w, "V4iV4iIUi", "nc") -BUILTIN(__builtin_msa_subvi_d, "V2LLiV2LLiIUi", "nc") - -BUILTIN(__builtin_msa_vshf_b, "V16cV16cV16cV16c", "nc") -BUILTIN(__builtin_msa_vshf_h, "V8sV8sV8sV8s", "nc") -BUILTIN(__builtin_msa_vshf_w, "V4iV4iV4iV4i", "nc") -BUILTIN(__builtin_msa_vshf_d, "V2LLiV2LLiV2LLiV2LLi", "nc") - -BUILTIN(__builtin_msa_xor_v, "V16cV16cV16c", "nc") - -BUILTIN(__builtin_msa_xori_b, "V16cV16cIUi", "nc") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsNEON.def b/include/clang/Basic/BuiltinsNEON.def deleted file mode 100644 index 7800ae69..0000000 --- a/include/clang/Basic/BuiltinsNEON.def +++ /dev/null @@ -1,21 +0,0 @@ -//===--- BuiltinsNEON.def - NEON Builtin function database ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the NEON-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -#define GET_NEON_BUILTINS -#include "clang/Basic/arm_neon.inc" -#undef GET_NEON_BUILTINS - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsNVPTX.def b/include/clang/Basic/BuiltinsNVPTX.def deleted file mode 100644 index 3ab6413..0000000 --- a/include/clang/Basic/BuiltinsNVPTX.def +++ /dev/null @@ -1,569 +0,0 @@ -//===--- BuiltinsPTX.def - PTX Builtin function database ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the PTX-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// Builtins retained from previous PTX back-end -BUILTIN(__builtin_ptx_read_tid_x, "i", "nc") -BUILTIN(__builtin_ptx_read_tid_y, "i", "nc") -BUILTIN(__builtin_ptx_read_tid_z, "i", "nc") -BUILTIN(__builtin_ptx_read_tid_w, "i", "nc") - -BUILTIN(__builtin_ptx_read_ntid_x, "i", "nc") -BUILTIN(__builtin_ptx_read_ntid_y, "i", "nc") -BUILTIN(__builtin_ptx_read_ntid_z, "i", "nc") -BUILTIN(__builtin_ptx_read_ntid_w, "i", "nc") - -BUILTIN(__builtin_ptx_read_ctaid_x, "i", "nc") -BUILTIN(__builtin_ptx_read_ctaid_y, "i", "nc") -BUILTIN(__builtin_ptx_read_ctaid_z, "i", "nc") -BUILTIN(__builtin_ptx_read_ctaid_w, "i", "nc") - -BUILTIN(__builtin_ptx_read_nctaid_x, "i", "nc") -BUILTIN(__builtin_ptx_read_nctaid_y, "i", "nc") -BUILTIN(__builtin_ptx_read_nctaid_z, "i", "nc") -BUILTIN(__builtin_ptx_read_nctaid_w, "i", "nc") - -BUILTIN(__builtin_ptx_read_laneid, "i", "nc") -BUILTIN(__builtin_ptx_read_warpid, "i", "nc") -BUILTIN(__builtin_ptx_read_nwarpid, "i", "nc") - -BUILTIN(__builtin_ptx_read_smid, "i", "nc") -BUILTIN(__builtin_ptx_read_nsmid, "i", "nc") -BUILTIN(__builtin_ptx_read_gridid, "i", "nc") - -BUILTIN(__builtin_ptx_read_lanemask_eq, "i", "nc") -BUILTIN(__builtin_ptx_read_lanemask_le, "i", "nc") -BUILTIN(__builtin_ptx_read_lanemask_lt, "i", "nc") -BUILTIN(__builtin_ptx_read_lanemask_ge, "i", "nc") -BUILTIN(__builtin_ptx_read_lanemask_gt, "i", "nc") - -BUILTIN(__builtin_ptx_read_clock, "i", "n") -BUILTIN(__builtin_ptx_read_clock64, "LLi", "n") - -BUILTIN(__builtin_ptx_read_pm0, "i", "n") -BUILTIN(__builtin_ptx_read_pm1, "i", "n") -BUILTIN(__builtin_ptx_read_pm2, "i", "n") -BUILTIN(__builtin_ptx_read_pm3, "i", "n") - -BUILTIN(__builtin_ptx_bar_sync, "vi", "n") - - -// Builtins exposed as part of NVVM -// MISC - -BUILTIN(__nvvm_clz_i, "ii", "") -BUILTIN(__nvvm_clz_ll, "iLLi", "") -BUILTIN(__nvvm_popc_i, "ii", "") -BUILTIN(__nvvm_popc_ll, "iLLi", "") -BUILTIN(__nvvm_prmt, "UiUiUiUi", "") - -// Min Max - -BUILTIN(__nvvm_min_i, "iii", "") -BUILTIN(__nvvm_min_ui, "UiUiUi", "") -BUILTIN(__nvvm_min_ll, "LLiLLiLLi", "") -BUILTIN(__nvvm_min_ull, "ULLiULLiULLi", "") - -BUILTIN(__nvvm_max_i, "iii", "") -BUILTIN(__nvvm_max_ui, "UiUiUi", "") -BUILTIN(__nvvm_max_ll, "LLiLLiLLi", "") -BUILTIN(__nvvm_max_ull, "ULLiULLiULLi", "") - -BUILTIN(__nvvm_fmax_ftz_f, "fff", "") -BUILTIN(__nvvm_fmax_f, "fff", "") -BUILTIN(__nvvm_fmin_ftz_f, "fff", "") -BUILTIN(__nvvm_fmin_f, "fff", "") - -BUILTIN(__nvvm_fmax_d, "ddd", "") -BUILTIN(__nvvm_fmin_d, "ddd", "") - -// Multiplication - -BUILTIN(__nvvm_mulhi_i, "iii", "") -BUILTIN(__nvvm_mulhi_ui, "UiUiUi", "") -BUILTIN(__nvvm_mulhi_ll, "LLiLLiLLi", "") -BUILTIN(__nvvm_mulhi_ull, "ULLiULLiULLi", "") - -BUILTIN(__nvvm_mul_rn_ftz_f, "fff", "") -BUILTIN(__nvvm_mul_rn_f, "fff", "") -BUILTIN(__nvvm_mul_rz_ftz_f, "fff", "") -BUILTIN(__nvvm_mul_rz_f, "fff", "") -BUILTIN(__nvvm_mul_rm_ftz_f, "fff", "") -BUILTIN(__nvvm_mul_rm_f, "fff", "") -BUILTIN(__nvvm_mul_rp_ftz_f, "fff", "") -BUILTIN(__nvvm_mul_rp_f, "fff", "") - -BUILTIN(__nvvm_mul_rn_d, "ddd", "") -BUILTIN(__nvvm_mul_rz_d, "ddd", "") -BUILTIN(__nvvm_mul_rm_d, "ddd", "") -BUILTIN(__nvvm_mul_rp_d, "ddd", "") - -BUILTIN(__nvvm_mul24_i, "iii", "") -BUILTIN(__nvvm_mul24_ui, "UiUiUi", "") - -// Div - -BUILTIN(__nvvm_div_approx_ftz_f, "fff", "") -BUILTIN(__nvvm_div_approx_f, "fff", "") - -BUILTIN(__nvvm_div_rn_ftz_f, "fff", "") -BUILTIN(__nvvm_div_rn_f, "fff", "") -BUILTIN(__nvvm_div_rz_ftz_f, "fff", "") -BUILTIN(__nvvm_div_rz_f, "fff", "") -BUILTIN(__nvvm_div_rm_ftz_f, "fff", "") -BUILTIN(__nvvm_div_rm_f, "fff", "") -BUILTIN(__nvvm_div_rp_ftz_f, "fff", "") -BUILTIN(__nvvm_div_rp_f, "fff", "") - -BUILTIN(__nvvm_div_rn_d, "ddd", "") -BUILTIN(__nvvm_div_rz_d, "ddd", "") -BUILTIN(__nvvm_div_rm_d, "ddd", "") -BUILTIN(__nvvm_div_rp_d, "ddd", "") - -// Brev - -BUILTIN(__nvvm_brev32, "UiUi", "") -BUILTIN(__nvvm_brev64, "ULLiULLi", "") - -// Sad - -BUILTIN(__nvvm_sad_i, "iiii", "") -BUILTIN(__nvvm_sad_ui, "UiUiUiUi", "") - -// Floor, Ceil - -BUILTIN(__nvvm_floor_ftz_f, "ff", "") -BUILTIN(__nvvm_floor_f, "ff", "") -BUILTIN(__nvvm_floor_d, "dd", "") - -BUILTIN(__nvvm_ceil_ftz_f, "ff", "") -BUILTIN(__nvvm_ceil_f, "ff", "") -BUILTIN(__nvvm_ceil_d, "dd", "") - -// Abs - -BUILTIN(__nvvm_abs_i, "ii", "") -BUILTIN(__nvvm_abs_ll, "LLiLLi", "") - -BUILTIN(__nvvm_fabs_ftz_f, "ff", "") -BUILTIN(__nvvm_fabs_f, "ff", "") -BUILTIN(__nvvm_fabs_d, "dd", "") - -// Round - -BUILTIN(__nvvm_round_ftz_f, "ff", "") -BUILTIN(__nvvm_round_f, "ff", "") -BUILTIN(__nvvm_round_d, "dd", "") - -// Trunc - -BUILTIN(__nvvm_trunc_ftz_f, "ff", "") -BUILTIN(__nvvm_trunc_f, "ff", "") -BUILTIN(__nvvm_trunc_d, "dd", "") - -// Saturate - -BUILTIN(__nvvm_saturate_ftz_f, "ff", "") -BUILTIN(__nvvm_saturate_f, "ff", "") -BUILTIN(__nvvm_saturate_d, "dd", "") - -// Exp2, Log2 - -BUILTIN(__nvvm_ex2_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_ex2_approx_f, "ff", "") -BUILTIN(__nvvm_ex2_approx_d, "dd", "") - -BUILTIN(__nvvm_lg2_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_lg2_approx_f, "ff", "") -BUILTIN(__nvvm_lg2_approx_d, "dd", "") - -// Sin, Cos - -BUILTIN(__nvvm_sin_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_sin_approx_f, "ff", "") - -BUILTIN(__nvvm_cos_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_cos_approx_f, "ff", "") - -// Fma - -BUILTIN(__nvvm_fma_rn_ftz_f, "ffff", "") -BUILTIN(__nvvm_fma_rn_f, "ffff", "") -BUILTIN(__nvvm_fma_rz_ftz_f, "ffff", "") -BUILTIN(__nvvm_fma_rz_f, "ffff", "") -BUILTIN(__nvvm_fma_rm_ftz_f, "ffff", "") -BUILTIN(__nvvm_fma_rm_f, "ffff", "") -BUILTIN(__nvvm_fma_rp_ftz_f, "ffff", "") -BUILTIN(__nvvm_fma_rp_f, "ffff", "") -BUILTIN(__nvvm_fma_rn_d, "dddd", "") -BUILTIN(__nvvm_fma_rz_d, "dddd", "") -BUILTIN(__nvvm_fma_rm_d, "dddd", "") -BUILTIN(__nvvm_fma_rp_d, "dddd", "") - -// Rcp - -BUILTIN(__nvvm_rcp_rn_ftz_f, "ff", "") -BUILTIN(__nvvm_rcp_rn_f, "ff", "") -BUILTIN(__nvvm_rcp_rz_ftz_f, "ff", "") -BUILTIN(__nvvm_rcp_rz_f, "ff", "") -BUILTIN(__nvvm_rcp_rm_ftz_f, "ff", "") -BUILTIN(__nvvm_rcp_rm_f, "ff", "") -BUILTIN(__nvvm_rcp_rp_ftz_f, "ff", "") -BUILTIN(__nvvm_rcp_rp_f, "ff", "") - -BUILTIN(__nvvm_rcp_rn_d, "dd", "") -BUILTIN(__nvvm_rcp_rz_d, "dd", "") -BUILTIN(__nvvm_rcp_rm_d, "dd", "") -BUILTIN(__nvvm_rcp_rp_d, "dd", "") -BUILTIN(__nvvm_rcp_approx_ftz_d, "dd", "") - -// Sqrt - -BUILTIN(__nvvm_sqrt_rn_ftz_f, "ff", "") -BUILTIN(__nvvm_sqrt_rn_f, "ff", "") -BUILTIN(__nvvm_sqrt_rz_ftz_f, "ff", "") -BUILTIN(__nvvm_sqrt_rz_f, "ff", "") -BUILTIN(__nvvm_sqrt_rm_ftz_f, "ff", "") -BUILTIN(__nvvm_sqrt_rm_f, "ff", "") -BUILTIN(__nvvm_sqrt_rp_ftz_f, "ff", "") -BUILTIN(__nvvm_sqrt_rp_f, "ff", "") -BUILTIN(__nvvm_sqrt_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_sqrt_approx_f, "ff", "") - -BUILTIN(__nvvm_sqrt_rn_d, "dd", "") -BUILTIN(__nvvm_sqrt_rz_d, "dd", "") -BUILTIN(__nvvm_sqrt_rm_d, "dd", "") -BUILTIN(__nvvm_sqrt_rp_d, "dd", "") - -// Rsqrt - -BUILTIN(__nvvm_rsqrt_approx_ftz_f, "ff", "") -BUILTIN(__nvvm_rsqrt_approx_f, "ff", "") -BUILTIN(__nvvm_rsqrt_approx_d, "dd", "") - -// Add - -BUILTIN(__nvvm_add_rn_ftz_f, "fff", "") -BUILTIN(__nvvm_add_rn_f, "fff", "") -BUILTIN(__nvvm_add_rz_ftz_f, "fff", "") -BUILTIN(__nvvm_add_rz_f, "fff", "") -BUILTIN(__nvvm_add_rm_ftz_f, "fff", "") -BUILTIN(__nvvm_add_rm_f, "fff", "") -BUILTIN(__nvvm_add_rp_ftz_f, "fff", "") -BUILTIN(__nvvm_add_rp_f, "fff", "") - -BUILTIN(__nvvm_add_rn_d, "ddd", "") -BUILTIN(__nvvm_add_rz_d, "ddd", "") -BUILTIN(__nvvm_add_rm_d, "ddd", "") -BUILTIN(__nvvm_add_rp_d, "ddd", "") - -// Convert - -BUILTIN(__nvvm_d2f_rn_ftz, "fd", "") -BUILTIN(__nvvm_d2f_rn, "fd", "") -BUILTIN(__nvvm_d2f_rz_ftz, "fd", "") -BUILTIN(__nvvm_d2f_rz, "fd", "") -BUILTIN(__nvvm_d2f_rm_ftz, "fd", "") -BUILTIN(__nvvm_d2f_rm, "fd", "") -BUILTIN(__nvvm_d2f_rp_ftz, "fd", "") -BUILTIN(__nvvm_d2f_rp, "fd", "") - -BUILTIN(__nvvm_d2i_rn, "id", "") -BUILTIN(__nvvm_d2i_rz, "id", "") -BUILTIN(__nvvm_d2i_rm, "id", "") -BUILTIN(__nvvm_d2i_rp, "id", "") - -BUILTIN(__nvvm_d2ui_rn, "Uid", "") -BUILTIN(__nvvm_d2ui_rz, "Uid", "") -BUILTIN(__nvvm_d2ui_rm, "Uid", "") -BUILTIN(__nvvm_d2ui_rp, "Uid", "") - -BUILTIN(__nvvm_i2d_rn, "di", "") -BUILTIN(__nvvm_i2d_rz, "di", "") -BUILTIN(__nvvm_i2d_rm, "di", "") -BUILTIN(__nvvm_i2d_rp, "di", "") - -BUILTIN(__nvvm_ui2d_rn, "dUi", "") -BUILTIN(__nvvm_ui2d_rz, "dUi", "") -BUILTIN(__nvvm_ui2d_rm, "dUi", "") -BUILTIN(__nvvm_ui2d_rp, "dUi", "") - -BUILTIN(__nvvm_f2i_rn_ftz, "if", "") -BUILTIN(__nvvm_f2i_rn, "if", "") -BUILTIN(__nvvm_f2i_rz_ftz, "if", "") -BUILTIN(__nvvm_f2i_rz, "if", "") -BUILTIN(__nvvm_f2i_rm_ftz, "if", "") -BUILTIN(__nvvm_f2i_rm, "if", "") -BUILTIN(__nvvm_f2i_rp_ftz, "if", "") -BUILTIN(__nvvm_f2i_rp, "if", "") - -BUILTIN(__nvvm_f2ui_rn_ftz, "Uif", "") -BUILTIN(__nvvm_f2ui_rn, "Uif", "") -BUILTIN(__nvvm_f2ui_rz_ftz, "Uif", "") -BUILTIN(__nvvm_f2ui_rz, "Uif", "") -BUILTIN(__nvvm_f2ui_rm_ftz, "Uif", "") -BUILTIN(__nvvm_f2ui_rm, "Uif", "") -BUILTIN(__nvvm_f2ui_rp_ftz, "Uif", "") -BUILTIN(__nvvm_f2ui_rp, "Uif", "") - -BUILTIN(__nvvm_i2f_rn, "fi", "") -BUILTIN(__nvvm_i2f_rz, "fi", "") -BUILTIN(__nvvm_i2f_rm, "fi", "") -BUILTIN(__nvvm_i2f_rp, "fi", "") - -BUILTIN(__nvvm_ui2f_rn, "fUi", "") -BUILTIN(__nvvm_ui2f_rz, "fUi", "") -BUILTIN(__nvvm_ui2f_rm, "fUi", "") -BUILTIN(__nvvm_ui2f_rp, "fUi", "") - -BUILTIN(__nvvm_lohi_i2d, "dii", "") - -BUILTIN(__nvvm_d2i_lo, "id", "") -BUILTIN(__nvvm_d2i_hi, "id", "") - -BUILTIN(__nvvm_f2ll_rn_ftz, "LLif", "") -BUILTIN(__nvvm_f2ll_rn, "LLif", "") -BUILTIN(__nvvm_f2ll_rz_ftz, "LLif", "") -BUILTIN(__nvvm_f2ll_rz, "LLif", "") -BUILTIN(__nvvm_f2ll_rm_ftz, "LLif", "") -BUILTIN(__nvvm_f2ll_rm, "LLif", "") -BUILTIN(__nvvm_f2ll_rp_ftz, "LLif", "") -BUILTIN(__nvvm_f2ll_rp, "LLif", "") - -BUILTIN(__nvvm_f2ull_rn_ftz, "ULLif", "") -BUILTIN(__nvvm_f2ull_rn, "ULLif", "") -BUILTIN(__nvvm_f2ull_rz_ftz, "ULLif", "") -BUILTIN(__nvvm_f2ull_rz, "ULLif", "") -BUILTIN(__nvvm_f2ull_rm_ftz, "ULLif", "") -BUILTIN(__nvvm_f2ull_rm, "ULLif", "") -BUILTIN(__nvvm_f2ull_rp_ftz, "ULLif", "") -BUILTIN(__nvvm_f2ull_rp, "ULLif", "") - -BUILTIN(__nvvm_d2ll_rn, "LLid", "") -BUILTIN(__nvvm_d2ll_rz, "LLid", "") -BUILTIN(__nvvm_d2ll_rm, "LLid", "") -BUILTIN(__nvvm_d2ll_rp, "LLid", "") - -BUILTIN(__nvvm_d2ull_rn, "ULLid", "") -BUILTIN(__nvvm_d2ull_rz, "ULLid", "") -BUILTIN(__nvvm_d2ull_rm, "ULLid", "") -BUILTIN(__nvvm_d2ull_rp, "ULLid", "") - -BUILTIN(__nvvm_ll2f_rn, "fLLi", "") -BUILTIN(__nvvm_ll2f_rz, "fLLi", "") -BUILTIN(__nvvm_ll2f_rm, "fLLi", "") -BUILTIN(__nvvm_ll2f_rp, "fLLi", "") - -BUILTIN(__nvvm_ull2f_rn, "fULLi", "") -BUILTIN(__nvvm_ull2f_rz, "fULLi", "") -BUILTIN(__nvvm_ull2f_rm, "fULLi", "") -BUILTIN(__nvvm_ull2f_rp, "fULLi", "") - -BUILTIN(__nvvm_ll2d_rn, "dLLi", "") -BUILTIN(__nvvm_ll2d_rz, "dLLi", "") -BUILTIN(__nvvm_ll2d_rm, "dLLi", "") -BUILTIN(__nvvm_ll2d_rp, "dLLi", "") - -BUILTIN(__nvvm_ull2d_rn, "dULLi", "") -BUILTIN(__nvvm_ull2d_rz, "dULLi", "") -BUILTIN(__nvvm_ull2d_rm, "dULLi", "") -BUILTIN(__nvvm_ull2d_rp, "dULLi", "") - -BUILTIN(__nvvm_f2h_rn_ftz, "Usf", "") -BUILTIN(__nvvm_f2h_rn, "Usf", "") - -BUILTIN(__nvvm_h2f, "fUs", "") - -// Bitcast - -BUILTIN(__nvvm_bitcast_f2i, "if", "") -BUILTIN(__nvvm_bitcast_i2f, "fi", "") - -BUILTIN(__nvvm_bitcast_ll2d, "dLLi", "") -BUILTIN(__nvvm_bitcast_d2ll, "LLid", "") - -// Sync - -BUILTIN(__syncthreads, "v", "") -BUILTIN(__nvvm_bar0, "v", "") -BUILTIN(__nvvm_bar0_popc, "ii", "") -BUILTIN(__nvvm_bar0_and, "ii", "") -BUILTIN(__nvvm_bar0_or, "ii", "") - -// Membar - -BUILTIN(__nvvm_membar_cta, "v", "") -BUILTIN(__nvvm_membar_gl, "v", "") -BUILTIN(__nvvm_membar_sys, "v", "") - -// Memcpy, Memset - -BUILTIN(__nvvm_memcpy, "vUc*Uc*zi","") -BUILTIN(__nvvm_memset, "vUc*Uczi","") - -// Image - -BUILTIN(__builtin_ptx_read_image2Dfi_, "V4fiiii", "") -BUILTIN(__builtin_ptx_read_image2Dff_, "V4fiiff", "") -BUILTIN(__builtin_ptx_read_image2Dii_, "V4iiiii", "") -BUILTIN(__builtin_ptx_read_image2Dif_, "V4iiiff", "") - -BUILTIN(__builtin_ptx_read_image3Dfi_, "V4fiiiiii", "") -BUILTIN(__builtin_ptx_read_image3Dff_, "V4fiiffff", "") -BUILTIN(__builtin_ptx_read_image3Dii_, "V4iiiiiii", "") -BUILTIN(__builtin_ptx_read_image3Dif_, "V4iiiffff", "") - -BUILTIN(__builtin_ptx_write_image2Df_, "viiiffff", "") -BUILTIN(__builtin_ptx_write_image2Di_, "viiiiiii", "") -BUILTIN(__builtin_ptx_write_image2Dui_, "viiiUiUiUiUi", "") -BUILTIN(__builtin_ptx_get_image_depthi_, "ii", "") -BUILTIN(__builtin_ptx_get_image_heighti_, "ii", "") -BUILTIN(__builtin_ptx_get_image_widthi_, "ii", "") -BUILTIN(__builtin_ptx_get_image_channel_data_typei_, "ii", "") -BUILTIN(__builtin_ptx_get_image_channel_orderi_, "ii", "") - -// Atomic -// -// We need the atom intrinsics because -// - they are used in converging analysis -// - they are used in address space analysis and optimization -// So it does not hurt to expose them as builtins. -// -BUILTIN(__nvvm_atom_add_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_add_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_add_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_add_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_add_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_add_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_add_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_add_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_add_gen_ll, "LLiLLiD*LLi", "n") -BUILTIN(__nvvm_atom_add_g_f, "ffD*1f", "n") -BUILTIN(__nvvm_atom_add_s_f, "ffD*3f", "n") -BUILTIN(__nvvm_atom_add_gen_f, "ffD*f", "n") -BUILTIN(__nvvm_atom_add_g_d, "ddD*1d", "n") -BUILTIN(__nvvm_atom_add_s_d, "ddD*3d", "n") -BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n") - -BUILTIN(__nvvm_atom_sub_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_sub_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_sub_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_sub_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_sub_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_sub_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_sub_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_sub_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_sub_gen_ll, "LLiLLiD*LLi", "n") - -BUILTIN(__nvvm_atom_xchg_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_xchg_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_xchg_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_xchg_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_xchg_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_xchg_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_xchg_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_xchg_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_xchg_gen_ll, "LLiLLiD*LLi", "n") - -BUILTIN(__nvvm_atom_max_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_max_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_max_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_max_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_max_s_ui, "UiUiD*3Ui", "n") -BUILTIN(__nvvm_atom_max_gen_ui, "UiUiD*Ui", "n") -BUILTIN(__nvvm_atom_max_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_max_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_max_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_max_g_ul, "ULiULiD*1ULi", "n") -BUILTIN(__nvvm_atom_max_s_ul, "ULiULiD*3ULi", "n") -BUILTIN(__nvvm_atom_max_gen_ul, "ULiULiD*ULi", "n") -BUILTIN(__nvvm_atom_max_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_max_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_max_gen_ll, "LLiLLiD*LLi", "n") -BUILTIN(__nvvm_atom_max_g_ull, "ULLiULLiD*1ULLi", "n") -BUILTIN(__nvvm_atom_max_s_ull, "ULLiULLiD*3ULLi", "n") -BUILTIN(__nvvm_atom_max_gen_ull, "ULLiULLiD*ULLi", "n") - -BUILTIN(__nvvm_atom_min_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_min_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_min_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_min_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_min_s_ui, "UiUiD*3Ui", "n") -BUILTIN(__nvvm_atom_min_gen_ui, "UiUiD*Ui", "n") -BUILTIN(__nvvm_atom_min_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_min_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_min_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_min_g_ul, "ULiULiD*1ULi", "n") -BUILTIN(__nvvm_atom_min_s_ul, "ULiULiD*3ULi", "n") -BUILTIN(__nvvm_atom_min_gen_ul, "ULiULiD*ULi", "n") -BUILTIN(__nvvm_atom_min_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_min_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_min_gen_ll, "LLiLLiD*LLi", "n") -BUILTIN(__nvvm_atom_min_g_ull, "ULLiULLiD*1ULLi", "n") -BUILTIN(__nvvm_atom_min_s_ull, "ULLiULLiD*3ULLi", "n") -BUILTIN(__nvvm_atom_min_gen_ull, "ULLiULLiD*ULLi", "n") - -BUILTIN(__nvvm_atom_inc_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_inc_s_ui, "UiUiD*3Ui", "n") -BUILTIN(__nvvm_atom_inc_gen_ui, "UiUiD*Ui", "n") -BUILTIN(__nvvm_atom_dec_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_dec_s_ui, "UiUiD*3Ui", "n") -BUILTIN(__nvvm_atom_dec_gen_ui, "UiUiD*Ui", "n") - -BUILTIN(__nvvm_atom_and_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_and_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_and_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_and_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_and_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_and_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_and_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_and_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_and_gen_ll, "LLiLLiD*LLi", "n") - -BUILTIN(__nvvm_atom_or_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_or_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_or_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_or_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_or_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_or_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_or_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_or_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_or_gen_ll, "LLiLLiD*LLi", "n") - -BUILTIN(__nvvm_atom_xor_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_xor_s_i, "iiD*3i", "n") -BUILTIN(__nvvm_atom_xor_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_xor_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_xor_s_l, "LiLiD*3Li", "n") -BUILTIN(__nvvm_atom_xor_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_xor_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_xor_s_ll, "LLiLLiD*3LLi", "n") -BUILTIN(__nvvm_atom_xor_gen_ll, "LLiLLiD*LLi", "n") - -BUILTIN(__nvvm_atom_cas_g_i, "iiD*1ii", "n") -BUILTIN(__nvvm_atom_cas_s_i, "iiD*3ii", "n") -BUILTIN(__nvvm_atom_cas_gen_i, "iiD*ii", "n") -BUILTIN(__nvvm_atom_cas_g_l, "LiLiD*1LiLi", "n") -BUILTIN(__nvvm_atom_cas_s_l, "LiLiD*3LiLi", "n") -BUILTIN(__nvvm_atom_cas_gen_l, "LiLiD*LiLi", "n") -BUILTIN(__nvvm_atom_cas_g_ll, "LLiLLiD*1LLiLLi", "n") -BUILTIN(__nvvm_atom_cas_s_ll, "LLiLLiD*3LLiLLi", "n") -BUILTIN(__nvvm_atom_cas_gen_ll, "LLiLLiD*LLiLLi", "n") - -// Compiler Error Warn -BUILTIN(__nvvm_compiler_error, "vcC*4", "n") -BUILTIN(__nvvm_compiler_warn, "vcC*4", "n") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsPPC.def b/include/clang/Basic/BuiltinsPPC.def deleted file mode 100644 index 5681c1f2..0000000 --- a/include/clang/Basic/BuiltinsPPC.def +++ /dev/null @@ -1,379 +0,0 @@ -//===--- BuiltinsPPC.def - PowerPC Builtin function database ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the PowerPC-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// FIXME: this needs to be the full list supported by GCC. Right now, I'm just -// adding stuff on demand. - -// The format of this database matches clang/Basic/Builtins.def. - -BUILTIN(__builtin_ppc_get_timebase, "ULLi", "n") - -// This is just a placeholder, the types and attributes are wrong. -BUILTIN(__builtin_altivec_vaddcuw, "V4UiV4UiV4Ui", "") - -BUILTIN(__builtin_altivec_vaddsbs, "V16ScV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vaddubs, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vaddshs, "V8SsV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vadduhs, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_vaddsws, "V4SiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vadduws, "V4UiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vaddeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") -BUILTIN(__builtin_altivec_vaddcuq, "V1ULLLiV1ULLLiV1ULLLi","") -BUILTIN(__builtin_altivec_vaddecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") - -BUILTIN(__builtin_altivec_vsubsbs, "V16ScV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vsububs, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vsubshs, "V8SsV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vsubuhs, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_vsubsws, "V4SiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vsubuws, "V4UiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vsubeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") -BUILTIN(__builtin_altivec_vsubcuq, "V1ULLLiV1ULLLiV1ULLLi","") -BUILTIN(__builtin_altivec_vsubecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") - -BUILTIN(__builtin_altivec_vavgsb, "V16ScV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vavgub, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vavgsh, "V8SsV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vavguh, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_vavgsw, "V4SiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vavguw, "V4UiV4UiV4Ui", "") - -BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vcfsx, "V4fV4ii", "") -BUILTIN(__builtin_altivec_vcfux, "V4fV4ii", "") -BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fi", "") -BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fi", "") - -BUILTIN(__builtin_altivec_dss, "vUi", "") -BUILTIN(__builtin_altivec_dssall, "v", "") -BUILTIN(__builtin_altivec_dst, "vvC*iUi", "") -BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "") -BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "") -BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "") - -BUILTIN(__builtin_altivec_vexptefp, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vrfim, "V4fV4f", "") - -BUILTIN(__builtin_altivec_lvx, "V4iivC*", "") -BUILTIN(__builtin_altivec_lvxl, "V4iivC*", "") -BUILTIN(__builtin_altivec_lvebx, "V16civC*", "") -BUILTIN(__builtin_altivec_lvehx, "V8sivC*", "") -BUILTIN(__builtin_altivec_lvewx, "V4iivC*", "") - -BUILTIN(__builtin_altivec_vlogefp, "V4fV4f", "") - -BUILTIN(__builtin_altivec_lvsl, "V16cUcvC*", "") -BUILTIN(__builtin_altivec_lvsr, "V16cUcvC*", "") - -BUILTIN(__builtin_altivec_vmaddfp, "V4fV4fV4fV4f", "") -BUILTIN(__builtin_altivec_vmhaddshs, "V8sV8sV8sV8s", "") -BUILTIN(__builtin_altivec_vmhraddshs, "V8sV8sV8sV8s", "") - -BUILTIN(__builtin_altivec_vmsumubm, "V4UiV16UcV16UcV4Ui", "") -BUILTIN(__builtin_altivec_vmsummbm, "V4SiV16ScV16UcV4Si", "") -BUILTIN(__builtin_altivec_vmsumuhm, "V4UiV8UsV8UsV4Ui", "") -BUILTIN(__builtin_altivec_vmsumshm, "V4SiV8SsV8SsV4Si", "") -BUILTIN(__builtin_altivec_vmsumuhs, "V4UiV8UsV8UsV4Ui", "") -BUILTIN(__builtin_altivec_vmsumshs, "V4SiV8SsV8SsV4Si", "") - -BUILTIN(__builtin_altivec_vmuleub, "V8UsV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vmulesb, "V8SsV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vmuleuh, "V4UiV8UsV8Us", "") -BUILTIN(__builtin_altivec_vmulesh, "V4SiV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vmuleuw, "V2ULLiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vmulesw, "V2SLLiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vmuloub, "V8UsV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vmulosb, "V8SsV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vmulouh, "V4UiV8UsV8Us", "") -BUILTIN(__builtin_altivec_vmulosh, "V4SiV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vmulouw, "V2ULLiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vmulosw, "V2SLLiV4SiV4Si", "") - -BUILTIN(__builtin_altivec_vnmsubfp, "V4fV4fV4fV4f", "") - -BUILTIN(__builtin_altivec_vpkpx, "V8sV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vpkuhus, "V16UcV8UsV8Us", "") -BUILTIN(__builtin_altivec_vpkshss, "V16ScV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vpkuwus, "V8UsV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vpkswss, "V8SsV4SiV4Si", "") -BUILTIN(__builtin_altivec_vpkshus, "V16UcV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vpkswus, "V8UsV4SiV4Si", "") -BUILTIN(__builtin_altivec_vpksdss, "V4SiV2SLLiV2SLLi", "") -BUILTIN(__builtin_altivec_vpksdus, "V4UiV2SLLiV2SLLi", "") -BUILTIN(__builtin_altivec_vpkudus, "V4UiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_vpkudum, "V4UiV2ULLiV2ULLi", "") - -BUILTIN(__builtin_altivec_vperm_4si, "V4iV4iV4iV16Uc", "") - -BUILTIN(__builtin_altivec_stvx, "vV4iiv*", "") -BUILTIN(__builtin_altivec_stvxl, "vV4iiv*", "") -BUILTIN(__builtin_altivec_stvebx, "vV16civ*", "") -BUILTIN(__builtin_altivec_stvehx, "vV8siv*", "") -BUILTIN(__builtin_altivec_stvewx, "vV4iiv*", "") - -BUILTIN(__builtin_altivec_vcmpbfp, "V4iV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpgefp, "V4iV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpequb, "V16cV16cV16c", "") -BUILTIN(__builtin_altivec_vcmpequh, "V8sV8sV8s", "") -BUILTIN(__builtin_altivec_vcmpequw, "V4iV4iV4i", "") -BUILTIN(__builtin_altivec_vcmpequd, "V2LLiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vcmpeqfp, "V4iV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpgtsb, "V16cV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vcmpgtub, "V16cV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vcmpgtsh, "V8sV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vcmpgtuh, "V8sV8UsV8Us", "") -BUILTIN(__builtin_altivec_vcmpgtsw, "V4iV4SiV4Si", "") -BUILTIN(__builtin_altivec_vcmpgtuw, "V4iV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vcmpgtsd, "V2LLiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vcmpgtud, "V2LLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_vcmpgtfp, "V4iV4fV4f", "") - -BUILTIN(__builtin_altivec_vmaxsb, "V16ScV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vmaxub, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vmaxsh, "V8SsV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vmaxuh, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_vmaxsw, "V4SiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vmaxuw, "V4UiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vmaxsd, "V2LLiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vmaxud, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_vmaxfp, "V4fV4fV4f", "") - -BUILTIN(__builtin_altivec_mfvscr, "V8Us", "") - -BUILTIN(__builtin_altivec_vminsb, "V16ScV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vminub, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vminsh, "V8SsV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vminuh, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_vminsw, "V4SiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vminuw, "V4UiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vminsd, "V2LLiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vminud, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_vminfp, "V4fV4fV4f", "") - -BUILTIN(__builtin_altivec_mtvscr, "vV4i", "") - -BUILTIN(__builtin_altivec_vrefp, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vrlb, "V16cV16cV16Uc", "") -BUILTIN(__builtin_altivec_vrlh, "V8sV8sV8Us", "") -BUILTIN(__builtin_altivec_vrlw, "V4iV4iV4Ui", "") -BUILTIN(__builtin_altivec_vrld, "V2LLiV2LLiV2ULLi", "") - -BUILTIN(__builtin_altivec_vsel_4si, "V4iV4iV4iV4Ui", "") - -BUILTIN(__builtin_altivec_vsl, "V4iV4iV4i", "") -BUILTIN(__builtin_altivec_vslo, "V4iV4iV4i", "") - -BUILTIN(__builtin_altivec_vsrab, "V16cV16cV16Uc", "") -BUILTIN(__builtin_altivec_vsrah, "V8sV8sV8Us", "") -BUILTIN(__builtin_altivec_vsraw, "V4iV4iV4Ui", "") - -BUILTIN(__builtin_altivec_vsr, "V4iV4iV4i", "") -BUILTIN(__builtin_altivec_vsro, "V4iV4iV4i", "") - -BUILTIN(__builtin_altivec_vrfin, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vrsqrtefp, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vsubcuw, "V4UiV4UiV4Ui", "") - -BUILTIN(__builtin_altivec_vsum4sbs, "V4SiV16ScV4Si", "") -BUILTIN(__builtin_altivec_vsum4ubs, "V4UiV16UcV4Ui", "") -BUILTIN(__builtin_altivec_vsum4shs, "V4SiV8SsV4Si", "") - -BUILTIN(__builtin_altivec_vsum2sws, "V4SiV4SiV4Si", "") - -BUILTIN(__builtin_altivec_vsumsws, "V4SiV4SiV4Si", "") - -BUILTIN(__builtin_altivec_vrfiz, "V4fV4f", "") - -BUILTIN(__builtin_altivec_vupkhsb, "V8sV16c", "") -BUILTIN(__builtin_altivec_vupkhpx, "V4UiV8s", "") -BUILTIN(__builtin_altivec_vupkhsh, "V4iV8s", "") -BUILTIN(__builtin_altivec_vupkhsw, "V2LLiV4i", "") - -BUILTIN(__builtin_altivec_vupklsb, "V8sV16c", "") -BUILTIN(__builtin_altivec_vupklpx, "V4UiV8s", "") -BUILTIN(__builtin_altivec_vupklsh, "V4iV8s", "") -BUILTIN(__builtin_altivec_vupklsw, "V2LLiV4i", "") - -BUILTIN(__builtin_altivec_vcmpbfp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpgefp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpequb_p, "iiV16cV16c", "") -BUILTIN(__builtin_altivec_vcmpequh_p, "iiV8sV8s", "") -BUILTIN(__builtin_altivec_vcmpequw_p, "iiV4iV4i", "") -BUILTIN(__builtin_altivec_vcmpequd_p, "iiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vcmpeqfp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_altivec_vcmpgtsb_p, "iiV16ScV16Sc", "") -BUILTIN(__builtin_altivec_vcmpgtub_p, "iiV16UcV16Uc", "") -BUILTIN(__builtin_altivec_vcmpgtsh_p, "iiV8SsV8Ss", "") -BUILTIN(__builtin_altivec_vcmpgtuh_p, "iiV8UsV8Us", "") -BUILTIN(__builtin_altivec_vcmpgtsw_p, "iiV4SiV4Si", "") -BUILTIN(__builtin_altivec_vcmpgtuw_p, "iiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_vcmpgtsd_p, "iiV2LLiV2LLi", "") -BUILTIN(__builtin_altivec_vcmpgtud_p, "iiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_vcmpgtfp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_altivec_vgbbd, "V16UcV16Uc", "") -BUILTIN(__builtin_altivec_vbpermq, "V2ULLiV16UcV16Uc", "") - -// P8 Crypto built-ins. -BUILTIN(__builtin_altivec_crypto_vsbox, "V2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_crypto_vpermxor, "V16UcV16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_crypto_vshasigmaw, "V4UiV4UiIiIi", "") -BUILTIN(__builtin_altivec_crypto_vshasigmad, "V2ULLiV2ULLiIiIi", "") -BUILTIN(__builtin_altivec_crypto_vcipher, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_crypto_vcipherlast, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_crypto_vncipher, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_crypto_vncipherlast, "V2ULLiV2ULLiV2ULLi", "") -BUILTIN(__builtin_altivec_crypto_vpmsumb, "V16UcV16UcV16Uc", "") -BUILTIN(__builtin_altivec_crypto_vpmsumh, "V8UsV8UsV8Us", "") -BUILTIN(__builtin_altivec_crypto_vpmsumw, "V4UiV4UiV4Ui", "") -BUILTIN(__builtin_altivec_crypto_vpmsumd, "V2ULLiV2ULLiV2ULLi", "") - -BUILTIN(__builtin_altivec_vclzb, "V16UcV16Uc", "") -BUILTIN(__builtin_altivec_vclzh, "V8UsV8Us", "") -BUILTIN(__builtin_altivec_vclzw, "V4UiV4Ui", "") -BUILTIN(__builtin_altivec_vclzd, "V2ULLiV2ULLi", "") - -// VSX built-ins. - -BUILTIN(__builtin_vsx_lxvd2x, "V2divC*", "") -BUILTIN(__builtin_vsx_lxvw4x, "V4iivC*", "") - -BUILTIN(__builtin_vsx_stxvd2x, "vV2div*", "") -BUILTIN(__builtin_vsx_stxvw4x, "vV4iiv*", "") - -BUILTIN(__builtin_vsx_xvmaxdp, "V2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvmaxsp, "V4fV4fV4f", "") -BUILTIN(__builtin_vsx_xsmaxdp, "ddd", "") - -BUILTIN(__builtin_vsx_xvmindp, "V2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvminsp, "V4fV4fV4f", "") -BUILTIN(__builtin_vsx_xsmindp, "ddd", "") - -BUILTIN(__builtin_vsx_xvdivdp, "V2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvdivsp, "V4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvrdpip, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrspip, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpeqdp, "V2ULLiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpeqsp, "V4UiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpeqdp_p, "iiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpeqsp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpgedp, "V2ULLiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpgesp, "V4UiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpgedp_p, "iiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpgesp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpgtdp, "V2ULLiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpgtsp, "V4UiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvcmpgtdp_p, "iiV2dV2d", "") -BUILTIN(__builtin_vsx_xvcmpgtsp_p, "iiV4fV4f", "") - -BUILTIN(__builtin_vsx_xvrdpim, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrspim, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvrdpi, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrspi, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvrdpic, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrspic, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvrdpiz, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrspiz, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvmaddadp, "V2dV2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvmaddasp, "V4fV4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvmsubadp, "V2dV2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvmsubasp, "V4fV4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvmuldp, "V2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvmulsp, "V4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvnmaddadp, "V2dV2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvnmaddasp, "V4fV4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvnmsubadp, "V2dV2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvnmsubasp, "V4fV4fV4fV4f", "") - -BUILTIN(__builtin_vsx_xvredp, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvresp, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvrsqrtedp, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvrsqrtesp, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xvsqrtdp, "V2dV2d", "") -BUILTIN(__builtin_vsx_xvsqrtsp, "V4fV4f", "") - -BUILTIN(__builtin_vsx_xxleqv, "V4UiV4UiV4Ui", "") - -BUILTIN(__builtin_vsx_xvcpsgndp, "V2dV2dV2d", "") -BUILTIN(__builtin_vsx_xvcpsgnsp, "V4fV4fV4f", "") - -// HTM builtins -BUILTIN(__builtin_tbegin, "UiUIi", "") -BUILTIN(__builtin_tend, "UiUIi", "") - -BUILTIN(__builtin_tabort, "UiUi", "") -BUILTIN(__builtin_tabortdc, "UiUiUiUi", "") -BUILTIN(__builtin_tabortdci, "UiUiUii", "") -BUILTIN(__builtin_tabortwc, "UiUiUiUi", "") -BUILTIN(__builtin_tabortwci, "UiUiUii", "") - -BUILTIN(__builtin_tcheck, "Ui", "") -BUILTIN(__builtin_treclaim, "UiUi", "") -BUILTIN(__builtin_trechkpt, "Ui", "") -BUILTIN(__builtin_tsr, "UiUi", "") - -BUILTIN(__builtin_tendall, "Ui", "") -BUILTIN(__builtin_tresume, "Ui", "") -BUILTIN(__builtin_tsuspend, "Ui", "") - -BUILTIN(__builtin_get_texasr, "LUi", "c") -BUILTIN(__builtin_get_texasru, "LUi", "c") -BUILTIN(__builtin_get_tfhar, "LUi", "c") -BUILTIN(__builtin_get_tfiar, "LUi", "c") - -BUILTIN(__builtin_set_texasr, "vLUi", "c") -BUILTIN(__builtin_set_texasru, "vLUi", "c") -BUILTIN(__builtin_set_tfhar, "vLUi", "c") -BUILTIN(__builtin_set_tfiar, "vLUi", "c") - -BUILTIN(__builtin_ttest, "LUi", "") - -// Scalar built-ins -BUILTIN(__builtin_divwe, "SiSiSi", "") -BUILTIN(__builtin_divweu, "UiUiUi", "") -BUILTIN(__builtin_divde, "SLLiSLLiSLLi", "") -BUILTIN(__builtin_divdeu, "ULLiULLiULLi", "") -BUILTIN(__builtin_bpermd, "SLLiSLLiSLLi", "") - -// FIXME: Obviously incomplete. - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsSystemZ.def b/include/clang/Basic/BuiltinsSystemZ.def deleted file mode 100644 index 68d5a1c..0000000 --- a/include/clang/Basic/BuiltinsSystemZ.def +++ /dev/null @@ -1,252 +0,0 @@ -//===-- BuiltinsSystemZ.def - SystemZ Builtin function database -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the SystemZ-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// Transactional-memory intrinsics -BUILTIN(__builtin_tbegin, "iv*", "j") -BUILTIN(__builtin_tbegin_nofloat, "iv*", "j") -BUILTIN(__builtin_tbeginc, "v", "nj") -BUILTIN(__builtin_tabort, "vi", "r") -BUILTIN(__builtin_tend, "i", "n") -BUILTIN(__builtin_tx_nesting_depth, "i", "nc") -BUILTIN(__builtin_tx_assist, "vi", "n") -BUILTIN(__builtin_non_tx_store, "vULi*ULi", "") - -// Vector intrinsics. -// These all map directly to z instructions, except that some variants ending -// in "s" have a final "int *" that receives the post-instruction CC value. - -// Vector support instructions (chapter 21 of the PoP) -BUILTIN(__builtin_s390_lcbb, "UivC*Ii", "nc") -BUILTIN(__builtin_s390_vlbb, "V16ScvC*Ii", "") -BUILTIN(__builtin_s390_vll, "V16ScUivC*", "") -BUILTIN(__builtin_s390_vstl, "vV16ScUiv*", "") -BUILTIN(__builtin_s390_vperm, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vpdi, "V2ULLiV2ULLiV2ULLiIi", "nc") -BUILTIN(__builtin_s390_vpksh, "V16ScV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vpkshs, "V16ScV8SsV8Ssi*", "nc") -BUILTIN(__builtin_s390_vpksf, "V8SsV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vpksfs, "V8SsV4SiV4Sii*", "nc") -BUILTIN(__builtin_s390_vpksg, "V4SiV2SLLiV2SLLi", "nc") -BUILTIN(__builtin_s390_vpksgs, "V4SiV2SLLiV2SLLii*", "nc") -BUILTIN(__builtin_s390_vpklsh, "V16UcV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vpklshs, "V16UcV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vpklsf, "V8UsV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vpklsfs, "V8UsV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vpklsg, "V4UiV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vpklsgs, "V4UiV2ULLiV2ULLii*", "nc") -BUILTIN(__builtin_s390_vuphb, "V8SsV16Sc", "nc") -BUILTIN(__builtin_s390_vuphh, "V4SiV8Ss", "nc") -BUILTIN(__builtin_s390_vuphf, "V2SLLiV4Si", "nc") -BUILTIN(__builtin_s390_vuplb, "V8SsV16Sc", "nc") -BUILTIN(__builtin_s390_vuplhw, "V4SiV8Ss", "nc") -BUILTIN(__builtin_s390_vuplf, "V2SLLiV4Si", "nc") -BUILTIN(__builtin_s390_vuplhb, "V8UsV16Uc", "nc") -BUILTIN(__builtin_s390_vuplhh, "V4UiV8Us", "nc") -BUILTIN(__builtin_s390_vuplhf, "V2ULLiV4Ui", "nc") -BUILTIN(__builtin_s390_vupllb, "V8UsV16Uc", "nc") -BUILTIN(__builtin_s390_vupllh, "V4UiV8Us", "nc") -BUILTIN(__builtin_s390_vupllf, "V2ULLiV4Ui", "nc") - -// Vector integer instructions (chapter 22 of the PoP) -BUILTIN(__builtin_s390_vaq, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vacq, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vaccb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vacch, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vaccf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vaccg, "V2ULLiV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vaccq, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vacccq, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vavgb, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_s390_vavgh, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vavgf, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vavgg, "V2SLLiV2SLLiV2SLLi", "nc") -BUILTIN(__builtin_s390_vavglb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vavglh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vavglf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vavglg, "V2ULLiV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vceqbs, "V16ScV16ScV16Sci*", "nc") -BUILTIN(__builtin_s390_vceqhs, "V8SsV8SsV8Ssi*", "nc") -BUILTIN(__builtin_s390_vceqfs, "V4SiV4SiV4Sii*", "nc") -BUILTIN(__builtin_s390_vceqgs, "V2SLLiV2SLLiV2SLLii*", "nc") -BUILTIN(__builtin_s390_vchbs, "V16ScV16ScV16Sci*", "nc") -BUILTIN(__builtin_s390_vchhs, "V8SsV8SsV8Ssi*", "nc") -BUILTIN(__builtin_s390_vchfs, "V4SiV4SiV4Sii*", "nc") -BUILTIN(__builtin_s390_vchgs, "V2SLLiV2SLLiV2SLLii*", "nc") -BUILTIN(__builtin_s390_vchlbs, "V16ScV16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vchlhs, "V8SsV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vchlfs, "V4SiV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vchlgs, "V2SLLiV2ULLiV2ULLii*", "nc") -BUILTIN(__builtin_s390_vcksm, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vclzb, "V16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vclzh, "V8UsV8Us", "nc") -BUILTIN(__builtin_s390_vclzf, "V4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vclzg, "V2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vctzb, "V16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vctzh, "V8UsV8Us", "nc") -BUILTIN(__builtin_s390_vctzf, "V4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vctzg, "V2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_verimb, "V16UcV16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_verimh, "V8UsV8UsV8UsV8UsIi", "nc") -BUILTIN(__builtin_s390_verimf, "V4UiV4UiV4UiV4UiIi", "nc") -BUILTIN(__builtin_s390_verimg, "V2ULLiV2ULLiV2ULLiV2ULLiIi", "nc") -BUILTIN(__builtin_s390_verllb, "V16UcV16UcUi", "nc") -BUILTIN(__builtin_s390_verllh, "V8UsV8UsUi", "nc") -BUILTIN(__builtin_s390_verllf, "V4UiV4UiUi", "nc") -BUILTIN(__builtin_s390_verllg, "V2ULLiV2ULLiUi", "nc") -BUILTIN(__builtin_s390_verllvb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_verllvh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_verllvf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_verllvg, "V2ULLiV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vgfmb, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vgfmh, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vgfmf, "V2ULLiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vgfmg, "V16UcV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vgfmab, "V8UsV16UcV16UcV8Us", "nc") -BUILTIN(__builtin_s390_vgfmah, "V4UiV8UsV8UsV4Ui", "nc") -BUILTIN(__builtin_s390_vgfmaf, "V2ULLiV4UiV4UiV2ULLi", "nc") -BUILTIN(__builtin_s390_vgfmag, "V16UcV2ULLiV2ULLiV16Uc", "nc") -BUILTIN(__builtin_s390_vmahb, "V16ScV16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_s390_vmahh, "V8SsV8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vmahf, "V4SiV4SiV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vmalhb, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vmalhh, "V8UsV8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vmalhf, "V4UiV4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vmaeb, "V8SsV16ScV16ScV8Ss", "nc") -BUILTIN(__builtin_s390_vmaeh, "V4SiV8SsV8SsV4Si", "nc") -BUILTIN(__builtin_s390_vmaef, "V2SLLiV4SiV4SiV2SLLi", "nc") -BUILTIN(__builtin_s390_vmaleb, "V8UsV16UcV16UcV8Us", "nc") -BUILTIN(__builtin_s390_vmaleh, "V4UiV8UsV8UsV4Ui", "nc") -BUILTIN(__builtin_s390_vmalef, "V2ULLiV4UiV4UiV2ULLi", "nc") -BUILTIN(__builtin_s390_vmaob, "V8SsV16ScV16ScV8Ss", "nc") -BUILTIN(__builtin_s390_vmaoh, "V4SiV8SsV8SsV4Si", "nc") -BUILTIN(__builtin_s390_vmaof, "V2SLLiV4SiV4SiV2SLLi", "nc") -BUILTIN(__builtin_s390_vmalob, "V8UsV16UcV16UcV8Us", "nc") -BUILTIN(__builtin_s390_vmaloh, "V4UiV8UsV8UsV4Ui", "nc") -BUILTIN(__builtin_s390_vmalof, "V2ULLiV4UiV4UiV2ULLi", "nc") -BUILTIN(__builtin_s390_vmhb, "V16ScV16ScV16Sc", "nc") -BUILTIN(__builtin_s390_vmhh, "V8SsV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vmhf, "V4SiV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vmlhb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vmlhh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vmlhf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vmeb, "V8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_s390_vmeh, "V4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vmef, "V2SLLiV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vmleb, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vmleh, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vmlef, "V2ULLiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vmob, "V8SsV16ScV16Sc", "nc") -BUILTIN(__builtin_s390_vmoh, "V4SiV8SsV8Ss", "nc") -BUILTIN(__builtin_s390_vmof, "V2SLLiV4SiV4Si", "nc") -BUILTIN(__builtin_s390_vmlob, "V8UsV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vmloh, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vmlof, "V2ULLiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vpopctb, "V16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vpopcth, "V8UsV8Us", "nc") -BUILTIN(__builtin_s390_vpopctf, "V4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vpopctg, "V2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vsq, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsbcbiq, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsbiq, "V16UcV16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vscbib, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vscbih, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vscbif, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vscbig, "V2ULLiV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vscbiq, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsl, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vslb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsldb, "V16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_vsra, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsrab, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsrl, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsrlb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsumb, "V4UiV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vsumh, "V4UiV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vsumgh, "V2ULLiV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vsumgf, "V2ULLiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vsumqf, "V16UcV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vsumqg, "V16UcV2ULLiV2ULLi", "nc") -BUILTIN(__builtin_s390_vtm, "iV16UcV16Uc", "nc") - -// Vector string instructions (chapter 23 of the PoP) -BUILTIN(__builtin_s390_vfaeb, "V16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_vfaebs, "V16UcV16UcV16UcIii*", "nc") -BUILTIN(__builtin_s390_vfaeh, "V8UsV8UsV8UsIi", "nc") -BUILTIN(__builtin_s390_vfaehs, "V8UsV8UsV8UsIii*", "nc") -BUILTIN(__builtin_s390_vfaef, "V4UiV4UiV4UiIi", "nc") -BUILTIN(__builtin_s390_vfaefs, "V4UiV4UiV4UiIii*", "nc") -BUILTIN(__builtin_s390_vfaezb, "V16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_vfaezbs, "V16UcV16UcV16UcIii*", "nc") -BUILTIN(__builtin_s390_vfaezh, "V8UsV8UsV8UsIi", "nc") -BUILTIN(__builtin_s390_vfaezhs, "V8UsV8UsV8UsIii*", "nc") -BUILTIN(__builtin_s390_vfaezf, "V4UiV4UiV4UiIi", "nc") -BUILTIN(__builtin_s390_vfaezfs, "V4UiV4UiV4UiIii*", "nc") -BUILTIN(__builtin_s390_vfeeb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vfeebs, "V16UcV16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vfeeh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vfeehs, "V8UsV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vfeef, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vfeefs, "V4UiV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vfeezb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vfeezbs, "V16UcV16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vfeezh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vfeezhs, "V8UsV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vfeezf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vfeezfs, "V4UiV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vfeneb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vfenebs, "V16UcV16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vfeneh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vfenehs, "V8UsV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vfenef, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vfenefs, "V4UiV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vfenezb, "V16UcV16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vfenezbs, "V16UcV16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vfenezh, "V8UsV8UsV8Us", "nc") -BUILTIN(__builtin_s390_vfenezhs, "V8UsV8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vfenezf, "V4UiV4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vfenezfs, "V4UiV4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vistrb, "V16UcV16Uc", "nc") -BUILTIN(__builtin_s390_vistrbs, "V16UcV16Uci*", "nc") -BUILTIN(__builtin_s390_vistrh, "V8UsV8Us", "nc") -BUILTIN(__builtin_s390_vistrhs, "V8UsV8Usi*", "nc") -BUILTIN(__builtin_s390_vistrf, "V4UiV4Ui", "nc") -BUILTIN(__builtin_s390_vistrfs, "V4UiV4Uii*", "nc") -BUILTIN(__builtin_s390_vstrcb, "V16UcV16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_vstrcbs, "V16UcV16UcV16UcV16UcIii*", "nc") -BUILTIN(__builtin_s390_vstrch, "V8UsV8UsV8UsV8UsIi", "nc") -BUILTIN(__builtin_s390_vstrchs, "V8UsV8UsV8UsV8UsIii*", "nc") -BUILTIN(__builtin_s390_vstrcf, "V4UiV4UiV4UiV4UiIi", "nc") -BUILTIN(__builtin_s390_vstrcfs, "V4UiV4UiV4UiV4UiIii*", "nc") -BUILTIN(__builtin_s390_vstrczb, "V16UcV16UcV16UcV16UcIi", "nc") -BUILTIN(__builtin_s390_vstrczbs, "V16UcV16UcV16UcV16UcIii*", "nc") -BUILTIN(__builtin_s390_vstrczh, "V8UsV8UsV8UsV8UsIi", "nc") -BUILTIN(__builtin_s390_vstrczhs, "V8UsV8UsV8UsV8UsIii*", "nc") -BUILTIN(__builtin_s390_vstrczf, "V4UiV4UiV4UiV4UiIi", "nc") -BUILTIN(__builtin_s390_vstrczfs, "V4UiV4UiV4UiV4UiIii*", "nc") - -// Vector floating-point instructions (chapter 24 of the PoP) -BUILTIN(__builtin_s390_vfcedbs, "V2SLLiV2dV2di*", "nc") -BUILTIN(__builtin_s390_vfchdbs, "V2SLLiV2dV2di*", "nc") -BUILTIN(__builtin_s390_vfchedbs, "V2SLLiV2dV2di*", "nc") -BUILTIN(__builtin_s390_vfidb, "V2dV2dIiIi", "nc") -BUILTIN(__builtin_s390_vflndb, "V2dV2d", "nc") -BUILTIN(__builtin_s390_vflpdb, "V2dV2d", "nc") -BUILTIN(__builtin_s390_vfmadb, "V2dV2dV2dV2d", "nc") -BUILTIN(__builtin_s390_vfmsdb, "V2dV2dV2dV2d", "nc") -BUILTIN(__builtin_s390_vfsqdb, "V2dV2d", "nc") -BUILTIN(__builtin_s390_vftcidb, "V2SLLiV2dIii*", "nc") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsWebAssembly.def b/include/clang/Basic/BuiltinsWebAssembly.def deleted file mode 100644 index 9754335..0000000 --- a/include/clang/Basic/BuiltinsWebAssembly.def +++ /dev/null @@ -1,24 +0,0 @@ -// BuiltinsWebAssembly.def - WebAssembly builtin function database -*- C++ -*-// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief This file defines the WebAssembly-specific builtin function database. -/// Users of this file must define the BUILTIN macro to make use of this -/// information. -/// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// Note that memory_size is not "c" (readnone) because it must be sequenced with -// respect to grow_memory calls. -BUILTIN(__builtin_wasm_memory_size, "z", "n") -BUILTIN(__builtin_wasm_grow_memory, "vz", "n") - -#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def deleted file mode 100644 index f738cc1..0000000 --- a/include/clang/Basic/BuiltinsX86.def +++ /dev/null @@ -1,1577 +0,0 @@ -//===--- BuiltinsX86.def - X86 Builtin function database --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the X86-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -// FIXME: Ideally we would be able to pull this information from what -// LLVM already knows about X86 builtins. We need to match the LLVM -// definition anyway, since code generation will lower to the -// intrinsic if one exists. - -#if defined(BUILTIN) && !defined(TARGET_BUILTIN) -# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) -#endif - -// FIXME: Are these nothrow/const? - -// Miscellaneous builtin for checking x86 cpu features. -// TODO: Make this somewhat generic so that other backends -// can use it? -BUILTIN(__builtin_cpu_supports, "bcC*", "nc") - -// Win64-compatible va_list functions -BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") -BUILTIN(__builtin_ms_va_end, "vc*&", "n") -BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n") - -// Undefined Values -// -TARGET_BUILTIN(__builtin_ia32_undef128, "V2d", "nc", "") -TARGET_BUILTIN(__builtin_ia32_undef256, "V4d", "nc", "") -TARGET_BUILTIN(__builtin_ia32_undef512, "V8d", "nc", "") - -// FLAGS -// -TARGET_BUILTIN(__builtin_ia32_readeflags_u32, "Ui", "n", "") -TARGET_BUILTIN(__builtin_ia32_readeflags_u64, "ULLi", "n", "") -TARGET_BUILTIN(__builtin_ia32_writeeflags_u32, "vUi", "n", "") -TARGET_BUILTIN(__builtin_ia32_writeeflags_u64, "vULLi", "n", "") - -// 3DNow! -// -TARGET_BUILTIN(__builtin_ia32_femms, "v", "", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pavgusb, "V8cV8cV8c", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pf2id, "V2iV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfacc, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfadd, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpeq, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpge, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpgt, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmax, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmin, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmul, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcp, "V2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcpit1, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcpit2, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrsqrt, "V2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrsqit1, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfsub, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfsubr, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pi2fd, "V2fV2i", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pmulhrw, "V4sV4sV4s", "nc", "3dnow") -// 3DNow! Extensions (3dnowa). -TARGET_BUILTIN(__builtin_ia32_pf2iw, "V2iV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pfnacc, "V2fV2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pfpnacc, "V2fV2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pi2fw, "V2fV2i", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pswapdsf, "V2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pswapdsi, "V2iV2i", "nc", "3dnowa") - -// MMX -// -// All MMX instructions will be generated via builtins. Any MMX vector -// types (<1 x i64>, <2 x i32>, etc.) that aren't used by these builtins will be -// expanded by the back-end. -// FIXME: _mm_prefetch must be a built-in because it takes a compile-time constant -// argument and our prior approach of using a #define to the current built-in -// doesn't work in the presence of re-declaration of _mm_prefetch for windows. -TARGET_BUILTIN(_mm_prefetch, "vcC*i", "nc", "mmx") -TARGET_BUILTIN(__builtin_ia32_emms, "v", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddsb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddsw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddusb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddusw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubsb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubsw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubusb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubusw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmulhw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmullw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmaddwd, "V2iV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pand, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pandn, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_por, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pxor, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pslld, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllq, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrld, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlq, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psraw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrad, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllwi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pslldi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllqi, "V1LLiV1LLii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlwi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrldi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlqi, "V1LLiV1LLii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrawi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psradi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packsswb, "V8cV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packssdw, "V4sV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packuswb, "V8cV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhbw, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhwd, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhdq, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpcklbw, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpcklwd, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckldq, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_maskmovq, "vV8cV8cc*", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_movntq, "vV1LLi*V1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v2si, "V2iii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v4hi, "V4sssss", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v8qi, "V8ccccccccc", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_ext_v2si, "iV2ii", "", "mmx") - -// MMX2 (MMX+SSE) intrinsics -TARGET_BUILTIN(__builtin_ia32_cvtpi2ps, "V4fV4fV2i", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvtps2pi, "V2iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvttps2pi, "V2iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pavgb, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pavgw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmaxsw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmaxub, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pminsw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pminub, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmovmskb, "iV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmulhuw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_psadbw, "V4sV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pshufw, "V4sV4sIc", "", "sse") - -// MMX+SSE2 -TARGET_BUILTIN(__builtin_ia32_cvtpd2pi, "V2iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpi2pd, "V2dV2i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttpd2pi, "V2iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddq, "V1LLiV1LLiV1LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmuludq, "V1LLiV2iV2i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubq, "V1LLiV1LLiV1LLi", "", "sse2") - -// MMX+SSSE3 -TARGET_BUILTIN(__builtin_ia32_pabsb, "V8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsd, "V2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsw, "V4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_palignr, "V8cV8cV8cIc", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddd, "V2iV2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubd, "V2iV2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pshufb, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignb, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignd, "V2iV2iV2i", "", "ssse3") - -// SSE intrinsics. -TARGET_BUILTIN(__builtin_ia32_comieq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comilt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comile, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comigt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comige, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comineq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomieq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomilt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomile, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomigt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomige, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomineq, "iV4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_comisdeq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdlt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdle, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdgt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdge, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdneq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdeq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdlt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdle, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdgt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdge, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdneq, "iV2dV2d", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_cmpps, "V4fV4fV4fIc", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpeqps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpltps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpleps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpunordps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpneqps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnltps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnleps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpordps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpss, "V4fV4fV4fIc", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpeqss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpltss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpless, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpunordss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpneqss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnltss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnless, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpordss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_minps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_maxps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_minss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_maxss, "V4fV4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dIc", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpeqpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpltpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmplepd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpunordpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpneqpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnltpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnlepd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpordpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dIc", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpeqsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpltsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmplesd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpunordsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpneqsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnltsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnlesd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpordsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_maxpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_minsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_maxsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmulhw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pavgb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pavgw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaxub128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaxsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pminub128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pminsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packsswb128, "V16cV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packssdw128, "V8sV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packuswb128, "V16cV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmulhuw128, "V8sV8sV8s", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_addsubps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_addsubpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_haddps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_haddpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_hsubps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_hsubpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_phaddw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw128, "V8sV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pshufb128, "V16cV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignb128, "V16cV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsb128, "V16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsw128, "V8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsd128, "V4iV4i", "", "ssse3") - -TARGET_BUILTIN(__builtin_ia32_ldmxcsr, "vUi", "", "sse") -TARGET_BUILTIN(__builtin_ia32_stmxcsr, "Ui", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvtss2si, "iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvtss2si64, "LLiV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_storeups, "vf*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_storehps, "vV2i*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_storelps, "vV2i*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_movmskps, "iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_movntps, "vf*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sfence, "v", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rcpps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rcpss, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rsqrtps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rsqrtss, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sqrtps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sqrtss, "V4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_maskmovdqu, "vV16cV16cc*", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_storeupd, "vd*V2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movmskpd, "iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmovmskb128, "iV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movnti, "vi*i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movnti64, "vLLi*LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movntpd, "vd*V2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movntdq, "vV2LLi*V2LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psadbw128, "V2LLiV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_sqrtpd, "V2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_sqrtsd, "V2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtdq2pd, "V2dV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps, "V4fV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq, "V2LLiV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps, "V4fV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq, "V4iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtsd2si, "iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "LLiV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq, "V4iV4f", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd, "V2dV4f", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq, "V4iV4f", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_clflush, "vvC*", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_lfence, "v", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_mfence, "v", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pause, "v", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_storedqu, "vc*V16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmuludq128, "V2LLiV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psraw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrad128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrld128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlq128, "V2LLiV2LLiV2LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pslld128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllq128, "V2LLiV2LLiV2LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllwi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pslldi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllqi128, "V2LLiV2LLii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlwi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrldi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlqi128, "V2LLiV2LLii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrawi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psradi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaddwd128, "V4iV8sV8s", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_monitor, "vv*UiUi", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_mwait, "vUiUi", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_lddqu, "V16ccC*", "", "sse3") - -TARGET_BUILTIN(__builtin_ia32_palignr128, "V16cV16cV16cIc", "", "ssse3") - -TARGET_BUILTIN(__builtin_ia32_insertps128, "V4fV4fV4fIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pblendvb128, "V16cV16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_blendvpd, "V2dV2dV2dV2d", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_blendvps, "V4fV4fV4fV4f", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_packusdw128, "V8sV4iV4i", "", "sse4.1") - -TARGET_BUILTIN(__builtin_ia32_pmaxsb128, "V16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxsd128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxud128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminsb128, "V16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd128, "V4iV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq128, "V2LLiV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw128, "V8sV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq128, "V2LLiV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd128, "V4iV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq128, "V2LLiV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmulld128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundss, "V4fV4fV4fIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundsd, "V2dV2dV2dIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundpd, "V2dV2dIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_dpps, "V4fV4fV4fIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_dppd, "V2dV2dV2dIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_movntdqa, "V2LLiV2LLiC*", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestz128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestc128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestnzc128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_mpsadbw128, "V16cV16cV16cIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_phminposuw128, "V8sV8s", "", "sse4.1") - -// SSE 4.2 -TARGET_BUILTIN(__builtin_ia32_pcmpistrm128, "V16cV16cV16cIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistri128, "iV16cV16cIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestrm128, "V16cV16ciV16ciIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestri128, "iV16ciV16ciIc","", "sse4.2") - -TARGET_BUILTIN(__builtin_ia32_pcmpistria128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistric128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistrio128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistris128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistriz128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestria128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestric128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","", "sse4.2") - -TARGET_BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "", "sse4.2") - -// SSE4a -TARGET_BUILTIN(__builtin_ia32_extrqi, "V2LLiV2LLiIcIc", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_extrq, "V2LLiV2LLiV16c", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_insertqi, "V2LLiV2LLiV2LLiIcIc", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_insertq, "V2LLiV2LLiV2LLi", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_movntsd, "vd*V2d", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_movntss, "vf*V4f", "", "sse4a") - -// AES -TARGET_BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesenclast128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesdec128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesdeclast128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesimc128, "V2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aeskeygenassist128, "V2LLiV2LLiIc", "", "aes") - -// CLMUL -TARGET_BUILTIN(__builtin_ia32_pclmulqdq128, "V2LLiV2LLiV2LLiIc", "", "pclmul") - -// AVX -TARGET_BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_addsubps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_haddpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_hsubps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_hsubpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_haddps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maxpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maxps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_minpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_minps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd, "V2dV2dV2LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps, "V4fV4fV4i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd256, "V4dV4dV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps256, "V8fV8fV8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_blendvpd256, "V4dV4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtdq2pd256, "V4dV4i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps256, "V8fV8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256, "V4fV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq256, "V8iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd256, "V4dV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256, "V4iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256, "V4iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_sqrtpd256, "V4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_sqrtps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_rsqrtps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_rcpps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_roundpd256, "V4dV4dIi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_roundps256, "V8fV8fIi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestz256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestc256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestnzc256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movmskpd256, "iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movmskps256, "iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vzeroall, "v", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vzeroupper, "v", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vbroadcastf128_pd256, "V4dV2dC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vbroadcastf128_ps256, "V8fV4fC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_storeupd256, "vd*V4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_storeups256, "vf*V8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_storedqu256, "vc*V32c", "", "avx") -TARGET_BUILTIN(__builtin_ia32_lddqu256, "V32ccC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movntdq256, "vV4LLi*V4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movntpd256, "vd*V4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movntps256, "vf*V8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadpd, "V2dV2dC*V2LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadps, "V4fV4fC*V4i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadpd256, "V4dV4dC*V4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadps256, "V8fV8fC*V8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstorepd, "vV2d*V2LLiV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstoreps, "vV4f*V4iV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstorepd256, "vV4d*V4LLiV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstoreps256, "vV8f*V8iV8f", "", "avx") - -// AVX2 -TARGET_BUILTIN(__builtin_ia32_mpsadbw256, "V32cV32cV32cIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsb256, "V32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsw256, "V16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsd256, "V8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packsswb256, "V32cV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packssdw256, "V16sV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packuswb256, "V32cV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packusdw256, "V16sV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_palignr256, "V32cV32cV32cIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pavgb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pavgw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pblendvb256, "V32cV32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw256, "V16sV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaddwd256, "V8iV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxub256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxud256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminub256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminud256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovsxdq256, "V4LLiV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbw256, "V16sV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbd256, "V8iV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxbq256, "V4LLiV16c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwd256, "V8iV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxwq256, "V4LLiV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovzxdq256, "V4LLiV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmuludq256, "V4LLiV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psadbw256, "V4LLiV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pshufb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pslldqi256, "V4LLiV4LLiIi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllwi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pslldi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pslld256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllqi256, "V4LLiV4LLii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllq256, "V4LLiV4LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrawi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psraw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psradi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrad256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrldqi256, "V4LLiV4LLiIi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlwi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrldi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrld256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlqi256, "V4LLiV4LLii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlq256, "V4LLiV4LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_movntdqa256, "V4LLiV4LLiC*", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permvarsi256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permti256, "V4LLiV4LLiV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadd256, "V8iV8iC*V8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadq256, "V4LLiV4LLiC*V4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadd, "V4iV4iC*V4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadq, "V2LLiV2LLiC*V2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstored256, "vV8i*V8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstoreq256, "vV4LLi*V4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstored, "vV4i*V4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstoreq, "vV2LLi*V2LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv4di, "V4LLiV4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv2di, "V2LLiV2LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrav8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrav4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv4di, "V4LLiV4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv2di, "V2LLiV2LLiV2LLi", "", "avx2") - -// GATHER -TARGET_BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2ddC*V4iV2dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4ddC*V4iV4dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2ddC*V2LLiV2dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4ddC*V4LLiV4dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4ffC*V4iV4fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8ffC*V8iV8fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4ffC*V2LLiV4fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4ffC*V4LLiV4fIc", "", "avx2") - -TARGET_BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiLLiC*V4iV2LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiLLiC*V4iV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiLLiC*V2LLiV2LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiLLiC*V4LLiV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iiC*V4iV4iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iiC*V8iV8iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iiC*V2LLiV4iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iiC*V4LLiV4iIc", "", "avx2") - -// F16C -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph, "V8sV4fIi", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256, "V8sV8fIi", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512, "V16sV16fIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps, "V4fV8s", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256, "V8fV8s", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512, "V16fV16s", "", "avx512f") - -// RDRAND -TARGET_BUILTIN(__builtin_ia32_rdrand16_step, "UiUs*", "", "rdrnd") -TARGET_BUILTIN(__builtin_ia32_rdrand32_step, "UiUi*", "", "rdrnd") -TARGET_BUILTIN(__builtin_ia32_rdrand64_step, "UiULLi*", "", "rdrnd") - -// FSGSBASE -TARGET_BUILTIN(__builtin_ia32_rdfsbase32, "Ui", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_rdfsbase64, "ULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_rdgsbase32, "Ui", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_rdgsbase64, "ULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrfsbase32, "vUi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrfsbase64, "vULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrgsbase32, "vUi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrgsbase64, "vULLi", "", "fsgsbase") - -// FXSR -TARGET_BUILTIN(__builtin_ia32_fxrstor, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_fxrstor64, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_fxsave, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_fxsave64, "vv*", "", "fxsr") - -// XSAVE -TARGET_BUILTIN(__builtin_ia32_xsave, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xsave64, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xrstor, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xrstor64, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xsaveopt, "vv*ULLi", "", "xsaveopt") -TARGET_BUILTIN(__builtin_ia32_xsaveopt64, "vv*ULLi", "", "xsaveopt") -TARGET_BUILTIN(__builtin_ia32_xrstors, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_xrstors64, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_xsavec, "vv*ULLi", "", "xsavec") -TARGET_BUILTIN(__builtin_ia32_xsavec64, "vv*ULLi", "", "xsavec") -TARGET_BUILTIN(__builtin_ia32_xsaves, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_xsaves64, "vv*ULLi", "", "xsaves") - -// ADX -TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "adx") - -// RDSEED -TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed") -TARGET_BUILTIN(__builtin_ia32_rdseed32_step, "UiUi*", "", "rdseed") -TARGET_BUILTIN(__builtin_ia32_rdseed64_step, "UiULLi*", "", "rdseed") - -// BMI -TARGET_BUILTIN(__builtin_ia32_bextr_u32, "UiUiUi", "", "bmi") -TARGET_BUILTIN(__builtin_ia32_bextr_u64, "ULLiULLiULLi", "", "bmi") - -// BMI2 -TARGET_BUILTIN(__builtin_ia32_bzhi_si, "UiUiUi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_bzhi_di, "ULLiULLiULLi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pdep_si, "UiUiUi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pdep_di, "ULLiULLiULLi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pext_si, "UiUiUi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pext_di, "ULLiULLiULLi", "", "bmi2") - -// TBM -TARGET_BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "", "tbm") -TARGET_BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "", "tbm") - -// SHA -TARGET_BUILTIN(__builtin_ia32_sha1rnds4, "V4iV4iV4iIc", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1nexte, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1msg1, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1msg2, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256rnds2, "V4iV4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256msg1, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256msg2, "V4iV4iV4i", "", "sha") - -// FMA -TARGET_BUILTIN(__builtin_ia32_vfmaddps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddss, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubss, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubsd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddss, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddsd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubss, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubsd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd256, "V4dV4dV4dV4d", "", "fma|fma4") - -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_maskz, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_maskz, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_maskz, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_maskz, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_maskz, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_maskz, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_maskz, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_maskz, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmaddps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") - -// XOP -TARGET_BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsww, "V8sV8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdd, "V4iV4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdd, "V4iV4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdql, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdql, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdqh, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdqh, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmadcsswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmadcswd, "V4iV8sV8sV4i", "", "xop") - -TARGET_BUILTIN(__builtin_ia32_vphaddbw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddbd, "V4iV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddbq, "V2LLiV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddwq, "V2LLiV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadddq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubd, "V4iV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubq, "V2LLiV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadduwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadduwq, "V2LLiV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddudq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubbw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubdq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcmov, "V2LLiV2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcmov_256, "V4LLiV4LLiV4LLiV4LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpperm, "V16cV16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotb, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotd, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotbi, "V16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotwi, "V8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotdi, "V4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotqi, "V2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlb, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshld, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshab, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshaw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshad, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshaq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomub, "V16cV16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomuw, "V8sV8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomud, "V4iV4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomuq, "V2LLiV2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomb, "V16cV16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomw, "V8sV8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomd, "V4iV4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomq, "V2LLiV2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2pd, "V2dV2dV2dV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2pd256, "V4dV4dV4dV4LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2ps, "V4fV4fV4fV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2ps256, "V8fV8fV8fV8iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczss, "V4fV4f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczsd, "V2dV2d", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczps, "V4fV4f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczpd, "V2dV2d", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczps256, "V8fV8f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczpd256, "V4dV4d", "", "xop") - -TARGET_BUILTIN(__builtin_ia32_xbegin, "i", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xend, "v", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xabort, "vIc", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xtest, "i", "", "rtm") - -BUILTIN(__builtin_ia32_rdpmc, "ULLii", "") -BUILTIN(__builtin_ia32_rdtsc, "ULLi", "") -BUILTIN(__builtin_ia32_rdtscp, "ULLiUi*", "") -// PKU -TARGET_BUILTIN(__builtin_ia32_rdpkru, "Ui", "", "pku") -TARGET_BUILTIN(__builtin_ia32_wrpkru, "vUi", "", "pku") - -// AVX-512 -TARGET_BUILTIN(__builtin_ia32_sqrtpd512_mask, "V8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_sqrtps512_mask, "V16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14sd, "V2dV2dV2dV2dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ss, "V4fV4fV4fV4fUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14pd512_mask, "V8dV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ps512_mask, "V16fV16fV16fUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_rsqrt28sd_round, "V2dV2dV2dV2dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28ss_round, "V4fV4fV4fV4fUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28ps_mask, "V16fV16fV16fUsIi", "", "avx512er") - -TARGET_BUILTIN(__builtin_ia32_rcp14sd, "V2dV2dV2dV2dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14ss, "V4fV4fV4fV4fUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14pd512_mask, "V8dV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14ps512_mask, "V16fV16fV16fUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_rcp28sd_round, "V2dV2dV2dV2dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28ss_round, "V4fV4fV4fV4fUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "", "avx512er") - -TARGET_BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fIiUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_cmpps256_mask, "UcV8fV8fIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpps128_mask, "UcV4fV4fIiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_pcmpeqb512_mask, "LLiV64cV64cLLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqd512_mask, "sV16iV16is", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pcmpeqq512_mask, "cV8LLiV8LLic", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pcmpeqw512_mask, "iV32sV32si", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pcmpeqb256_mask, "iV32cV32ci", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqd256_mask, "cV8iV8ic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqq256_mask, "cV4LLiV4LLic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqw256_mask, "sV16sV16ss", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqb128_mask, "sV16cV16cs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqd128_mask, "cV4iV4ic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqq128_mask, "cV2LLiV2LLic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpeqw128_mask, "cV8sV8sc", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pcmpgtb512_mask, "LLiV64cV64cLLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtd512_mask, "sV16iV16is", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pcmpgtq512_mask, "cV8LLiV8LLic", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pcmpgtw512_mask, "iV32sV32si", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pcmpgtb256_mask, "iV32cV32ci", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtd256_mask, "cV8iV8ic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtq256_mask, "cV4LLiV4LLic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtw256_mask, "sV16sV16ss", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtb128_mask, "sV16cV16cs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtd128_mask, "cV4iV4ic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtq128_mask, "cV2LLiV2LLic", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pcmpgtw128_mask, "cV8sV8sc", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dIiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmppd256_mask, "UcV4dV4dIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmppd128_mask, "UcV2dV2dIiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fIiV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dIiV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtdq2pd512_mask, "V8dV8iV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtudq2pd512_mask, "V8dV8iV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512_mask, "V16sV16fIiV16sUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512_mask, "V16fV16sV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pandd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pandq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pord512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_porq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pxord512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pxorq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pabsd512_mask, "V16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pabsq512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxsd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxsq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxud512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxuq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminsd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminsq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminud512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminuq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuldq512_mask, "V8LLiV16iV16iV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuludq512_mask, "V8LLiV16iV16iV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_blendmd_512_mask, "V16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_blendmq_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_blendmps_512_mask, "V16fV16fV16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_blendmpd_512_mask, "V8dV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ptestmd512, "UsV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ptestmq512, "UcV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pbroadcastd512_gpr_mask, "V16iiV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_gpr_mask, "V8LLiLLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_mem_mask, "V8LLiLLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16ivC*V16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLivC*V8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16fvC*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadaps512_mask, "V16fvC*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadupd512_mask, "V8dvC*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadapd512_mask, "V8dvC*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqudi512_mask, "vv*V8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqusi512_mask, "vv*V16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeupd512_mask, "vv*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vv*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vv*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vv*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_mask, "V16fV16iV16fV16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_mask, "V8dV8LLiV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_alignq512_mask, "V8LLiV8LLiV8LLiIiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_alignd512_mask, "V16iV16iV16iIiV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_extractf64x4_mask, "V4dV8dIiV4dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_extractf32x4_mask, "V4fV16fIiV4fUc", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8dvC*V8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16fvC*UsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8dvC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8fvC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8LLiV8LLivC*V8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16ivC*UsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8LLiV8LLivC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8ivC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vv*UcV8iV8dIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vv*UsV16iV16fIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vv*UcV8LLiV8dIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vv*UcV8LLiV8fIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vv*UcV8iV8LLiIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vv*UsV16iV16iIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vv*UcV8LLiV8LLiIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vv*UcV8LLiV8iIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8ivC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16ivC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8LLivC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8LLivC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iv*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16iv*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiv*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLiv*IiIi", "", "avx512pf") - -TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_cmpb128_mask, "UsV16cV16cIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd128_mask, "UcV4iV4iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpq128_mask, "UcV2LLiV2LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpw128_mask, "UcV8sV8sIiUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpb256_mask, "UiV32cV32cIiUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd256_mask, "UcV8iV8iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpq256_mask, "UcV4LLiV4LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpw256_mask, "UsV16sV16sIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpb512_mask, "ULLiV64cV64cIiULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd512_mask, "UsV16iV16iIiUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpq512_mask, "UcV8LLiV8LLiIiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpw512_mask, "UiV32sV32sIiUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb128_mask, "UsV16cV16cIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd128_mask, "UcV4iV4iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpq128_mask, "UcV2LLiV2LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpw128_mask, "UcV8sV8sIiUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb256_mask, "UiV32cV32cIiUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd256_mask, "UcV8iV8iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpq256_mask, "UcV4LLiV4LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpw256_mask, "UsV16sV16sIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb512_mask, "ULLiV64cV64cIiULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd512_mask, "UsV16iV16iIiUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8LLiV8LLiIiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_paddd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_paddq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_psubq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmuldq256_mask, "V4LLiV8iV8iV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmuldq128_mask, "V2LLiV4iV4iV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmuludq256_mask, "V4LLiV8iV8iV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmuludq128_mask, "V2LLiV4iV4iV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmulld256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmulld128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandnd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandnd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pord256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pord128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pxord256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pxord128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandnq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pandnq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_porq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_porq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pxorq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pxorq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_paddb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmullw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmullw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmullw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pandnd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pandnq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_paddq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psubq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_paddd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_psubd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_pmulld512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmullq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorpd512_mask, "V8dV8dV8dV8dUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorps512_mask, "V16fV16fV16fV16fUs", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_orpd512_mask, "V8dV8dV8dV8dUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_orps512_mask, "V16fV16fV16fV16fUs", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_andpd512_mask, "V8dV8dV8dV8dUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_andps512_mask, "V16fV16fV16fV16fUs", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnpd512_mask, "V8dV8dV8dV8dUc", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnps512_mask, "V16fV16fV16fV16fUs", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmullq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmullq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andnps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_andps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_xorps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_orpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_orpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_orps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_orps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl,avx512dq") - -TARGET_BUILTIN(__builtin_ia32_blendmb_512_mask, "V64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_blendmw_512_mask, "V32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsb512_mask, "V64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsw512_mask, "V32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packssdw512_mask, "V32sV16iV16iV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packsswb512_mask, "V64cV32sV32sV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packusdw512_mask, "V32sV16iV16iV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packuswb512_mask, "V64cV32sV32sV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxub512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminub512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshufb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_maskz, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512_mask, "V16iV16iV16iUs", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntd_512_mask, "V16iV16iV16iUs", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntq_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512cd") - -TARGET_BUILTIN(__builtin_ia32_blendmb_128_mask, "V16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_blendmb_256_mask, "V32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_blendmw_128_mask, "V8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_blendmw_256_mask, "V16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsb128_mask, "V16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsb256_mask, "V32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsw128_mask, "V8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsw256_mask, "V16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packssdw128_mask, "V8sV4iV4iV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packssdw256_mask, "V16sV8iV8iV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packsswb128_mask, "V16cV8sV8sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packsswb256_mask, "V32cV16sV16sV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packusdw128_mask, "V8sV4iV4iV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packusdw256_mask, "V16sV8iV8iV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packuswb128_mask, "V16cV8sV8sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_packuswb256_mask, "V32cV16sV16sV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pavgw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxub128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxub256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxuw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxuw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminub128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminub256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminuw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminuw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshufb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshufb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusb128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusb256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pmulhrsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_addpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_addps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_pmaddubsw512_mask, "V32sV64cV64cV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddwd512_mask, "V16iV32sV32sV16iUs", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_addss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minss_round, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_addsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minsd_round, "V2dV2dV2dV2dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_addpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_addpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_addps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_addps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmd_128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmd_256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmpd_128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmpd_256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmps_128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmps_256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmq_128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_blendmq_256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdf128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdf256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssf128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssf256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssi128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssi256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredf128_mask, "vV2d*V2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredf256_mask, "vV4d*V4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredi128_mask, "vV2LLi*V2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredi256_mask, "vV4LLi*V4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresf128_mask, "vV4f*V4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresf256_mask, "vV8f*V8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresi128_mask, "vV4i*V4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresi256_mask, "vV8i*V8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2pd128_mask, "V2dV4iV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2pd256_mask, "V4dV4iV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps128_mask, "V4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps256_mask, "V8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps_mask, "V4fV2dV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256_mask, "V4fV4dV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd128_mask, "V2dV4fV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd256_mask, "V4dV4fV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2pd128_mask, "V2dV4iV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2pd256_mask, "V4dV4iV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps128_mask, "V4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps256_mask, "V8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_divpd_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_divpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_divps_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_divps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddf128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddf256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddf128_mask, "V2dV2d*V2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddf256_mask, "V4dV4d*V4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddi128_mask, "V4iV2LLi*V2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddi256_mask, "V4LLiV4LLi*V4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsf128_mask, "V4fV4f*V4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsf256_mask, "V8fV8f*V8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsi128_mask, "V4iV4i*V4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsi256_mask, "V8iV8i*V8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsf128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsf256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsi128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsi256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexppd128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexppd256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexpps128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexpps256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_maxpd_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_maxpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_maxps_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_maxps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_minpd_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_minpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_minps_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_minps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_mulpd_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_mulpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_mulps_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_mulps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsd128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsd256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsq128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsq256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxud128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxud256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxuq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxuq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminud128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminud256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminuq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminuq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_128_mask, "V2dV2dIiV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_256_mask, "V4dV4dIiV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleps_128_mask, "V4fV4fIiV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleps_256_mask, "V8fV8fIiV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_scatterdiv2df, "vv*UcV2LLiV2dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv2di, "vv*UcV2LLiV2LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4df, "vv*UcV4LLiV4dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4di, "vv*UcV4LLiV4LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4sf, "vv*UcV2LLiV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4si, "vv*UcV2LLiV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8sf, "vv*UcV4LLiV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8si, "vv*UcV4LLiV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2df, "vv*UcV4iV2dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2di, "vv*UcV4iV2LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4df, "vv*UcV4iV4dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4di, "vv*UcV4iV4LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4sf, "vv*UcV4iV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4si, "vv*UcV4iV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vv*UcV8iV8fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vv*UcV8iV8iIi", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_sqrtpd128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_sqrtpd256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_sqrtps128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_sqrtps256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_subpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_subpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_subps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_subps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2vard128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2vard256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128_mask, "V2dV2dV2LLiV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256_mask, "V4dV4dV4LLiV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps128_mask, "V4fV4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps256_mask, "V8fV8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_mask, "V2dV2LLiV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_maskz, "V2dV2LLiV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_mask, "V4dV4LLiV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_maskz, "V4dV4LLiV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_mask, "V4fV4iV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_maskz, "V4fV4iV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_mask, "V8fV8iV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_maskz, "V8fV8iV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhbw512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhwd512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklbw512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklwd512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd128_mask, "V2dV2LLiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd256_mask, "V4dV4LLiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps128_mask, "V4fV2LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps256_mask, "V4fV4LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd128_mask, "V2dV2LLiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd256_mask, "V4dV4LLiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps128_mask, "V4fV2LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps256_mask, "V4fV4LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd128_mask, "V2dV2dV2dIiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd256_mask, "V4dV4dV4dIiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps128_mask, "V4fV4fV4fIiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps256_mask, "V8fV8fV8fIiV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd128_mask, "V2dV2dIiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw128_mask, "V8sV16cV16cV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw256_mask, "V16sV32cV32cV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddwd128_mask, "V4iV8sV8sV4iUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddwd256_mask, "V8iV16sV16sV8iUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovswb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovswb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhuw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhuw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhbw128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhbw256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhwd128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpckhwd256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklbw128_mask, "V16cV16cV16cV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklbw256_mask, "V32cV32cV32cV32cUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklwd128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_punpcklwd256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "", "avx512dq") - -#undef BUILTIN -#undef TARGET_BUILTIN diff --git a/include/clang/Basic/BuiltinsXCore.def b/include/clang/Basic/BuiltinsXCore.def deleted file mode 100644 index 672d205..0000000 --- a/include/clang/Basic/BuiltinsXCore.def +++ /dev/null @@ -1,22 +0,0 @@ -//===--- BuiltinsXCore.def - XCore Builtin function database ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the XCore-specific builtin function database. Users of -// this file must define the BUILTIN macro to make use of this information. -// -//===----------------------------------------------------------------------===// - -// The format of this database matches clang/Basic/Builtins.def. - -BUILTIN(__builtin_bitrev, "UiUi", "nc") -BUILTIN(__builtin_getid, "Si", "nc") -BUILTIN(__builtin_getps, "UiUi", "n") -BUILTIN(__builtin_setps, "vUiUi", "n") - -#undef BUILTIN diff --git a/include/clang/Basic/CMakeLists.txt b/include/clang/Basic/CMakeLists.txt deleted file mode 100644 index e4929b5..0000000 --- a/include/clang/Basic/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -macro(clang_diag_gen component) - clang_tablegen(Diagnostic${component}Kinds.inc - -gen-clang-diags-defs -clang-component=${component} - SOURCE Diagnostic.td - TARGET ClangDiagnostic${component}) -endmacro(clang_diag_gen) - -clang_diag_gen(Analysis) -clang_diag_gen(AST) -clang_diag_gen(Comment) -clang_diag_gen(Common) -clang_diag_gen(Driver) -clang_diag_gen(Frontend) -clang_diag_gen(Lex) -clang_diag_gen(Parse) -clang_diag_gen(Sema) -clang_diag_gen(Serialization) -clang_tablegen(DiagnosticGroups.inc -gen-clang-diag-groups - SOURCE Diagnostic.td - TARGET ClangDiagnosticGroups) - -clang_tablegen(DiagnosticIndexName.inc -gen-clang-diags-index-name - SOURCE Diagnostic.td - TARGET ClangDiagnosticIndexName) - -clang_tablegen(AttrList.inc -gen-clang-attr-list - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ - SOURCE Attr.td - TARGET ClangAttrList) - -clang_tablegen(AttrHasAttributeImpl.inc -gen-clang-attr-has-attribute-impl - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ - SOURCE Attr.td - TARGET ClangAttrHasAttributeImpl - ) - -# ARM NEON -clang_tablegen(arm_neon.inc -gen-arm-neon-sema - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ - SOURCE arm_neon.td - TARGET ClangARMNeon) diff --git a/include/clang/Basic/CapturedStmt.h b/include/clang/Basic/CapturedStmt.h deleted file mode 100644 index c4a289b..0000000 --- a/include/clang/Basic/CapturedStmt.h +++ /dev/null @@ -1,24 +0,0 @@ -//===--- CapturedStmt.h - Types for CapturedStmts ---------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -#ifndef LLVM_CLANG_BASIC_CAPTUREDSTMT_H -#define LLVM_CLANG_BASIC_CAPTUREDSTMT_H - -namespace clang { - -/// \brief The different kinds of captured statement. -enum CapturedRegionKind { - CR_Default, - CR_OpenMP -}; - -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_CAPTUREDSTMT_H diff --git a/include/clang/Basic/CharInfo.h b/include/clang/Basic/CharInfo.h deleted file mode 100644 index dd9c554..0000000 --- a/include/clang/Basic/CharInfo.h +++ /dev/null @@ -1,198 +0,0 @@ -//===--- clang/Basic/CharInfo.h - Classifying ASCII Characters ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_CHARINFO_H -#define LLVM_CLANG_BASIC_CHARINFO_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" - -namespace clang { -namespace charinfo { - extern const uint16_t InfoTable[256]; - - enum { - CHAR_HORZ_WS = 0x0001, // '\t', '\f', '\v'. Note, no '\0' - CHAR_VERT_WS = 0x0002, // '\r', '\n' - CHAR_SPACE = 0x0004, // ' ' - CHAR_DIGIT = 0x0008, // 0-9 - CHAR_XLETTER = 0x0010, // a-f,A-F - CHAR_UPPER = 0x0020, // A-Z - CHAR_LOWER = 0x0040, // a-z - CHAR_UNDER = 0x0080, // _ - CHAR_PERIOD = 0x0100, // . - CHAR_RAWDEL = 0x0200, // {}[]#<>%:;?*+-/^&|~!=,"' - CHAR_PUNCT = 0x0400 // `$@() - }; - - enum { - CHAR_XUPPER = CHAR_XLETTER | CHAR_UPPER, - CHAR_XLOWER = CHAR_XLETTER | CHAR_LOWER - }; -} // end namespace charinfo - -/// Returns true if this is an ASCII character. -LLVM_READNONE static inline bool isASCII(char c) { - return static_cast<unsigned char>(c) <= 127; -} - -/// Returns true if this is a valid first character of a C identifier, -/// which is [a-zA-Z_]. -LLVM_READONLY static inline bool isIdentifierHead(unsigned char c, - bool AllowDollar = false) { - using namespace charinfo; - if (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_UNDER)) - return true; - return AllowDollar && c == '$'; -} - -/// Returns true if this is a body character of a C identifier, -/// which is [a-zA-Z0-9_]. -LLVM_READONLY static inline bool isIdentifierBody(unsigned char c, - bool AllowDollar = false) { - using namespace charinfo; - if (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_DIGIT|CHAR_UNDER)) - return true; - return AllowDollar && c == '$'; -} - -/// Returns true if this character is horizontal ASCII whitespace: -/// ' ', '\\t', '\\f', '\\v'. -/// -/// Note that this returns false for '\\0'. -LLVM_READONLY static inline bool isHorizontalWhitespace(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_HORZ_WS|CHAR_SPACE)) != 0; -} - -/// Returns true if this character is vertical ASCII whitespace: '\\n', '\\r'. -/// -/// Note that this returns false for '\\0'. -LLVM_READONLY static inline bool isVerticalWhitespace(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & CHAR_VERT_WS) != 0; -} - -/// Return true if this character is horizontal or vertical ASCII whitespace: -/// ' ', '\\t', '\\f', '\\v', '\\n', '\\r'. -/// -/// Note that this returns false for '\\0'. -LLVM_READONLY static inline bool isWhitespace(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_HORZ_WS|CHAR_VERT_WS|CHAR_SPACE)) != 0; -} - -/// Return true if this character is an ASCII digit: [0-9] -LLVM_READONLY static inline bool isDigit(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & CHAR_DIGIT) != 0; -} - -/// Return true if this character is a lowercase ASCII letter: [a-z] -LLVM_READONLY static inline bool isLowercase(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & CHAR_LOWER) != 0; -} - -/// Return true if this character is an uppercase ASCII letter: [A-Z] -LLVM_READONLY static inline bool isUppercase(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & CHAR_UPPER) != 0; -} - -/// Return true if this character is an ASCII letter: [a-zA-Z] -LLVM_READONLY static inline bool isLetter(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER)) != 0; -} - -/// Return true if this character is an ASCII letter or digit: [a-zA-Z0-9] -LLVM_READONLY static inline bool isAlphanumeric(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_DIGIT|CHAR_UPPER|CHAR_LOWER)) != 0; -} - -/// Return true if this character is an ASCII hex digit: [0-9a-fA-F] -LLVM_READONLY static inline bool isHexDigit(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_DIGIT|CHAR_XLETTER)) != 0; -} - -/// Return true if this character is an ASCII punctuation character. -/// -/// Note that '_' is both a punctuation character and an identifier character! -LLVM_READONLY static inline bool isPunctuation(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_UNDER|CHAR_PERIOD|CHAR_RAWDEL|CHAR_PUNCT)) != 0; -} - -/// Return true if this character is an ASCII printable character; that is, a -/// character that should take exactly one column to print in a fixed-width -/// terminal. -LLVM_READONLY static inline bool isPrintable(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_PERIOD|CHAR_PUNCT| - CHAR_DIGIT|CHAR_UNDER|CHAR_RAWDEL|CHAR_SPACE)) != 0; -} - -/// Return true if this is the body character of a C preprocessing number, -/// which is [a-zA-Z0-9_.]. -LLVM_READONLY static inline bool isPreprocessingNumberBody(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & - (CHAR_UPPER|CHAR_LOWER|CHAR_DIGIT|CHAR_UNDER|CHAR_PERIOD)) != 0; -} - -/// Return true if this is the body character of a C++ raw string delimiter. -LLVM_READONLY static inline bool isRawStringDelimBody(unsigned char c) { - using namespace charinfo; - return (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_PERIOD| - CHAR_DIGIT|CHAR_UNDER|CHAR_RAWDEL)) != 0; -} - - -/// Converts the given ASCII character to its lowercase equivalent. -/// -/// If the character is not an uppercase character, it is returned as is. -LLVM_READONLY static inline char toLowercase(char c) { - if (isUppercase(c)) - return c + 'a' - 'A'; - return c; -} - -/// Converts the given ASCII character to its uppercase equivalent. -/// -/// If the character is not a lowercase character, it is returned as is. -LLVM_READONLY static inline char toUppercase(char c) { - if (isLowercase(c)) - return c + 'A' - 'a'; - return c; -} - - -/// Return true if this is a valid ASCII identifier. -/// -/// Note that this is a very simple check; it does not accept '$' or UCNs as -/// valid identifier characters. -LLVM_READONLY static inline bool isValidIdentifier(StringRef S) { - if (S.empty() || !isIdentifierHead(S[0])) - return false; - - for (StringRef::iterator I = S.begin(), E = S.end(); I != E; ++I) - if (!isIdentifierBody(*I)) - return false; - - return true; -} - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/CommentNodes.td b/include/clang/Basic/CommentNodes.td deleted file mode 100644 index 7bf32b7..0000000 --- a/include/clang/Basic/CommentNodes.td +++ /dev/null @@ -1,27 +0,0 @@ -class Comment<bit abstract = 0> { - bit Abstract = abstract; -} - -class DComment<Comment base, bit abstract = 0> : Comment<abstract> { - Comment Base = base; -} - -def InlineContentComment : Comment<1>; - def TextComment : DComment<InlineContentComment>; - def InlineCommandComment : DComment<InlineContentComment>; - def HTMLTagComment : DComment<InlineContentComment, 1>; - def HTMLStartTagComment : DComment<HTMLTagComment>; - def HTMLEndTagComment : DComment<HTMLTagComment>; - -def BlockContentComment : Comment<1>; - def ParagraphComment : DComment<BlockContentComment>; - def BlockCommandComment : DComment<BlockContentComment>; - def ParamCommandComment : DComment<BlockCommandComment>; - def TParamCommandComment : DComment<BlockCommandComment>; - def VerbatimBlockComment : DComment<BlockCommandComment>; - def VerbatimLineComment : DComment<BlockCommandComment>; - -def VerbatimBlockLineComment : Comment; - -def FullComment : Comment; - diff --git a/include/clang/Basic/CommentOptions.h b/include/clang/Basic/CommentOptions.h deleted file mode 100644 index 92419f9..0000000 --- a/include/clang/Basic/CommentOptions.h +++ /dev/null @@ -1,39 +0,0 @@ -//===--- CommentOptions.h - Options for parsing comments -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::CommentOptions interface. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_COMMENTOPTIONS_H -#define LLVM_CLANG_BASIC_COMMENTOPTIONS_H - -#include <string> -#include <vector> - -namespace clang { - -/// \brief Options for controlling comment parsing. -struct CommentOptions { - typedef std::vector<std::string> BlockCommandNamesTy; - - /// \brief Command names to treat as block commands in comments. - /// Should not include the leading backslash. - BlockCommandNamesTy BlockCommandNames; - - /// \brief Treat ordinary comments as documentation comments. - bool ParseAllComments; - - CommentOptions() : ParseAllComments(false) { } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/DeclNodes.td b/include/clang/Basic/DeclNodes.td deleted file mode 100644 index 723ea54..0000000 --- a/include/clang/Basic/DeclNodes.td +++ /dev/null @@ -1,88 +0,0 @@ -class AttrSubject; - -class Decl<bit abstract = 0> : AttrSubject { - bit Abstract = abstract; -} - -class DDecl<Decl base, bit abstract = 0> : Decl<abstract> { - Decl Base = base; -} - -class DeclContext { } - -def TranslationUnit : Decl, DeclContext; -def ExternCContext : Decl, DeclContext; -def Named : Decl<1>; - def Namespace : DDecl<Named>, DeclContext; - def UsingDirective : DDecl<Named>; - def NamespaceAlias : DDecl<Named>; - def Label : DDecl<Named>; - def Type : DDecl<Named, 1>; - def TypedefName : DDecl<Type, 1>; - def Typedef : DDecl<TypedefName>; - def TypeAlias : DDecl<TypedefName>; - def ObjCTypeParam : DDecl<TypedefName>; - def UnresolvedUsingTypename : DDecl<Type>; - def Tag : DDecl<Type, 1>, DeclContext; - def Enum : DDecl<Tag>; - def Record : DDecl<Tag>; - def CXXRecord : DDecl<Record>; - def ClassTemplateSpecialization : DDecl<CXXRecord>; - def ClassTemplatePartialSpecialization - : DDecl<ClassTemplateSpecialization>; - def TemplateTypeParm : DDecl<Type>; - def Value : DDecl<Named, 1>; - def EnumConstant : DDecl<Value>; - def UnresolvedUsingValue : DDecl<Value>; - def IndirectField : DDecl<Value>; - def Declarator : DDecl<Value, 1>; - def Field : DDecl<Declarator>; - def ObjCIvar : DDecl<Field>; - def ObjCAtDefsField : DDecl<Field>; - def MSProperty : DDecl<Declarator>; - def Function : DDecl<Declarator>, DeclContext; - def CXXMethod : DDecl<Function>; - def CXXConstructor : DDecl<CXXMethod>; - def CXXDestructor : DDecl<CXXMethod>; - def CXXConversion : DDecl<CXXMethod>; - def Var : DDecl<Declarator>; - def VarTemplateSpecialization : DDecl<Var>; - def VarTemplatePartialSpecialization - : DDecl<VarTemplateSpecialization>; - def ImplicitParam : DDecl<Var>; - def ParmVar : DDecl<Var>; - def NonTypeTemplateParm : DDecl<Declarator>; - def Template : DDecl<Named, 1>; - def RedeclarableTemplate : DDecl<Template, 1>; - def FunctionTemplate : DDecl<RedeclarableTemplate>; - def ClassTemplate : DDecl<RedeclarableTemplate>; - def VarTemplate : DDecl<RedeclarableTemplate>; - def TypeAliasTemplate : DDecl<RedeclarableTemplate>; - def TemplateTemplateParm : DDecl<Template>; - def BuiltinTemplate : DDecl<Template>; - def Using : DDecl<Named>; - def UsingShadow : DDecl<Named>; - def ObjCMethod : DDecl<Named>, DeclContext; - def ObjCContainer : DDecl<Named, 1>, DeclContext; - def ObjCCategory : DDecl<ObjCContainer>; - def ObjCProtocol : DDecl<ObjCContainer>; - def ObjCInterface : DDecl<ObjCContainer>; - def ObjCImpl : DDecl<ObjCContainer, 1>; - def ObjCCategoryImpl : DDecl<ObjCImpl>; - def ObjCImplementation : DDecl<ObjCImpl>; - def ObjCProperty : DDecl<Named>; - def ObjCCompatibleAlias : DDecl<Named>; -def LinkageSpec : Decl, DeclContext; -def ObjCPropertyImpl : Decl; -def FileScopeAsm : Decl; -def AccessSpec : Decl; -def Friend : Decl; -def FriendTemplate : Decl; -def StaticAssert : Decl; -def Block : Decl, DeclContext; -def Captured : Decl, DeclContext; -def ClassScopeFunctionSpecialization : Decl; -def Import : Decl; -def OMPThreadPrivate : Decl; -def Empty : Decl; - diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h deleted file mode 100644 index 1d6c19b..0000000 --- a/include/clang/Basic/Diagnostic.h +++ /dev/null @@ -1,1414 +0,0 @@ -//===--- Diagnostic.h - C Language Family Diagnostic Handling ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the Diagnostic-related interfaces. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_DIAGNOSTIC_H -#define LLVM_CLANG_BASIC_DIAGNOSTIC_H - -#include "clang/Basic/DiagnosticIDs.h" -#include "clang/Basic/DiagnosticOptions.h" -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/Specifiers.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/iterator_range.h" -#include <list> -#include <vector> - -namespace clang { - class DeclContext; - class DiagnosticBuilder; - class DiagnosticConsumer; - class DiagnosticErrorTrap; - class DiagnosticOptions; - class IdentifierInfo; - class LangOptions; - class Preprocessor; - class StoredDiagnostic; - namespace tok { - enum TokenKind : unsigned short; - } - -/// \brief Annotates a diagnostic with some code that should be -/// inserted, removed, or replaced to fix the problem. -/// -/// This kind of hint should be used when we are certain that the -/// introduction, removal, or modification of a particular (small!) -/// amount of code will correct a compilation error. The compiler -/// should also provide full recovery from such errors, such that -/// suppressing the diagnostic output can still result in successful -/// compilation. -class FixItHint { -public: - /// \brief Code that should be replaced to correct the error. Empty for an - /// insertion hint. - CharSourceRange RemoveRange; - - /// \brief Code in the specific range that should be inserted in the insertion - /// location. - CharSourceRange InsertFromRange; - - /// \brief The actual code to insert at the insertion location, as a - /// string. - std::string CodeToInsert; - - bool BeforePreviousInsertions; - - /// \brief Empty code modification hint, indicating that no code - /// modification is known. - FixItHint() : BeforePreviousInsertions(false) { } - - bool isNull() const { - return !RemoveRange.isValid(); - } - - /// \brief Create a code modification hint that inserts the given - /// code string at a specific location. - static FixItHint CreateInsertion(SourceLocation InsertionLoc, - StringRef Code, - bool BeforePreviousInsertions = false) { - FixItHint Hint; - Hint.RemoveRange = - CharSourceRange::getCharRange(InsertionLoc, InsertionLoc); - Hint.CodeToInsert = Code; - Hint.BeforePreviousInsertions = BeforePreviousInsertions; - return Hint; - } - - /// \brief Create a code modification hint that inserts the given - /// code from \p FromRange at a specific location. - static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc, - CharSourceRange FromRange, - bool BeforePreviousInsertions = false) { - FixItHint Hint; - Hint.RemoveRange = - CharSourceRange::getCharRange(InsertionLoc, InsertionLoc); - Hint.InsertFromRange = FromRange; - Hint.BeforePreviousInsertions = BeforePreviousInsertions; - return Hint; - } - - /// \brief Create a code modification hint that removes the given - /// source range. - static FixItHint CreateRemoval(CharSourceRange RemoveRange) { - FixItHint Hint; - Hint.RemoveRange = RemoveRange; - return Hint; - } - static FixItHint CreateRemoval(SourceRange RemoveRange) { - return CreateRemoval(CharSourceRange::getTokenRange(RemoveRange)); - } - - /// \brief Create a code modification hint that replaces the given - /// source range with the given code string. - static FixItHint CreateReplacement(CharSourceRange RemoveRange, - StringRef Code) { - FixItHint Hint; - Hint.RemoveRange = RemoveRange; - Hint.CodeToInsert = Code; - return Hint; - } - - static FixItHint CreateReplacement(SourceRange RemoveRange, - StringRef Code) { - return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code); - } -}; - -/// \brief Concrete class used by the front-end to report problems and issues. -/// -/// This massages the diagnostics (e.g. handling things like "report warnings -/// as errors" and passes them off to the DiagnosticConsumer for reporting to -/// the user. DiagnosticsEngine is tied to one translation unit and one -/// SourceManager. -class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> { - DiagnosticsEngine(const DiagnosticsEngine &) = delete; - void operator=(const DiagnosticsEngine &) = delete; - -public: - /// \brief The level of the diagnostic, after it has been through mapping. - enum Level { - Ignored = DiagnosticIDs::Ignored, - Note = DiagnosticIDs::Note, - Remark = DiagnosticIDs::Remark, - Warning = DiagnosticIDs::Warning, - Error = DiagnosticIDs::Error, - Fatal = DiagnosticIDs::Fatal - }; - - enum ArgumentKind { - ak_std_string, ///< std::string - ak_c_string, ///< const char * - ak_sint, ///< int - ak_uint, ///< unsigned - ak_tokenkind, ///< enum TokenKind : unsigned - ak_identifierinfo, ///< IdentifierInfo - ak_qualtype, ///< QualType - ak_declarationname, ///< DeclarationName - ak_nameddecl, ///< NamedDecl * - ak_nestednamespec, ///< NestedNameSpecifier * - ak_declcontext, ///< DeclContext * - ak_qualtype_pair, ///< pair<QualType, QualType> - ak_attr ///< Attr * - }; - - /// \brief Represents on argument value, which is a union discriminated - /// by ArgumentKind, with a value. - typedef std::pair<ArgumentKind, intptr_t> ArgumentValue; - -private: - unsigned char AllExtensionsSilenced; // Used by __extension__ - bool IgnoreAllWarnings; // Ignore all warnings: -w - bool WarningsAsErrors; // Treat warnings like errors. - bool EnableAllWarnings; // Enable all warnings. - bool ErrorsAsFatal; // Treat errors like fatal errors. - bool SuppressSystemWarnings; // Suppress warnings in system headers. - bool SuppressAllDiagnostics; // Suppress all diagnostics. - bool ElideType; // Elide common types of templates. - bool PrintTemplateTree; // Print a tree when comparing templates. - bool ShowColors; // Color printing is enabled. - OverloadsShown ShowOverloads; // Which overload candidates to show. - unsigned ErrorLimit; // Cap of # errors emitted, 0 -> no limit. - unsigned TemplateBacktraceLimit; // Cap on depth of template backtrace stack, - // 0 -> no limit. - unsigned ConstexprBacktraceLimit; // Cap on depth of constexpr evaluation - // backtrace stack, 0 -> no limit. - diag::Severity ExtBehavior; // Map extensions to warnings or errors? - IntrusiveRefCntPtr<DiagnosticIDs> Diags; - IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; - DiagnosticConsumer *Client; - std::unique_ptr<DiagnosticConsumer> Owner; - SourceManager *SourceMgr; - - /// \brief Mapping information for diagnostics. - /// - /// Mapping info is packed into four bits per diagnostic. The low three - /// bits are the mapping (an instance of diag::Severity), or zero if unset. - /// The high bit is set when the mapping was established as a user mapping. - /// If the high bit is clear, then the low bits are set to the default - /// value, and should be mapped with -pedantic, -Werror, etc. - /// - /// A new DiagState is created and kept around when diagnostic pragmas modify - /// the state so that we know what is the diagnostic state at any given - /// source location. - class DiagState { - llvm::DenseMap<unsigned, DiagnosticMapping> DiagMap; - - public: - typedef llvm::DenseMap<unsigned, DiagnosticMapping>::iterator iterator; - typedef llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator - const_iterator; - - void setMapping(diag::kind Diag, DiagnosticMapping Info) { - DiagMap[Diag] = Info; - } - - DiagnosticMapping &getOrAddMapping(diag::kind Diag); - - const_iterator begin() const { return DiagMap.begin(); } - const_iterator end() const { return DiagMap.end(); } - }; - - /// \brief Keeps and automatically disposes all DiagStates that we create. - std::list<DiagState> DiagStates; - - /// \brief Represents a point in source where the diagnostic state was - /// modified because of a pragma. - /// - /// 'Loc' can be null if the point represents the diagnostic state - /// modifications done through the command-line. - struct DiagStatePoint { - DiagState *State; - FullSourceLoc Loc; - DiagStatePoint(DiagState *State, FullSourceLoc Loc) - : State(State), Loc(Loc) { } - - bool operator<(const DiagStatePoint &RHS) const { - // If Loc is invalid it means it came from <command-line>, in which case - // we regard it as coming before any valid source location. - if (RHS.Loc.isInvalid()) - return false; - if (Loc.isInvalid()) - return true; - return Loc.isBeforeInTranslationUnitThan(RHS.Loc); - } - }; - - /// \brief A sorted vector of all DiagStatePoints representing changes in - /// diagnostic state due to diagnostic pragmas. - /// - /// The vector is always sorted according to the SourceLocation of the - /// DiagStatePoint. - typedef std::vector<DiagStatePoint> DiagStatePointsTy; - mutable DiagStatePointsTy DiagStatePoints; - - /// \brief Keeps the DiagState that was active during each diagnostic 'push' - /// so we can get back at it when we 'pop'. - std::vector<DiagState *> DiagStateOnPushStack; - - DiagState *GetCurDiagState() const { - assert(!DiagStatePoints.empty()); - return DiagStatePoints.back().State; - } - - void PushDiagStatePoint(DiagState *State, SourceLocation L) { - FullSourceLoc Loc(L, getSourceManager()); - // Make sure that DiagStatePoints is always sorted according to Loc. - assert(Loc.isValid() && "Adding invalid loc point"); - assert(!DiagStatePoints.empty() && - (DiagStatePoints.back().Loc.isInvalid() || - DiagStatePoints.back().Loc.isBeforeInTranslationUnitThan(Loc)) && - "Previous point loc comes after or is the same as new one"); - DiagStatePoints.push_back(DiagStatePoint(State, Loc)); - } - - /// \brief Finds the DiagStatePoint that contains the diagnostic state of - /// the given source location. - DiagStatePointsTy::iterator GetDiagStatePointForLoc(SourceLocation Loc) const; - - /// \brief Sticky flag set to \c true when an error is emitted. - bool ErrorOccurred; - - /// \brief Sticky flag set to \c true when an "uncompilable error" occurs. - /// I.e. an error that was not upgraded from a warning by -Werror. - bool UncompilableErrorOccurred; - - /// \brief Sticky flag set to \c true when a fatal error is emitted. - bool FatalErrorOccurred; - - /// \brief Indicates that an unrecoverable error has occurred. - bool UnrecoverableErrorOccurred; - - /// \brief Counts for DiagnosticErrorTrap to check whether an error occurred - /// during a parsing section, e.g. during parsing a function. - unsigned TrapNumErrorsOccurred; - unsigned TrapNumUnrecoverableErrorsOccurred; - - /// \brief The level of the last diagnostic emitted. - /// - /// This is used to emit continuation diagnostics with the same level as the - /// diagnostic that they follow. - DiagnosticIDs::Level LastDiagLevel; - - unsigned NumWarnings; ///< Number of warnings reported - unsigned NumErrors; ///< Number of errors reported - - /// \brief A function pointer that converts an opaque diagnostic - /// argument to a strings. - /// - /// This takes the modifiers and argument that was present in the diagnostic. - /// - /// The PrevArgs array indicates the previous arguments formatted for this - /// diagnostic. Implementations of this function can use this information to - /// avoid redundancy across arguments. - /// - /// This is a hack to avoid a layering violation between libbasic and libsema. - typedef void (*ArgToStringFnTy)( - ArgumentKind Kind, intptr_t Val, - StringRef Modifier, StringRef Argument, - ArrayRef<ArgumentValue> PrevArgs, - SmallVectorImpl<char> &Output, - void *Cookie, - ArrayRef<intptr_t> QualTypeVals); - void *ArgToStringCookie; - ArgToStringFnTy ArgToStringFn; - - /// \brief ID of the "delayed" diagnostic, which is a (typically - /// fatal) diagnostic that had to be delayed because it was found - /// while emitting another diagnostic. - unsigned DelayedDiagID; - - /// \brief First string argument for the delayed diagnostic. - std::string DelayedDiagArg1; - - /// \brief Second string argument for the delayed diagnostic. - std::string DelayedDiagArg2; - - /// \brief Optional flag value. - /// - /// Some flags accept values, for instance: -Wframe-larger-than=<value> and - /// -Rpass=<value>. The content of this string is emitted after the flag name - /// and '='. - std::string FlagValue; - -public: - explicit DiagnosticsEngine( - const IntrusiveRefCntPtr<DiagnosticIDs> &Diags, - DiagnosticOptions *DiagOpts, - DiagnosticConsumer *client = nullptr, - bool ShouldOwnClient = true); - ~DiagnosticsEngine(); - - const IntrusiveRefCntPtr<DiagnosticIDs> &getDiagnosticIDs() const { - return Diags; - } - - /// \brief Retrieve the diagnostic options. - DiagnosticOptions &getDiagnosticOptions() const { return *DiagOpts; } - - typedef llvm::iterator_range<DiagState::const_iterator> diag_mapping_range; - - /// \brief Get the current set of diagnostic mappings. - diag_mapping_range getDiagnosticMappings() const { - const DiagState &DS = *GetCurDiagState(); - return diag_mapping_range(DS.begin(), DS.end()); - } - - DiagnosticConsumer *getClient() { return Client; } - const DiagnosticConsumer *getClient() const { return Client; } - - /// \brief Determine whether this \c DiagnosticsEngine object own its client. - bool ownsClient() const { return Owner != nullptr; } - - /// \brief Return the current diagnostic client along with ownership of that - /// client. - std::unique_ptr<DiagnosticConsumer> takeClient() { return std::move(Owner); } - - bool hasSourceManager() const { return SourceMgr != nullptr; } - SourceManager &getSourceManager() const { - assert(SourceMgr && "SourceManager not set!"); - return *SourceMgr; - } - void setSourceManager(SourceManager *SrcMgr) { SourceMgr = SrcMgr; } - - //===--------------------------------------------------------------------===// - // DiagnosticsEngine characterization methods, used by a client to customize - // how diagnostics are emitted. - // - - /// \brief Copies the current DiagMappings and pushes the new copy - /// onto the top of the stack. - void pushMappings(SourceLocation Loc); - - /// \brief Pops the current DiagMappings off the top of the stack, - /// causing the new top of the stack to be the active mappings. - /// - /// \returns \c true if the pop happens, \c false if there is only one - /// DiagMapping on the stack. - bool popMappings(SourceLocation Loc); - - /// \brief Set the diagnostic client associated with this diagnostic object. - /// - /// \param ShouldOwnClient true if the diagnostic object should take - /// ownership of \c client. - void setClient(DiagnosticConsumer *client, bool ShouldOwnClient = true); - - /// \brief Specify a limit for the number of errors we should - /// emit before giving up. - /// - /// Zero disables the limit. - void setErrorLimit(unsigned Limit) { ErrorLimit = Limit; } - - /// \brief Specify the maximum number of template instantiation - /// notes to emit along with a given diagnostic. - void setTemplateBacktraceLimit(unsigned Limit) { - TemplateBacktraceLimit = Limit; - } - - /// \brief Retrieve the maximum number of template instantiation - /// notes to emit along with a given diagnostic. - unsigned getTemplateBacktraceLimit() const { - return TemplateBacktraceLimit; - } - - /// \brief Specify the maximum number of constexpr evaluation - /// notes to emit along with a given diagnostic. - void setConstexprBacktraceLimit(unsigned Limit) { - ConstexprBacktraceLimit = Limit; - } - - /// \brief Retrieve the maximum number of constexpr evaluation - /// notes to emit along with a given diagnostic. - unsigned getConstexprBacktraceLimit() const { - return ConstexprBacktraceLimit; - } - - /// \brief When set to true, any unmapped warnings are ignored. - /// - /// If this and WarningsAsErrors are both set, then this one wins. - void setIgnoreAllWarnings(bool Val) { IgnoreAllWarnings = Val; } - bool getIgnoreAllWarnings() const { return IgnoreAllWarnings; } - - /// \brief When set to true, any unmapped ignored warnings are no longer - /// ignored. - /// - /// If this and IgnoreAllWarnings are both set, then that one wins. - void setEnableAllWarnings(bool Val) { EnableAllWarnings = Val; } - bool getEnableAllWarnings() const { return EnableAllWarnings; } - - /// \brief When set to true, any warnings reported are issued as errors. - void setWarningsAsErrors(bool Val) { WarningsAsErrors = Val; } - bool getWarningsAsErrors() const { return WarningsAsErrors; } - - /// \brief When set to true, any error reported is made a fatal error. - void setErrorsAsFatal(bool Val) { ErrorsAsFatal = Val; } - bool getErrorsAsFatal() const { return ErrorsAsFatal; } - - /// \brief When set to true mask warnings that come from system headers. - void setSuppressSystemWarnings(bool Val) { SuppressSystemWarnings = Val; } - bool getSuppressSystemWarnings() const { return SuppressSystemWarnings; } - - /// \brief Suppress all diagnostics, to silence the front end when we - /// know that we don't want any more diagnostics to be passed along to the - /// client - void setSuppressAllDiagnostics(bool Val = true) { - SuppressAllDiagnostics = Val; - } - bool getSuppressAllDiagnostics() const { return SuppressAllDiagnostics; } - - /// \brief Set type eliding, to skip outputting same types occurring in - /// template types. - void setElideType(bool Val = true) { ElideType = Val; } - bool getElideType() { return ElideType; } - - /// \brief Set tree printing, to outputting the template difference in a - /// tree format. - void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; } - bool getPrintTemplateTree() { return PrintTemplateTree; } - - /// \brief Set color printing, so the type diffing will inject color markers - /// into the output. - void setShowColors(bool Val = false) { ShowColors = Val; } - bool getShowColors() { return ShowColors; } - - /// \brief Specify which overload candidates to show when overload resolution - /// fails. - /// - /// By default, we show all candidates. - void setShowOverloads(OverloadsShown Val) { - ShowOverloads = Val; - } - OverloadsShown getShowOverloads() const { return ShowOverloads; } - - /// \brief Pretend that the last diagnostic issued was ignored, so any - /// subsequent notes will be suppressed. - /// - /// This can be used by clients who suppress diagnostics themselves. - void setLastDiagnosticIgnored() { - if (LastDiagLevel == DiagnosticIDs::Fatal) - FatalErrorOccurred = true; - LastDiagLevel = DiagnosticIDs::Ignored; - } - - /// \brief Determine whether the previous diagnostic was ignored. This can - /// be used by clients that want to determine whether notes attached to a - /// diagnostic will be suppressed. - bool isLastDiagnosticIgnored() const { - return LastDiagLevel == DiagnosticIDs::Ignored; - } - - /// \brief Controls whether otherwise-unmapped extension diagnostics are - /// mapped onto ignore/warning/error. - /// - /// This corresponds to the GCC -pedantic and -pedantic-errors option. - void setExtensionHandlingBehavior(diag::Severity H) { ExtBehavior = H; } - diag::Severity getExtensionHandlingBehavior() const { return ExtBehavior; } - - /// \brief Counter bumped when an __extension__ block is/ encountered. - /// - /// When non-zero, all extension diagnostics are entirely silenced, no - /// matter how they are mapped. - void IncrementAllExtensionsSilenced() { ++AllExtensionsSilenced; } - void DecrementAllExtensionsSilenced() { --AllExtensionsSilenced; } - bool hasAllExtensionsSilenced() { return AllExtensionsSilenced != 0; } - - /// \brief This allows the client to specify that certain warnings are - /// ignored. - /// - /// Notes can never be mapped, errors can only be mapped to fatal, and - /// WARNINGs and EXTENSIONs can be mapped arbitrarily. - /// - /// \param Loc The source location that this change of diagnostic state should - /// take affect. It can be null if we are setting the latest state. - void setSeverity(diag::kind Diag, diag::Severity Map, SourceLocation Loc); - - /// \brief Change an entire diagnostic group (e.g. "unknown-pragmas") to - /// have the specified mapping. - /// - /// \returns true (and ignores the request) if "Group" was unknown, false - /// otherwise. - /// - /// \param Flavor The flavor of group to affect. -Rfoo does not affect the - /// state of the -Wfoo group and vice versa. - /// - /// \param Loc The source location that this change of diagnostic state should - /// take affect. It can be null if we are setting the state from command-line. - bool setSeverityForGroup(diag::Flavor Flavor, StringRef Group, - diag::Severity Map, - SourceLocation Loc = SourceLocation()); - - /// \brief Set the warning-as-error flag for the given diagnostic group. - /// - /// This function always only operates on the current diagnostic state. - /// - /// \returns True if the given group is unknown, false otherwise. - bool setDiagnosticGroupWarningAsError(StringRef Group, bool Enabled); - - /// \brief Set the error-as-fatal flag for the given diagnostic group. - /// - /// This function always only operates on the current diagnostic state. - /// - /// \returns True if the given group is unknown, false otherwise. - bool setDiagnosticGroupErrorAsFatal(StringRef Group, bool Enabled); - - /// \brief Add the specified mapping to all diagnostics of the specified - /// flavor. - /// - /// Mainly to be used by -Wno-everything to disable all warnings but allow - /// subsequent -W options to enable specific warnings. - void setSeverityForAll(diag::Flavor Flavor, diag::Severity Map, - SourceLocation Loc = SourceLocation()); - - bool hasErrorOccurred() const { return ErrorOccurred; } - - /// \brief Errors that actually prevent compilation, not those that are - /// upgraded from a warning by -Werror. - bool hasUncompilableErrorOccurred() const { - return UncompilableErrorOccurred; - } - bool hasFatalErrorOccurred() const { return FatalErrorOccurred; } - - /// \brief Determine whether any kind of unrecoverable error has occurred. - bool hasUnrecoverableErrorOccurred() const { - return FatalErrorOccurred || UnrecoverableErrorOccurred; - } - - unsigned getNumWarnings() const { return NumWarnings; } - - void setNumWarnings(unsigned NumWarnings) { - this->NumWarnings = NumWarnings; - } - - /// \brief Return an ID for a diagnostic with the specified format string and - /// level. - /// - /// If this is the first request for this diagnostic, it is registered and - /// created, otherwise the existing ID is returned. - /// - /// \param FormatString A fixed diagnostic format string that will be hashed - /// and mapped to a unique DiagID. - template <unsigned N> - unsigned getCustomDiagID(Level L, const char (&FormatString)[N]) { - return Diags->getCustomDiagID((DiagnosticIDs::Level)L, - StringRef(FormatString, N - 1)); - } - - /// \brief Converts a diagnostic argument (as an intptr_t) into the string - /// that represents it. - void ConvertArgToString(ArgumentKind Kind, intptr_t Val, - StringRef Modifier, StringRef Argument, - ArrayRef<ArgumentValue> PrevArgs, - SmallVectorImpl<char> &Output, - ArrayRef<intptr_t> QualTypeVals) const { - ArgToStringFn(Kind, Val, Modifier, Argument, PrevArgs, Output, - ArgToStringCookie, QualTypeVals); - } - - void SetArgToStringFn(ArgToStringFnTy Fn, void *Cookie) { - ArgToStringFn = Fn; - ArgToStringCookie = Cookie; - } - - /// \brief Note that the prior diagnostic was emitted by some other - /// \c DiagnosticsEngine, and we may be attaching a note to that diagnostic. - void notePriorDiagnosticFrom(const DiagnosticsEngine &Other) { - LastDiagLevel = Other.LastDiagLevel; - } - - /// \brief Reset the state of the diagnostic object to its initial - /// configuration. - void Reset(); - - //===--------------------------------------------------------------------===// - // DiagnosticsEngine classification and reporting interfaces. - // - - /// \brief Determine whether the diagnostic is known to be ignored. - /// - /// This can be used to opportunistically avoid expensive checks when it's - /// known for certain that the diagnostic has been suppressed at the - /// specified location \p Loc. - /// - /// \param Loc The source location we are interested in finding out the - /// diagnostic state. Can be null in order to query the latest state. - bool isIgnored(unsigned DiagID, SourceLocation Loc) const { - return Diags->getDiagnosticSeverity(DiagID, Loc, *this) == - diag::Severity::Ignored; - } - - /// \brief Based on the way the client configured the DiagnosticsEngine - /// object, classify the specified diagnostic ID into a Level, consumable by - /// the DiagnosticConsumer. - /// - /// To preserve invariant assumptions, this function should not be used to - /// influence parse or semantic analysis actions. Instead consider using - /// \c isIgnored(). - /// - /// \param Loc The source location we are interested in finding out the - /// diagnostic state. Can be null in order to query the latest state. - Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc) const { - return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this); - } - - /// \brief Issue the message to the client. - /// - /// This actually returns an instance of DiagnosticBuilder which emits the - /// diagnostics (through @c ProcessDiag) when it is destroyed. - /// - /// \param DiagID A member of the @c diag::kind enum. - /// \param Loc Represents the source location associated with the diagnostic, - /// which can be an invalid location if no position information is available. - inline DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID); - inline DiagnosticBuilder Report(unsigned DiagID); - - void Report(const StoredDiagnostic &storedDiag); - - /// \brief Determine whethere there is already a diagnostic in flight. - bool isDiagnosticInFlight() const { return CurDiagID != ~0U; } - - /// \brief Set the "delayed" diagnostic that will be emitted once - /// the current diagnostic completes. - /// - /// If a diagnostic is already in-flight but the front end must - /// report a problem (e.g., with an inconsistent file system - /// state), this routine sets a "delayed" diagnostic that will be - /// emitted after the current diagnostic completes. This should - /// only be used for fatal errors detected at inconvenient - /// times. If emitting a delayed diagnostic causes a second delayed - /// diagnostic to be introduced, that second delayed diagnostic - /// will be ignored. - /// - /// \param DiagID The ID of the diagnostic being delayed. - /// - /// \param Arg1 A string argument that will be provided to the - /// diagnostic. A copy of this string will be stored in the - /// DiagnosticsEngine object itself. - /// - /// \param Arg2 A string argument that will be provided to the - /// diagnostic. A copy of this string will be stored in the - /// DiagnosticsEngine object itself. - void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "", - StringRef Arg2 = ""); - - /// \brief Clear out the current diagnostic. - void Clear() { CurDiagID = ~0U; } - - /// \brief Return the value associated with this diagnostic flag. - StringRef getFlagValue() const { return FlagValue; } - -private: - /// \brief Report the delayed diagnostic. - void ReportDelayed(); - - // This is private state used by DiagnosticBuilder. We put it here instead of - // in DiagnosticBuilder in order to keep DiagnosticBuilder a small lightweight - // object. This implementation choice means that we can only have one - // diagnostic "in flight" at a time, but this seems to be a reasonable - // tradeoff to keep these objects small. Assertions verify that only one - // diagnostic is in flight at a time. - friend class DiagnosticIDs; - friend class DiagnosticBuilder; - friend class Diagnostic; - friend class PartialDiagnostic; - friend class DiagnosticErrorTrap; - - /// \brief The location of the current diagnostic that is in flight. - SourceLocation CurDiagLoc; - - /// \brief The ID of the current diagnostic that is in flight. - /// - /// This is set to ~0U when there is no diagnostic in flight. - unsigned CurDiagID; - - enum { - /// \brief The maximum number of arguments we can hold. - /// - /// We currently only support up to 10 arguments (%0-%9). A single - /// diagnostic with more than that almost certainly has to be simplified - /// anyway. - MaxArguments = 10, - }; - - /// \brief The number of entries in Arguments. - signed char NumDiagArgs; - - /// \brief Specifies whether an argument is in DiagArgumentsStr or - /// in DiagArguments. - /// - /// This is an array of ArgumentKind::ArgumentKind enum values, one for each - /// argument. - unsigned char DiagArgumentsKind[MaxArguments]; - - /// \brief Holds the values of each string argument for the current - /// diagnostic. - /// - /// This is only used when the corresponding ArgumentKind is ak_std_string. - std::string DiagArgumentsStr[MaxArguments]; - - /// \brief The values for the various substitution positions. - /// - /// This is used when the argument is not an std::string. The specific - /// value is mangled into an intptr_t and the interpretation depends on - /// exactly what sort of argument kind it is. - intptr_t DiagArgumentsVal[MaxArguments]; - - /// \brief The list of ranges added to this diagnostic. - SmallVector<CharSourceRange, 8> DiagRanges; - - /// \brief If valid, provides a hint with some code to insert, remove, - /// or modify at a particular position. - SmallVector<FixItHint, 8> DiagFixItHints; - - DiagnosticMapping makeUserMapping(diag::Severity Map, SourceLocation L) { - bool isPragma = L.isValid(); - DiagnosticMapping Mapping = - DiagnosticMapping::Make(Map, /*IsUser=*/true, isPragma); - - // If this is a pragma mapping, then set the diagnostic mapping flags so - // that we override command line options. - if (isPragma) { - Mapping.setNoWarningAsError(true); - Mapping.setNoErrorAsFatal(true); - } - - return Mapping; - } - - /// \brief Used to report a diagnostic that is finally fully formed. - /// - /// \returns true if the diagnostic was emitted, false if it was suppressed. - bool ProcessDiag() { - return Diags->ProcessDiag(*this); - } - - /// @name Diagnostic Emission - /// @{ -protected: - // Sema requires access to the following functions because the current design - // of SFINAE requires it to use its own SemaDiagnosticBuilder, which needs to - // access us directly to ensure we minimize the emitted code for the common - // Sema::Diag() patterns. - friend class Sema; - - /// \brief Emit the current diagnostic and clear the diagnostic state. - /// - /// \param Force Emit the diagnostic regardless of suppression settings. - bool EmitCurrentDiagnostic(bool Force = false); - - unsigned getCurrentDiagID() const { return CurDiagID; } - - SourceLocation getCurrentDiagLoc() const { return CurDiagLoc; } - - /// @} - - friend class ASTReader; - friend class ASTWriter; -}; - -/// \brief RAII class that determines when any errors have occurred -/// between the time the instance was created and the time it was -/// queried. -class DiagnosticErrorTrap { - DiagnosticsEngine &Diag; - unsigned NumErrors; - unsigned NumUnrecoverableErrors; - -public: - explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag) - : Diag(Diag) { reset(); } - - /// \brief Determine whether any errors have occurred since this - /// object instance was created. - bool hasErrorOccurred() const { - return Diag.TrapNumErrorsOccurred > NumErrors; - } - - /// \brief Determine whether any unrecoverable errors have occurred since this - /// object instance was created. - bool hasUnrecoverableErrorOccurred() const { - return Diag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors; - } - - /// \brief Set to initial state of "no errors occurred". - void reset() { - NumErrors = Diag.TrapNumErrorsOccurred; - NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred; - } -}; - -//===----------------------------------------------------------------------===// -// DiagnosticBuilder -//===----------------------------------------------------------------------===// - -/// \brief A little helper class used to produce diagnostics. -/// -/// This is constructed by the DiagnosticsEngine::Report method, and -/// allows insertion of extra information (arguments and source ranges) into -/// the currently "in flight" diagnostic. When the temporary for the builder -/// is destroyed, the diagnostic is issued. -/// -/// Note that many of these will be created as temporary objects (many call -/// sites), so we want them to be small and we never want their address taken. -/// This ensures that compilers with somewhat reasonable optimizers will promote -/// the common fields to registers, eliminating increments of the NumArgs field, -/// for example. -class DiagnosticBuilder { - mutable DiagnosticsEngine *DiagObj = nullptr; - mutable unsigned NumArgs = 0; - - /// \brief Status variable indicating if this diagnostic is still active. - /// - // NOTE: This field is redundant with DiagObj (IsActive iff (DiagObj == 0)), - // but LLVM is not currently smart enough to eliminate the null check that - // Emit() would end up with if we used that as our status variable. - mutable bool IsActive = false; - - /// \brief Flag indicating that this diagnostic is being emitted via a - /// call to ForceEmit. - mutable bool IsForceEmit = false; - - void operator=(const DiagnosticBuilder &) = delete; - friend class DiagnosticsEngine; - - DiagnosticBuilder() = default; - - explicit DiagnosticBuilder(DiagnosticsEngine *diagObj) - : DiagObj(diagObj), IsActive(true) { - assert(diagObj && "DiagnosticBuilder requires a valid DiagnosticsEngine!"); - diagObj->DiagRanges.clear(); - diagObj->DiagFixItHints.clear(); - } - - friend class PartialDiagnostic; - -protected: - void FlushCounts() { - DiagObj->NumDiagArgs = NumArgs; - } - - /// \brief Clear out the current diagnostic. - void Clear() const { - DiagObj = nullptr; - IsActive = false; - IsForceEmit = false; - } - - /// \brief Determine whether this diagnostic is still active. - bool isActive() const { return IsActive; } - - /// \brief Force the diagnostic builder to emit the diagnostic now. - /// - /// Once this function has been called, the DiagnosticBuilder object - /// should not be used again before it is destroyed. - /// - /// \returns true if a diagnostic was emitted, false if the - /// diagnostic was suppressed. - bool Emit() { - // If this diagnostic is inactive, then its soul was stolen by the copy ctor - // (or by a subclass, as in SemaDiagnosticBuilder). - if (!isActive()) return false; - - // When emitting diagnostics, we set the final argument count into - // the DiagnosticsEngine object. - FlushCounts(); - - // Process the diagnostic. - bool Result = DiagObj->EmitCurrentDiagnostic(IsForceEmit); - - // This diagnostic is dead. - Clear(); - - return Result; - } - -public: - /// Copy constructor. When copied, this "takes" the diagnostic info from the - /// input and neuters it. - DiagnosticBuilder(const DiagnosticBuilder &D) { - DiagObj = D.DiagObj; - IsActive = D.IsActive; - IsForceEmit = D.IsForceEmit; - D.Clear(); - NumArgs = D.NumArgs; - } - - /// \brief Retrieve an empty diagnostic builder. - static DiagnosticBuilder getEmpty() { - return DiagnosticBuilder(); - } - - /// \brief Emits the diagnostic. - ~DiagnosticBuilder() { - Emit(); - } - - /// \brief Forces the diagnostic to be emitted. - const DiagnosticBuilder &setForceEmit() const { - IsForceEmit = true; - return *this; - } - - /// \brief Conversion of DiagnosticBuilder to bool always returns \c true. - /// - /// This allows is to be used in boolean error contexts (where \c true is - /// used to indicate that an error has occurred), like: - /// \code - /// return Diag(...); - /// \endcode - operator bool() const { return true; } - - void AddString(StringRef S) const { - assert(isActive() && "Clients must not add to cleared diagnostic!"); - assert(NumArgs < DiagnosticsEngine::MaxArguments && - "Too many arguments to diagnostic!"); - DiagObj->DiagArgumentsKind[NumArgs] = DiagnosticsEngine::ak_std_string; - DiagObj->DiagArgumentsStr[NumArgs++] = S; - } - - void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const { - assert(isActive() && "Clients must not add to cleared diagnostic!"); - assert(NumArgs < DiagnosticsEngine::MaxArguments && - "Too many arguments to diagnostic!"); - DiagObj->DiagArgumentsKind[NumArgs] = Kind; - DiagObj->DiagArgumentsVal[NumArgs++] = V; - } - - void AddSourceRange(const CharSourceRange &R) const { - assert(isActive() && "Clients must not add to cleared diagnostic!"); - DiagObj->DiagRanges.push_back(R); - } - - void AddFixItHint(const FixItHint &Hint) const { - assert(isActive() && "Clients must not add to cleared diagnostic!"); - if (!Hint.isNull()) - DiagObj->DiagFixItHints.push_back(Hint); - } - - void addFlagValue(StringRef V) const { DiagObj->FlagValue = V; } -}; - -struct AddFlagValue { - explicit AddFlagValue(StringRef V) : Val(V) {} - StringRef Val; -}; - -/// \brief Register a value for the flag in the current diagnostic. This -/// value will be shown as the suffix "=value" after the flag name. It is -/// useful in cases where the diagnostic flag accepts values (e.g., -/// -Rpass or -Wframe-larger-than). -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const AddFlagValue V) { - DB.addFlagValue(V.Val); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - StringRef S) { - DB.AddString(S); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const char *Str) { - DB.AddTaggedVal(reinterpret_cast<intptr_t>(Str), - DiagnosticsEngine::ak_c_string); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, int I) { - DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); - return DB; -} - -// We use enable_if here to prevent that this overload is selected for -// pointers or other arguments that are implicitly convertible to bool. -template <typename T> -inline -typename std::enable_if<std::is_same<T, bool>::value, - const DiagnosticBuilder &>::type -operator<<(const DiagnosticBuilder &DB, T I) { - DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - unsigned I) { - DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - tok::TokenKind I) { - DB.AddTaggedVal(static_cast<unsigned>(I), DiagnosticsEngine::ak_tokenkind); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const IdentifierInfo *II) { - DB.AddTaggedVal(reinterpret_cast<intptr_t>(II), - DiagnosticsEngine::ak_identifierinfo); - return DB; -} - -// Adds a DeclContext to the diagnostic. The enable_if template magic is here -// so that we only match those arguments that are (statically) DeclContexts; -// other arguments that derive from DeclContext (e.g., RecordDecls) will not -// match. -template<typename T> -inline -typename std::enable_if<std::is_same<T, DeclContext>::value, - const DiagnosticBuilder &>::type -operator<<(const DiagnosticBuilder &DB, T *DC) { - DB.AddTaggedVal(reinterpret_cast<intptr_t>(DC), - DiagnosticsEngine::ak_declcontext); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - SourceRange R) { - DB.AddSourceRange(CharSourceRange::getTokenRange(R)); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - ArrayRef<SourceRange> Ranges) { - for (SourceRange R : Ranges) - DB.AddSourceRange(CharSourceRange::getTokenRange(R)); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const CharSourceRange &R) { - DB.AddSourceRange(R); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const FixItHint &Hint) { - DB.AddFixItHint(Hint); - return DB; -} - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - ArrayRef<FixItHint> Hints) { - for (const FixItHint &Hint : Hints) - DB.AddFixItHint(Hint); - return DB; -} - -/// A nullability kind paired with a bit indicating whether it used a -/// context-sensitive keyword. -typedef std::pair<NullabilityKind, bool> DiagNullabilityKind; - -const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - DiagNullabilityKind nullability); - -inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc, - unsigned DiagID) { - assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); - CurDiagLoc = Loc; - CurDiagID = DiagID; - FlagValue.clear(); - return DiagnosticBuilder(this); -} - -inline DiagnosticBuilder DiagnosticsEngine::Report(unsigned DiagID) { - return Report(SourceLocation(), DiagID); -} - -//===----------------------------------------------------------------------===// -// Diagnostic -//===----------------------------------------------------------------------===// - -/// A little helper class (which is basically a smart pointer that forwards -/// info from DiagnosticsEngine) that allows clients to enquire about the -/// currently in-flight diagnostic. -class Diagnostic { - const DiagnosticsEngine *DiagObj; - StringRef StoredDiagMessage; -public: - explicit Diagnostic(const DiagnosticsEngine *DO) : DiagObj(DO) {} - Diagnostic(const DiagnosticsEngine *DO, StringRef storedDiagMessage) - : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {} - - const DiagnosticsEngine *getDiags() const { return DiagObj; } - unsigned getID() const { return DiagObj->CurDiagID; } - const SourceLocation &getLocation() const { return DiagObj->CurDiagLoc; } - bool hasSourceManager() const { return DiagObj->hasSourceManager(); } - SourceManager &getSourceManager() const { return DiagObj->getSourceManager();} - - unsigned getNumArgs() const { return DiagObj->NumDiagArgs; } - - /// \brief Return the kind of the specified index. - /// - /// Based on the kind of argument, the accessors below can be used to get - /// the value. - /// - /// \pre Idx < getNumArgs() - DiagnosticsEngine::ArgumentKind getArgKind(unsigned Idx) const { - assert(Idx < getNumArgs() && "Argument index out of range!"); - return (DiagnosticsEngine::ArgumentKind)DiagObj->DiagArgumentsKind[Idx]; - } - - /// \brief Return the provided argument string specified by \p Idx. - /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_std_string - const std::string &getArgStdStr(unsigned Idx) const { - assert(getArgKind(Idx) == DiagnosticsEngine::ak_std_string && - "invalid argument accessor!"); - return DiagObj->DiagArgumentsStr[Idx]; - } - - /// \brief Return the specified C string argument. - /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_c_string - const char *getArgCStr(unsigned Idx) const { - assert(getArgKind(Idx) == DiagnosticsEngine::ak_c_string && - "invalid argument accessor!"); - return reinterpret_cast<const char*>(DiagObj->DiagArgumentsVal[Idx]); - } - - /// \brief Return the specified signed integer argument. - /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_sint - int getArgSInt(unsigned Idx) const { - assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint && - "invalid argument accessor!"); - return (int)DiagObj->DiagArgumentsVal[Idx]; - } - - /// \brief Return the specified unsigned integer argument. - /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_uint - unsigned getArgUInt(unsigned Idx) const { - assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint && - "invalid argument accessor!"); - return (unsigned)DiagObj->DiagArgumentsVal[Idx]; - } - - /// \brief Return the specified IdentifierInfo argument. - /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_identifierinfo - const IdentifierInfo *getArgIdentifier(unsigned Idx) const { - assert(getArgKind(Idx) == DiagnosticsEngine::ak_identifierinfo && - "invalid argument accessor!"); - return reinterpret_cast<IdentifierInfo*>(DiagObj->DiagArgumentsVal[Idx]); - } - - /// \brief Return the specified non-string argument in an opaque form. - /// \pre getArgKind(Idx) != DiagnosticsEngine::ak_std_string - intptr_t getRawArg(unsigned Idx) const { - assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string && - "invalid argument accessor!"); - return DiagObj->DiagArgumentsVal[Idx]; - } - - /// \brief Return the number of source ranges associated with this diagnostic. - unsigned getNumRanges() const { - return DiagObj->DiagRanges.size(); - } - - /// \pre Idx < getNumRanges() - const CharSourceRange &getRange(unsigned Idx) const { - assert(Idx < getNumRanges() && "Invalid diagnostic range index!"); - return DiagObj->DiagRanges[Idx]; - } - - /// \brief Return an array reference for this diagnostic's ranges. - ArrayRef<CharSourceRange> getRanges() const { - return DiagObj->DiagRanges; - } - - unsigned getNumFixItHints() const { - return DiagObj->DiagFixItHints.size(); - } - - const FixItHint &getFixItHint(unsigned Idx) const { - assert(Idx < getNumFixItHints() && "Invalid index!"); - return DiagObj->DiagFixItHints[Idx]; - } - - ArrayRef<FixItHint> getFixItHints() const { - return DiagObj->DiagFixItHints; - } - - /// \brief Format this diagnostic into a string, substituting the - /// formal arguments into the %0 slots. - /// - /// The result is appended onto the \p OutStr array. - void FormatDiagnostic(SmallVectorImpl<char> &OutStr) const; - - /// \brief Format the given format-string into the output buffer using the - /// arguments stored in this diagnostic. - void FormatDiagnostic(const char *DiagStr, const char *DiagEnd, - SmallVectorImpl<char> &OutStr) const; -}; - -/** - * \brief Represents a diagnostic in a form that can be retained until its - * corresponding source manager is destroyed. - */ -class StoredDiagnostic { - unsigned ID; - DiagnosticsEngine::Level Level; - FullSourceLoc Loc; - std::string Message; - std::vector<CharSourceRange> Ranges; - std::vector<FixItHint> FixIts; - -public: - StoredDiagnostic() = default; - StoredDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info); - StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, - StringRef Message); - StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, - StringRef Message, FullSourceLoc Loc, - ArrayRef<CharSourceRange> Ranges, - ArrayRef<FixItHint> Fixits); - - /// \brief Evaluates true when this object stores a diagnostic. - explicit operator bool() const { return Message.size() > 0; } - - unsigned getID() const { return ID; } - DiagnosticsEngine::Level getLevel() const { return Level; } - const FullSourceLoc &getLocation() const { return Loc; } - StringRef getMessage() const { return Message; } - - void setLocation(FullSourceLoc Loc) { this->Loc = Loc; } - - typedef std::vector<CharSourceRange>::const_iterator range_iterator; - range_iterator range_begin() const { return Ranges.begin(); } - range_iterator range_end() const { return Ranges.end(); } - unsigned range_size() const { return Ranges.size(); } - - ArrayRef<CharSourceRange> getRanges() const { - return llvm::makeArrayRef(Ranges); - } - - - typedef std::vector<FixItHint>::const_iterator fixit_iterator; - fixit_iterator fixit_begin() const { return FixIts.begin(); } - fixit_iterator fixit_end() const { return FixIts.end(); } - unsigned fixit_size() const { return FixIts.size(); } - - ArrayRef<FixItHint> getFixIts() const { - return llvm::makeArrayRef(FixIts); - } -}; - -/// \brief Abstract interface, implemented by clients of the front-end, which -/// formats and prints fully processed diagnostics. -class DiagnosticConsumer { -protected: - unsigned NumWarnings; ///< Number of warnings reported - unsigned NumErrors; ///< Number of errors reported - -public: - DiagnosticConsumer() : NumWarnings(0), NumErrors(0) { } - - unsigned getNumErrors() const { return NumErrors; } - unsigned getNumWarnings() const { return NumWarnings; } - virtual void clear() { NumWarnings = NumErrors = 0; } - - virtual ~DiagnosticConsumer(); - - /// \brief Callback to inform the diagnostic client that processing - /// of a source file is beginning. - /// - /// Note that diagnostics may be emitted outside the processing of a source - /// file, for example during the parsing of command line options. However, - /// diagnostics with source range information are required to only be emitted - /// in between BeginSourceFile() and EndSourceFile(). - /// - /// \param LangOpts The language options for the source file being processed. - /// \param PP The preprocessor object being used for the source; this is - /// optional, e.g., it may not be present when processing AST source files. - virtual void BeginSourceFile(const LangOptions &LangOpts, - const Preprocessor *PP = nullptr) {} - - /// \brief Callback to inform the diagnostic client that processing - /// of a source file has ended. - /// - /// The diagnostic client should assume that any objects made available via - /// BeginSourceFile() are inaccessible. - virtual void EndSourceFile() {} - - /// \brief Callback to inform the diagnostic client that processing of all - /// source files has ended. - virtual void finish() {} - - /// \brief Indicates whether the diagnostics handled by this - /// DiagnosticConsumer should be included in the number of diagnostics - /// reported by DiagnosticsEngine. - /// - /// The default implementation returns true. - virtual bool IncludeInDiagnosticCounts() const; - - /// \brief Handle this diagnostic, reporting it to the user or - /// capturing it to a log as needed. - /// - /// The default implementation just keeps track of the total number of - /// warnings and errors. - virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info); -}; - -/// \brief A diagnostic client that ignores all diagnostics. -class IgnoringDiagConsumer : public DiagnosticConsumer { - virtual void anchor(); - void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info) override { - // Just ignore it. - } -}; - -/// \brief Diagnostic consumer that forwards diagnostics along to an -/// existing, already-initialized diagnostic consumer. -/// -class ForwardingDiagnosticConsumer : public DiagnosticConsumer { - DiagnosticConsumer &Target; - -public: - ForwardingDiagnosticConsumer(DiagnosticConsumer &Target) : Target(Target) {} - - ~ForwardingDiagnosticConsumer() override; - - void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, - const Diagnostic &Info) override; - void clear() override; - - bool IncludeInDiagnosticCounts() const override; -}; - -// Struct used for sending info about how a type should be printed. -struct TemplateDiffTypes { - intptr_t FromType; - intptr_t ToType; - unsigned PrintTree : 1; - unsigned PrintFromType : 1; - unsigned ElideType : 1; - unsigned ShowColors : 1; - // The printer sets this variable to true if the template diff was used. - unsigned TemplateDiffUsed : 1; -}; - -/// Special character that the diagnostic printer will use to toggle the bold -/// attribute. The character itself will be not be printed. -const char ToggleHighlight = 127; - - -/// ProcessWarningOptions - Initialize the diagnostic client and process the -/// warning options specified on the command line. -void ProcessWarningOptions(DiagnosticsEngine &Diags, - const DiagnosticOptions &Opts, - bool ReportDiags = true); - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td deleted file mode 100644 index 48cbf09..0000000 --- a/include/clang/Basic/Diagnostic.td +++ /dev/null @@ -1,127 +0,0 @@ -//===--- Diagnostic.td - C Language Family Diagnostic Handling ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the TableGen core definitions for the diagnostics -// and diagnostic control. -// -//===----------------------------------------------------------------------===// - -// Define the diagnostic severities. -class Severity<string N> { - string Name = N; -} -def SEV_Ignored : Severity<"Ignored">; -def SEV_Remark : Severity<"Remark">; -def SEV_Warning : Severity<"Warning">; -def SEV_Error : Severity<"Error">; -def SEV_Fatal : Severity<"Fatal">; - -// Define the diagnostic classes. -class DiagClass; -def CLASS_NOTE : DiagClass; -def CLASS_REMARK : DiagClass; -def CLASS_WARNING : DiagClass; -def CLASS_EXTENSION : DiagClass; -def CLASS_ERROR : DiagClass; - -// Responses to a diagnostic in a SFINAE context. -class SFINAEResponse; -def SFINAE_SubstitutionFailure : SFINAEResponse; -def SFINAE_Suppress : SFINAEResponse; -def SFINAE_Report : SFINAEResponse; -def SFINAE_AccessControl : SFINAEResponse; - -// Diagnostic Categories. These can be applied to groups or individual -// diagnostics to specify a category. -class DiagCategory<string Name> { - string CategoryName = Name; -} - -// Diagnostic Groups. -class DiagGroup<string Name, list<DiagGroup> subgroups = []> { - string GroupName = Name; - list<DiagGroup> SubGroups = subgroups; - string CategoryName = ""; -} -class InGroup<DiagGroup G> { DiagGroup Group = G; } -//class IsGroup<string Name> { DiagGroup Group = DiagGroup<Name>; } - - -// This defines all of the named diagnostic categories. -include "DiagnosticCategories.td" - -// This defines all of the named diagnostic groups. -include "DiagnosticGroups.td" - - -// All diagnostics emitted by the compiler are an indirect subclass of this. -class Diagnostic<string text, DiagClass DC, Severity defaultmapping> { - /// Component is specified by the file with a big let directive. - string Component = ?; - string Text = text; - DiagClass Class = DC; - SFINAEResponse SFINAE = SFINAE_Suppress; - bit AccessControl = 0; - bit WarningNoWerror = 0; - bit ShowInSystemHeader = 0; - Severity DefaultSeverity = defaultmapping; - DiagGroup Group; - string CategoryName = ""; -} - -class SFINAEFailure { - SFINAEResponse SFINAE = SFINAE_SubstitutionFailure; -} -class NoSFINAE { - SFINAEResponse SFINAE = SFINAE_Report; -} -class AccessControl { - SFINAEResponse SFINAE = SFINAE_AccessControl; -} - -class ShowInSystemHeader { - bit ShowInSystemHeader = 1; -} - -class SuppressInSystemHeader { - bit ShowInSystemHeader = 0; -} - -// FIXME: ExtWarn and Extension should also be SFINAEFailure by default. -class Error<string str> : Diagnostic<str, CLASS_ERROR, SEV_Error>, SFINAEFailure { - bit ShowInSystemHeader = 1; -} -class Warning<string str> : Diagnostic<str, CLASS_WARNING, SEV_Warning>; -class Remark<string str> : Diagnostic<str, CLASS_REMARK, SEV_Ignored>; -class Extension<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Ignored>; -class ExtWarn<string str> : Diagnostic<str, CLASS_EXTENSION, SEV_Warning>; -class Note<string str> : Diagnostic<str, CLASS_NOTE, SEV_Fatal/*ignored*/>; - - -class DefaultIgnore { Severity DefaultSeverity = SEV_Ignored; } -class DefaultWarn { Severity DefaultSeverity = SEV_Warning; } -class DefaultError { Severity DefaultSeverity = SEV_Error; } -class DefaultFatal { Severity DefaultSeverity = SEV_Fatal; } -class DefaultWarnNoWerror { - bit WarningNoWerror = 1; -} -class DefaultRemark { Severity DefaultSeverity = SEV_Remark; } - -// Definitions for Diagnostics. -include "DiagnosticASTKinds.td" -include "DiagnosticAnalysisKinds.td" -include "DiagnosticCommentKinds.td" -include "DiagnosticCommonKinds.td" -include "DiagnosticDriverKinds.td" -include "DiagnosticFrontendKinds.td" -include "DiagnosticLexKinds.td" -include "DiagnosticParseKinds.td" -include "DiagnosticSemaKinds.td" -include "DiagnosticSerializationKinds.td" - diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td deleted file mode 100644 index 0b37030..0000000 --- a/include/clang/Basic/DiagnosticASTKinds.td +++ /dev/null @@ -1,266 +0,0 @@ -//==--- DiagnosticASTKinds.td - libast diagnostics ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -let Component = "AST" in { - -// Constant expression diagnostics. These (and their users) belong in Sema. -def note_expr_divide_by_zero : Note<"division by zero">; -def note_constexpr_invalid_cast : Note< - "%select{reinterpret_cast|dynamic_cast|cast that performs the conversions of" - " a reinterpret_cast|cast from %1}0 is not allowed in a constant expression">; -def note_constexpr_invalid_downcast : Note< - "cannot cast object of dynamic type %0 to type %1">; -def note_constexpr_overflow : Note< - "value %0 is outside the range of representable values of type %1">; -def note_constexpr_negative_shift : Note<"negative shift count %0">; -def note_constexpr_large_shift : Note< - "shift count %0 >= width of type %1 (%2 bit%s2)">; -def note_constexpr_lshift_of_negative : Note<"left shift of negative value %0">; -def note_constexpr_lshift_discards : Note<"signed left shift discards bits">; -def note_constexpr_invalid_function : Note< - "%select{non-constexpr|undefined}0 %select{function|constructor}1 %2 cannot " - "be used in a constant expression">; -def note_constexpr_no_return : Note< - "control reached end of constexpr function">; -def note_constexpr_virtual_call : Note< - "cannot evaluate virtual function call in a constant expression">; -def note_constexpr_virtual_base : Note< - "cannot construct object of type %0 with virtual base class " - "in a constant expression">; -def note_constexpr_nonliteral : Note< - "non-literal type %0 cannot be used in a constant expression">; -def note_constexpr_non_global : Note< - "%select{pointer|reference}0 to %select{|subobject of }1" - "%select{temporary|%3}2 is not a constant expression">; -def note_constexpr_uninitialized : Note< - "%select{|sub}0object of type %1 is not initialized">; -def note_constexpr_array_index : Note<"cannot refer to element %0 of " - "%select{array of %2 elements|non-array object}1 in a constant expression">; -def note_constexpr_float_arithmetic : Note< - "floating point arithmetic produces %select{an infinity|a NaN}0">; -def note_constexpr_pointer_subtraction_not_same_array : Note< - "subtracted pointers are not elements of the same array">; -def note_constexpr_pointer_subtraction_zero_size : Note< - "subtraction of pointers to type %0 of zero size">; -def note_constexpr_pointer_comparison_base_classes : Note< - "comparison of addresses of subobjects of different base classes " - "has unspecified value">; -def note_constexpr_pointer_comparison_base_field : Note< - "comparison of address of base class subobject %0 of class %1 to field %2 " - "has unspecified value">; -def note_constexpr_pointer_comparison_differing_access : Note< - "comparison of address of fields %0 and %2 of %4 with differing access " - "specifiers (%1 vs %3) has unspecified value">; -def note_constexpr_compare_virtual_mem_ptr : Note< - "comparison of pointer to virtual member function %0 has unspecified value">; -def note_constexpr_past_end : Note< - "dereferenced pointer past the end of %select{|subobject of }0" - "%select{temporary|%2}1 is not a constant expression">; -def note_constexpr_past_end_subobject : Note< - "cannot %select{access base class of|access derived class of|access field of|" - "access array element of|ERROR|call member function on|" - "access real component of|access imaginary component of}0 " - "pointer past the end of object">; -def note_constexpr_null_subobject : Note< - "cannot %select{access base class of|access derived class of|access field of|" - "access array element of|perform pointer arithmetic on|" - "call member function on|access real component of|" - "access imaginary component of}0 null pointer">; -def note_constexpr_var_init_non_constant : Note< - "initializer of %0 is not a constant expression">; -def note_constexpr_typeid_polymorphic : Note< - "typeid applied to expression of polymorphic type %0 is " - "not allowed in a constant expression">; -def note_constexpr_void_comparison : Note< - "comparison between unequal pointers to void has unspecified result">; -def note_constexpr_temporary_here : Note<"temporary created here">; -def note_constexpr_conditional_never_const : Note< - "both arms of conditional operator are unable to produce a " - "constant expression">; -def note_constexpr_depth_limit_exceeded : Note< - "constexpr evaluation exceeded maximum depth of %0 calls">; -def note_constexpr_call_limit_exceeded : Note< - "constexpr evaluation hit maximum call limit">; -def note_constexpr_step_limit_exceeded : Note< - "constexpr evaluation hit maximum step limit; possible infinite loop?">; -def note_constexpr_this : Note< - "%select{|implicit }0use of 'this' pointer is only allowed within the " - "evaluation of a call to a 'constexpr' member function">; -def note_constexpr_lifetime_ended : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "%select{temporary|variable}1 whose lifetime has ended">; -def note_constexpr_access_uninit : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "object outside its lifetime is not allowed in a constant expression">; -def note_constexpr_use_uninit_reference : Note< - "use of reference outside its lifetime " - "is not allowed in a constant expression">; -def note_constexpr_modify_const_type : Note< - "modification of object of const-qualified type %0 is not allowed " - "in a constant expression">; -def note_constexpr_access_volatile_type : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "volatile-qualified type %1 is not allowed in a constant expression">; -def note_constexpr_access_volatile_obj : Note< - "%select{read of|assignment to|increment of|decrement of}0 volatile " - "%select{temporary|object %2|member %2}1 is not allowed in " - "a constant expression">; -def note_constexpr_ltor_mutable : Note< - "read of mutable member %0 is not allowed in a constant expression">; -def note_constexpr_ltor_non_const_int : Note< - "read of non-const variable %0 is not allowed in a constant expression">; -def note_constexpr_ltor_non_constexpr : Note< - "read of non-constexpr variable %0 is not allowed in a constant expression">; -def note_constexpr_access_null : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "dereferenced null pointer is not allowed in a constant expression">; -def note_constexpr_access_past_end : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "dereferenced one-past-the-end pointer is not allowed in a constant expression">; -def note_constexpr_access_inactive_union_member : Note< - "%select{read of|assignment to|increment of|decrement of}0 " - "member %1 of union with %select{active member %3|no active member}2 " - "is not allowed in a constant expression">; -def note_constexpr_access_static_temporary : Note< - "%select{read of|assignment to|increment of|decrement of}0 temporary " - "is not allowed in a constant expression outside the expression that " - "created the temporary">; -def note_constexpr_modify_global : Note< - "a constant expression cannot modify an object that is visible outside " - "that expression">; -def note_constexpr_stmt_expr_unsupported : Note< - "this use of statement expressions is not supported in a " - "constant expression">; -def note_constexpr_calls_suppressed : Note< - "(skipping %0 call%s0 in backtrace; use -fconstexpr-backtrace-limit=0 to " - "see all)">; -def note_constexpr_call_here : Note<"in call to '%0'">; -def note_constexpr_baa_insufficient_alignment : Note< - "%select{alignment of|offset of the aligned pointer from}0 the base pointee " - "object (%1 %plural{1:byte|:bytes}1) is %select{less than|not a multiple of}0 the " - "asserted %2 %plural{1:byte|:bytes}2">; -def note_constexpr_baa_value_insufficient_alignment : Note< - "value of the aligned pointer (%0) is not a multiple of the asserted %1 " - "%plural{1:byte|:bytes}1">; - -def warn_integer_constant_overflow : Warning< - "overflow in expression; result is %0 with type %1">, - InGroup<DiagGroup<"integer-overflow">>; - -// inline asm related. -let CategoryName = "Inline Assembly Issue" in { - def err_asm_invalid_escape : Error< - "invalid %% escape in inline assembly string">; - def err_asm_unknown_symbolic_operand_name : Error< - "unknown symbolic operand name in inline assembly string">; - - def err_asm_unterminated_symbolic_operand_name : Error< - "unterminated symbolic operand name in inline assembly string">; - def err_asm_empty_symbolic_operand_name : Error< - "empty symbolic operand name in inline assembly string">; - def err_asm_invalid_operand_number : Error< - "invalid operand number in inline asm string">; -} - -// vtable related. -let CategoryName = "VTable ABI Issue" in { - def err_vftable_ambiguous_component : Error< - "ambiguous vftable component for %0 introduced via covariant thunks; " - "this is an inherent limitation of the ABI">; - def note_covariant_thunk : Note< - "covariant thunk required by %0">; -} - -// Importing ASTs -def err_odr_variable_type_inconsistent : Error< - "external variable %0 declared with incompatible types in different " - "translation units (%1 vs. %2)">; -def err_odr_variable_multiple_def : Error< - "external variable %0 defined in multiple translation units">; -def note_odr_value_here : Note<"declared here with type %0">; -def note_odr_defined_here : Note<"also defined here">; -def err_odr_function_type_inconsistent : Error< - "external function %0 declared with incompatible types in different " - "translation units (%1 vs. %2)">; -def warn_odr_tag_type_inconsistent : Warning< - "type %0 has incompatible definitions in different translation units">, - InGroup<DiagGroup<"odr">>; -def note_odr_tag_kind_here: Note< - "%0 is a %select{struct|interface|union|class|enum}1 here">; -def note_odr_field : Note<"field %0 has type %1 here">; -def note_odr_missing_field : Note<"no corresponding field here">; -def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">; -def note_odr_not_bit_field : Note<"field %0 is not a bit-field">; -def note_odr_base : Note<"class has base type %0">; -def note_odr_virtual_base : Note< - "%select{non-virtual|virtual}0 derivation here">; -def note_odr_missing_base : Note<"no corresponding base class here">; -def note_odr_number_of_bases : Note< - "class has %0 base %plural{1:class|:classes}0">; -def note_odr_enumerator : Note<"enumerator %0 with value %1 here">; -def note_odr_missing_enumerator : Note<"no corresponding enumerator here">; - -def err_odr_field_type_inconsistent : Error< - "field %0 declared with incompatible types in different " - "translation units (%1 vs. %2)">; - -// Importing Objective-C ASTs -def err_odr_ivar_type_inconsistent : Error< - "instance variable %0 declared with incompatible types in different " - "translation units (%1 vs. %2)">; -def err_odr_objc_superclass_inconsistent : Error< - "class %0 has incompatible superclasses">; -def note_odr_objc_superclass : Note<"inherits from superclass %0 here">; -def note_odr_objc_missing_superclass : Note<"no corresponding superclass here">; -def err_odr_objc_method_result_type_inconsistent : Error< - "%select{class|instance}0 method %1 has incompatible result types in " - "different translation units (%2 vs. %3)">; -def err_odr_objc_method_num_params_inconsistent : Error< - "%select{class|instance}0 method %1 has a different number of parameters in " - "different translation units (%2 vs. %3)">; -def err_odr_objc_method_param_type_inconsistent : Error< - "%select{class|instance}0 method %1 has a parameter with a different types " - "in different translation units (%2 vs. %3)">; -def err_odr_objc_method_variadic_inconsistent : Error< - "%select{class|instance}0 method %1 is variadic in one translation unit " - "and not variadic in another">; -def note_odr_objc_method_here : Note< - "%select{class|instance}0 method %1 also declared here">; -def err_odr_objc_property_type_inconsistent : Error< - "property %0 declared with incompatible types in different " - "translation units (%1 vs. %2)">; -def err_odr_objc_property_impl_kind_inconsistent : Error< - "property %0 is implemented with %select{@synthesize|@dynamic}1 in one " - "translation but %select{@dynamic|@synthesize}1 in another translation unit">; -def note_odr_objc_property_impl_kind : Note< - "property %0 is implemented with %select{@synthesize|@dynamic}1 here">; -def err_odr_objc_synthesize_ivar_inconsistent : Error< - "property %0 is synthesized to different ivars in different translation " - "units (%1 vs. %2)">; -def note_odr_objc_synthesize_ivar_here : Note< - "property is synthesized to ivar %0 here">; - -// Importing C++ ASTs -def err_odr_different_num_template_parameters : Error< - "template parameter lists have a different number of parameters (%0 vs %1)">; -def note_odr_template_parameter_list : Note< - "template parameter list also declared here">; -def err_odr_different_template_parameter_kind : Error< - "template parameter has different kinds in different translation units">; -def note_odr_template_parameter_here : Note< - "template parameter declared here">; -def err_odr_parameter_pack_non_pack : Error< - "parameter kind mismatch; parameter is %select{not a|a}0 parameter pack">; -def note_odr_parameter_pack_non_pack : Note< - "%select{parameter|parameter pack}0 declared here">; -def err_odr_non_type_parameter_type_inconsistent : Error< - "non-type template parameter declared with incompatible types in different " - "translation units (%0 vs. %1)">; -def err_unsupported_ast_node: Error<"cannot import unsupported AST node %0">; -} diff --git a/include/clang/Basic/DiagnosticAnalysisKinds.td b/include/clang/Basic/DiagnosticAnalysisKinds.td deleted file mode 100644 index 5461212..0000000 --- a/include/clang/Basic/DiagnosticAnalysisKinds.td +++ /dev/null @@ -1,12 +0,0 @@ -//==--- DiagnosticAnalysisKinds.td - libanalysis diagnostics --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -let Component = "Analysis" in { - -} diff --git a/include/clang/Basic/DiagnosticCategories.h b/include/clang/Basic/DiagnosticCategories.h deleted file mode 100644 index 4dd067b..0000000 --- a/include/clang/Basic/DiagnosticCategories.h +++ /dev/null @@ -1,26 +0,0 @@ -//===- DiagnosticCategories.h - Diagnostic Categories Enumerators-*- C++ -*===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_DIAGNOSTICCATEGORIES_H -#define LLVM_CLANG_BASIC_DIAGNOSTICCATEGORIES_H - -namespace clang { - namespace diag { - enum { -#define GET_CATEGORY_TABLE -#define CATEGORY(X, ENUM) ENUM, -#include "clang/Basic/DiagnosticGroups.inc" -#undef CATEGORY -#undef GET_CATEGORY_TABLE - DiagCat_NUM_CATEGORIES - }; - } // end namespace diag -} // end namespace clang - -#endif diff --git a/include/clang/Basic/DiagnosticCategories.td b/include/clang/Basic/DiagnosticCategories.td deleted file mode 100644 index 37b8569..0000000 --- a/include/clang/Basic/DiagnosticCategories.td +++ /dev/null @@ -1,11 +0,0 @@ -//==--- DiagnosticCategories.td - Diagnostic Category Definitions ---------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -class CatInlineAsm : DiagCategory<"Inline Assembly Issue">; -class CatBackend : DiagCategory<"Backend Issue">; diff --git a/include/clang/Basic/DiagnosticCommentKinds.td b/include/clang/Basic/DiagnosticCommentKinds.td deleted file mode 100644 index ab24582..0000000 --- a/include/clang/Basic/DiagnosticCommentKinds.td +++ /dev/null @@ -1,172 +0,0 @@ -//==--- DiagnosticCommentKinds.td - diagnostics related to comments -------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -let Component = "Comment" in { -let CategoryName = "Documentation Issue" in { - -// HTML parsing errors. These are under -Wdocumentation to make sure the user -// knows that we didn't parse something as they might expect. - -def warn_doc_html_start_tag_expected_quoted_string : Warning< - "expected quoted string after equals sign">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_html_start_tag_expected_ident_or_greater : Warning< - "HTML start tag prematurely ended, expected attribute name or '>'">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_html_tag_started_here : Note< - "HTML tag started here">; - -// HTML semantic errors - -def warn_doc_html_end_forbidden : Warning< - "HTML end tag '%0' is forbidden">, - InGroup<DocumentationHTML>, DefaultIgnore; - -def warn_doc_html_end_unbalanced : Warning< - "HTML end tag does not match any start tag">, - InGroup<DocumentationHTML>, DefaultIgnore; - -def warn_doc_html_start_end_mismatch : Warning< - "HTML start tag '%0' closed by '%1'">, - InGroup<DocumentationHTML>, DefaultIgnore; - -def note_doc_html_end_tag : Note< - "end tag">; - -def warn_doc_html_missing_end_tag : Warning< - "HTML tag '%0' requires an end tag">, - InGroup<DocumentationHTML>, DefaultIgnore; - -// Commands - -def warn_doc_block_command_empty_paragraph : Warning< - "empty paragraph passed to '%select{\\|@}0%1' command">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_block_command_duplicate : Warning< - "duplicated command '%select{\\|@}0%1'">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_block_command_previous : Note< - "previous command '%select{\\|@}0%1' here">; - -def note_doc_block_command_previous_alias : Note< - "previous command '%select{\\|@}0%1' (an alias of '\\%2') here">; - -// \param command - -def warn_doc_param_invalid_direction : Warning< - "unrecognized parameter passing direction, " - "valid directions are '[in]', '[out]' and '[in,out]'">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_param_spaces_in_direction : Warning< - "whitespace is not allowed in parameter passing direction">, - InGroup<DocumentationPedantic>, DefaultIgnore; - -def warn_doc_param_not_attached_to_a_function_decl : Warning< - "'%select{\\|@}0param' command used in a comment that is not attached to " - "a function declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_function_method_decl_mismatch : Warning< - "'%select{\\|@}0%select{function|functiongroup|method|methodgroup|callback}1' " - "command should be used in a comment attached to " - "%select{a function|a function|an Objective-C method|an Objective-C method|" - "a pointer to function}2 declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_api_container_decl_mismatch : Warning< - "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' " - "command should not be used in a comment attached to a " - "non-%select{class|interface|protocol|struct|union}2 declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_container_decl_mismatch : Warning< - "'%select{\\|@}0%select{classdesign|coclass|dependency|helper" - "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' " - "command should not be used in a comment attached to a non-container declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_param_duplicate : Warning< - "parameter '%0' is already documented">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_param_previous : Note< - "previous documentation">; - -def warn_doc_param_not_found : Warning< - "parameter '%0' not found in the function declaration">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_param_name_suggestion : Note< - "did you mean '%0'?">; - -// tparam command - -def warn_doc_tparam_not_attached_to_a_template_decl : Warning< - "'%select{\\|@}0tparam' command used in a comment that is not attached to " - "a template declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_tparam_duplicate : Warning< - "template parameter '%0' is already documented">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_tparam_previous : Note< - "previous documentation">; - -def warn_doc_tparam_not_found : Warning< - "template parameter '%0' not found in the template declaration">, - InGroup<Documentation>, DefaultIgnore; - -def note_doc_tparam_name_suggestion : Note< - "did you mean '%0'?">; - -// \returns command - -def warn_doc_returns_not_attached_to_a_function_decl : Warning< - "'%select{\\|@}0%1' command used in a comment that is not attached to " - "a function or method declaration">, - InGroup<Documentation>, DefaultIgnore; - -def warn_doc_returns_attached_to_a_void_function : Warning< - "'%select{\\|@}0%1' command used in a comment that is attached to a " - "%select{function returning void|constructor|destructor|" - "method returning void}2">, - InGroup<Documentation>, DefaultIgnore; - -// \deprecated command - -def warn_doc_deprecated_not_sync : Warning< - "declaration is marked with '\\deprecated' command but does not have " - "a deprecation attribute">, - InGroup<DocumentationDeprecatedSync>, DefaultIgnore; - -def note_add_deprecation_attr : Note< - "add a deprecation attribute to the declaration to silence this warning">; - -// verbatim block commands - -def warn_verbatim_block_end_without_start : Warning< - "'%select{\\|@}0%1' command does not terminate a verbatim text block">, - InGroup<Documentation>, DefaultIgnore; - -def warn_unknown_comment_command_name : Warning< - "unknown command tag name">, - InGroup<DocumentationUnknownCommand>, DefaultIgnore; - -def warn_correct_comment_command_name : Warning< - "unknown command tag name '%0'; did you mean '%1'?">, - InGroup<DocumentationUnknownCommand>, DefaultIgnore; - -} // end of documentation issue category -} // end of AST component diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td deleted file mode 100644 index ccc271a..0000000 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ /dev/null @@ -1,217 +0,0 @@ -//==--- DiagnosticCommonKinds.td - common diagnostics ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// Common Helpers -//===----------------------------------------------------------------------===// - -let Component = "Common" in { - -// Basic. - -def fatal_too_many_errors - : Error<"too many errors emitted, stopping now">, DefaultFatal; - -def note_declared_at : Note<"declared here">; -def note_previous_definition : Note<"previous definition is here">; -def note_previous_declaration : Note<"previous declaration is here">; -def note_previous_implicit_declaration : Note< - "previous implicit declaration is here">; -def note_previous_use : Note<"previous use is here">; -def note_duplicate_case_prev : Note<"previous case defined here">; -def note_forward_declaration : Note<"forward declaration of %0">; -def note_type_being_defined : Note< - "definition of %0 is not complete until the closing '}'">; -/// note_matching - this is used as a continuation of a previous diagnostic, -/// e.g. to specify the '(' when we expected a ')'. -def note_matching : Note<"to match this %0">; - -def note_using : Note<"using">; -def note_possibility : Note<"one possibility">; -def note_also_found : Note<"also found">; - -// Parse && Lex - -let CategoryName = "Lexical or Preprocessor Issue" in { - -def err_expected_colon_after_setter_name : Error< - "method name referenced in property setter attribute " - "must end with ':'">; -def err_expected_string_literal : Error<"expected string literal " - "%select{in %1|for diagnostic message in static_assert|" - "for optional message in 'availability' attribute}0">; -def err_invalid_string_udl : Error< - "string literal with user-defined suffix cannot be used here">; -def err_invalid_character_udl : Error< - "character literal with user-defined suffix cannot be used here">; -def err_invalid_numeric_udl : Error< - "numeric literal with user-defined suffix cannot be used here">; - -} - -// Parse && Sema - -let CategoryName = "Parse Issue" in { - -def err_expected : Error<"expected %0">; -def err_expected_either : Error<"expected %0 or %1">; -def err_expected_after : Error<"expected %1 after %0">; - -def err_param_redefinition : Error<"redefinition of parameter %0">; -def warn_method_param_redefinition : Warning<"redefinition of method parameter %0">; -def warn_method_param_declaration : Warning<"redeclaration of method parameter %0">, - InGroup<DuplicateArgDecl>, DefaultIgnore; -def err_invalid_storage_class_in_func_decl : Error< - "invalid storage class specifier in function declarator">; -def err_expected_namespace_name : Error<"expected namespace name">; -def ext_variadic_templates : ExtWarn< - "variadic templates are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_variadic_templates : - Warning<"variadic templates are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_default_special_members : Error< - "only special member functions may be defaulted">; -def err_deleted_non_function : Error< - "only functions can have deleted definitions">; -def err_module_not_found : Error<"module '%0' not found">, DefaultFatal; -def err_module_not_built : Error<"could not build module '%0'">, DefaultFatal; -def err_module_build_disabled: Error< - "module '%0' is needed but has not been provided, and implicit use of module " - "files is disabled">, DefaultFatal; -def err_module_unavailable : Error< - "module '%0' %select{is incompatible with|requires}1 feature '%2'">; -def err_module_header_missing : Error< - "%select{|umbrella }0header '%1' not found">; -def err_module_lock_failure : Error< - "could not acquire lock file for module '%0'">, DefaultFatal; -def err_module_lock_timeout : Error< - "timed out waiting to acquire lock file for module '%0'">, DefaultFatal; -def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, - DefaultFatal; -def note_pragma_entered_here : Note<"#pragma entered here">; -def note_decl_hiding_tag_type : Note< - "%1 %0 is hidden by a non-type declaration of %0 here">; -def err_attribute_not_type_attr : Error< - "%0 attribute cannot be applied to types">; -def err_enum_template : Error<"enumeration cannot be a template">; - -} - -let CategoryName = "Nullability Issue" in { - -def warn_nullability_duplicate : Warning< - "duplicate nullability specifier %0">, - InGroup<Nullability>; - -def warn_conflicting_nullability_attr_overriding_ret_types : Warning< - "conflicting nullability specifier on return types, %0 " - "conflicts with existing specifier %1">, - InGroup<Nullability>; - -def warn_conflicting_nullability_attr_overriding_param_types : Warning< - "conflicting nullability specifier on parameter types, %0 " - "conflicts with existing specifier %1">, - InGroup<Nullability>; - -def err_nullability_conflicting : Error< - "nullability specifier %0 conflicts with existing specifier %1">; - -} - -// Sema && Lex -def ext_c99_longlong : Extension< - "'long long' is an extension when C99 mode is not enabled">, - InGroup<LongLong>; -def ext_cxx11_longlong : Extension< - "'long long' is a C++11 extension">, - InGroup<CXX11LongLong>; -def warn_cxx98_compat_longlong : Warning< - "'long long' is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def err_integer_literal_too_large : Error< - "integer literal is too large to be represented in any %select{signed |}0" - "integer type">; -def ext_integer_literal_too_large_for_signed : ExtWarn< - "integer literal is too large to be represented in a signed integer type, " - "interpreting as unsigned">, - InGroup<ImplicitlyUnsignedLiteral>; -def warn_old_implicitly_unsigned_long : Warning< - "integer literal is too large to be represented in type 'long', " - "interpreting as 'unsigned long' per C89; this literal will " - "%select{have type 'long long'|be ill-formed}0 in C99 onwards">, - InGroup<C99Compat>; -def warn_old_implicitly_unsigned_long_cxx : Warning< - "integer literal is too large to be represented in type 'long', " - "interpreting as 'unsigned long' per C++98; this literal will " - "%select{have type 'long long'|be ill-formed}0 in C++11 onwards">, - InGroup<CXX11Compat>; -def ext_old_implicitly_unsigned_long_cxx : ExtWarn< - "integer literal is too large to be represented in type 'long' and is " - "subject to undefined behavior under C++98, interpreting as 'unsigned long'; " - "this literal will %select{have type 'long long'|be ill-formed}0 " - "in C++11 onwards">, - InGroup<CXX11Compat>; - -// SEH -def err_seh_expected_handler : Error< - "expected '__except' or '__finally' block">; -def err_seh___except_block : Error< - "%0 only allowed in __except block or filter expression">; -def err_seh___except_filter : Error< - "%0 only allowed in __except filter expression">; -def err_seh___finally_block : Error< - "%0 only allowed in __finally block">; - -// Sema && AST -def note_invalid_subexpr_in_const_expr : Note< - "subexpression not valid in a constant expression">; - -// Targets - -def err_target_unknown_triple : Error< - "unknown target triple '%0', please use -triple or -arch">; -def err_target_unknown_cpu : Error<"unknown target CPU '%0'">; -def err_target_unknown_abi : Error<"unknown target ABI '%0'">; -def err_target_unknown_fpmath : Error<"unknown FP unit '%0'">; -def err_target_unsupported_fpmath : Error< - "the '%0' unit is not supported with this instruction set">; -def err_target_unsupported_unaligned : Error< - "the %0 sub-architecture does not support unaligned accesses">; -def err_opt_not_valid_with_opt : Error< - "option '%0' cannot be specified with '%1'">; - -// Source manager -def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal; -def err_file_modified : Error< - "file '%0' modified since it was first processed">, DefaultFatal; -def err_unsupported_bom : Error<"%0 byte order mark detected in '%1', but " - "encoding is not supported">, DefaultFatal; -def err_unable_to_rename_temp : Error< - "unable to rename temporary '%0' to output file '%1': '%2'">; -def err_unable_to_make_temp : Error< - "unable to make temporary file: %0">; - -// Modules -def err_module_format_unhandled : Error< - "no handler registered for module format '%0'">, DefaultFatal; - -// TransformActions -// TODO: Use a custom category name to distinguish rewriter errors. -def err_mt_message : Error<"[rewriter] %0">, SuppressInSystemHeader; -def warn_mt_message : Warning<"[rewriter] %0">; -def note_mt_message : Note<"[rewriter] %0">; - -// ARCMigrate -def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">; -def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">; - -// OpenMP -def err_omp_more_one_clause : Error< - "directive '#pragma omp %0' cannot contain more than one '%1' clause%select{| with '%3' name modifier| with 'source' dependence}2">; -} diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td deleted file mode 100644 index ce270bf..0000000 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ /dev/null @@ -1,226 +0,0 @@ -//==--- DiagnosticDriverKinds.td - libdriver diagnostics ------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -let Component = "Driver" in { - -def err_drv_no_such_file : Error<"no such file or directory: '%0'">; -def err_drv_unsupported_opt : Error<"unsupported option '%0'">; -def err_drv_unsupported_opt_for_target : Error< - "unsupported option '%0' for target '%1'">; -def err_drv_unsupported_option_argument : Error< - "unsupported argument '%1' to option '%0'">; -def err_drv_unknown_stdin_type : Error< - "-E or -x required when input is from standard input">; -def err_drv_unknown_stdin_type_clang_cl : Error< - "use /Tc or /Tp to set input type for standard input">; -def err_drv_unknown_language : Error<"language not recognized: '%0'">; -def err_drv_invalid_arch_name : Error< - "invalid arch name '%0'">; -def err_drv_invalid_thread_model_for_target : Error< - "invalid thread model '%0' in '%1' for this target">; -def err_drv_invalid_linker_name : Error< - "invalid linker name in argument '%0'">; -def err_drv_invalid_rtlib_name : Error< - "invalid runtime library name in argument '%0'">; -def err_drv_unsupported_rtlib_for_platform : Error< - "unsupported runtime library '%0' for platform '%1'">; -def err_drv_invalid_stdlib_name : Error< - "invalid library name in argument '%0'">; -def err_drv_invalid_output_with_multiple_archs : Error< - "cannot use '%0' output with multiple -arch options">; -def err_drv_no_input_files : Error<"no input files">; -def err_drv_use_of_Z_option : Error< - "unsupported use of internal gcc -Z option '%0'">; -def err_drv_output_argument_with_multiple_files : Error< - "cannot specify -o when generating multiple output files">; -def err_drv_out_file_argument_with_multiple_sources : Error< - "cannot specify '%0%1' when compiling multiple source files">; -def err_no_external_assembler : Error< - "there is no external assembler that can be used on this platform">; -def err_drv_unable_to_remove_file : Error< - "unable to remove file: %0">; -def err_drv_command_failure : Error< - "unable to execute command: %0">; -def err_drv_invalid_darwin_version : Error< - "invalid Darwin version number: %0">; -def err_drv_missing_argument : Error< - "argument to '%0' is missing (expected %1 value%s1)">; -def err_drv_invalid_Xarch_argument_with_args : Error< - "invalid Xarch argument: '%0', options requiring arguments are unsupported">; -def err_drv_invalid_Xarch_argument_isdriver : Error< - "invalid Xarch argument: '%0', cannot change driver behavior inside Xarch argument">; -def err_drv_argument_only_allowed_with : Error< - "invalid argument '%0' only allowed with '%1'">; -def err_drv_argument_not_allowed_with : Error< - "invalid argument '%0' not allowed with '%1'">; -def err_drv_invalid_version_number : Error< - "invalid version number in '%0'">; -def err_drv_no_linker_llvm_support : Error< - "'%0': unable to pass LLVM bit-code files to linker">; -def err_drv_no_ast_support : Error< - "'%0': unable to use AST files with this tool">; -def err_drv_no_module_support : Error< - "'%0': unable to use module files with this tool">; -def err_drv_clang_unsupported : Error< - "the clang compiler does not support '%0'">; -def err_drv_clang_unsupported_opt_cxx_darwin_i386 : Error< - "the clang compiler does not support '%0' for C++ on Darwin/i386">; -def err_drv_command_failed : Error< - "%0 command failed with exit code %1 (use -v to see invocation)">; -def err_drv_command_signalled : Error< - "%0 command failed due to signal (use -v to see invocation)">; -def err_drv_force_crash : Error< - "failing because environment variable '%0' is set">; -def err_drv_invalid_mfloat_abi : Error< - "invalid float ABI '%0'">; -def err_drv_invalid_libcxx_deployment : Error< - "invalid deployment target for -stdlib=libc++ (requires %0 or later)">; -def err_drv_invalid_argument_to_fdebug_prefix_map : Error< - "invalid argument '%0' to -fdebug-prefix-map">; -def err_drv_malformed_sanitizer_blacklist : Error< - "malformed sanitizer blacklist: '%0'">; - -def err_target_unsupported_arch - : Error<"the target architecture '%0' is not supported by the target '%1'">; - -def err_drv_I_dash_not_supported : Error< - "'%0' not supported, please use -iquote instead">; -def err_drv_unknown_argument : Error<"unknown argument: '%0'">; -def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">; -def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; -def err_drv_invalid_remap_file : Error< - "invalid option '%0' not of the form <from-file>;<to-file>">; -def err_drv_invalid_gcc_output_type : Error< - "invalid output type '%0' for use with gcc tool">; -def err_drv_cc_print_options_failure : Error< - "unable to open CC_PRINT_OPTIONS file: %0">; -def err_drv_preamble_format : Error< - "incorrect format for -preamble-bytes=N,END">; -def err_drv_conflicting_deployment_targets : Error< - "conflicting deployment targets, both '%0' and '%1' are present in environment">; -def err_drv_objc_gc_arr : Error< - "cannot specify both '-fobjc-arc' and '%0'">; -def err_arc_unsupported_on_runtime : Error< - "-fobjc-arc is not supported on platforms using the legacy runtime">; -def err_arc_unsupported_on_toolchain : Error< // feel free to generalize this - "-fobjc-arc is not supported on versions of OS X prior to 10.6">; -def err_objc_weak_with_gc : Error< - "-fobjc-weak is not supported in Objective-C garbage collection">; -def err_objc_weak_unsupported : Error< - "-fobjc-weak is not supported on the current deployment target">; -def err_drv_mg_requires_m_or_mm : Error< - "option '-MG' requires '-M' or '-MM'">; -def err_drv_unknown_objc_runtime : Error< - "unknown or ill-formed Objective-C runtime '%0'">; -def err_drv_emit_llvm_link : Error< - "-emit-llvm cannot be used when linking">; -def err_drv_optimization_remark_pattern : Error< - "%0 in '%1'">; -def err_drv_no_neon_modifier : Error<"[no]neon is not accepted as modifier, please use [no]simd instead">; -def err_drv_invalid_omp_target : Error<"OpenMP target is invalid: '%0'">; -def err_drv_omp_host_ir_file_not_found : Error< - "The provided host compiler IR file '%0' is required to generate code for OpenMP target regions but cannot be found.">; - -def warn_O4_is_O3 : Warning<"-O4 is equivalent to -O3">, InGroup<Deprecated>; -def warn_drv_lto_libpath : Warning<"libLTO.dylib relative to clang installed dir not found; using 'ld' default search path instead">, - InGroup<LibLTO>; -def warn_drv_optimization_value : Warning<"optimization level '%0' is not supported; using '%1%2' instead">, - InGroup<InvalidCommandLineArgument>; -def warn_ignored_gcc_optimization : Warning<"optimization flag '%0' is not supported">, - InGroup<IgnoredOptimizationArgument>; -def warn_c_kext : Warning< - "ignoring -fapple-kext which is valid for C++ and Objective-C++ only">; -def warn_drv_input_file_unused : Warning< - "%0: '%1' input unused%select{ when '%3' is present|}2">, - InGroup<UnusedCommandLineArgument>; -def warn_drv_input_file_unused_by_cpp : Warning< - "%0: '%1' input unused in cpp mode">, - InGroup<UnusedCommandLineArgument>; -def warn_drv_preprocessed_input_file_unused : Warning< - "%0: previously preprocessed input%select{ unused when '%2' is present|}1">, - InGroup<UnusedCommandLineArgument>; -def warn_drv_unused_argument : Warning< - "argument unused during compilation: '%0'">, - InGroup<UnusedCommandLineArgument>; -def warn_drv_empty_joined_argument : Warning< - "joined argument expects additional value: '%0'">, - InGroup<UnusedCommandLineArgument>; -def warn_drv_clang_unsupported : Warning< - "the clang compiler does not support '%0'">; -def warn_drv_deprecated_arg : Warning< - "argument '%0' is deprecated, use '%1' instead">, InGroup<Deprecated>; -def warn_drv_assuming_mfloat_abi_is : Warning< - "unknown platform, assuming -mfloat-abi=%0">; -def warn_ignoring_ftabstop_value : Warning< - "ignoring invalid -ftabstop value '%0', using default value %1">; -def warn_drv_overriding_flag_option : Warning< - "overriding '%0' option with '%1'">, - InGroup<DiagGroup<"overriding-t-option">>; -def warn_drv_treating_input_as_cxx : Warning< - "treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">, - InGroup<Deprecated>; -def warn_drv_objc_gc_unsupported : Warning< - "Objective-C garbage collection is not supported on this platform, ignoring '%0'">; -def warn_drv_pch_not_first_include : Warning< - "precompiled header '%0' was ignored because '%1' is not first '-include'">; -def warn_missing_sysroot : Warning<"no such sysroot directory: '%0'">, - InGroup<DiagGroup<"missing-sysroot">>; -def warn_debug_compression_unavailable : Warning<"cannot compress debug sections (zlib not installed)">, - InGroup<DiagGroup<"debug-compression-unavailable">>; -def warn_drv_enabling_rtti_with_exceptions : Warning< - "implicitly enabling rtti for exception handling">, - InGroup<DiagGroup<"rtti-for-exceptions">>; -def warn_drv_disabling_vptr_no_rtti_default : Warning< - "implicitly disabling vptr sanitizer because rtti wasn't enabled">, - InGroup<DiagGroup<"auto-disable-vptr-sanitizer">>; - -def note_drv_command_failed_diag_msg : Note< - "diagnostic msg: %0">; -def note_drv_t_option_is_global : Note< - "The last /TC or /TP option takes precedence over earlier instances">; -def note_drv_address_sanitizer_debug_runtime : Note< - "AddressSanitizer doesn't support linking with debug runtime libraries yet">; - -def err_analyzer_config_no_value : Error< - "analyzer-config option '%0' has a key but no value">; -def err_analyzer_config_multiple_values : Error< - "analyzer-config option '%0' should contain only one '='">; - -def err_drv_modules_validate_once_requires_timestamp : Error< - "option '-fmodules-validate-once-per-build-session' requires " - "'-fbuild-session-timestamp=<seconds since Epoch>' or '-fbuild-session-file=<file>'">; - -def err_test_module_file_extension_format : Error< - "-ftest-module-file-extension argument '%0' is not of the required form " - "'blockname:major:minor:hashed:user info'">; - -def warn_drv_invoking_fallback : Warning<"falling back to %0">, - InGroup<Fallback>; - -def warn_target_unsupported_nan2008 : Warning< - "ignoring '-mnan=2008' option because the '%0' architecture does not support it">, - InGroup<UnsupportedNan>; -def warn_target_unsupported_nanlegacy : Warning< - "ignoring '-mnan=legacy' option because the '%0' architecture does not support it">, - InGroup<UnsupportedNan>; - -def warn_drv_unable_to_find_directory_expected : Warning< - "unable to find %0 directory, expected to be in '%1'">, - InGroup<InvalidOrNonExistentDirectory>, DefaultIgnore; - -def warn_drv_ps4_force_pic : Warning< - "option '%0' was ignored by the PS4 toolchain, using '-fPIC'">, - InGroup<OptionIgnored>; - -def warn_drv_ps4_sdk_dir : Warning< - "environment variable SCE_PS4_SDK_DIR is set, but points to invalid or nonexistent directory '%0'">, - InGroup<InvalidOrNonExistentDirectory>; - -def err_drv_unsupported_linker : Error<"unsupported value '%0' for -linker option">; -} diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td deleted file mode 100644 index 033834b..0000000 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ /dev/null @@ -1,219 +0,0 @@ -//==--- DiagnosticFrontendKinds.td - frontend diagnostics -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -class BackendInfo : CatBackend, ShowInSystemHeader; - -let Component = "Frontend" in { - -def err_fe_error_opening : Error<"error opening '%0': %1">; -def err_fe_error_reading : Error<"error reading '%0'">; -def err_fe_error_reading_stdin : Error<"error reading stdin: %0">; -def err_fe_error_backend : Error<"error in backend: %0">, DefaultFatal; - -def err_fe_inline_asm : Error<"%0">, CatInlineAsm; -def warn_fe_inline_asm : Warning<"%0">, CatInlineAsm, InGroup<BackendInlineAsm>; -def note_fe_inline_asm : Note<"%0">, CatInlineAsm; -def note_fe_inline_asm_here : Note<"instantiated into assembly here">; -def err_fe_cannot_link_module : Error<"cannot link module '%0': %1">, - DefaultFatal; - -def warn_fe_frame_larger_than : Warning<"stack frame size of %0 bytes in %q1">, - BackendInfo, InGroup<BackendFrameLargerThanEQ>; -def warn_fe_backend_frame_larger_than: Warning<"%0">, - BackendInfo, InGroup<BackendFrameLargerThanEQ>; -def err_fe_backend_frame_larger_than: Error<"%0">, BackendInfo; -def note_fe_backend_frame_larger_than: Note<"%0">, BackendInfo; - -def warn_fe_backend_plugin: Warning<"%0">, BackendInfo, InGroup<BackendPlugin>; -def err_fe_backend_plugin: Error<"%0">, BackendInfo; -def remark_fe_backend_plugin: Remark<"%0">, BackendInfo, InGroup<RemarkBackendPlugin>; -def note_fe_backend_plugin: Note<"%0">, BackendInfo; - -def warn_fe_override_module : Warning< - "overriding the module target triple with %0">, - InGroup<DiagGroup<"override-module">>; - -def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo, - InGroup<BackendOptimizationRemark>; -def remark_fe_backend_optimization_remark_missed : Remark<"%0">, BackendInfo, - InGroup<BackendOptimizationRemarkMissed>; -def remark_fe_backend_optimization_remark_analysis : Remark<"%0">, BackendInfo, - InGroup<BackendOptimizationRemarkAnalysis>; -def remark_fe_backend_optimization_remark_analysis_fpcommute : Remark<"%0; " - "allow reordering by specifying '#pragma clang loop vectorize(enable)' " - "before the loop or by providing the compiler option '-ffast-math'.">, - BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>; -def remark_fe_backend_optimization_remark_analysis_aliasing : Remark<"%0; " - "allow reordering by specifying '#pragma clang loop vectorize(enable)' " - "before the loop. If the arrays will always be independent specify " - "'#pragma clang loop vectorize(assume_safety)' before the loop or provide " - "the '__restrict__' qualifier with the independent array arguments. " - "Erroneous results will occur if these options are incorrectly applied!">, - BackendInfo, InGroup<BackendOptimizationRemarkAnalysis>; -def warn_fe_backend_optimization_failure : Warning<"%0">, BackendInfo, - InGroup<BackendOptimizationFailure>, DefaultWarn; -def note_fe_backend_optimization_remark_invalid_loc : Note<"could " - "not determine the original source location for %0:%1:%2">; - -def remark_sanitize_address_insert_extra_padding_accepted : Remark< - "-fsanitize-address-field-padding applied to %0">, ShowInSystemHeader, - InGroup<SanitizeAddressRemarks>; -def remark_sanitize_address_insert_extra_padding_rejected : Remark< - "-fsanitize-address-field-padding ignored for %0 because it " - "%select{is not C++|is packed|is a union|is trivially copyable|" - "has trivial destructor|is standard layout|is in a blacklisted file|" - "is blacklisted}1">, ShowInSystemHeader, - InGroup<SanitizeAddressRemarks>; - -def err_fe_invalid_code_complete_file : Error< - "cannot locate code-completion file %0">, DefaultFatal; -def err_fe_stdout_binary : Error<"unable to change standard output to binary">, - DefaultFatal; -def err_fe_dependency_file_requires_MT : Error< - "-dependency-file requires at least one -MT or -MQ option">; -def err_fe_invalid_plugin_name : Error< - "unable to find plugin '%0'">; -def err_fe_expected_compiler_job : Error< - "unable to handle compilation, expected exactly one compiler job in '%0'">; -def err_fe_expected_clang_command : Error< - "expected a clang compiler command">; -def err_fe_remap_missing_to_file : Error< - "could not remap file '%0' to the contents of file '%1'">, DefaultFatal; -def err_fe_remap_missing_from_file : Error< - "could not remap from missing file '%0'">, DefaultFatal; -def err_fe_unable_to_load_pch : Error< - "unable to load PCH file">; -def err_fe_unable_to_load_plugin : Error< - "unable to load plugin '%0': '%1'">; -def err_fe_unable_to_create_target : Error< - "unable to create target: '%0'">; -def err_fe_unable_to_interface_with_target : Error< - "unable to interface with target machine">; -def err_fe_unable_to_open_output : Error< - "unable to open output file '%0': '%1'">; -def err_fe_pth_file_has_no_source_header : Error< - "PTH file '%0' does not designate an original source header file for -include-pth">; -def warn_fe_macro_contains_embedded_newline : Warning< - "macro '%0' contains embedded newline; text after the newline is ignored">; -def warn_fe_cc_print_header_failure : Warning< - "unable to open CC_PRINT_HEADERS file: %0 (using stderr)">; -def warn_fe_cc_log_diagnostics_failure : Warning< - "unable to open CC_LOG_DIAGNOSTICS file: %0 (using stderr)">; -def err_fe_no_pch_in_dir : Error< - "no suitable precompiled header file found in directory '%0'">; -def err_fe_action_not_available : Error< - "action %0 not compiled in">; - -def warn_fe_serialized_diag_merge_failure : Warning< - "unable to merge a subprocess's serialized diagnostics">, - InGroup<SerializedDiagnostics>; -def warn_fe_serialized_diag_failure : Warning< - "unable to open file %0 for serializing diagnostics (%1)">, - InGroup<SerializedDiagnostics>; - -def err_verify_missing_line : Error< - "missing or invalid line number following '@' in expected %0">; -def err_verify_missing_file : Error< - "file '%0' could not be located in expected %1">; -def err_verify_invalid_range : Error< - "invalid range following '-' in expected %0">; -def err_verify_missing_start : Error< - "cannot find start ('{{') of expected %0">; -def err_verify_missing_end : Error< - "cannot find end ('}}') of expected %0">; -def err_verify_invalid_content : Error< - "invalid expected %0: %1">; -def err_verify_missing_regex : Error< - "cannot find start of regex ('{{') in %0">; -def err_verify_inconsistent_diags : Error< - "'%0' diagnostics %select{expected|seen}1 but not %select{seen|expected}1: " - "%2">; -def err_verify_invalid_no_diags : Error< - "%select{expected|'expected-no-diagnostics'}0 directive cannot follow " - "%select{'expected-no-diagnostics' directive|other expected directives}0">; -def err_verify_no_directives : Error< - "no expected directives found: consider use of 'expected-no-diagnostics'">; - -def note_fixit_applied : Note<"FIX-IT applied suggested code changes">; -def note_fixit_in_macro : Note< - "FIX-IT unable to apply suggested code changes in a macro">; -def note_fixit_failed : Note< - "FIX-IT unable to apply suggested code changes">; -def note_fixit_unfixed_error : Note<"FIX-IT detected an error it cannot fix">; -def warn_fixit_no_changes : Note< - "FIX-IT detected errors it could not fix; no output will be generated">; - -// PCH reader -def err_relocatable_without_isysroot : Error< - "must specify system root with -isysroot when building a relocatable " - "PCH file">; - -def warn_unknown_diag_option : Warning< - "unknown %select{warning|remark}0 option '%1'%select{|; did you mean '%3'?}2">, - InGroup<UnknownWarningOption>; -def warn_unknown_warning_specifier : Warning< - "unknown %0 warning specifier: '%1'">, - InGroup<UnknownWarningOption>; - -def err_unknown_analyzer_checker : Error< - "no analyzer checkers are associated with '%0'">; -def note_suggest_disabling_all_checkers : Note< - "use -analyzer-disable-all-checks to disable all static analyzer checkers">; - -def warn_incompatible_analyzer_plugin_api : Warning< - "checker plugin '%0' is not compatible with this version of the analyzer">, - InGroup<DiagGroup<"analyzer-incompatible-plugin"> >; -def note_incompatible_analyzer_plugin_api : Note< - "current API version is '%0', but plugin was compiled with version '%1'">; - -def warn_module_config_mismatch : Warning< - "module file %0 cannot be loaded due to a configuration mismatch with the current " - "compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError; -def err_module_map_not_found : Error<"module map file '%0' not found">, - DefaultFatal; -def err_missing_module_name : Error< - "no module name provided; specify one with -fmodule-name=">, - DefaultFatal; -def err_missing_module : Error< - "no module named '%0' declared in module map file '%1'">, DefaultFatal; -def err_no_submodule : Error<"no submodule named %0 in module '%1'">; -def err_no_submodule_suggest : Error< - "no submodule named %0 in module '%1'; did you mean '%2'?">; -def warn_missing_submodule : Warning<"missing submodule '%0'">, - InGroup<IncompleteUmbrella>; -def err_module_cannot_create_includes : Error< - "cannot create includes file for module %0: %1">; -def warn_module_config_macro_undef : Warning< - "%select{definition|#undef}0 of configuration macro '%1' has no effect on " - "the import of '%2'; pass '%select{-D%1=...|-U%1}0' on the command line " - "to configure the module">, - InGroup<ConfigMacros>; -def note_module_def_undef_here : Note< - "macro was %select{defined|#undef'd}0 here">; -def remark_module_build : Remark<"building module '%0' as '%1'">, - InGroup<ModuleBuild>; -def remark_module_build_done : Remark<"finished building module '%0'">, - InGroup<ModuleBuild>; -def err_modules_embed_file_not_found : - Error<"file '%0' specified by '-fmodules-embed-file=' not found">, - DefaultFatal; - -def err_test_module_file_extension_version : Error< - "test module file extension '%0' has different version (%1.%2) than expected " - "(%3.%4)">; - -def err_conflicting_module_names : Error< - "conflicting module names specified: '-fmodule-name=%0' and " - "'-fmodule-implementation-of %1'">; - -def err_missing_vfs_overlay_file : Error< - "virtual filesystem overlay file '%0' not found">, DefaultFatal; -def err_invalid_vfs_overlay : Error< - "invalid virtual filesystem overlay file '%0'">, DefaultFatal; -} diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td deleted file mode 100644 index 8e5f57d..0000000 --- a/include/clang/Basic/DiagnosticGroups.td +++ /dev/null @@ -1,848 +0,0 @@ -//==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">; -def ImplicitInt : DiagGroup<"implicit-int">; - -// Aggregation warning settings. -def Implicit : DiagGroup<"implicit", [ - ImplicitFunctionDeclare, - ImplicitInt -]>; - -// Empty DiagGroups are recognized by clang but ignored. -def : DiagGroup<"abi">; -def AbsoluteValue : DiagGroup<"absolute-value">; -def AddressOfTemporary : DiagGroup<"address-of-temporary">; -def : DiagGroup<"aggregate-return">; -def GNUAlignofExpression : DiagGroup<"gnu-alignof-expression">; -def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">; -def GNUAnonymousStruct : DiagGroup<"gnu-anonymous-struct">; -def GNUAutoType : DiagGroup<"gnu-auto-type">; -def ArrayBounds : DiagGroup<"array-bounds">; -def ArrayBoundsPointerArithmetic : DiagGroup<"array-bounds-pointer-arithmetic">; -def Availability : DiagGroup<"availability">; -def Section : DiagGroup<"section">; -def AutoImport : DiagGroup<"auto-import">; -def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">; -def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">; -def GNUCompoundLiteralInitializer : DiagGroup<"gnu-compound-literal-initializer">; -def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion">; -def BitFieldWidth : DiagGroup<"bitfield-width">; -def ConstantConversion : - DiagGroup<"constant-conversion", [ BitFieldConstantConversion ] >; -def LiteralConversion : DiagGroup<"literal-conversion">; -def StringConversion : DiagGroup<"string-conversion">; -def SignConversion : DiagGroup<"sign-conversion">; -def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">; -def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">; -def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion, - UndefinedBoolConversion]>; -def IntConversion : DiagGroup<"int-conversion">; -def EnumConversion : DiagGroup<"enum-conversion">; -def FloatConversion : DiagGroup<"float-conversion">; -def DoublePromotion : DiagGroup<"double-promotion">; -def EnumTooLarge : DiagGroup<"enum-too-large">; -def UnsupportedNan : DiagGroup<"unsupported-nan">; -def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">; -def NullConversion : DiagGroup<"null-conversion">; -def ImplicitConversionFloatingPointToBool : - DiagGroup<"implicit-conversion-floating-point-to-bool">; -def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">; -def BadArrayNewLength : DiagGroup<"bad-array-new-length">; -def MacroRedefined : DiagGroup<"macro-redefined">; -def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">; -def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">; -def C99Compat : DiagGroup<"c99-compat">; -def CXXCompat: DiagGroup<"c++-compat">; -def ExternCCompat : DiagGroup<"extern-c-compat">; -def KeywordCompat : DiagGroup<"keyword-compat">; -def GNUCaseRange : DiagGroup<"gnu-case-range">; -def CastAlign : DiagGroup<"cast-align">; -def CastQual : DiagGroup<"cast-qual">; -def : DiagGroup<"char-align">; -def Comment : DiagGroup<"comment">; -def GNUComplexInteger : DiagGroup<"gnu-complex-integer">; -def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">; -def ConfigMacros : DiagGroup<"config-macros">; -def : DiagGroup<"ctor-dtor-privacy">; -def GNUDesignator : DiagGroup<"gnu-designator">; -def GNUStringLiteralOperatorTemplate : - DiagGroup<"gnu-string-literal-operator-template">; - -def DeleteIncomplete : DiagGroup<"delete-incomplete">; -def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">; -def AbstractFinalClass : DiagGroup<"abstract-final-class">; - -def CXX11CompatDeprecatedWritableStr : - DiagGroup<"c++11-compat-deprecated-writable-strings">; - -def DeprecatedAttributes : DiagGroup<"deprecated-attributes">; -def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">; -def UnavailableDeclarations : DiagGroup<"unavailable-declarations">; -def PartialAvailability : DiagGroup<"partial-availability">; -def DeprecatedImplementations :DiagGroup<"deprecated-implementations">; -def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">; -def DeprecatedRegister : DiagGroup<"deprecated-register">; -def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings", - [CXX11CompatDeprecatedWritableStr]>; -// FIXME: Why is DeprecatedImplementations not in this group? -def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes, - DeprecatedDeclarations, - DeprecatedIncrementBool, - DeprecatedRegister, - DeprecatedWritableStr]>, - DiagCategory<"Deprecations">; - -def LibLTO : DiagGroup<"liblto">; -def : DiagGroup<"disabled-optimization">; -def : DiagGroup<"discard-qual">; -def : DiagGroup<"div-by-zero">; - -def DocumentationHTML : DiagGroup<"documentation-html">; -def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">; -def DocumentationPedantic : DiagGroup<"documentation-pedantic", - [DocumentationUnknownCommand]>; -def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">; -def Documentation : DiagGroup<"documentation", - [DocumentationHTML, - DocumentationDeprecatedSync]>; - -def EmptyBody : DiagGroup<"empty-body">; -def Exceptions : DiagGroup<"exceptions">; - -def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">; -def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">; -def ExtraTokens : DiagGroup<"extra-tokens">; -def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">; -def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>; - -def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">; -def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">; -def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">; -def FormatExtraArgs : DiagGroup<"format-extra-args">; -def FormatZeroLength : DiagGroup<"format-zero-length">; - -// Warnings for C++1y code which is not compatible with prior C++ standards. -def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">; -def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic", - [CXXPre14Compat]>; -def CXXPre1zCompat : DiagGroup<"c++98-c++11-c++14-compat">; -def CXXPre1zCompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic", - [CXXPre1zCompat]>; - -def CXX98CompatBindToTemporaryCopy : - DiagGroup<"c++98-compat-bind-to-temporary-copy">; -def CXX98CompatLocalTypeTemplateArgs : - DiagGroup<"c++98-compat-local-type-template-args">; -def CXX98CompatUnnamedTypeTemplateArgs : - DiagGroup<"c++98-compat-unnamed-type-template-args">; - -def CXX98Compat : DiagGroup<"c++98-compat", - [CXX98CompatLocalTypeTemplateArgs, - CXX98CompatUnnamedTypeTemplateArgs, - CXXPre14Compat, - CXXPre1zCompat]>; -// Warnings for C++11 features which are Extensions in C++98 mode. -def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", - [CXX98Compat, - CXX98CompatBindToTemporaryCopy, - CXXPre14CompatPedantic, - CXXPre1zCompatPedantic]>; - -def CXX11Narrowing : DiagGroup<"c++11-narrowing">; - -def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">; - -// Original name of this warning in Clang -def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>; - -// Name of this warning in GCC -def : DiagGroup<"narrowing", [CXX11Narrowing]>; - -def CXX11CompatReservedUserDefinedLiteral : - DiagGroup<"c++11-compat-reserved-user-defined-literal">; -def ReservedUserDefinedLiteral : - DiagGroup<"reserved-user-defined-literal", - [CXX11CompatReservedUserDefinedLiteral]>; - -def CXX11Compat : DiagGroup<"c++11-compat", - [CXX11Narrowing, - CXX11CompatReservedUserDefinedLiteral, - CXX11CompatDeprecatedWritableStr, - CXXPre14Compat, - CXXPre1zCompat]>; -def : DiagGroup<"c++0x-compat", [CXX11Compat]>; -def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic", - [CXXPre14CompatPedantic, - CXXPre1zCompatPedantic]>; - -def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zCompat]>; -def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic", - [CXXPre1zCompatPedantic]>; - -def CXX1zCompat : DiagGroup<"c++1z-compat", [DeprecatedRegister, - DeprecatedIncrementBool]>; - -def : DiagGroup<"effc++">; -def DivZero : DiagGroup<"division-by-zero">; -def ExitTimeDestructors : DiagGroup<"exit-time-destructors">; -def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">; -def FourByteMultiChar : DiagGroup<"four-char-constants">; -def GlobalConstructors : DiagGroup<"global-constructors">; -def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">; -def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">; -def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">; -def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">; -def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">; -def DanglingElse: DiagGroup<"dangling-else">; -def DanglingField : DiagGroup<"dangling-field">; -def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">; -def FlagEnum : DiagGroup<"flag-enum">; -def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>; -def InfiniteRecursion : DiagGroup<"infinite-recursion">; -def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">; -def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">; -def : DiagGroup<"import">; -def GNUIncludeNext : DiagGroup<"gnu-include-next">; -def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">; -def IncompatiblePointerTypesDiscardsQualifiers - : DiagGroup<"incompatible-pointer-types-discards-qualifiers">; -def IncompatiblePointerTypes - : DiagGroup<"incompatible-pointer-types", - [IncompatiblePointerTypesDiscardsQualifiers]>; -def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">; -def NonModularIncludeInFrameworkModule - : DiagGroup<"non-modular-include-in-framework-module">; -def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module", - [NonModularIncludeInFrameworkModule]>; -def IncompleteModule : DiagGroup<"incomplete-module", - [IncompleteUmbrella, NonModularIncludeInModule]>; - -def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">; -def InvalidNoreturn : DiagGroup<"invalid-noreturn">; -def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">; -def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">; -def : DiagGroup<"init-self">; -def : DiagGroup<"inline">; -def : DiagGroup<"invalid-pch">; -def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">; -def LiteralRange : DiagGroup<"literal-range">; -def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args", - [CXX98CompatLocalTypeTemplateArgs]>; -def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">; -def ForLoopAnalysis : DiagGroup<"for-loop-analysis">; -def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis, - RangeLoopAnalysis]>; -def MalformedWarningCheck : DiagGroup<"malformed-warning-check">; -def Main : DiagGroup<"main">; -def MainReturnType : DiagGroup<"main-return-type">; -def MissingBraces : DiagGroup<"missing-braces">; -def MissingDeclarations: DiagGroup<"missing-declarations">; -def : DiagGroup<"missing-format-attribute">; -def : DiagGroup<"missing-include-dirs">; -def MissingNoreturn : DiagGroup<"missing-noreturn">; -def MultiChar : DiagGroup<"multichar">; -def : DiagGroup<"nested-externs">; -def CXX11LongLong : DiagGroup<"c++11-long-long">; -def LongLong : DiagGroup<"long-long", [CXX11LongLong]>; -def ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">; -def MethodSignatures : DiagGroup<"method-signatures">; -def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">; -def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">; -def MismatchedTags : DiagGroup<"mismatched-tags">; -def MissingFieldInitializers : DiagGroup<"missing-field-initializers">; -def ModuleBuild : DiagGroup<"module-build">; -def ModuleConflict : DiagGroup<"module-conflict">; -def ModuleFileExtension : DiagGroup<"module-file-extension">; -def NewlineEOF : DiagGroup<"newline-eof">; -def Nullability : DiagGroup<"nullability">; -def NullabilityDeclSpec : DiagGroup<"nullability-declspec">; -def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">; -def NullabilityCompleteness : DiagGroup<"nullability-completeness">; -def NullArithmetic : DiagGroup<"null-arithmetic">; -def NullCharacter : DiagGroup<"null-character">; -def NullDereference : DiagGroup<"null-dereference">; -def InitializerOverrides : DiagGroup<"initializer-overrides">; -def NonNull : DiagGroup<"nonnull">; -def NonPODVarargs : DiagGroup<"non-pod-varargs">; -def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>; -def : DiagGroup<"nonportable-cfstrings">; -def NonVirtualDtor : DiagGroup<"non-virtual-dtor">; -def OveralignedType : DiagGroup<"over-aligned">; -def OldStyleCast : DiagGroup<"old-style-cast">; -def : DiagGroup<"old-style-definition">; -def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">; -def : DiagGroup<"overflow">; -def ForwardClassReceiver : DiagGroup<"receiver-forward-class">; -def MethodAccess : DiagGroup<"objc-method-access">; -def ObjCReceiver : DiagGroup<"receiver-expr">; -// FIXME: Remove this when Xcode removes the warning setting. -def : DiagGroup<"receiver-is-weak">; -def OperatorNewReturnsNull : DiagGroup<"new-returns-null">; -def OverlengthStrings : DiagGroup<"overlength-strings">; -def OverloadedVirtual : DiagGroup<"overloaded-virtual">; -def PrivateExtern : DiagGroup<"private-extern">; -def SelTypeCast : DiagGroup<"cast-of-sel-type">; -def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">; -def BadFunctionCast : DiagGroup<"bad-function-cast">; -def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; -def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; -def ObjCProtocolQualifiers : DiagGroup<"objc-protocol-qualifiers">; -def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; -def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">; -def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">; -def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">; -def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">; -def ObjCRootClass : DiagGroup<"objc-root-class">; -def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">; -def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>; -def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">; -def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">; -def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">; -def Packed : DiagGroup<"packed">; -def Padded : DiagGroup<"padded">; -def PessimizingMove : DiagGroup<"pessimizing-move">; -def PointerArith : DiagGroup<"pointer-arith">; -def PoundWarning : DiagGroup<"#warnings">; -def PoundPragmaMessage : DiagGroup<"#pragma-messages">, - DiagCategory<"#pragma message Directive">; -def : DiagGroup<"pointer-to-int-cast">; -def : DiagGroup<"redundant-decls">; -def RedeclaredClassMember : DiagGroup<"redeclared-class-member">; -def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">; -def RedundantMove : DiagGroup<"redundant-move">; -def Register : DiagGroup<"register", [DeprecatedRegister]>; -def ReturnStackAddress : DiagGroup<"return-stack-address">; -def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">; -def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>; -def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy", - [CXX98CompatBindToTemporaryCopy]>; -def SelfAssignmentField : DiagGroup<"self-assign-field">; -def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>; -def SelfMove : DiagGroup<"self-move">; -def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">; -def Sentinel : DiagGroup<"sentinel">; -def MissingMethodReturnType : DiagGroup<"missing-method-return-type">; -def Shadow : DiagGroup<"shadow">; -def Shorten64To32 : DiagGroup<"shorten-64-to-32">; -def : DiagGroup<"sign-promo">; -def SignCompare : DiagGroup<"sign-compare">; -def : DiagGroup<"stack-protector">; -def : DiagGroup<"switch-default">; -def : DiagGroup<"synth">; -def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">; -def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">; -def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">; -def StaticInInline : DiagGroup<"static-in-inline">; -def StaticLocalInInline : DiagGroup<"static-local-in-inline">; -def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">; -def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>; -def GNUStatementExpression : DiagGroup<"gnu-statement-expression">; -def StringCompare : DiagGroup<"string-compare">; -def StringPlusInt : DiagGroup<"string-plus-int">; -def StringPlusChar : DiagGroup<"string-plus-char">; -def StrncatSize : DiagGroup<"strncat-size">; -def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">; -def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">; -def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">; -def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">; -def TautologicalCompare : DiagGroup<"tautological-compare", - [TautologicalOutOfRangeCompare, - TautologicalPointerCompare, - TautologicalOverlapCompare, - TautologicalUndefinedCompare]>; -def HeaderHygiene : DiagGroup<"header-hygiene">; -def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">; -def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">; -def GNUUnionCast : DiagGroup<"gnu-union-cast">; -def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">; -def Varargs : DiagGroup<"varargs">; - -def Unsequenced : DiagGroup<"unsequenced">; -// GCC name for -Wunsequenced -def : DiagGroup<"sequence-point", [Unsequenced]>; - -// Preprocessor warnings. -def AmbiguousMacro : DiagGroup<"ambiguous-macro">; -def KeywordAsMacro : DiagGroup<"keyword-macro">; -def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">; - -// Just silence warnings about -Wstrict-aliasing for now. -def : DiagGroup<"strict-aliasing=0">; -def : DiagGroup<"strict-aliasing=1">; -def : DiagGroup<"strict-aliasing=2">; -def : DiagGroup<"strict-aliasing">; - -// Just silence warnings about -Wstrict-overflow for now. -def : DiagGroup<"strict-overflow=0">; -def : DiagGroup<"strict-overflow=1">; -def : DiagGroup<"strict-overflow=2">; -def : DiagGroup<"strict-overflow=3">; -def : DiagGroup<"strict-overflow=4">; -def : DiagGroup<"strict-overflow=5">; -def : DiagGroup<"strict-overflow">; - -def InvalidOffsetof : DiagGroup<"invalid-offsetof">; -def : DiagGroup<"strict-prototypes">; -def StrictSelector : DiagGroup<"strict-selector-match">; -def MethodDuplicate : DiagGroup<"duplicate-method-match">; -def ObjCCStringFormat : DiagGroup<"cstring-format-directive">; -def CoveredSwitchDefault : DiagGroup<"covered-switch-default">; -def SwitchBool : DiagGroup<"switch-bool">; -def SwitchEnum : DiagGroup<"switch-enum">; -def Switch : DiagGroup<"switch">; -def ImplicitFallthroughPerFunction : - DiagGroup<"implicit-fallthrough-per-function">; -def ImplicitFallthrough : DiagGroup<"implicit-fallthrough", - [ImplicitFallthroughPerFunction]>; -def InvalidPPToken : DiagGroup<"invalid-pp-token">; -def Trigraphs : DiagGroup<"trigraphs">; - -def : DiagGroup<"type-limits">; -def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">; -def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">; -def Unicode : DiagGroup<"unicode">; -def UninitializedMaybe : DiagGroup<"conditional-uninitialized">; -def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">; -def UninitializedStaticSelfInit : DiagGroup<"static-self-init">; -def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes, - UninitializedStaticSelfInit]>; -def UnknownPragmas : DiagGroup<"unknown-pragmas">; -def IgnoredPragmas : DiagGroup<"ignored-pragmas">; -def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas]>; -def UnknownWarningOption : DiagGroup<"unknown-warning-option">; -def NSobjectAttribute : DiagGroup<"NSObject-attribute">; -def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">; -def UnknownAttributes : DiagGroup<"unknown-attributes">; -def IgnoredAttributes : DiagGroup<"ignored-attributes">; -def Attributes : DiagGroup<"attributes", [UnknownAttributes, - IgnoredAttributes]>; -def UnknownSanitizers : DiagGroup<"unknown-sanitizers">; -def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args", - [CXX98CompatUnnamedTypeTemplateArgs]>; -def UnsupportedFriend : DiagGroup<"unsupported-friend">; -def UnusedArgument : DiagGroup<"unused-argument">; -def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">; -def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">; -def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument", - [IgnoredOptimizationArgument]>; -def UnusedComparison : DiagGroup<"unused-comparison">; -def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">; -def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">; -def UnneededMemberFunction : DiagGroup<"unneeded-member-function">; -def UnusedPrivateField : DiagGroup<"unused-private-field">; -def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>; -def UnusedMemberFunction : DiagGroup<"unused-member-function", - [UnneededMemberFunction]>; -def UnusedLabel : DiagGroup<"unused-label">; -def UnusedParameter : DiagGroup<"unused-parameter">; -def UnusedResult : DiagGroup<"unused-result">; -def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">; -def UnevaluatedExpression : DiagGroup<"unevaluated-expression", - [PotentiallyEvaluatedExpression]>; -def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult, - UnevaluatedExpression]>; -def UnusedConstVariable : DiagGroup<"unused-const-variable">; -def UnusedVariable : DiagGroup<"unused-variable", - [UnusedConstVariable]>; -def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">; -def UnusedPropertyIvar : DiagGroup<"unused-property-ivar">; -def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">; -def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">; -def UserDefinedLiterals : DiagGroup<"user-defined-literals">; -def Reorder : DiagGroup<"reorder">; -def UndeclaredSelector : DiagGroup<"undeclared-selector">; -def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">; -def CustomAtomic : DiagGroup<"custom-atomic-properties">; -def AtomicProperties : DiagGroup<"atomic-properties", - [ImplicitAtomic, CustomAtomic]>; -def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">; -def ARCRetainCycles : DiagGroup<"arc-retain-cycles">; -def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">; -def AutomaticReferenceCounting : DiagGroup<"arc", - [ARCUnsafeRetainedAssign, - ARCRetainCycles, - ARCNonPodMemAccess]>; -def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">; -def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak", - [ARCRepeatedUseOfWeakMaybe]>; -def ObjCBridge : DiagGroup<"bridge-cast">; - -def DeallocInCategory:DiagGroup<"dealloc-in-category">; -def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">; -def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>; -def Protocol : DiagGroup<"protocol">; -def AtProtocol : DiagGroup<"at-protocol">; -def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">; -def PropertyAttr : DiagGroup<"property-attribute-mismatch">; -def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">; -def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">; -def VariadicMacros : DiagGroup<"variadic-macros">; -def VectorConversion : DiagGroup<"vector-conversion">; // clang specific -def VexingParse : DiagGroup<"vexing-parse">; -def VLA : DiagGroup<"vla">; -def VLAExtension : DiagGroup<"vla-extension">; -def VolatileRegisterVar : DiagGroup<"volatile-register-var">; -def Visibility : DiagGroup<"visibility">; -def ZeroLengthArray : DiagGroup<"zero-length-array">; -def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">; -def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">; -def Fallback : DiagGroup<"fallback">; - -// This covers both the deprecated case (in C++98) -// and the extension case (in C++11 onwards). -def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>; - -// GCC calls -Wdeprecated-writable-strings -Wwrite-strings. -// -// Bizarrely, this warning flag enables -fconst-strings in C. This is -// GCC-compatible, but really weird. -// -// FIXME: Should this affect C++11 (where this is an error, -// not just deprecated) or not? -def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>; - -def CharSubscript : DiagGroup<"char-subscripts">; -def LargeByValueCopy : DiagGroup<"large-by-value-copy">; -def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">; - -// Unreachable code warning groups. -// -// The goal is make -Wunreachable-code on by default, in -Wall, or at -// least actively used, with more noisy versions of the warning covered -// under separate flags. -// -def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">; -def UnreachableCode : DiagGroup<"unreachable-code", - [UnreachableCodeLoopIncrement]>; -def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">; -def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">; -def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive", - [UnreachableCode, - UnreachableCodeBreak, - UnreachableCodeReturn]>; - -// Aggregation warning settings. - -// Populate -Waddress with warnings from other groups. -def : DiagGroup<"address", [PointerBoolConversion, - StringCompare, - TautologicalPointerCompare]>; - -// -Widiomatic-parentheses contains warnings about 'idiomatic' -// missing parentheses; it is off by default. We do not include it -// in -Wparentheses because most users who use -Wparentheses explicitly -// do not want these warnings. -def ParenthesesOnEquality : DiagGroup<"parentheses-equality">; -def Parentheses : DiagGroup<"parentheses", - [LogicalOpParentheses, - LogicalNotParentheses, - BitwiseOpParentheses, - ShiftOpParentheses, - OverloadedShiftOpParentheses, - ParenthesesOnEquality, - DanglingElse]>; - -// -Wconversion has its own warnings, but we split a few out for -// legacy reasons: -// - some people want just 64-to-32 warnings -// - conversion warnings with constant sources are on by default -// - conversion warnings for literals are on by default -// - bool-to-pointer conversion warnings are on by default -// - __null-to-integer conversion warnings are on by default -def Conversion : DiagGroup<"conversion", - [BoolConversion, - ConstantConversion, - EnumConversion, - FloatConversion, - Shorten64To32, - IntConversion, - LiteralConversion, - NonLiteralNullConversion, // (1-1)->pointer (etc) - NullConversion, // NULL->non-pointer - ObjCLiteralConversion, - SignConversion, - StringConversion]>, - DiagCategory<"Value Conversion Issue">; - -def Unused : DiagGroup<"unused", - [UnusedArgument, UnusedFunction, UnusedLabel, - // UnusedParameter, (matches GCC's behavior) - // UnusedMemberFunction, (clean-up llvm before enabling) - UnusedPrivateField, UnusedLocalTypedef, - UnusedValue, UnusedVariable, UnusedPropertyIvar]>, - DiagCategory<"Unused Entity Issue">; - -// Format settings. -def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">; -def FormatSecurity : DiagGroup<"format-security">; -def FormatNonStandard : DiagGroup<"format-non-iso">; -def FormatY2K : DiagGroup<"format-y2k">; -def FormatPedantic : DiagGroup<"format-pedantic">; -def Format : DiagGroup<"format", - [FormatExtraArgs, FormatZeroLength, NonNull, - FormatSecurity, FormatY2K, FormatInvalidSpecifier]>, - DiagCategory<"Format String Issue">; -def FormatNonLiteral : DiagGroup<"format-nonliteral">; -def Format2 : DiagGroup<"format=2", - [FormatNonLiteral, FormatSecurity, FormatY2K]>; - -def TypeSafety : DiagGroup<"type-safety">; - -def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">; -def IntToPointerCast : DiagGroup<"int-to-pointer-cast", - [IntToVoidPointerCast]>; - -def Move : DiagGroup<"move", [PessimizingMove, RedundantMove, SelfMove]>; - -def Extra : DiagGroup<"extra", [ - MissingFieldInitializers, - IgnoredQualifiers, - InitializerOverrides, - SemiBeforeMethodBody, - MissingMethodReturnType, - SignCompare, - UnusedParameter - ]>; - -def Most : DiagGroup<"most", [ - CharSubscript, - Comment, - DeleteNonVirtualDtor, - Format, - Implicit, - InfiniteRecursion, - MismatchedTags, - MissingBraces, - Move, - MultiChar, - Reorder, - ReturnType, - SelfAssignment, - SelfMove, - SizeofArrayArgument, - SizeofArrayDecay, - StringPlusInt, - Trigraphs, - Uninitialized, - UnknownPragmas, - Unused, - VolatileRegisterVar, - ObjCMissingSuperCalls, - ObjCDesignatedInit, - OverloadedVirtual, - PrivateExtern, - SelTypeCast, - ExternCCompat - ]>; - -// Thread Safety warnings -def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">; -def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">; -def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">; -def ThreadSafetyReference : DiagGroup<"thread-safety-reference">; -def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">; -def ThreadSafety : DiagGroup<"thread-safety", - [ThreadSafetyAttributes, - ThreadSafetyAnalysis, - ThreadSafetyPrecise, - ThreadSafetyReference]>; -def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">; -def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">; - -// Uniqueness Analysis warnings -def Consumed : DiagGroup<"consumed">; - -// Note that putting warnings in -Wall will not disable them by default. If a -// warning should be active _only_ when -Wall is passed in, mark it as -// DefaultIgnore in addition to putting it here. -def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>; - -// Warnings that should be in clang-cl /w4. -def : DiagGroup<"CL4", [All, Extra]>; - -// Warnings enabled by -pedantic. This is magically filled in by TableGen. -def Pedantic : DiagGroup<"pedantic">; - -// Aliases. -def : DiagGroup<"", [Extra]>; // -W = -Wextra -def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens -def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment -def : DiagGroup<"conversion-null", - [NullConversion]>; // -Wconversion-null = -Wnull-conversion -def : DiagGroup<"bool-conversions", - [BoolConversion]>; // -Wbool-conversions = -Wbool-conversion -def : DiagGroup<"int-conversions", - [IntConversion]>; // -Wint-conversions = -Wint-conversion -def : DiagGroup<"vector-conversions", - [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion -def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>; - // -Wunused-local-typedefs = -Wunused-local-typedef - -// A warning group for warnings that we want to have on by default in clang, -// but which aren't on by default in GCC. -def NonGCC : DiagGroup<"non-gcc", - [SignCompare, Conversion, LiteralRange]>; - -// A warning group for warnings about using C++11 features as extensions in -// earlier C++ versions. -def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace, - CXX11LongLong]>; - -// A warning group for warnings about using C++14 features as extensions in -// earlier C++ versions. -def CXX14 : DiagGroup<"c++14-extensions", [CXX14BinaryLiteral]>; - -// A warning group for warnings about using C++1z features as extensions in -// earlier C++ versions. -def CXX1z : DiagGroup<"c++1z-extensions">; - -def : DiagGroup<"c++0x-extensions", [CXX11]>; -def : DiagGroup<"c++1y-extensions", [CXX14]>; - -def DelegatingCtorCycles : - DiagGroup<"delegating-ctor-cycles">; - -// A warning group for warnings about using C11 features as extensions. -def C11 : DiagGroup<"c11-extensions">; - -// A warning group for warnings about using C99 features as extensions. -def C99 : DiagGroup<"c99-extensions">; - -// A warning group for warnings about GCC extensions. -def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct, - GNUAutoType, - GNUBinaryLiteral, GNUCaseRange, - GNUComplexInteger, GNUCompoundLiteralInitializer, - GNUConditionalOmittedOperand, GNUDesignator, - GNUEmptyInitializer, GNUEmptyStruct, - VLAExtension, GNUFlexibleArrayInitializer, - GNUFlexibleArrayUnionMember, GNUFoldingConstant, - GNUImaginaryConstant, GNUIncludeNext, - GNULabelsAsValue, - RedeclaredClassMember, GNURedeclaredEnum, - GNUStatementExpression, GNUStaticFloatInit, - GNUStringLiteralOperatorTemplate, - GNUUnionCast, GNUVariableSizedTypeNotAtEnd, - ZeroLengthArray, GNUZeroLineDirective, - GNUZeroVariadicMacroArguments]>; -// A warning group for warnings about code that clang accepts but gcc doesn't. -def GccCompat : DiagGroup<"gcc-compat">; - -// Warnings for Microsoft extensions. -def MicrosoftCharize : DiagGroup<"microsoft-charize">; -def MicrosoftInclude : DiagGroup<"microsoft-include">; -def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">; -def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">; -def MicrosoftSealed : DiagGroup<"microsoft-sealed">; -def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">; -def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">; -def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">; -def MicrosoftMutableReference : DiagGroup<"microsoft-mutable-reference">; -def MicrosoftPureDefinition : DiagGroup<"microsoft-pure-definition">; -def MicrosoftUnionMemberReference : DiagGroup< - "microsoft-union-member-reference">; -def MicrosoftExplicitConstructorCall : DiagGroup< - "microsoft-explicit-constructor-call">; -def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">; -def MicrosoftDefaultArgRedefinition : - DiagGroup<"microsoft-default-arg-redefinition">; -def MicrosoftTemplate : DiagGroup<"microsoft-template">; -def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">; -def MicrosoftEnumForwardReference : - DiagGroup<"microsoft-enum-forward-reference">; -def MicrosoftGoto : DiagGroup<"microsoft-goto">; -def MicrosoftFlexibleArray : DiagGroup<"microsoft-flexible-array">; -def MicrosoftExtraQualification : DiagGroup<"microsoft-extra-qualification">; -def MicrosoftCast : DiagGroup<"microsoft-cast">; -def MicrosoftConstInit : DiagGroup<"microsoft-const-init">; -def MicrosoftVoidPseudoDtor : DiagGroup<"microsoft-void-pseudo-dtor">; -def MicrosoftAnonTag : DiagGroup<"microsoft-anon-tag">; -def MicrosoftCommentPaste : DiagGroup<"microsoft-comment-paste">; -def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">; -// Aliases. -def : DiagGroup<"msvc-include", [MicrosoftInclude]>; - // -Wmsvc-include = -Wmicrosoft-include - -// Warnings group for warnings about Microsoft extensions. -def Microsoft : DiagGroup<"microsoft", - [MicrosoftCharize, MicrosoftInclude, MicrosoftCppMacro, MicrosoftFixedEnum, - MicrosoftSealed, MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec, - MicrosoftUsingDecl, MicrosoftMutableReference, MicrosoftPureDefinition, - MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall, - MicrosoftEnumValue, MicrosoftDefaultArgRedefinition, MicrosoftTemplate, - MicrosoftRedeclareStatic, MicrosoftEnumForwardReference, MicrosoftGoto, - MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast, - MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag, - MicrosoftCommentPaste, MicrosoftEndOfFile]>; - -def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">; - -def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">; - -def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">; - -// ObjC API warning groups. -def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">; -def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [ - ObjCRedundantLiteralUse - ]>; - -def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [ - ObjCRedundantAPIUse - ]>; - -def ObjCStringComparison : DiagGroup<"objc-string-compare">; -def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">; -def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [ - ObjCStringComparison - ]>; - -// Inline ASM warnings. -def ASMOperandWidths : DiagGroup<"asm-operand-widths">; -def ASM : DiagGroup<"asm", [ - ASMOperandWidths - ]>; - -// OpenMP warnings. -def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">; -def OpenMPClauses : DiagGroup<"openmp-clauses">; -def OpenMPLoopForm : DiagGroup<"openmp-loop-form">; - -// Backend warnings. -def BackendInlineAsm : DiagGroup<"inline-asm">; -def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">; -def BackendPlugin : DiagGroup<"backend-plugin">; -def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">; -def BackendOptimizationRemark : DiagGroup<"pass">; -def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">; -def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">; -def BackendOptimizationFailure : DiagGroup<"pass-failed">; - -// Instrumentation based profiling warnings. -def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">; -def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">; - -// AddressSanitizer frontent instrumentation remarks. -def SanitizeAddressRemarks : DiagGroup<"sanitize-address">; - -// Issues with serialized diagnostics. -def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">; - -// A warning group for warnings about code that clang accepts when -// compiling CUDA C/C++ but which is not compatible with the CUDA spec. -def CudaCompat : DiagGroup<"cuda-compat">; - -// A warning group for things that will change semantics in the future. -def FutureCompat : DiagGroup<"future-compat">; - -def InvalidOrNonExistentDirectory : DiagGroup<"invalid-or-nonexistent-directory">; - -def OptionIgnored : DiagGroup<"option-ignored">; diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h deleted file mode 100644 index a675dfa..0000000 --- a/include/clang/Basic/DiagnosticIDs.h +++ /dev/null @@ -1,287 +0,0 @@ -//===--- DiagnosticIDs.h - Diagnostic IDs Handling --------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the Diagnostic IDs-related interfaces. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_DIAGNOSTICIDS_H -#define LLVM_CLANG_BASIC_DIAGNOSTICIDS_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/StringRef.h" - -namespace clang { - class DiagnosticsEngine; - class SourceLocation; - - // Import the diagnostic enums themselves. - namespace diag { - // Start position for diagnostics. - enum { - DIAG_START_COMMON = 0, - DIAG_START_DRIVER = DIAG_START_COMMON + 300, - DIAG_START_FRONTEND = DIAG_START_DRIVER + 100, - DIAG_START_SERIALIZATION = DIAG_START_FRONTEND + 100, - DIAG_START_LEX = DIAG_START_SERIALIZATION + 120, - DIAG_START_PARSE = DIAG_START_LEX + 300, - DIAG_START_AST = DIAG_START_PARSE + 500, - DIAG_START_COMMENT = DIAG_START_AST + 110, - DIAG_START_SEMA = DIAG_START_COMMENT + 100, - DIAG_START_ANALYSIS = DIAG_START_SEMA + 3000, - DIAG_UPPER_LIMIT = DIAG_START_ANALYSIS + 100 - }; - - class CustomDiagInfo; - - /// \brief All of the diagnostics that can be emitted by the frontend. - typedef unsigned kind; - - // Get typedefs for common diagnostics. - enum { -#define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ - SFINAE,CATEGORY,NOWERROR,SHOWINSYSHEADER) ENUM, -#define COMMONSTART -#include "clang/Basic/DiagnosticCommonKinds.inc" - NUM_BUILTIN_COMMON_DIAGNOSTICS -#undef DIAG - }; - - /// Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs - /// to either Ignore (nothing), Remark (emit a remark), Warning - /// (emit a warning) or Error (emit as an error). It allows clients to - /// map ERRORs to Error or Fatal (stop emitting diagnostics after this one). - enum class Severity { - // NOTE: 0 means "uncomputed". - Ignored = 1, ///< Do not present this diagnostic, ignore it. - Remark = 2, ///< Present this diagnostic as a remark. - Warning = 3, ///< Present this diagnostic as a warning. - Error = 4, ///< Present this diagnostic as an error. - Fatal = 5 ///< Present this diagnostic as a fatal error. - }; - - /// Flavors of diagnostics we can emit. Used to filter for a particular - /// kind of diagnostic (for instance, for -W/-R flags). - enum class Flavor { - WarningOrError, ///< A diagnostic that indicates a problem or potential - ///< problem. Can be made fatal by -Werror. - Remark ///< A diagnostic that indicates normal progress through - ///< compilation. - }; - } - -class DiagnosticMapping { - unsigned Severity : 3; - unsigned IsUser : 1; - unsigned IsPragma : 1; - unsigned HasNoWarningAsError : 1; - unsigned HasNoErrorAsFatal : 1; - -public: - static DiagnosticMapping Make(diag::Severity Severity, bool IsUser, - bool IsPragma) { - DiagnosticMapping Result; - Result.Severity = (unsigned)Severity; - Result.IsUser = IsUser; - Result.IsPragma = IsPragma; - Result.HasNoWarningAsError = 0; - Result.HasNoErrorAsFatal = 0; - return Result; - } - - diag::Severity getSeverity() const { return (diag::Severity)Severity; } - void setSeverity(diag::Severity Value) { Severity = (unsigned)Value; } - - bool isUser() const { return IsUser; } - bool isPragma() const { return IsPragma; } - - bool hasNoWarningAsError() const { return HasNoWarningAsError; } - void setNoWarningAsError(bool Value) { HasNoWarningAsError = Value; } - - bool hasNoErrorAsFatal() const { return HasNoErrorAsFatal; } - void setNoErrorAsFatal(bool Value) { HasNoErrorAsFatal = Value; } -}; - -/// \brief Used for handling and querying diagnostic IDs. -/// -/// Can be used and shared by multiple Diagnostics for multiple translation units. -class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> { -public: - /// \brief The level of the diagnostic, after it has been through mapping. - enum Level { - Ignored, Note, Remark, Warning, Error, Fatal - }; - -private: - /// \brief Information for uniquing and looking up custom diags. - diag::CustomDiagInfo *CustomDiagInfo; - -public: - DiagnosticIDs(); - ~DiagnosticIDs(); - - /// \brief Return an ID for a diagnostic with the specified format string and - /// level. - /// - /// If this is the first request for this diagnostic, it is registered and - /// created, otherwise the existing ID is returned. - - // FIXME: Replace this function with a create-only facilty like - // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of - // writing, nearly all callers of this function were invalid. - unsigned getCustomDiagID(Level L, StringRef FormatString); - - //===--------------------------------------------------------------------===// - // Diagnostic classification and reporting interfaces. - // - - /// \brief Given a diagnostic ID, return a description of the issue. - StringRef getDescription(unsigned DiagID) const; - - /// \brief Return true if the unmapped diagnostic levelof the specified - /// diagnostic ID is a Warning or Extension. - /// - /// This only works on builtin diagnostics, not custom ones, and is not - /// legal to call on NOTEs. - static bool isBuiltinWarningOrExtension(unsigned DiagID); - - /// \brief Return true if the specified diagnostic is mapped to errors by - /// default. - static bool isDefaultMappingAsError(unsigned DiagID); - - /// \brief Determine whether the given built-in diagnostic ID is a Note. - static bool isBuiltinNote(unsigned DiagID); - - /// \brief Determine whether the given built-in diagnostic ID is for an - /// extension of some sort. - static bool isBuiltinExtensionDiag(unsigned DiagID) { - bool ignored; - return isBuiltinExtensionDiag(DiagID, ignored); - } - - /// \brief Determine whether the given built-in diagnostic ID is for an - /// extension of some sort, and whether it is enabled by default. - /// - /// This also returns EnabledByDefault, which is set to indicate whether the - /// diagnostic is ignored by default (in which case -pedantic enables it) or - /// treated as a warning/error by default. - /// - static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault); - - - /// \brief Return the lowest-level warning option that enables the specified - /// diagnostic. - /// - /// If there is no -Wfoo flag that controls the diagnostic, this returns null. - static StringRef getWarningOptionForDiag(unsigned DiagID); - - /// \brief Return the category number that a specified \p DiagID belongs to, - /// or 0 if no category. - static unsigned getCategoryNumberForDiag(unsigned DiagID); - - /// \brief Return the number of diagnostic categories. - static unsigned getNumberOfCategories(); - - /// \brief Given a category ID, return the name of the category. - static StringRef getCategoryNameFromID(unsigned CategoryID); - - /// \brief Return true if a given diagnostic falls into an ARC diagnostic - /// category. - static bool isARCDiagnostic(unsigned DiagID); - - /// \brief Enumeration describing how the emission of a diagnostic should - /// be treated when it occurs during C++ template argument deduction. - enum SFINAEResponse { - /// \brief The diagnostic should not be reported, but it should cause - /// template argument deduction to fail. - /// - /// The vast majority of errors that occur during template argument - /// deduction fall into this category. - SFINAE_SubstitutionFailure, - - /// \brief The diagnostic should be suppressed entirely. - /// - /// Warnings generally fall into this category. - SFINAE_Suppress, - - /// \brief The diagnostic should be reported. - /// - /// The diagnostic should be reported. Various fatal errors (e.g., - /// template instantiation depth exceeded) fall into this category. - SFINAE_Report, - - /// \brief The diagnostic is an access-control diagnostic, which will be - /// substitution failures in some contexts and reported in others. - SFINAE_AccessControl - }; - - /// \brief Determines whether the given built-in diagnostic ID is - /// for an error that is suppressed if it occurs during C++ template - /// argument deduction. - /// - /// When an error is suppressed due to SFINAE, the template argument - /// deduction fails but no diagnostic is emitted. Certain classes of - /// errors, such as those errors that involve C++ access control, - /// are not SFINAE errors. - static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID); - - /// \brief Get the set of all diagnostic IDs in the group with the given name. - /// - /// \param[out] Diags - On return, the diagnostics in the group. - /// \returns \c true if the given group is unknown, \c false otherwise. - bool getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, - SmallVectorImpl<diag::kind> &Diags) const; - - /// \brief Get the set of all diagnostic IDs. - void getAllDiagnostics(diag::Flavor Flavor, - SmallVectorImpl<diag::kind> &Diags) const; - - /// \brief Get the diagnostic option with the closest edit distance to the - /// given group name. - static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group); - -private: - /// \brief Classify the specified diagnostic ID into a Level, consumable by - /// the DiagnosticClient. - /// - /// The classification is based on the way the client configured the - /// DiagnosticsEngine object. - /// - /// \param Loc The source location for which we are interested in finding out - /// the diagnostic state. Can be null in order to query the latest state. - DiagnosticIDs::Level - getDiagnosticLevel(unsigned DiagID, SourceLocation Loc, - const DiagnosticsEngine &Diag) const LLVM_READONLY; - - diag::Severity - getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, - const DiagnosticsEngine &Diag) const LLVM_READONLY; - - /// \brief Used to report a diagnostic that is finally fully formed. - /// - /// \returns \c true if the diagnostic was emitted, \c false if it was - /// suppressed. - bool ProcessDiag(DiagnosticsEngine &Diag) const; - - /// \brief Used to emit a diagnostic that is finally fully formed, - /// ignoring suppression. - void EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const; - - /// \brief Whether the diagnostic may leave the AST in a state where some - /// invariants can break. - bool isUnrecoverable(unsigned DiagID) const; - - friend class DiagnosticsEngine; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td deleted file mode 100644 index ed6ff20..0000000 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ /dev/null @@ -1,673 +0,0 @@ -//==--- DiagnosticLexKinds.td - liblex diagnostics ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// Lexer Diagnostics -//===----------------------------------------------------------------------===// - -let Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in { - -def null_in_char_or_string : Warning< - "null character(s) preserved in %select{char|string}0 literal">, - InGroup<NullCharacter>; -def null_in_file : Warning<"null character ignored">, InGroup<NullCharacter>; -def warn_nested_block_comment : Warning<"'/*' within block comment">, - InGroup<Comment>; -def escaped_newline_block_comment_end : Warning< - "escaped newline between */ characters at block comment end">, - InGroup<Comment>; -def backslash_newline_space : Warning< - "backslash and newline separated by space">, - InGroup<DiagGroup<"backslash-newline-escape">>; - -// Digraphs. -def warn_cxx98_compat_less_colon_colon : Warning< - "'<::' is treated as digraph '<:' (aka '[') followed by ':' in C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -// Trigraphs. -def trigraph_ignored : Warning<"trigraph ignored">, InGroup<Trigraphs>; -def trigraph_ignored_block_comment : Warning< - "ignored trigraph would end block comment">, InGroup<Trigraphs>; -def trigraph_ends_block_comment : Warning<"trigraph ends block comment">, - InGroup<Trigraphs>; -def trigraph_converted : Warning<"trigraph converted to '%0' character">, - InGroup<Trigraphs>; - -def ext_multi_line_line_comment : Extension<"multi-line // comment">, - InGroup<Comment>; -def ext_line_comment : Extension< - "// comments are not allowed in this language">, - InGroup<Comment>; -def ext_no_newline_eof : Extension<"no newline at end of file">, - InGroup<NewlineEOF>; -def warn_no_newline_eof : Warning<"no newline at end of file">, - InGroup<NewlineEOF>, DefaultIgnore; - -def warn_cxx98_compat_no_newline_eof : Warning< - "C++98 requires newline at end of file">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; - -def ext_dollar_in_identifier : Extension<"'$' in identifier">, - InGroup<DiagGroup<"dollar-in-identifier-extension">>; -def ext_charize_microsoft : Extension< - "charizing operator #@ is a Microsoft extension">, - InGroup<MicrosoftCharize>; -def ext_comment_paste_microsoft : Extension< - "pasting two '/' tokens into a '//' comment is a Microsoft extension">, - InGroup<MicrosoftCommentPaste>; -def ext_ctrl_z_eof_microsoft : Extension< - "treating Ctrl-Z as end-of-file is a Microsoft extension">, - InGroup<MicrosoftEndOfFile>; - -def ext_token_used : Extension<"extension used">, - InGroup<DiagGroup<"language-extension-token">>; - -def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">, - InGroup<CXX11Compat>, DefaultIgnore; - -def ext_unterminated_char_or_string : ExtWarn< - "missing terminating %select{'|'\"'}0 character">, InGroup<InvalidPPToken>; -def ext_empty_character : ExtWarn<"empty character constant">, - InGroup<InvalidPPToken>; -def err_unterminated_block_comment : Error<"unterminated /* comment">; -def err_invalid_character_to_charify : Error< - "invalid argument to convert to character">; -def err_unterminated___pragma : Error<"missing terminating ')' character">; - -def err_conflict_marker : Error<"version control conflict marker in file">; - -def err_raw_delim_too_long : Error< - "raw string delimiter longer than 16 characters" - "; use PREFIX( )PREFIX to delimit raw string">; -def err_invalid_char_raw_delim : Error< - "invalid character '%0' character in raw string delimiter" - "; use PREFIX( )PREFIX to delimit raw string">; -def err_unterminated_raw_string : Error< - "raw string missing terminating delimiter )%0\"">; -def warn_cxx98_compat_raw_string_literal : Warning< - "raw string literals are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -def ext_multichar_character_literal : ExtWarn< - "multi-character character constant">, InGroup<MultiChar>; -def ext_four_char_character_literal : Extension< - "multi-character character constant">, InGroup<FourByteMultiChar>; - - -// Unicode and UCNs -def err_invalid_utf8 : Error< - "source file is not valid UTF-8">; -def err_non_ascii : Error< - "non-ASCII characters are not allowed outside of literals and identifiers">; -def ext_unicode_whitespace : ExtWarn< - "treating Unicode character as whitespace">, - InGroup<DiagGroup<"unicode-whitespace">>; - -def err_hex_escape_no_digits : Error< - "\\%0 used with no following hex digits">; -def warn_ucn_escape_no_digits : Warning< - "\\%0 used with no following hex digits; " - "treating as '\\' followed by identifier">, InGroup<Unicode>; -def err_ucn_escape_incomplete : Error< - "incomplete universal character name">; -def warn_ucn_escape_incomplete : Warning< - "incomplete universal character name; " - "treating as '\\' followed by identifier">, InGroup<Unicode>; -def note_ucn_four_not_eight : Note<"did you mean to use '\\u'?">; - -def err_ucn_escape_basic_scs : Error< - "character '%0' cannot be specified by a universal character name">; -def err_ucn_control_character : Error< - "universal character name refers to a control character">; -def err_ucn_escape_invalid : Error<"invalid universal character">; -def warn_ucn_escape_surrogate : Warning< - "universal character name refers to a surrogate character">, - InGroup<Unicode>; - -def warn_c99_compat_unicode_id : Warning< - "%select{using this character in an identifier|starting an identifier with " - "this character}0 is incompatible with C99">, - InGroup<C99Compat>, DefaultIgnore; -def warn_cxx98_compat_unicode_id : Warning< - "using this character in an identifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning< - "specifying character '%0' with a universal character name " - "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_literal_ucn_control_character : Warning< - "universal character name referring to a control character " - "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def warn_ucn_not_valid_in_c89 : Warning< - "universal character names are only valid in C99 or C++; " - "treating as '\\' followed by identifier">, InGroup<Unicode>; -def warn_ucn_not_valid_in_c89_literal : ExtWarn< - "universal character names are only valid in C99 or C++">, InGroup<Unicode>; - - -// Literal -def ext_nonstandard_escape : Extension< - "use of non-standard escape character '\\%0'">; -def ext_unknown_escape : ExtWarn<"unknown escape sequence '\\%0'">, - InGroup<DiagGroup<"unknown-escape-sequence">>; -def err_invalid_digit : Error< - "invalid digit '%0' in %select{decimal|octal|binary}1 constant">; -def err_invalid_suffix_constant : Error< - "invalid suffix '%0' on %select{integer|floating}1 constant">; -def warn_cxx11_compat_digit_separator : Warning< - "digit separators are incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def err_digit_separator_not_between_digits : Error< - "digit separator cannot appear at %select{start|end}0 of digit sequence">; -def warn_extraneous_char_constant : Warning< - "extraneous characters in character constant ignored">; -def warn_char_constant_too_large : Warning< - "character constant too long for its type">; -def err_multichar_utf_character_literal : Error< - "Unicode character literals may not contain multiple characters">; -def err_exponent_has_no_digits : Error<"exponent has no digits">; -def ext_imaginary_constant : Extension< - "imaginary constants are a GNU extension">, InGroup<GNUImaginaryConstant>; -def err_hexconstant_requires: Error< - "hexadecimal floating constants require %select{an exponent|a significand}0">; -def ext_hexconstant_invalid : Extension< - "hexadecimal floating constants are a C99 feature">, InGroup<C99>; -def ext_binary_literal : Extension< - "binary integer literals are a GNU extension">, InGroup<GNUBinaryLiteral>; -def ext_binary_literal_cxx14 : Extension< - "binary integer literals are a C++14 extension">, InGroup<CXX14BinaryLiteral>; -def warn_cxx11_compat_binary_literal : Warning< - "binary integer literals are incompatible with C++ standards before C++14">, - InGroup<CXXPre14CompatPedantic>, DefaultIgnore; -def err_pascal_string_too_long : Error<"Pascal string is too long">; -def err_escape_too_large : Error< - "%select{hex|octal}0 escape sequence out of range">; -def ext_string_too_long : Extension<"string literal of length %0 exceeds " - "maximum length %1 that %select{C90|ISO C99|C++}2 compilers are required to " - "support">, InGroup<OverlengthStrings>; -def err_character_too_large : Error< - "character too large for enclosing character literal type">; -def warn_c99_compat_unicode_literal : Warning< - "unicode literals are incompatible with C99">, - InGroup<C99Compat>, DefaultIgnore; -def warn_cxx98_compat_unicode_literal : Warning< - "unicode literals are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx14_compat_u8_character_literal : Warning< - "unicode literals are incompatible with C++ standards before C++1z">, - InGroup<CXXPre1zCompat>, DefaultIgnore; -def warn_cxx11_compat_user_defined_literal : Warning< - "identifier after literal will be treated as a user-defined literal suffix " - "in C++11">, InGroup<CXX11Compat>, DefaultIgnore; -def warn_cxx11_compat_reserved_user_defined_literal : Warning< - "identifier after literal will be treated as a reserved user-defined literal " - "suffix in C++11">, - InGroup<CXX11CompatReservedUserDefinedLiteral>, DefaultIgnore; -def ext_reserved_user_defined_literal : ExtWarn< - "invalid suffix on literal; C++11 requires a space between literal and " - "identifier">, InGroup<ReservedUserDefinedLiteral>, DefaultError; -def ext_ms_reserved_user_defined_literal : ExtWarn< - "invalid suffix on literal; C++11 requires a space between literal and " - "identifier">, InGroup<ReservedUserDefinedLiteral>; -def err_unsupported_string_concat : Error< - "unsupported non-standard concatenation of string literals">; -def err_string_concat_mixed_suffix : Error< - "differing user-defined suffixes ('%0' and '%1') in string literal " - "concatenation">; -def err_pp_invalid_udl : Error< - "%select{character|integer}0 literal with user-defined suffix " - "cannot be used in preprocessor constant expression">; -def err_bad_string_encoding : Error< - "illegal character encoding in string literal">; -def warn_bad_string_encoding : ExtWarn< - "illegal character encoding in string literal">, - InGroup<InvalidSourceEncoding>; -def err_bad_character_encoding : Error< - "illegal character encoding in character literal">; -def warn_bad_character_encoding : ExtWarn< - "illegal character encoding in character literal">, - InGroup<InvalidSourceEncoding>; -def err_lexing_string : Error<"failure when lexing a string">; - - -//===----------------------------------------------------------------------===// -// PTH Diagnostics -//===----------------------------------------------------------------------===// -def err_invalid_pth_file : Error< - "invalid or corrupt PTH file '%0'">; - -//===----------------------------------------------------------------------===// -// Preprocessor Diagnostics -//===----------------------------------------------------------------------===// - -let CategoryName = "User-Defined Issue" in { -def pp_hash_warning : Warning<"%0">, - InGroup<PoundWarning>, ShowInSystemHeader; -def err_pp_hash_error : Error<"%0">; -} - -def pp_include_next_in_primary : Warning< - "#include_next in primary source file">, - InGroup<DiagGroup<"include-next-outside-header">>; -def pp_include_macros_out_of_predefines : Error< - "the #__include_macros directive is only for internal use by -imacros">; -def pp_include_next_absolute_path : Warning< - "#include_next with absolute path">, - InGroup<DiagGroup<"include-next-absolute-path">>; -def ext_c99_whitespace_required_after_macro_name : ExtWarn< - "ISO C99 requires whitespace after the macro name">, InGroup<C99>; -def ext_missing_whitespace_after_macro_name : ExtWarn< - "whitespace required after macro name">; -def warn_missing_whitespace_after_macro_name : Warning< - "whitespace recommended after macro name">; - -def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">, - InGroup<DiagGroup<"pragma-once-outside-header">>; -def pp_pragma_sysheader_in_main_file : Warning< - "#pragma system_header ignored in main file">, - InGroup<DiagGroup<"pragma-system-header-outside-header">>; -def pp_poisoning_existing_macro : Warning<"poisoning existing macro">; -def pp_out_of_date_dependency : Warning< - "current file is older than dependency %0">; -def ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">, - InGroup<BuiltinMacroRedefined>; -def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">, - InGroup<BuiltinMacroRedefined>; -def pp_disabled_macro_expansion : Warning< - "disabled expansion of recursive macro">, DefaultIgnore, - InGroup<DiagGroup<"disabled-macro-expansion">>; -def pp_macro_not_used : Warning<"macro is not used">, DefaultIgnore, - InGroup<DiagGroup<"unused-macros">>; -def warn_pp_undef_identifier : Warning< - "%0 is not defined, evaluates to 0">, - InGroup<DiagGroup<"undef">>, DefaultIgnore; -def warn_pp_ambiguous_macro : Warning< - "ambiguous expansion of macro %0">, InGroup<AmbiguousMacro>; -def note_pp_ambiguous_macro_chosen : Note< - "expanding this definition of %0">; -def note_pp_ambiguous_macro_other : Note< - "other definition of %0">; -def warn_pp_macro_hides_keyword : Extension< - "keyword is hidden by macro definition">, InGroup<KeywordAsMacro>; -def warn_pp_macro_is_reserved_id : Warning< - "macro name is a reserved identifier">, DefaultIgnore, - InGroup<ReservedIdAsMacro>; -def warn_pp_objc_macro_redef_ignored : Warning< - "ignoring redefinition of Objective-C qualifier macro">, - InGroup<DiagGroup<"objc-macro-redefinition">>; - -def pp_invalid_string_literal : Warning< - "invalid string literal, ignoring final '\\'">; -def warn_pp_expr_overflow : Warning< - "integer overflow in preprocessor expression">; -def warn_pp_convert_to_positive : Warning< - "%select{left|right}0 side of operator converted from negative value to " - "unsigned: %1">; - -def ext_pp_import_directive : Extension<"#import is a language extension">, - InGroup<DiagGroup<"import-preprocessor-directive-pedantic">>; -def err_pp_import_directive_ms : Error< - "#import of type library is an unsupported Microsoft feature">; -def ext_pp_include_search_ms : ExtWarn< - "#include resolved using non-portable Microsoft search rules as: %0">, - InGroup<MicrosoftInclude>; - -def ext_pp_ident_directive : Extension<"#ident is a language extension">; -def ext_pp_include_next_directive : Extension< - "#include_next is a language extension">, InGroup<GNUIncludeNext>; -def ext_pp_warning_directive : Extension<"#warning is a language extension">; - -def ext_pp_extra_tokens_at_eol : ExtWarn< - "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>; - -def ext_pp_comma_expr : Extension<"comma operator in operand of #if">; -def ext_pp_bad_vaargs_use : Extension< - "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">; -def ext_pp_macro_redef : ExtWarn<"%0 macro redefined">, InGroup<MacroRedefined>; -def ext_variadic_macro : Extension<"variadic macros are a C99 feature">, - InGroup<VariadicMacros>; -def warn_cxx98_compat_variadic_macro : Warning< - "variadic macros are incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def ext_named_variadic_macro : Extension< - "named variadic macros are a GNU extension">, InGroup<VariadicMacros>; -def err_embedded_directive : Error< - "embedding a #%0 directive within macro arguments is not supported">; -def ext_embedded_directive : Extension< - "embedding a directive within macro arguments has undefined behavior">, - InGroup<DiagGroup<"embedded-directive">>; -def ext_missing_varargs_arg : Extension< - "must specify at least one argument for '...' parameter of variadic macro">, - InGroup<GNUZeroVariadicMacroArguments>; -def ext_empty_fnmacro_arg : Extension< - "empty macro arguments are a C99 feature">, InGroup<C99>; -def warn_cxx98_compat_empty_fnmacro_arg : Warning< - "empty macro arguments are incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def note_macro_here : Note<"macro %0 defined here">; - -def err_pp_opencl_variadic_macros : - Error<"variadic macros not supported in OpenCL">; - -def err_pp_invalid_directive : Error<"invalid preprocessing directive">; -def err_pp_directive_required : Error< - "%0 must be used within a preprocessing directive">; -def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal; -def err_pp_file_not_found_not_fatal : Error< - "'%0' file not found with <angled> include; use \"quotes\" instead">; -def err_pp_error_opening_file : Error< - "error opening file '%0': %1">, DefaultFatal; -def err_pp_empty_filename : Error<"empty filename">; -def err_pp_include_too_deep : Error<"#include nested too deeply">; -def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">; -def err_pp_macro_not_identifier : Error<"macro name must be an identifier">; -def err_pp_missing_macro_name : Error<"macro name missing">; -def err_pp_missing_rparen_in_macro_def : Error< - "missing ')' in macro parameter list">; -def err_pp_invalid_tok_in_arg_list : Error< - "invalid token in macro parameter list">; -def err_pp_expected_ident_in_arg_list : Error< - "expected identifier in macro parameter list">; -def err_pp_expected_comma_in_arg_list : Error< - "expected comma in macro parameter list">; -def err_pp_duplicate_name_in_arg_list : Error< - "duplicate macro parameter name %0">; -def err_pp_stringize_not_parameter : Error< - "'#' is not followed by a macro parameter">; -def err_pp_malformed_ident : Error<"invalid #ident directive">; -def err_pp_unterminated_conditional : Error< - "unterminated conditional directive">; -def pp_err_else_after_else : Error<"#else after #else">; -def pp_err_elif_after_else : Error<"#elif after #else">; -def pp_err_else_without_if : Error<"#else without #if">; -def pp_err_elif_without_if : Error<"#elif without #if">; -def err_pp_endif_without_if : Error<"#endif without #if">; -def err_pp_expected_value_in_expr : Error<"expected value in expression">; -def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">; -def err_pp_expected_eol : Error< - "expected end of line in preprocessor expression">; -def err_pp_expected_after : Error<"missing %1 after %0">; -def err_pp_colon_without_question : Error<"':' without preceding '?'">; -def err_pp_division_by_zero : Error< - "division by zero in preprocessor expression">; -def err_pp_remainder_by_zero : Error< - "remainder by zero in preprocessor expression">; -def err_pp_expr_bad_token_binop : Error< - "token is not a valid binary operator in a preprocessor subexpression">; -def err_pp_expr_bad_token_start_expr : Error< - "invalid token at start of a preprocessor expression">; -def err_pp_invalid_poison : Error<"can only poison identifier tokens">; -def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">; - -def err_feature_check_malformed : Error< - "builtin feature check macro requires a parenthesized identifier">; - -def err_warning_check_malformed : Error< - "builtin warning check macro requires a parenthesized string">; -def warn_has_warning_invalid_option : - ExtWarn<"__has_warning expected option name (e.g. \"-Wundef\")">, - InGroup<MalformedWarningCheck>; - -def err_pp_identifier_arg_not_identifier : Error< - "cannot convert %0 token to an identifier">; - -def warn_pragma_include_alias_mismatch_angle : - ExtWarn<"angle-bracketed include <%0> cannot be aliased to double-quoted " - "include \"%1\"">, InGroup<UnknownPragmas>; -def warn_pragma_include_alias_mismatch_quote : - ExtWarn<"double-quoted include \"%0\" cannot be aliased to angle-bracketed " - "include <%1>">, InGroup<UnknownPragmas>; -def warn_pragma_include_alias_expected : - ExtWarn<"pragma include_alias expected '%0'">, - InGroup<UnknownPragmas>; -def warn_pragma_include_alias_expected_filename : - ExtWarn<"pragma include_alias expected include filename">, - InGroup<UnknownPragmas>; - -// - #pragma warning(...) -def warn_pragma_warning_expected : - ExtWarn<"#pragma warning expected '%0'">, - InGroup<UnknownPragmas>; -def warn_pragma_warning_spec_invalid : - ExtWarn<"#pragma warning expected 'push', 'pop', 'default', 'disable'," - " 'error', 'once', 'suppress', 1, 2, 3, or 4">, - InGroup<UnknownPragmas>; -def warn_pragma_warning_push_level : - ExtWarn<"#pragma warning(push, level) requires a level between 0 and 4">, - InGroup<UnknownPragmas>; -def warn_pragma_warning_expected_number : - ExtWarn<"#pragma warning expected a warning number">, - InGroup<UnknownPragmas>; - -def err__Pragma_malformed : Error< - "_Pragma takes a parenthesized string literal">; -def err_pragma_message_malformed : Error< - "pragma %select{message|warning|error}0 requires parenthesized string">; -def err_pragma_push_pop_macro_malformed : Error< - "pragma %0 requires a parenthesized string">; -def warn_pragma_pop_macro_no_push : Warning< - "pragma pop_macro could not pop '%0', no matching push_macro">, - InGroup<IgnoredPragmas>; -def warn_pragma_message : Warning<"%0">, - InGroup<PoundPragmaMessage>, DefaultWarnNoWerror; -def err_pragma_message : Error<"%0">; -def warn_pragma_ignored : Warning<"unknown pragma ignored">, - InGroup<UnknownPragmas>, DefaultIgnore; -def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, - InGroup<UnknownPragmas>; -def ext_on_off_switch_syntax : - ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">, - InGroup<UnknownPragmas>; -def ext_pragma_syntax_eod : - ExtWarn<"expected end of directive in pragma">, - InGroup<UnknownPragmas>; -def warn_stdc_fenv_access_not_supported : - Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, - InGroup<UnknownPragmas>; -def warn_pragma_diagnostic_invalid : - ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'," - " 'push', or 'pop'">, - InGroup<UnknownPragmas>; -def warn_pragma_diagnostic_cannot_pop : - ExtWarn<"pragma diagnostic pop could not pop, no matching push">, - InGroup<UnknownPragmas>; -def warn_pragma_diagnostic_invalid_option : - ExtWarn<"pragma diagnostic expected option name (e.g. \"-Wundef\")">, - InGroup<UnknownPragmas>; -def warn_pragma_diagnostic_invalid_token : - ExtWarn<"unexpected token in pragma diagnostic">, - InGroup<UnknownPragmas>; -def warn_pragma_diagnostic_unknown_warning : - ExtWarn<"unknown warning group '%0', ignored">, - InGroup<UnknownPragmas>; -// - #pragma __debug -def warn_pragma_debug_unexpected_command : Warning< - "unexpected debug command '%0'">, InGroup<IgnoredPragmas>; - -def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">; -def err_paste_at_start : Error< - "'##' cannot appear at start of macro expansion">; -def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">; -def ext_paste_comma : Extension< - "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNUZeroVariadicMacroArguments>; -def err_unterm_macro_invoc : Error< - "unterminated function-like macro invocation">; -def err_too_many_args_in_macro_invoc : Error< - "too many arguments provided to function-like macro invocation">; -def note_suggest_parens_for_macro : Note< - "parentheses are required around macro argument containing braced " - "initializer list">; -def note_init_list_at_beginning_of_macro_argument : Note< - "cannot use initializer list at the beginning of a macro argument">; -def err_too_few_args_in_macro_invoc : Error< - "too few arguments provided to function-like macro invocation">; -def err_pp_bad_paste : Error< - "pasting formed '%0', an invalid preprocessing token">; -def ext_pp_bad_paste_ms : ExtWarn< - "pasting formed '%0', an invalid preprocessing token">, DefaultError, - InGroup<DiagGroup<"invalid-token-paste">>; -def err_pp_operator_used_as_macro_name : Error< - "C++ operator %0 (aka %1) used as a macro name">; -def ext_pp_operator_used_as_macro_name : Extension< - err_pp_operator_used_as_macro_name.Text>, InGroup<MicrosoftCppMacro>; -def err_pp_illegal_floating_literal : Error< - "floating point literal in preprocessor expression">; -def err_pp_line_requires_integer : Error< - "#line directive requires a positive integer argument">; -def ext_pp_line_zero : Extension< - "#line directive with zero argument is a GNU extension">, - InGroup<GNUZeroLineDirective>; -def err_pp_line_invalid_filename : Error< - "invalid filename for #line directive">; -def warn_pp_line_decimal : Warning< - "%select{#line|GNU line marker}0 directive interprets number as decimal, not octal">; -def err_pp_line_digit_sequence : Error< - "%select{#line|GNU line marker}0 directive requires a simple digit sequence">; -def err_pp_linemarker_requires_integer : Error< - "line marker directive requires a positive integer argument">; -def err_pp_linemarker_invalid_filename : Error< - "invalid filename for line marker directive">; -def err_pp_linemarker_invalid_flag : Error< - "invalid flag line marker directive">; -def err_pp_linemarker_invalid_pop : Error< - "invalid line marker flag '2': cannot pop empty include stack">; -def ext_pp_line_too_big : Extension< - "C requires #line number to be less than %0, allowed as extension">; -def warn_cxx98_compat_pp_line_too_big : Warning< - "#line number greater than 32767 is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; - -def err_pp_visibility_non_macro : Error<"no macro named %0">; - -def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">; -def err_pp_double_begin_of_arc_cf_code_audited : Error< - "already inside '#pragma clang arc_cf_code_audited'">; -def err_pp_unmatched_end_of_arc_cf_code_audited : Error< - "not currently inside '#pragma clang arc_cf_code_audited'">; -def err_pp_include_in_arc_cf_code_audited : Error< - "cannot #include files inside '#pragma clang arc_cf_code_audited'">; -def err_pp_eof_in_arc_cf_code_audited : Error< - "'#pragma clang arc_cf_code_audited' was not ended within this file">; - -def warn_pp_date_time : Warning< - "expansion of date or time macro is not reproducible">, - ShowInSystemHeader, DefaultIgnore, InGroup<DiagGroup<"date-time">>; - -// Module map parsing -def err_mmap_unknown_token : Error<"skipping stray token">; -def err_mmap_expected_module : Error<"expected module declaration">; -def err_mmap_expected_module_name : Error<"expected module name">; -def err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">; -def err_mmap_expected_rbrace : Error<"expected '}'">; -def note_mmap_lbrace_match : Note<"to match this '{'">; -def err_mmap_expected_rsquare : Error<"expected ']' to close attribute">; -def note_mmap_lsquare_match : Note<"to match this ']'">; -def err_mmap_expected_member : Error< - "expected umbrella, header, submodule, or module export">; -def err_mmap_expected_header : Error<"expected a header name after '%0'">; -def err_mmap_expected_mmap_file : Error<"expected a module map file name">; -def err_mmap_module_redefinition : Error< - "redefinition of module '%0'">; -def note_mmap_prev_definition : Note<"previously defined here">; -def err_mmap_umbrella_dir_not_found : Error< - "umbrella directory '%0' not found">; -def err_mmap_umbrella_clash : Error< - "umbrella for module '%0' already covers this directory">; -def err_mmap_module_id : Error< - "expected a module name or '*'">; -def err_mmap_expected_library_name : Error< - "expected %select{library|framework}0 name as a string">; -def err_mmap_config_macro_submodule : Error< - "configuration macros are only allowed in top-level modules">; -def err_mmap_use_decl_submodule : Error< - "use declarations are only allowed in top-level modules">; -def err_mmap_expected_config_macro : Error< - "expected configuration macro name after ','">; -def err_mmap_expected_conflicts_comma : Error< - "expected ',' after conflicting module name">; -def err_mmap_expected_conflicts_message : Error< - "expected a message describing the conflict with '%0'">; -def err_mmap_missing_module_unqualified : Error< - "no module named '%0' visible from '%1'">; -def err_mmap_missing_module_qualified : Error< - "no module named '%0' in '%1'">; -def err_mmap_top_level_inferred_submodule : Error< - "only submodules and framework modules may be inferred with wildcard syntax">; -def err_mmap_inferred_no_umbrella : Error< - "inferred submodules require a module with an umbrella">; -def err_mmap_inferred_framework_submodule : Error< - "inferred submodule cannot be a framework submodule">; -def err_mmap_explicit_inferred_framework : Error< - "inferred framework modules cannot be 'explicit'">; -def err_mmap_missing_exclude_name : Error< - "expected excluded module name">; -def err_mmap_inferred_redef : Error< - "redefinition of inferred submodule">; -def err_mmap_expected_lbrace_wildcard : Error< - "expected '{' to start inferred submodule">; -def err_mmap_expected_inferred_member : Error< - "expected %select{module exclusion with 'exclude'|'export *'}0">; -def err_mmap_expected_export_wildcard : Error< - "only '*' can be exported from an inferred submodule">; -def err_mmap_explicit_top_level : Error< - "'explicit' is not permitted on top-level modules">; -def err_mmap_nested_submodule_id : Error< - "qualified module name can only be used to define modules at the top level">; -def err_mmap_expected_feature : Error<"expected a feature name">; -def err_mmap_expected_attribute : Error<"expected an attribute name">; -def warn_mmap_unknown_attribute : Warning<"unknown attribute '%0'">, - InGroup<IgnoredAttributes>; - -def warn_auto_module_import : Warning< - "treating #%select{include|import|include_next|__include_macros}0 as an " - "import of module '%1'">, InGroup<AutoImport>, DefaultIgnore; -def note_implicit_top_level_module_import_here : Note< - "submodule of top-level module '%0' implicitly imported here">; -def warn_uncovered_module_header : Warning< - "umbrella header for module '%0' does not include header '%1'">, - InGroup<IncompleteUmbrella>; -def err_expected_id_building_module : Error< - "expected a module name in '__building_module' expression">; -def warn_use_of_private_header_outside_module : Warning< - "use of private header from outside its module: '%0'">, - InGroup<DiagGroup<"private-header">>, DefaultError; -def err_undeclared_use_of_module : Error< - "module %0 does not depend on a module exporting '%1'">; -def warn_non_modular_include_in_framework_module : Warning< - "include of non-modular header inside framework module '%0'">, - InGroup<NonModularIncludeInFrameworkModule>, DefaultIgnore; -def warn_non_modular_include_in_module : Warning< - "include of non-modular header inside module '%0'">, - InGroup<NonModularIncludeInModule>, DefaultIgnore; -def warn_module_conflict : Warning< - "module '%0' conflicts with already-imported module '%1': %2">, - InGroup<ModuleConflict>; - -def warn_header_guard : Warning< - "%0 is used as a header guard here, followed by #define of a different macro">, - InGroup<DiagGroup<"header-guard">>; -def note_header_guard : Note< - "%0 is defined here; did you mean %1?">; - -let CategoryName = "Nullability Issue" in { - -def err_pp_assume_nonnull_syntax : Error<"expected 'begin' or 'end'">; -def err_pp_double_begin_of_assume_nonnull : Error< - "already inside '#pragma clang assume_nonnull'">; -def err_pp_unmatched_end_of_assume_nonnull : Error< - "not currently inside '#pragma clang assume_nonnull'">; -def err_pp_include_in_assume_nonnull : Error< - "cannot #include files inside '#pragma clang assume_nonnull'">; -def err_pp_eof_in_assume_nonnull : Error< - "'#pragma clang assume_nonnull' was not ended within this file">; - -} - -} diff --git a/include/clang/Basic/DiagnosticOptions.def b/include/clang/Basic/DiagnosticOptions.def deleted file mode 100644 index f4ba6da..0000000 --- a/include/clang/Basic/DiagnosticOptions.def +++ /dev/null @@ -1,99 +0,0 @@ -//===--- DiagOptions.def - Diagnostic option database ------------- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the diagnostic options. Users of this file -// must define the DIAGOPT macro to make use of this information. -// Optionally, the user may also define ENUM_DIAGOPT (for options -// that have enumeration type and VALUE_DIAGOPT (for options that -// describe a value rather than a flag). The SEMANTIC_* variants of these macros -// indicate options that affect the processing of the program, rather than -// simply the output. -// -//===----------------------------------------------------------------------===// -#ifndef DIAGOPT -# error Define the DIAGOPT macro to handle language options -#endif - -#ifndef VALUE_DIAGOPT -# define VALUE_DIAGOPT(Name, Bits, Default) \ -DIAGOPT(Name, Bits, Default) -#endif - -#ifndef ENUM_DIAGOPT -# define ENUM_DIAGOPT(Name, Type, Bits, Default) \ -DIAGOPT(Name, Bits, Default) -#endif - -#ifndef SEMANTIC_DIAGOPT -# define SEMANTIC_DIAGOPT(Name, Bits, Default) DIAGOPT(Name, Bits, Default) -#endif - -#ifndef SEMANTIC_VALUE_DIAGOPT -# define SEMANTIC_VALUE_DIAGOPT(Name, Bits, Default) \ - VALUE_DIAGOPT(Name, Bits, Default) -#endif - -#ifndef SEMANTIC_ENUM_DIAGOPT -# define SEMANTIC_ENUM_DIAGOPT(Name, Type, Bits, Default) \ - ENUM_DIAGOPT(Name, Type, Bits, Default) -#endif - -SEMANTIC_DIAGOPT(IgnoreWarnings, 1, 0) /// -w -DIAGOPT(NoRewriteMacros, 1, 0) /// -Wno-rewrite-macros -DIAGOPT(Pedantic, 1, 0) /// -pedantic -DIAGOPT(PedanticErrors, 1, 0) /// -pedantic-errors -DIAGOPT(ShowColumn, 1, 1) /// Show column number on diagnostics. -DIAGOPT(ShowLocation, 1, 1) /// Show source location information. -DIAGOPT(ShowCarets, 1, 1) /// Show carets in diagnostics. -DIAGOPT(ShowFixits, 1, 1) /// Show fixit information. -DIAGOPT(ShowSourceRanges, 1, 0) /// Show source ranges in numeric form. -DIAGOPT(ShowParseableFixits, 1, 0) /// Show machine parseable fix-its. -DIAGOPT(ShowPresumedLoc, 1, 0) /// Show presumed location for diagnostics. -DIAGOPT(ShowOptionNames, 1, 0) /// Show the option name for mappable - /// diagnostics. -DIAGOPT(ShowNoteIncludeStack, 1, 0) /// Show include stacks for notes. -VALUE_DIAGOPT(ShowCategories, 2, 0) /// Show categories: 0 -> none, 1 -> Number, - /// 2 -> Full Name. - -ENUM_DIAGOPT(Format, TextDiagnosticFormat, 2, Clang) /// Format for diagnostics: - -DIAGOPT(ShowColors, 1, 0) /// Show diagnostics with ANSI color sequences. -ENUM_DIAGOPT(ShowOverloads, OverloadsShown, 1, - Ovl_All) /// Overload candidates to show. -DIAGOPT(VerifyDiagnostics, 1, 0) /// Check that diagnostics match the expected - /// diagnostics, indicated by markers in the - /// input source file. -ENUM_DIAGOPT(VerifyIgnoreUnexpected, DiagnosticLevelMask, 4, - DiagnosticLevelMask::None) /// Ignore unexpected diagnostics of - /// the specified levels when using - /// -verify. -DIAGOPT(ElideType, 1, 0) /// Elide identical types in template diffing -DIAGOPT(ShowTemplateTree, 1, 0) /// Print a template tree when diffing -DIAGOPT(CLFallbackMode, 1, 0) /// Format for clang-cl fallback mode - -VALUE_DIAGOPT(ErrorLimit, 32, 0) /// Limit # errors emitted. -/// Limit depth of macro expansion backtrace. -VALUE_DIAGOPT(MacroBacktraceLimit, 32, DefaultMacroBacktraceLimit) -/// Limit depth of instantiation backtrace. -VALUE_DIAGOPT(TemplateBacktraceLimit, 32, DefaultTemplateBacktraceLimit) -/// Limit depth of constexpr backtrace. -VALUE_DIAGOPT(ConstexprBacktraceLimit, 32, DefaultConstexprBacktraceLimit) -/// Limit number of times to perform spell checking. -VALUE_DIAGOPT(SpellCheckingLimit, 32, DefaultSpellCheckingLimit) - -VALUE_DIAGOPT(TabStop, 32, DefaultTabStop) /// The distance between tab stops. -/// Column limit for formatting message diagnostics, or 0 if unused. -VALUE_DIAGOPT(MessageLength, 32, 0) - -#undef DIAGOPT -#undef ENUM_DIAGOPT -#undef VALUE_DIAGOPT -#undef SEMANTIC_DIAGOPT -#undef SEMANTIC_ENUM_DIAGOPT -#undef SEMANTIC_VALUE_DIAGOPT diff --git a/include/clang/Basic/DiagnosticOptions.h b/include/clang/Basic/DiagnosticOptions.h deleted file mode 100644 index c9b0c5d..0000000 --- a/include/clang/Basic/DiagnosticOptions.h +++ /dev/null @@ -1,118 +0,0 @@ -//===--- DiagnosticOptions.h ------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_DIAGNOSTICOPTIONS_H -#define LLVM_CLANG_BASIC_DIAGNOSTICOPTIONS_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include <string> -#include <type_traits> -#include <vector> - -namespace clang { - -/// \brief Specifies which overload candidates to display when overload -/// resolution fails. -enum OverloadsShown : unsigned { - Ovl_All, ///< Show all overloads. - Ovl_Best ///< Show just the "best" overload candidates. -}; - -/// \brief A bitmask representing the diagnostic levels used by -/// VerifyDiagnosticConsumer. -enum class DiagnosticLevelMask : unsigned { - None = 0, - Note = 1 << 0, - Remark = 1 << 1, - Warning = 1 << 2, - Error = 1 << 3, - All = Note | Remark | Warning | Error -}; - -inline DiagnosticLevelMask operator~(DiagnosticLevelMask M) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; - return static_cast<DiagnosticLevelMask>(~static_cast<UT>(M)); -} - -inline DiagnosticLevelMask operator|(DiagnosticLevelMask LHS, - DiagnosticLevelMask RHS) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; - return static_cast<DiagnosticLevelMask>( - static_cast<UT>(LHS) | static_cast<UT>(RHS)); -} - -inline DiagnosticLevelMask operator&(DiagnosticLevelMask LHS, - DiagnosticLevelMask RHS) { - using UT = std::underlying_type<DiagnosticLevelMask>::type; - return static_cast<DiagnosticLevelMask>( - static_cast<UT>(LHS) & static_cast<UT>(RHS)); -} - -raw_ostream& operator<<(raw_ostream& Out, DiagnosticLevelMask M); - -/// \brief Options for controlling the compiler diagnostics engine. -class DiagnosticOptions : public RefCountedBase<DiagnosticOptions>{ -public: - enum TextDiagnosticFormat { Clang, MSVC, Vi }; - - // Default values. - enum { DefaultTabStop = 8, MaxTabStop = 100, - DefaultMacroBacktraceLimit = 6, - DefaultTemplateBacktraceLimit = 10, - DefaultConstexprBacktraceLimit = 10, - DefaultSpellCheckingLimit = 50 }; - - // Define simple diagnostic options (with no accessors). -#define DIAGOPT(Name, Bits, Default) unsigned Name : Bits; -#define ENUM_DIAGOPT(Name, Type, Bits, Default) -#include "clang/Basic/DiagnosticOptions.def" - -protected: - // Define diagnostic options of enumeration type. These are private, and will - // have accessors (below). -#define DIAGOPT(Name, Bits, Default) -#define ENUM_DIAGOPT(Name, Type, Bits, Default) unsigned Name : Bits; -#include "clang/Basic/DiagnosticOptions.def" - -public: - /// \brief The file to log diagnostic output to. - std::string DiagnosticLogFile; - - /// \brief The file to serialize diagnostics to (non-appending). - std::string DiagnosticSerializationFile; - - /// The list of -W... options used to alter the diagnostic mappings, with the - /// prefixes removed. - std::vector<std::string> Warnings; - - /// The list of -R... options used to alter the diagnostic mappings, with the - /// prefixes removed. - std::vector<std::string> Remarks; - -public: - // Define accessors/mutators for diagnostic options of enumeration type. -#define DIAGOPT(Name, Bits, Default) -#define ENUM_DIAGOPT(Name, Type, Bits, Default) \ - Type get##Name() const { return static_cast<Type>(Name); } \ - void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } -#include "clang/Basic/DiagnosticOptions.def" - - DiagnosticOptions() { -#define DIAGOPT(Name, Bits, Default) Name = Default; -#define ENUM_DIAGOPT(Name, Type, Bits, Default) set##Name(Default); -#include "clang/Basic/DiagnosticOptions.def" - } -}; - -typedef DiagnosticOptions::TextDiagnosticFormat TextDiagnosticFormat; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td deleted file mode 100644 index f8dee2f..0000000 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ /dev/null @@ -1,985 +0,0 @@ -//==--- DiagnosticParseKinds.td - libparse diagnostics --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// Parser Diagnostics -//===----------------------------------------------------------------------===// - -let Component = "Parse" in { - -def w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">, - CatInlineAsm; -def warn_file_asm_volatile : Warning< - "meaningless 'volatile' on asm outside function">, CatInlineAsm; - -let CategoryName = "Inline Assembly Issue" in { -def err_asm_empty : Error<"__asm used with no assembly instructions">; -def err_inline_ms_asm_parsing : Error<"%0">; -def err_msasm_unsupported_arch : Error< - "Unsupported architecture '%0' for MS-style inline assembly">; -def err_msasm_unable_to_create_target : Error< - "MS-style inline assembly is not available: %0">; -def err_gnu_inline_asm_disabled : Error< - "GNU-style inline assembly is disabled">; -} - -let CategoryName = "Parse Issue" in { - -def ext_empty_translation_unit : Extension< - "ISO C requires a translation unit to contain at least one declaration">, - InGroup<DiagGroup<"empty-translation-unit">>; -def warn_cxx98_compat_top_level_semi : Warning< - "extra ';' outside of a function is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def ext_extra_semi : Extension< - "extra ';' %select{" - "outside of a function|" - "inside a %1|" - "inside instance variable list|" - "after member function definition}0">, - InGroup<ExtraSemi>; -def ext_extra_semi_cxx11 : Extension< - "extra ';' outside of a function is a C++11 extension">, - InGroup<CXX11ExtraSemi>; -def warn_extra_semi_after_mem_fn_def : Warning< - "extra ';' after member function definition">, - InGroup<ExtraSemi>, DefaultIgnore; - -def ext_thread_before : Extension<"'__thread' before '%0'">; -def ext_keyword_as_ident : ExtWarn< - "keyword '%0' will be made available as an identifier " - "%select{here|for the remainder of the translation unit}1">, - InGroup<KeywordCompat>; - -def ext_nullability : Extension< - "type nullability specifier %0 is a Clang extension">, - InGroup<DiagGroup<"nullability-extension">>; - -def error_empty_enum : Error<"use of empty enum">; - -def ext_ident_list_in_param : Extension< - "type-less parameter names in function declaration">; -def ext_c99_variable_decl_in_for_loop : Extension< - "variable declaration in for loop is a C99-specific feature">, InGroup<C99>; -def ext_c99_compound_literal : Extension< - "compound literals are a C99-specific feature">, InGroup<C99>; -def ext_enumerator_list_comma_c : Extension< - "commas at the end of enumerator lists are a C99-specific " - "feature">, InGroup<C99>; -def ext_enumerator_list_comma_cxx : Extension< - "commas at the end of enumerator lists are a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_enumerator_list_comma : Warning< - "commas at the end of enumerator lists are incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def err_enumerator_list_missing_comma : Error< - "missing ',' between enumerators">; -def err_enumerator_unnamed_no_def : Error< - "unnamed enumeration must be a definition">; -def ext_cxx11_enum_fixed_underlying_type : Extension< - "enumeration types with a fixed underlying type are a C++11 extension">, - InGroup<CXX11>; -def ext_c_enum_fixed_underlying_type : Extension< - "enumeration types with a fixed underlying type are a Microsoft extension">, - InGroup<MicrosoftFixedEnum>; -def warn_cxx98_compat_enum_fixed_underlying_type : Warning< - "enumeration types with a fixed underlying type are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_alignof : Warning< - "alignof expressions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_alignof_expr : ExtWarn< - "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>; - -def warn_microsoft_dependent_exists : Warning< - "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">, - InGroup<DiagGroup<"microsoft-exists">>; -def warn_microsoft_qualifiers_ignored : Warning< - "qualifiers after comma in declarator list are ignored">, - InGroup<IgnoredAttributes>; - -def ext_c11_generic_selection : Extension< - "generic selections are a C11-specific feature">, InGroup<C11>; -def err_duplicate_default_assoc : Error< - "duplicate default generic association">; -def note_previous_default_assoc : Note< - "previous default generic association is here">; - -def ext_c11_alignment : Extension< - "%0 is a C11-specific feature">, InGroup<C11>; - -def ext_c11_noreturn : Extension< - "_Noreturn functions are a C11-specific feature">, InGroup<C11>; -def err_c11_noreturn_misplaced : Error< - "'_Noreturn' keyword must precede function declarator">; - -def ext_gnu_indirect_goto : Extension< - "use of GNU indirect-goto extension">, InGroup<GNULabelsAsValue>; -def ext_gnu_address_of_label : Extension< - "use of GNU address-of-label extension">, InGroup<GNULabelsAsValue>; -def err_stmtexpr_file_scope : Error< - "statement expression not allowed at file scope">; -def ext_gnu_statement_expr : Extension< - "use of GNU statement expression extension">, InGroup<GNUStatementExpression>; -def ext_gnu_conditional_expr : Extension< - "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>; -def ext_gnu_empty_initializer : Extension< - "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>; -def ext_gnu_array_range : Extension<"use of GNU array range extension">, - InGroup<GNUDesignator>; -def ext_gnu_missing_equal_designator : ExtWarn< - "use of GNU 'missing =' extension in designator">, - InGroup<GNUDesignator>; -def err_expected_equal_designator : Error<"expected '=' or another designator">; -def ext_gnu_old_style_field_designator : ExtWarn< - "use of GNU old-style field designator extension">, - InGroup<GNUDesignator>; -def ext_gnu_case_range : Extension<"use of GNU case range extension">, - InGroup<GNUCaseRange>; - -// Generic errors. -def err_expected_expression : Error<"expected expression">; -def err_expected_type : Error<"expected a type">; -def err_expected_external_declaration : Error<"expected external declaration">; -def err_extraneous_closing_brace : Error<"extraneous closing brace ('}')">; -def err_expected_semi_declaration : Error< - "expected ';' at end of declaration">; -def err_expected_semi_decl_list : Error< - "expected ';' at end of declaration list">; -def ext_expected_semi_decl_list : ExtWarn< - "expected ';' at end of declaration list">; -def err_expected_member_name_or_semi : Error< - "expected member name or ';' after declaration specifiers">; -def err_function_declared_typedef : Error< - "function definition declared 'typedef'">; -def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">; -def err_at_in_class : Error<"unexpected '@' in member specification">; -def err_unexpected_semi : Error<"unexpected ';' before %0">; - -def err_expected_fn_body : Error< - "expected function body after function declarator">; -def warn_attribute_on_function_definition : Warning< - "GCC does not allow %0 attribute in this position on a function definition">, - InGroup<GccCompat>; -def warn_gcc_attribute_location : Warning< - "GCC does not allow an attribute in this position on a function declaration">, - InGroup<GccCompat>; -def warn_attribute_no_decl : Warning< - "attribute %0 ignored, because it is not attached to a declaration">, - InGroup<IgnoredAttributes>; -def err_expected_method_body : Error<"expected method body">; -def err_declspec_after_virtspec : Error< - "'%0' qualifier may not appear after the virtual specifier '%1'">; -def err_invalid_token_after_toplevel_declarator : Error< - "expected ';' after top level declarator">; -def err_invalid_token_after_declarator_suggest_equal : Error< - "invalid %0 at end of declaration; did you mean '='?">; -def err_expected_statement : Error<"expected statement">; -def err_expected_lparen_after : Error<"expected '(' after '%0'">; -def err_expected_rparen_after : Error<"expected ')' after '%0'">; -def err_expected_punc : Error<"expected ')' or ',' after '%0'">; -def err_expected_less_after : Error<"expected '<' after '%0'">; -def err_expected_lbrace_in_compound_literal : Error< - "expected '{' in compound literal">; -def err_expected_while : Error<"expected 'while' in do/while loop">; - -def err_expected_semi_after_stmt : Error<"expected ';' after %0 statement">; -def err_expected_semi_after_expr : Error<"expected ';' after expression">; -def err_extraneous_token_before_semi : Error<"extraneous '%0' before ';'">; - -def err_expected_semi_after_method_proto : Error< - "expected ';' after method prototype">; -def err_expected_semi_after_namespace_name : Error< - "expected ';' after namespace name">; -def err_unexpected_namespace_attributes_alias : Error< - "attributes cannot be specified on namespace alias">; -def err_unexpected_nested_namespace_attribute : Error< - "attributes cannot be specified on a nested namespace definition">; -def err_inline_namespace_alias : Error<"namespace alias cannot be inline">; -def err_namespace_nonnamespace_scope : Error< - "namespaces can only be defined in global or namespace scope">; -def ext_nested_namespace_definition : ExtWarn< - "nested namespace definition is a C++1z extension; " - "define each namespace separately">, InGroup<CXX1z>; -def warn_cxx14_compat_nested_namespace_definition : Warning< - "nested namespace definition is incompatible with C++ standards before C++1z">, - InGroup<CXXPre1zCompat>, DefaultIgnore; -def err_inline_nested_namespace_definition : Error< - "nested namespace definition cannot be 'inline'">; -def err_expected_semi_after_attribute_list : Error< - "expected ';' after attribute list">; -def err_expected_semi_after_static_assert : Error< - "expected ';' after static_assert">; -def err_expected_semi_for : Error<"expected ';' in 'for' statement specifier">; -def err_single_decl_assign_in_for_range : Error< - "range-based 'for' statement uses ':', not '='">; -def warn_missing_selector_name : Warning< - "%0 used as the name of the previous parameter rather than as part " - "of the selector">, - InGroup<DiagGroup<"missing-selector-name">>; -def note_missing_selector_name : Note< - "introduce a parameter name to make %0 part of the selector">; -def note_force_empty_selector_name : Note< - "or insert whitespace before ':' to use %0 as parameter name " - "and have an empty entry in the selector">; -def err_label_end_of_compound_statement : Error< - "label at end of compound statement: expected statement">; -def err_address_of_label_outside_fn : Error< - "use of address-of-label extension outside of a function body">; -def err_asm_operand_wide_string_literal : Error< - "cannot use %select{unicode|wide}0 string literal in 'asm'">; -def err_expected_selector_for_method : Error< - "expected selector for Objective-C method">; -def err_expected_property_name : Error<"expected property name">; - -def err_unexpected_at : Error<"unexpected '@' in program">; -def err_atimport : Error< -"use of '@import' when modules are disabled">; - -def err_invalid_reference_qualifier_application : Error< - "'%0' qualifier may not be applied to a reference">; -def err_illegal_decl_reference_to_reference : Error< - "%0 declared as a reference to a reference">; -def ext_rvalue_reference : ExtWarn< - "rvalue references are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_rvalue_reference : Warning< - "rvalue references are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_ref_qualifier : ExtWarn< - "reference qualifiers on functions are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_ref_qualifier : Warning< - "reference qualifiers on functions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_inline_namespace : ExtWarn< - "inline namespaces are a C++11 feature">, InGroup<CXX11InlineNamespace>; -def warn_cxx98_compat_inline_namespace : Warning< - "inline namespaces are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_generalized_initializer_lists : ExtWarn< - "generalized initializer lists are a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_generalized_initializer_lists : Warning< - "generalized initializer lists are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_init_list_bin_op : Error<"initializer list cannot be used on the " - "%select{left|right}0 hand side of operator '%1'">; -def warn_cxx98_compat_trailing_return_type : Warning< - "trailing return types are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_auto_storage_class : ExtWarn< - "'auto' storage class specifier is not permitted in C++11, and will not " - "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>; -def ext_decltype_auto_type_specifier : ExtWarn< - "'decltype(auto)' type specifier is a C++14 extension">, InGroup<CXX14>; -def warn_cxx11_compat_decltype_auto_type_specifier : Warning< - "'decltype(auto)' type specifier is incompatible with C++ standards before " - "C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; -def ext_auto_type : Extension< - "'__auto_type' is a GNU extension">, - InGroup<GNUAutoType>; -def ext_for_range : ExtWarn< - "range-based for loop is a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_for_range : Warning< - "range-based for loop is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_for_range_identifier : Error< - "range-based for loop requires type for loop variable">; -def err_for_range_expected_decl : Error< - "for range declaration must declare a variable">; -def err_argument_required_after_attribute : Error< - "argument required after attribute">; -def err_missing_param : Error<"expected parameter declarator">; -def err_missing_comma_before_ellipsis : Error< - "C requires a comma prior to the ellipsis in a variadic function type">; -def err_unexpected_typedef_ident : Error< - "unexpected type name %0: expected identifier">; -def warn_cxx98_compat_decltype : Warning< - "'decltype' type specifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_unexpected_scope_on_base_decltype : Error< - "unexpected namespace scope prior to decltype">; -def err_expected_class_name : Error<"expected class name">; -def err_expected_class_name_not_template : - Error<"'typename' is redundant; base classes are implicitly types">; -def err_unspecified_vla_size_with_static : Error< - "'static' may not be used with an unspecified variable length array size">; -def err_unspecified_size_with_static : Error< - "'static' may not be used without an array size">; -def err_expected_parentheses_around_typename : Error< - "expected parentheses around type name in %0 expression">; - -def err_expected_case_before_expression: Error< - "expected 'case' keyword before expression">; - -// Declarations. -def err_typename_requires_specqual : Error< - "type name requires a specifier or qualifier">; -def err_typename_invalid_storageclass : Error< - "type name does not allow storage class to be specified">; -def err_typename_invalid_functionspec : Error< - "type name does not allow function specifier to be specified">; -def err_typename_invalid_constexpr : Error< - "type name does not allow constexpr specifier to be specified">; -def err_typename_identifiers_only : Error< - "typename is allowed for identifiers only">; - -def err_friend_invalid_in_context : Error< - "'friend' used outside of class">; -def err_templated_using_directive_declaration : Error< - "cannot template a using %select{directive|declaration}0">; -def err_unexpected_colon_in_nested_name_spec : Error< - "unexpected ':' in nested name specifier; did you mean '::'?">; -def err_unexpected_token_in_nested_name_spec : Error< - "'%0' cannot be a part of nested name specifier; did you mean ':'?">; -def err_bool_redeclaration : Error< - "redeclaration of C++ built-in type 'bool'">; -def ext_c11_static_assert : Extension< - "_Static_assert is a C11-specific feature">, InGroup<C11>; -def warn_cxx98_compat_static_assert : Warning< - "static_assert declarations are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_paren_after_colon_colon : Error< - "unexpected parenthesis after '::'">; -def err_function_definition_not_allowed : Error< - "function definition is not allowed here">; -def err_expected_end_of_enumerator : Error< - "expected '= constant-expression' or end of enumerator definition">; -def err_expected_coloncolon_after_super : Error< - "expected '::' after '__super'">; - -/// Objective-C parser diagnostics -def err_expected_minus_or_plus : Error< - "method type specifier must start with '-' or '+'">; -def err_objc_no_attributes_on_category : Error< - "attributes may not be specified on a category">; -def err_objc_missing_end : Error<"missing '@end'">; -def note_objc_container_start : Note< - "%select{class|protocol|category|class extension|implementation" - "|category implementation}0 started here">; -def warn_objc_protocol_qualifier_missing_id : Warning< - "protocol has no object type specified; defaults to qualified 'id'">; -def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">; -def err_illegal_super_cast : Error< - "cannot cast 'super' (it isn't an expression)">; -def err_nsnumber_nonliteral_unary : Error< - "@%0 must be followed by a number to form an NSNumber object">; -def warn_cstyle_param : Warning< - "use of C-style parameters in Objective-C method declarations" - " is deprecated">, InGroup<DeprecatedDeclarations>; - -let CategoryName = "ARC Parse Issue" in { -def err_arc_bridge_retain : Error< - "unknown cast annotation __bridge_retain; did you mean __bridge_retained?">; -// To be default mapped to an error later. -def warn_arc_bridge_cast_nonarc : Warning< - "'%0' casts have no effect when not using ARC">, - InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>; -} - -def err_objc_illegal_visibility_spec : Error< - "illegal visibility specification">; -def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">; -def err_objc_expected_equal_for_getter : Error< - "expected '=' for Objective-C getter">; -def err_objc_expected_equal_for_setter : Error< - "expected '=' for Objective-C setter">; -def err_objc_expected_selector_for_getter_setter : Error< - "expected selector for Objective-C %select{setter|getter}0">; -def err_objc_property_requires_field_name : Error< - "property requires fields to be named">; -def err_objc_property_bitfield : Error<"property name cannot be a bitfield">; -def err_objc_expected_property_attr : Error<"unknown property attribute %0">; -def err_objc_properties_require_objc2 : Error< - "properties are an Objective-C 2 feature">; -def err_objc_unexpected_attr : Error< - "prefix attribute must be followed by an interface or protocol">; -def err_objc_postfix_attribute : Error < - "postfix attributes are not allowed on Objective-C directives">; -def err_objc_postfix_attribute_hint : Error < - "postfix attributes are not allowed on Objective-C directives, place" - " them in front of '%select{@interface|@protocol}0'">; -def err_objc_directive_only_in_protocol : Error< - "directive may only be specified in protocols only">; -def err_missing_catch_finally : Error< - "@try statement without a @catch and @finally clause">; -def err_objc_concat_string : Error<"unexpected token after Objective-C string">; -def err_expected_objc_container : Error< - "'@end' must appear in an Objective-C context">; -def err_unexpected_protocol_qualifier : Error< - "@implementation declaration cannot be protocol qualified">; -def err_objc_unexpected_atend : Error< - "'@end' appears where closing brace '}' is expected">; -def error_property_ivar_decl : Error< - "property synthesize requires specification of an ivar">; -def err_synthesized_property_name : Error< - "expected a property name in @synthesize">; -def warn_semicolon_before_method_body : Warning< - "semicolon before method body is ignored">, - InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore; -def note_extra_comma_message_arg : Note< - "comma separating Objective-C messaging arguments">; - -def err_expected_field_designator : Error< - "expected a field designator, such as '.field = 4'">; - -def err_declaration_does_not_declare_param : Error< - "declaration does not declare a parameter">; -def err_no_matching_param : Error<"parameter named %0 is missing">; - -/// C++ parser diagnostics -def err_invalid_operator_on_type : Error< - "cannot use %select{dot|arrow}0 operator on a type">; -def err_expected_unqualified_id : Error< - "expected %select{identifier|unqualified-id}0">; -def err_brackets_go_after_unqualified_id : Error< - "brackets are not allowed here; to declare an array, " - "place the brackets after the %select{identifier|name}0">; -def err_unexpected_unqualified_id : Error<"type-id cannot have a name">; -def err_func_def_no_params : Error< - "function definition does not declare parameters">; -def err_expected_lparen_after_type : Error< - "expected '(' for function-style cast or type construction">; -def err_expected_init_in_condition : Error< - "variable declaration in condition must have an initializer">; -def err_expected_init_in_condition_lparen : Error< - "variable declaration in condition cannot have a parenthesized initializer">; -def err_extraneous_rparen_in_condition : Error< - "extraneous ')' after condition, expected a statement">; -def warn_dangling_else : Warning< - "add explicit braces to avoid dangling else">, - InGroup<DanglingElse>; -def err_expected_member_or_base_name : Error< - "expected class member or base class name">; -def err_expected_lbrace_after_base_specifiers : Error< - "expected '{' after base class list">; -def err_missing_end_of_definition : Error< - "missing '}' at end of definition of %q0">; -def note_missing_end_of_definition_before : Note< - "still within definition of %q0 here">; -def ext_ellipsis_exception_spec : Extension< - "exception specification of '...' is a Microsoft extension">, - InGroup<MicrosoftExceptionSpec>; -def err_dynamic_and_noexcept_specification : Error< - "cannot have both throw() and noexcept() clause on the same function">; -def err_except_spec_unparsed : Error< - "unexpected end of exception specification">; -def warn_cxx98_compat_noexcept_decl : Warning< - "noexcept specifications are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_expected_catch : Error<"expected catch">; -def err_using_namespace_in_class : Error< - "'using namespace' is not allowed in classes">; -def err_constructor_bad_name : Error< - "missing return type for function %0; did you mean the constructor name %1?">; -def err_destructor_tilde_identifier : Error< - "expected a class name after '~' to name a destructor">; -def err_destructor_tilde_scope : Error< - "'~' in destructor name should be after nested name specifier">; -def err_destructor_template_id : Error< - "destructor name %0 does not refer to a template">; -def err_default_arg_unparsed : Error< - "unexpected end of default argument expression">; -def err_bracket_depth_exceeded : Error< - "bracket nesting level exceeded maximum of %0">, DefaultFatal; -def note_bracket_depth : Note< - "use -fbracket-depth=N to increase maximum nesting level">; -def err_misplaced_ellipsis_in_declaration : Error< - "'...' must %select{immediately precede declared identifier|" - "be innermost component of anonymous pack declaration}0">; -def warn_misplaced_ellipsis_vararg : Warning< - "'...' in this location creates a C-style varargs function" - "%select{, not a function parameter pack|}0">, - InGroup<DiagGroup<"ambiguous-ellipsis">>; -def note_misplaced_ellipsis_vararg_existing_ellipsis : Note< - "preceding '...' declares a function parameter pack">; -def note_misplaced_ellipsis_vararg_add_ellipsis : Note< - "place '...' %select{immediately before declared identifier|here}0 " - "to declare a function parameter pack">; -def note_misplaced_ellipsis_vararg_add_comma : Note< - "insert ',' before '...' to silence this warning">; -def ext_abstract_pack_declarator_parens : ExtWarn< - "ISO C++11 requires a parenthesized pack declaration to have a name">, - InGroup<DiagGroup<"anonymous-pack-parens">>; -def err_function_is_not_record : Error< - "unexpected %0 in function call; perhaps remove the %0?">; -def err_super_in_using_declaration : Error< - "'__super' cannot be used with a using declaration">; - -// C++ derived classes -def err_dup_virtual : Error<"duplicate 'virtual' in base specifier">; - -// C++ operator overloading -def err_literal_operator_string_prefix : Error< - "string literal after 'operator' cannot have an encoding prefix">; -def err_literal_operator_string_not_empty : Error< - "string literal after 'operator' must be '\"\"'">; -def warn_cxx98_compat_literal_operator : Warning< - "literal operators are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -// Classes. -def err_anon_type_definition : Error< - "declaration of anonymous %0 must be a definition">; -def err_default_delete_in_multiple_declaration : Error< - "'= %select{default|delete}0' is a function definition and must occur in a " - "standalone declaration">; - -def warn_cxx98_compat_noexcept_expr : Warning< - "noexcept expressions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_nullptr : Warning< - "'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; - -def warn_cxx14_compat_attribute : Warning< - "attributes on %select{a namespace|an enumerator}0 declaration are " - "incompatible with C++ standards before C++1z">, - InGroup<CXXPre1zCompat>, DefaultIgnore; -def warn_cxx98_compat_alignas : Warning<"'alignas' is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_attribute : Warning< - "C++11 attribute syntax is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_cxx11_attribute_forbids_arguments : Error< - "attribute %0 cannot have an argument list">; -def err_attribute_requires_arguments : Error< - "parentheses must be omitted if %0 attribute's argument list is empty">; -def err_cxx11_attribute_forbids_ellipsis : Error< - "attribute '%0' cannot be used as an attribute pack">; -def err_cxx11_attribute_repeated : Error< - "attribute %0 cannot appear multiple times in an attribute specifier">; -def err_attributes_not_allowed : Error<"an attribute list cannot appear here">; -def err_l_square_l_square_not_attribute : Error< - "C++11 only allows consecutive left square brackets when " - "introducing an attribute">; -def err_ms_declspec_type : Error< - "__declspec attributes must be an identifier or string literal">; -def err_ms_property_no_getter_or_putter : Error< - "property does not specify a getter or a putter">; -def err_ms_property_unknown_accessor : Error< - "expected 'get' or 'put' in property declaration">; -def err_ms_property_has_set_accessor : Error< - "putter for property must be specified as 'put', not 'set'">; -def err_ms_property_missing_accessor_kind : Error< - "missing 'get=' or 'put='">; -def err_ms_property_expected_equal : Error< - "expected '=' after '%0'">; -def err_ms_property_duplicate_accessor : Error< - "property declaration specifies '%0' accessor twice">; -def err_ms_property_expected_accessor_name : Error< - "expected name of accessor method">; -def err_ms_property_expected_comma_or_rparen : Error< - "expected ',' or ')' at end of property accessor list">; -def err_ms_property_initializer : Error< - "property declaration cannot have an in-class initializer">; - -/// C++ Templates -def err_expected_template : Error<"expected template">; -def err_unknown_template_name : Error< - "unknown template name %0">; -def err_expected_comma_greater : Error< - "expected ',' or '>' in template-parameter-list">; -def err_class_on_template_template_param : Error< - "template template parameter requires 'class' after the parameter list">; -def ext_template_template_param_typename : ExtWarn< - "template template parameter using 'typename' is a C++1z extension">, - InGroup<CXX1z>; -def warn_cxx14_compat_template_template_param_typename : Warning< - "template template parameter using 'typename' is " - "incompatible with C++ standards before C++1z">, - InGroup<CXXPre1zCompat>, DefaultIgnore; -def err_template_spec_syntax_non_template : Error< - "identifier followed by '<' indicates a class template specialization but " - "%0 %select{does not refer to a template|refers to a function template|" - "<unused>|refers to a variable template|<unused>}1">; -def err_id_after_template_in_nested_name_spec : Error< - "expected template name after 'template' keyword in nested name specifier">; -def err_two_right_angle_brackets_need_space : Error< - "a space is required between consecutive right angle brackets (use '> >')">; -def err_right_angle_bracket_equal_needs_space : Error< - "a space is required between a right angle bracket and an equals sign " - "(use '> =')">; -def warn_cxx11_right_shift_in_template_arg : Warning< - "use of right-shift operator ('>>') in template argument will require " - "parentheses in C++11">, InGroup<CXX11Compat>; -def warn_cxx98_compat_two_right_angle_brackets : Warning< - "consecutive right angle brackets are incompatible with C++98 (use '> >')">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_templated_invalid_declaration : Error< - "a static_assert declaration cannot be a template">; -def err_multiple_template_declarators : Error< - "%select{|a template declaration|an explicit template specialization|" - "an explicit template instantiation}0 can " - "only %select{|declare|declare|instantiate}0 a single entity">; -def err_explicit_instantiation_with_definition : Error< - "explicit template instantiation cannot have a definition; if this " - "definition is meant to be an explicit specialization, add '<>' after the " - "'template' keyword">; -def err_template_defn_explicit_instantiation : Error< - "%select{function|class|variable}0 cannot be defined in an explicit instantiation; if this " - "declaration is meant to be a %select{function|class|variable}0 definition, remove the 'template' keyword">; -def err_friend_explicit_instantiation : Error< - "friend cannot be declared in an explicit instantiation; if this " - "declaration is meant to be a friend declaration, remove the 'template' keyword">; -def err_explicit_instantiation_enum : Error< - "enumerations cannot be explicitly instantiated">; -def err_expected_template_parameter : Error<"expected template parameter">; - -def err_missing_dependent_template_keyword : Error< - "use 'template' keyword to treat '%0' as a dependent template name">; -def warn_missing_dependent_template_keyword : ExtWarn< - "use 'template' keyword to treat '%0' as a dependent template name">; - -def ext_extern_template : Extension< - "extern templates are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_extern_template : Warning< - "extern templates are incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def warn_static_inline_explicit_inst_ignored : Warning< - "ignoring '%select{static|inline}0' keyword on explicit template " - "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>; - -// Constructor template diagnostics. -def err_out_of_line_constructor_template_id : Error< - "out-of-line constructor for %0 cannot have template arguments">; -def err_out_of_line_template_id_type_names_constructor : Error< - "qualified reference to %0 is a constructor name rather than a " - "%select{template name|type}1 wherever a constructor can be declared">; - -def err_expected_qualified_after_typename : Error< - "expected a qualified name after 'typename'">; -def warn_expected_qualified_after_typename : ExtWarn< - "expected a qualified name after 'typename'">; - -def err_typename_refers_to_non_type_template : Error< - "typename specifier refers to a non-type template">; -def err_expected_type_name_after_typename : Error< - "expected an identifier or template-id after '::'">; -def err_explicit_spec_non_template : Error< - "explicit %select{specialization|instantiation}0 of non-template %1 %2">; - -def err_default_template_template_parameter_not_template : Error< - "default template argument for a template template parameter must be a class " - "template">; - -def ext_fold_expression : ExtWarn< - "pack fold expression is a C++1z extension">, - InGroup<CXX1z>; -def warn_cxx14_compat_fold_expression : Warning< - "pack fold expression is incompatible with C++ standards before C++1z">, - InGroup<CXXPre1zCompat>, DefaultIgnore; -def err_expected_fold_operator : Error< - "expected a foldable binary operator in fold expression">; -def err_fold_operator_mismatch : Error< - "operators in fold expression must be the same">; - -def err_ctor_init_missing_comma : Error< - "missing ',' between base or member initializers">; - -// C++ declarations -def err_friend_decl_defines_type : Error< - "cannot define a type in a friend declaration">; -def err_missing_whitespace_digraph : Error< - "found '<::' after a " - "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0" - " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">; - -def ext_defaulted_deleted_function : ExtWarn< - "%select{defaulted|deleted}0 function definitions are a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_defaulted_deleted_function : Warning< - "%select{defaulted|deleted}0 function definitions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -// C++11 in-class member initialization -def ext_nonstatic_member_init : ExtWarn< - "in-class initialization of non-static data member is a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_nonstatic_member_init : Warning< - "in-class initialization of non-static data members is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_bitfield_member_init: Error< - "bitfield member cannot have an in-class initializer">; -def err_incomplete_array_member_init: Error< - "array bound cannot be deduced from an in-class initializer">; - -// C++11 alias-declaration -def ext_alias_declaration : ExtWarn< - "alias declarations are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_alias_declaration : Warning< - "alias declarations are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_alias_declaration_not_identifier : Error< - "name defined in alias declaration must be an identifier">; -def err_alias_declaration_specialization : Error< - "%select{partial specialization|explicit specialization|explicit instantiation}0 of alias templates is not permitted">; - -// C++11 override control -def ext_override_control_keyword : ExtWarn< - "'%0' keyword is a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_override_control_keyword : Warning< - "'%0' keyword is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_override_control_interface : Error< - "'%0' keyword not permitted with interface types">; -def ext_ms_sealed_keyword : ExtWarn< - "'sealed' keyword is a Microsoft extension">, - InGroup<MicrosoftSealed>; - -def err_access_specifier_interface : Error< - "interface types cannot specify '%select{private|protected}0' access">; - -def err_duplicate_virt_specifier : Error< - "class member already marked '%0'">; - -def err_scoped_enum_missing_identifier : Error< - "scoped enumeration requires a name">; -def ext_scoped_enum : ExtWarn< - "scoped enumerations are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_scoped_enum : Warning< - "scoped enumerations are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -def err_expected_parameter_pack : Error< - "expected the name of a parameter pack">; -def err_paren_sizeof_parameter_pack : Error< - "missing parentheses around the size of parameter pack %0">; -def err_sizeof_parameter_pack : Error< - "expected parenthesized parameter pack name in 'sizeof...' expression">; - -// C++11 lambda expressions -def err_expected_comma_or_rsquare : Error< - "expected ',' or ']' in lambda capture list">; -def err_this_captured_by_reference : Error< - "'this' cannot be captured by reference">; -def err_expected_capture : Error< - "expected variable name or 'this' in lambda capture list">; -def err_expected_lambda_body : Error<"expected body of lambda expression">; -def warn_cxx98_compat_lambda : Warning< - "lambda expressions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_lambda_missing_parens : Error< - "lambda requires '()' before %select{'mutable'|return type|" - "attribute specifier}0">; - -// Availability attribute -def err_expected_version : Error< - "expected a version of the form 'major[.minor[.subminor]]'">; -def warn_expected_consistent_version_separator : Warning< - "use same version number separators '_' or '.'; as in " - "'major[.minor[.subminor]]'">, InGroup<Availability>; -def err_zero_version : Error< - "version number must have non-zero major, minor, or sub-minor version">; -def err_availability_expected_platform : Error< - "expected a platform name, e.g., 'macosx'">; - -// objc_bridge_related attribute -def err_objcbridge_related_expected_related_class : Error< - "expected a related ObjectiveC class name, e.g., 'NSColor'">; -def err_objcbridge_related_selector_name : Error< - "expected a class method selector with single argument, e.g., 'colorWithCGColor:'">; - -def err_availability_expected_change : Error< - "expected 'introduced', 'deprecated', or 'obsoleted'">; -def err_availability_unknown_change : Error< - "%0 is not an availability stage; use 'introduced', 'deprecated', or " - "'obsoleted'">; -def err_availability_redundant : Error< - "redundant %0 availability change; only the last specified change will " - "be used">; -def warn_availability_and_unavailable : Warning< - "'unavailable' availability overrides all other availability information">, - InGroup<Availability>; - -// Type safety attributes -def err_type_safety_unknown_flag : Error< - "invalid comparison flag %0; use 'layout_compatible' or 'must_be_null'">; - -// Type traits -def err_type_trait_arity : Error< - "type trait requires %0%select{| or more}1 argument%select{|s}2; have " - "%3 argument%s3">; - -// Language specific pragmas -// - Generic warnings -def warn_pragma_expected_lparen : Warning< - "missing '(' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; -def warn_pragma_expected_rparen : Warning< - "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; -def warn_pragma_expected_identifier : Warning< - "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>; -def warn_pragma_expected_section_name : Warning< - "expected a string literal for the section name in '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_section_push_pop_or_name : Warning< - "expected push, pop or a string literal for the section name in '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_section_label_or_name : Warning< - "expected a stack label or a string literal for the section name in '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_init_seg : Warning< - "expected 'compiler', 'lib', 'user', or a string literal for the section name in '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_integer : Warning< - "expected integer between %0 and %1 inclusive in '#pragma %2' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_ms_struct : Warning< - "incorrect use of '#pragma ms_struct on|off' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_extra_tokens_at_eol : Warning< - "extra tokens at end of '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_punc : Warning< - "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>; -def warn_pragma_expected_non_wide_string : Warning< - "expected non-wide string literal in '#pragma %0'">, InGroup<IgnoredPragmas>; -// - Generic errors -def err_pragma_missing_argument : Error< - "missing argument to '#pragma %0'%select{|; expected %2}1">; -// - #pragma options -def warn_pragma_options_expected_align : Warning< - "expected 'align' following '#pragma options' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_align_expected_equal : Warning< - "expected '=' following '#pragma %select{align|options align}0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_align_invalid_option : Warning< - "invalid alignment option in '#pragma %select{align|options align}0' - ignored">, - InGroup<IgnoredPragmas>; -// - #pragma pack -def warn_pragma_unsupported_action : Warning< - "known but unsupported action '%1' for '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_invalid_specific_action : Warning< - "unknown action '%1' for '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_expected_action_or_r_paren : Warning< - "expected action or ')' in '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_invalid_action : Warning< - "unknown action for '#pragma %0' - ignored">, - InGroup<IgnoredPragmas>; -def warn_pragma_pack_malformed : Warning< - "expected integer or identifier in '#pragma pack' - ignored">, - InGroup<IgnoredPragmas>; -// - #pragma unused -def warn_pragma_unused_expected_var : Warning< - "expected '#pragma unused' argument to be a variable name">, - InGroup<IgnoredPragmas>; -// - #pragma init_seg -def warn_pragma_init_seg_unsupported_target : Warning< - "'#pragma init_seg' is only supported when targeting a " - "Microsoft environment">, - InGroup<IgnoredPragmas>; -// - #pragma fp_contract -def err_pragma_fp_contract_scope : Error< - "'#pragma fp_contract' can only appear at file scope or at the start of a " - "compound statement">; -// - #pragma comment -def err_pragma_comment_malformed : Error< - "pragma comment requires parenthesized identifier and optional string">; -def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">; -// PS4 recognizes only #pragma comment(lib) -def warn_pragma_comment_ignored : Warning<"'#pragma comment %0' ignored">, - InGroup<IgnoredPragmas>; -// - #pragma detect_mismatch -def err_pragma_detect_mismatch_malformed : Error< - "pragma detect_mismatch is malformed; it requires two comma-separated " - "string literals">; -// - #pragma pointers_to_members -def err_pragma_pointers_to_members_unknown_kind : Error< - "unexpected %0, expected to see one of %select{|'best_case', 'full_generality', }1" - "'single_inheritance', 'multiple_inheritance', or 'virtual_inheritance'">; -// - #pragma clang optimize on/off -def err_pragma_optimize_invalid_argument : Error< - "unexpected argument '%0' to '#pragma clang optimize'; " - "expected 'on' or 'off'">; -def err_pragma_optimize_extra_argument : Error< - "unexpected extra argument '%0' to '#pragma clang optimize'">; - -// OpenCL EXTENSION pragma (OpenCL 1.1 [9.1]) -def warn_pragma_expected_colon : Warning< - "missing ':' after %0 - ignoring">, InGroup<IgnoredPragmas>; -def warn_pragma_expected_enable_disable : Warning< - "expected 'enable' or 'disable' - ignoring">, InGroup<IgnoredPragmas>; -def warn_pragma_unknown_extension : Warning< - "unknown OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>; - -// OpenCL error -def err_opencl_taking_function_address_parser : Error< - "taking address of function is not allowed">; - -// OpenMP support. -def warn_pragma_omp_ignored : Warning< - "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore; -def warn_omp_extra_tokens_at_eol : Warning< - "extra tokens at the end of '#pragma omp %0' are ignored">, - InGroup<ExtraTokens>; -def warn_pragma_expected_colon_r_paren : Warning< - "missing ':' or ')' after %0 - ignoring">, InGroup<IgnoredPragmas>; -def err_omp_unknown_directive : Error< - "expected an OpenMP directive">; -def err_omp_unexpected_directive : Error< - "unexpected OpenMP directive '#pragma omp %0'">; -def err_omp_expected_punc : Error< - "expected ',' or ')' in '%0' %select{clause|directive}1">; -def err_omp_unexpected_clause : Error< - "unexpected OpenMP clause '%0' in directive '#pragma omp %1'">; -def err_omp_immediate_directive : Error< - "'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">; -def err_omp_expected_identifier_for_critical : Error< - "expected identifier specifying the name of the 'omp critical' directive">; -def err_omp_unknown_map_type : Error< - "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">; -def err_omp_unknown_map_type_modifier : Error< - "incorrect map type modifier, expected 'always'">; -def err_omp_map_type_missing : Error< - "missing map type">; - -// Pragma loop support. -def err_pragma_loop_missing_argument : Error< - "missing argument; expected %select{an integer value|" - "'enable', %select{'assume_safety'|'full'}1 or 'disable'}0">; -def err_pragma_loop_invalid_option : Error< - "%select{invalid|missing}0 option%select{ %1|}0; expected vectorize, " - "vectorize_width, interleave, interleave_count, unroll, or unroll_count">; -def err_pragma_invalid_keyword : Error< - "invalid argument; expected 'enable', %select{'assume_safety'|'full'}0 or 'disable'">; - -// Pragma unroll support. -def warn_pragma_unroll_cuda_value_in_parens : Warning< - "argument to '#pragma unroll' should not be in parentheses in CUDA C/C++">, - InGroup<CudaCompat>; -} // end of Parse Issue category. - -let CategoryName = "Modules Issue" in { -def err_module_expected_ident : Error< - "expected a module name after module import">; -def err_module_expected_semi : Error< - "expected ';' after module name">; -def err_missing_before_module_end : Error<"expected %0 at end of module">; -} - -let CategoryName = "Generics Issue" in { - -def err_objc_expected_type_parameter : Error< - "expected type parameter name">; - -def err_objc_parameterized_implementation : Error< - "@implementation cannot have type parameters">; - -def err_objc_type_args_after_protocols : Error< - "protocol qualifiers must precede type arguments">; -} - -let CategoryName = "Coroutines Issue" in { -def err_for_co_await_not_range_for : Error< - "'co_await' modifier can only be applied to range-based for loop">; -} - -} // end of Parser diagnostics diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td deleted file mode 100644 index 59f5095..0000000 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ /dev/null @@ -1,8221 +0,0 @@ - -//==--- DiagnosticSemaKinds.td - libsema diagnostics ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -//===----------------------------------------------------------------------===// -// Semantic Analysis -//===----------------------------------------------------------------------===// - -let Component = "Sema" in { -let CategoryName = "Semantic Issue" in { - -def note_previous_decl : Note<"%0 declared here">; -def note_entity_declared_at : Note<"%0 declared here">; -def note_callee_decl : Note<"%0 declared here">; -def note_defined_here : Note<"%0 defined here">; - -// For loop analysis -def warn_variables_not_in_loop_body : Warning< - "variable%select{s| %1|s %1 and %2|s %1, %2, and %3|s %1, %2, %3, and %4}0 " - "used in loop condition not modified in loop body">, - InGroup<ForLoopAnalysis>, DefaultIgnore; -def warn_redundant_loop_iteration : Warning< - "variable %0 is %select{decremented|incremented}1 both in the loop header " - "and in the loop body">, - InGroup<ForLoopAnalysis>, DefaultIgnore; -def note_loop_iteration_here : Note<"%select{decremented|incremented}0 here">; - -def warn_for_range_const_reference_copy : Warning< - "loop variable %0 " - "%diff{has type $ but is initialized with type $" - "| is initialized with a value of a different type}1,2 resulting in a copy">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_type_or_non_reference : Note< - "use non-reference type %0 to keep the copy or type %1 to prevent copying">; -def warn_for_range_variable_always_copy : Warning< - "loop variable %0 is always a copy because the range of type %1 does not " - "return a reference">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_non_reference_type : Note<"use non-reference type %0">; -def warn_for_range_copy : Warning< - "loop variable %0 of type %1 creates a copy from type %2">, - InGroup<RangeLoopAnalysis>, DefaultIgnore; -def note_use_reference_type : Note<"use reference type %0 to prevent copying">; - -def warn_duplicate_enum_values : Warning< - "element %0 has been implicitly assigned %1 which another element has " - "been assigned">, InGroup<DiagGroup<"duplicate-enum">>, DefaultIgnore; -def note_duplicate_element : Note<"element %0 also has value %1">; - -// Absolute value functions -def warn_unsigned_abs : Warning< - "taking the absolute value of unsigned type %0 has no effect">, - InGroup<AbsoluteValue>; -def note_remove_abs : Note< - "remove the call to '%0' since unsigned values cannot be negative">; -def warn_abs_too_small : Warning< - "absolute value function %0 given an argument of type %1 but has parameter " - "of type %2 which may cause truncation of value">, InGroup<AbsoluteValue>; -def warn_wrong_absolute_value_type : Warning< - "using %select{integer|floating point|complex}1 absolute value function %0 " - "when argument is of %select{integer|floating point|complex}2 type">, - InGroup<AbsoluteValue>; -def note_replace_abs_function : Note<"use function '%0' instead">; -def warn_pointer_abs : Warning< - "taking the absolute value of %select{pointer|function|array}0 type %1 is suspicious">, - InGroup<AbsoluteValue>; - -def warn_infinite_recursive_function : Warning< - "all paths through this function will call itself">, - InGroup<InfiniteRecursion>, DefaultIgnore; - -// Constant expressions -def err_expr_not_ice : Error< - "expression is not an %select{integer|integral}0 constant expression">; -def ext_expr_not_ice : Extension< - "expression is not an %select{integer|integral}0 constant expression; " - "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>; -def err_typecheck_converted_constant_expression : Error< - "value of type %0 is not implicitly convertible to %1">; -def err_typecheck_converted_constant_expression_disallowed : Error< - "conversion from %0 to %1 is not allowed in a converted constant expression">; -def err_typecheck_converted_constant_expression_indirect : Error< - "conversion from %0 to %1 in converted constant expression would " - "bind reference to a temporary">; -def err_expr_not_cce : Error< - "%select{case value|enumerator value|non-type template argument|array size}0 " - "is not a constant expression">; -def ext_cce_narrowing : ExtWarn< - "%select{case value|enumerator value|non-type template argument|array size}0 " - "%select{cannot be narrowed from type %2 to %3|" - "evaluates to %2, which cannot be narrowed to type %3}1">, - InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; -def err_ice_not_integral : Error< - "integral constant expression must have integral or unscoped enumeration " - "type, not %0">; -def err_ice_incomplete_type : Error< - "integral constant expression has incomplete class type %0">; -def err_ice_explicit_conversion : Error< - "integral constant expression requires explicit conversion from %0 to %1">; -def note_ice_conversion_here : Note< - "conversion to %select{integral|enumeration}0 type %1 declared here">; -def err_ice_ambiguous_conversion : Error< - "ambiguous conversion from type %0 to an integral or unscoped " - "enumeration type">; -def err_ice_too_large : Error< - "integer constant expression evaluates to value %0 that cannot be " - "represented in a %1-bit %select{signed|unsigned}2 integer type">; -def err_expr_not_string_literal : Error<"expression is not a string literal">; - -// Semantic analysis of constant literals. -def ext_predef_outside_function : Warning< - "predefined identifier is only valid inside function">, - InGroup<DiagGroup<"predefined-identifier-outside-function">>; -def warn_float_overflow : Warning< - "magnitude of floating-point constant too large for type %0; maximum is %1">, - InGroup<LiteralRange>; -def warn_float_underflow : Warning< - "magnitude of floating-point constant too small for type %0; minimum is %1">, - InGroup<LiteralRange>; -def warn_double_const_requires_fp64 : Warning< - "double precision constant requires cl_khr_fp64, casting to single precision">; - -// C99 variable-length arrays -def ext_vla : Extension<"variable length arrays are a C99 feature">, - InGroup<VLAExtension>; -def warn_vla_used : Warning<"variable length array used">, - InGroup<VLA>, DefaultIgnore; -def err_vla_non_pod : Error<"variable length array of non-POD element type %0">; -def err_vla_in_sfinae : Error< - "variable length array cannot be formed during template argument deduction">; -def err_array_star_in_function_definition : Error< - "variable length array must be bound in function definition">; -def err_vla_decl_in_file_scope : Error< - "variable length array declaration not allowed at file scope">; -def err_vla_decl_has_static_storage : Error< - "variable length array declaration cannot have 'static' storage duration">; -def err_vla_decl_has_extern_linkage : Error< - "variable length array declaration cannot have 'extern' linkage">; -def ext_vla_folded_to_constant : Extension< - "variable length array folded to constant array as an extension">, InGroup<GNUFoldingConstant>; - -// C99 variably modified types -def err_variably_modified_template_arg : Error< - "variably modified type %0 cannot be used as a template argument">; -def err_variably_modified_nontype_template_param : Error< - "non-type template parameter of variably modified type %0">; -def err_variably_modified_new_type : Error< - "'new' cannot allocate object of variably modified type %0">; - -// C99 Designated Initializers -def ext_designated_init : Extension< - "designated initializers are a C99 feature">, InGroup<C99>; -def err_array_designator_negative : Error< - "array designator value '%0' is negative">; -def err_array_designator_empty_range : Error< - "array designator range [%0, %1] is empty">; -def err_array_designator_non_array : Error< - "array designator cannot initialize non-array type %0">; -def err_array_designator_too_large : Error< - "array designator index (%0) exceeds array bounds (%1)">; -def err_field_designator_non_aggr : Error< - "field designator cannot initialize a " - "%select{non-struct, non-union|non-class}0 type %1">; -def err_field_designator_unknown : Error< - "field designator %0 does not refer to any field in type %1">; -def err_field_designator_nonfield : Error< - "field designator %0 does not refer to a non-static data member">; -def note_field_designator_found : Note<"field designator refers here">; -def err_designator_for_scalar_init : Error< - "designator in initializer for scalar type %0">; -def warn_subobject_initializer_overrides : Warning< - "subobject initialization overrides initialization of other fields " - "within its enclosing subobject">, InGroup<InitializerOverrides>; -def warn_initializer_overrides : Warning< - "initializer overrides prior initialization of this subobject">, - InGroup<InitializerOverrides>; -def note_previous_initializer : Note< - "previous initialization %select{|with side effects }0is here" - "%select{| (side effects may not occur at run time)}0">; -def err_designator_into_flexible_array_member : Error< - "designator into flexible array member subobject">; -def note_flexible_array_member : Note< - "initialized flexible array member %0 is here">; -def ext_flexible_array_init : Extension< - "flexible array initialization is a GNU extension">, InGroup<GNUFlexibleArrayInitializer>; - -// Declarations. -def ext_duplicate_declspec : ExtWarn<"duplicate '%0' declaration specifier">, - InGroup<DuplicateDeclSpecifier>; -def warn_duplicate_declspec : Warning<"duplicate '%0' declaration specifier">, - InGroup<DuplicateDeclSpecifier>; -def ext_plain_complex : ExtWarn< - "plain '_Complex' requires a type specifier; assuming '_Complex double'">; -def ext_integer_complex : Extension< - "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>; - -def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">; -def err_invalid_width_spec : Error< - "'%select{|short|long|long long}0 %1' is invalid">; -def err_invalid_complex_spec : Error<"'_Complex %0' is invalid">; -def err_friend_decl_spec : Error<"'%0' is invalid in friend declarations">; - -def ext_auto_type_specifier : ExtWarn< - "'auto' type specifier is a C++11 extension">, InGroup<CXX11>; -def warn_auto_storage_class : Warning< - "'auto' storage class specifier is redundant and incompatible with C++11">, - InGroup<CXX11Compat>, DefaultIgnore; - -def warn_deprecated_register : Warning< - "'register' storage class specifier is deprecated " - "and incompatible with C++1z">, InGroup<DeprecatedRegister>; -def ext_register_storage_class : ExtWarn< - "ISO C++1z does not allow 'register' storage class specifier">, - DefaultError, InGroup<Register>; - -def err_invalid_decl_spec_combination : Error< - "cannot combine with previous '%0' declaration specifier">; -def err_invalid_vector_decl_spec_combination : Error< - "cannot combine with previous '%0' declaration specifier. " - "'__vector' must be first">; -def err_invalid_pixel_decl_spec_combination : Error< - "'__pixel' must be preceded by '__vector'. " - "'%0' declaration specifier not allowed here">; -def err_invalid_vector_bool_decl_spec : Error< - "cannot use '%0' with '__vector bool'">; -def err_invalid_vector_long_decl_spec : Error< - "cannot use 'long' with '__vector'">; -def err_invalid_vector_float_decl_spec : Error< - "cannot use 'float' with '__vector'">; -def err_invalid_vector_double_decl_spec : Error < - "use of 'double' with '__vector' requires VSX support to be enabled " - "(available on POWER7 or later)">; -def err_invalid_vector_long_long_decl_spec : Error < - "use of 'long long' with '__vector bool' requires VSX support (available on " - "POWER7 or later) or extended Altivec support (available on POWER8 or later) " - "to be enabled">; -def err_invalid_vector_long_double_decl_spec : Error< - "cannot use 'long double' with '__vector'">; -def warn_vector_long_decl_spec_combination : Warning< - "Use of 'long' with '__vector' is deprecated">, InGroup<Deprecated>; - -def err_use_of_tag_name_without_tag : Error< - "must use '%1' tag to refer to type %0%select{| in this scope}2">; - -def err_redeclaration_different_type : Error< - "redeclaration of %0 with a different type%diff{: $ vs $|}1,2">; -def err_bad_variable_name : Error< - "%0 cannot be the name of a variable or data member">; -def err_bad_parameter_name : Error< - "%0 cannot be the name of a parameter">; -def err_parameter_name_omitted : Error<"parameter name omitted">; -def warn_mips_interrupt_attribute : Warning< - "MIPS '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">, - InGroup<UnusedVariable>, DefaultIgnore; -def warn_unused_local_typedef : Warning< - "unused %select{typedef|type alias}0 %1">, - InGroup<UnusedLocalTypedef>, DefaultIgnore; -def warn_unused_property_backing_ivar : - Warning<"ivar %0 which backs the property is not " - "referenced in this property's accessor">, - InGroup<UnusedPropertyIvar>, DefaultIgnore; -def warn_unused_const_variable : Warning<"unused variable %0">, - InGroup<UnusedConstVariable>, DefaultIgnore; -def warn_unused_exception_param : Warning<"unused exception parameter %0">, - InGroup<UnusedExceptionParameter>, DefaultIgnore; -def warn_decl_in_param_list : Warning< - "declaration of %0 will not be visible outside of this function">, - InGroup<Visibility>; -def warn_redefinition_in_param_list : Warning< - "redefinition of %0 will not be visible outside of this function">, - InGroup<Visibility>; -def warn_empty_parens_are_function_decl : Warning< - "empty parentheses interpreted as a function declaration">, - InGroup<VexingParse>; -def warn_parens_disambiguated_as_function_declaration : Warning< - "parentheses were disambiguated as a function declaration">, - InGroup<VexingParse>; -def note_additional_parens_for_variable_declaration : Note< - "add a pair of parentheses to declare a variable">; -def note_empty_parens_function_call : Note< - "change this ',' to a ';' to call %0">; -def note_empty_parens_default_ctor : Note< - "remove parentheses to declare a variable">; -def note_empty_parens_zero_initialize : Note< - "replace parentheses with an initializer to declare a variable">; -def warn_unused_function : Warning<"unused function %0">, - InGroup<UnusedFunction>, DefaultIgnore; -def warn_unused_member_function : Warning<"unused member function %0">, - InGroup<UnusedMemberFunction>, DefaultIgnore; -def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">, - InGroup<UsedButMarkedUnused>, DefaultIgnore; -def warn_unneeded_internal_decl : Warning< - "%select{function|variable}0 %1 is not needed and will not be emitted">, - InGroup<UnneededInternalDecl>, DefaultIgnore; -def warn_unneeded_static_internal_decl : Warning< - "'static' function %0 declared in header file " - "should be declared 'static inline'">, - InGroup<UnneededInternalDecl>, DefaultIgnore; -def warn_unneeded_member_function : Warning< - "member function %0 is not needed and will not be emitted">, - InGroup<UnneededMemberFunction>, DefaultIgnore; -def warn_unused_private_field: Warning<"private field %0 is not used">, - InGroup<UnusedPrivateField>, DefaultIgnore; - -def warn_parameter_size: Warning< - "%0 is a large (%1 bytes) pass-by-value argument; " - "pass it by reference instead ?">, InGroup<LargeByValueCopy>; -def warn_return_value_size: Warning< - "return value of %0 is a large (%1 bytes) pass-by-value object; " - "pass it by reference instead ?">, InGroup<LargeByValueCopy>; -def warn_return_value_udt: Warning< - "%0 has C-linkage specified, but returns user-defined type %1 which is " - "incompatible with C">, InGroup<ReturnTypeCLinkage>; -def warn_return_value_udt_incomplete: Warning< - "%0 has C-linkage specified, but returns incomplete type %1 which could be " - "incompatible with C">, InGroup<ReturnTypeCLinkage>; -def warn_implicit_function_decl : Warning< - "implicit declaration of function %0">, - InGroup<ImplicitFunctionDeclare>, DefaultIgnore; -def ext_implicit_function_decl : ExtWarn< - "implicit declaration of function %0 is invalid in C99">, - InGroup<ImplicitFunctionDeclare>; -def note_function_suggestion : Note<"did you mean %0?">; - -def err_ellipsis_first_param : Error< - "ISO C requires a named parameter before '...'">; -def err_declarator_need_ident : Error<"declarator requires an identifier">; -def err_language_linkage_spec_unknown : Error<"unknown linkage language">; -def err_language_linkage_spec_not_ascii : Error< - "string literal in language linkage specifier cannot have an " - "encoding-prefix">; -def warn_use_out_of_scope_declaration : Warning< - "use of out-of-scope declaration of %0">; -def err_inline_non_function : Error< - "'inline' can only appear on functions">; -def err_noreturn_non_function : Error< - "'_Noreturn' can only appear on functions">; -def warn_qual_return_type : Warning< - "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">, - InGroup<IgnoredQualifiers>, DefaultIgnore; - -def warn_decl_shadow : - Warning<"declaration shadows a %select{" - "local variable|" - "variable in %2|" - "static data member of %2|" - "field of %2}1">, - InGroup<Shadow>, DefaultIgnore; - -// C++ using declarations -def err_using_requires_qualname : Error< - "using declaration requires a qualified name">; -def err_using_typename_non_type : Error< - "'typename' keyword used on a non-type">; -def err_using_dependent_value_is_type : Error< - "dependent using declaration resolved to type without 'typename'">; -def err_using_decl_nested_name_specifier_is_not_class : Error< - "using declaration in class refers into '%0', which is not a class">; -def err_using_decl_nested_name_specifier_is_current_class : Error< - "using declaration refers to its own class">; -def err_using_decl_nested_name_specifier_is_not_base_class : Error< - "using declaration refers into '%0', which is not a base class of %1">; -def err_using_decl_constructor_not_in_direct_base : Error< - "%0 is not a direct base of %1, cannot inherit constructors">; -def err_using_decl_constructor_conflict : Error< - "cannot inherit constructor, already inherited constructor with " - "the same signature">; -def note_using_decl_constructor_conflict_current_ctor : Note< - "conflicting constructor">; -def note_using_decl_constructor_conflict_previous_ctor : Note< - "previous constructor">; -def note_using_decl_constructor_conflict_previous_using : Note< - "previously inherited here">; -def warn_using_decl_constructor_ellipsis : Warning< - "inheriting constructor does not inherit ellipsis">, - InGroup<DiagGroup<"inherited-variadic-ctor">>; -def note_using_decl_constructor_ellipsis : Note< - "constructor declared with ellipsis here">; -def err_using_decl_can_not_refer_to_class_member : Error< - "using declaration cannot refer to class member">; -def note_using_decl_class_member_workaround : Note< - "use %select{an alias declaration|a typedef declaration|a reference}0 " - "instead">; -def err_using_decl_can_not_refer_to_namespace : Error< - "using declaration cannot refer to namespace">; -def err_using_decl_constructor : Error< - "using declaration cannot refer to a constructor">; -def warn_cxx98_compat_using_decl_constructor : Warning< - "inheriting constructors are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_using_decl_destructor : Error< - "using declaration cannot refer to a destructor">; -def err_using_decl_template_id : Error< - "using declaration cannot refer to a template specialization">; -def note_using_decl_target : Note<"target of using declaration">; -def note_using_decl_conflict : Note<"conflicting declaration">; -def err_using_decl_redeclaration : Error<"redeclaration of using decl">; -def err_using_decl_conflict : Error< - "target of using declaration conflicts with declaration already in scope">; -def err_using_decl_conflict_reverse : Error< - "declaration conflicts with target of using declaration already in scope">; -def note_using_decl : Note<"%select{|previous }0using declaration">; - -def warn_access_decl_deprecated : Warning< - "access declarations are deprecated; use using declarations instead">, - InGroup<Deprecated>; -def err_access_decl : Error< - "ISO C++11 does not allow access declarations; " - "use using declarations instead">; -def warn_exception_spec_deprecated : Warning< - "dynamic exception specifications are deprecated">, - InGroup<Deprecated>, DefaultIgnore; -def note_exception_spec_deprecated : Note<"use '%0' instead">; -def warn_deprecated_copy_operation : Warning< - "definition of implicit copy %select{constructor|assignment operator}1 " - "for %0 is deprecated because it has a user-declared " - "%select{copy %select{assignment operator|constructor}1|destructor}2">, - InGroup<Deprecated>, DefaultIgnore; - -def warn_global_constructor : Warning< - "declaration requires a global constructor">, - InGroup<GlobalConstructors>, DefaultIgnore; -def warn_global_destructor : Warning< - "declaration requires a global destructor">, - InGroup<GlobalConstructors>, DefaultIgnore; -def warn_exit_time_destructor : Warning< - "declaration requires an exit-time destructor">, - InGroup<ExitTimeDestructors>, DefaultIgnore; - -def err_invalid_thread : Error< - "'%0' is only allowed on variable declarations">; -def err_thread_non_global : Error< - "'%0' variables must have global storage">; -def err_thread_unsupported : Error< - "thread-local storage is not supported for the current target">; - -def warn_maybe_falloff_nonvoid_function : Warning< - "control may reach end of non-void function">, - InGroup<ReturnType>; -def warn_falloff_nonvoid_function : Warning< - "control reaches end of non-void function">, - InGroup<ReturnType>; -def err_maybe_falloff_nonvoid_block : Error< - "control may reach end of non-void block">; -def err_falloff_nonvoid_block : Error< - "control reaches end of non-void block">; -def warn_suggest_noreturn_function : Warning< - "%select{function|method}0 %1 could be declared with attribute 'noreturn'">, - InGroup<MissingNoreturn>, DefaultIgnore; -def warn_suggest_noreturn_block : Warning< - "block could be declared with attribute 'noreturn'">, - InGroup<MissingNoreturn>, DefaultIgnore; - -// Unreachable code. -def warn_unreachable : Warning< - "code will never be executed">, - InGroup<UnreachableCode>, DefaultIgnore; -def warn_unreachable_break : Warning< - "'break' will never be executed">, - InGroup<UnreachableCodeBreak>, DefaultIgnore; -def warn_unreachable_return : Warning< - "'return' will never be executed">, - InGroup<UnreachableCodeReturn>, DefaultIgnore; -def warn_unreachable_loop_increment : Warning< - "loop will run at most once (loop increment never executed)">, - InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore; -def note_unreachable_silence : Note< - "silence by adding parentheses to mark code as explicitly dead">; - -/// Built-in functions. -def ext_implicit_lib_function_decl : ExtWarn< - "implicitly declaring library function '%0' with type %1">, - InGroup<ImplicitFunctionDeclare>; -def note_include_header_or_declare : Note< - "include the header <%0> or explicitly provide a declaration for '%1'">; -def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">; -def warn_implicit_decl_requires_sysheader : Warning< - "declaration of built-in function '%1' requires inclusion of the header <%0>">, - InGroup<BuiltinRequiresHeader>; -def warn_redecl_library_builtin : Warning< - "incompatible redeclaration of library function %0">, - InGroup<DiagGroup<"incompatible-library-redeclaration">>; -def err_builtin_definition : Error<"definition of builtin function %0">; -def err_arm_invalid_specialreg : Error<"invalid special register for builtin">; -def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">; -def err_builtin_needs_feature : Error<"%0 needs target feature %1">; -def err_function_needs_feature - : Error<"always_inline function %1 requires target feature '%2', but would " - "be inlined into function %0 that is compiled without support for " - "'%2'">; -def warn_builtin_unknown : Warning<"use of unknown builtin %0">, - InGroup<ImplicitFunctionDeclare>, DefaultError; -def warn_dyn_class_memaccess : Warning< - "%select{destination for|source of|first operand of|second operand of}0 this " - "%1 call is a pointer to %select{|class containing a }2dynamic class %3; " - "vtable pointer will be %select{overwritten|copied|moved|compared}4">, - InGroup<DiagGroup<"dynamic-class-memaccess">>; -def note_bad_memaccess_silence : Note< - "explicitly cast the pointer to silence this warning">; -def warn_sizeof_pointer_expr_memaccess : Warning< - "'%0' call operates on objects of type %1 while the size is based on a " - "different type %2">, - InGroup<SizeofPointerMemaccess>; -def warn_sizeof_pointer_expr_memaccess_note : Note< - "did you mean to %select{dereference the argument to 'sizeof' (and multiply " - "it by the number of elements)|remove the addressof in the argument to " - "'sizeof' (and multiply it by the number of elements)|provide an explicit " - "length}0?">; -def warn_sizeof_pointer_type_memaccess : Warning< - "argument to 'sizeof' in %0 call is the same pointer type %1 as the " - "%select{destination|source}2; expected %3 or an explicit length">, - InGroup<SizeofPointerMemaccess>; -def warn_strlcpycat_wrong_size : Warning< - "size argument in %0 call appears to be size of the source; " - "expected the size of the destination">, - InGroup<DiagGroup<"strlcpy-strlcat-size">>; -def note_strlcpycat_wrong_size : Note< - "change size argument to be the size of the destination">; -def warn_memsize_comparison : Warning< - "size argument in %0 call is a comparison">, - InGroup<DiagGroup<"memsize-comparison">>; -def note_memsize_comparison_paren : Note< - "did you mean to compare the result of %0 instead?">; -def note_memsize_comparison_cast_silence : Note< - "explicitly cast the argument to size_t to silence this warning">; - -def warn_strncat_large_size : Warning< - "the value of the size argument in 'strncat' is too large, might lead to a " - "buffer overflow">, InGroup<StrncatSize>; -def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " - "to be size of the source">, InGroup<StrncatSize>; -def warn_strncat_wrong_size : Warning< - "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>; -def note_strncat_wrong_size : Note< - "change the argument to be the free space in the destination buffer minus " - "the terminating null byte">; - -def warn_assume_side_effects : Warning< - "the argument to %0 has side effects that will be discarded">, - InGroup<DiagGroup<"assume">>; - -def warn_memcpy_chk_overflow : Warning< - "%0 will always overflow destination buffer">, - InGroup<DiagGroup<"builtin-memcpy-chk-size">>; - -/// main() -// static main() is not an error in C, just in C++. -def warn_static_main : Warning<"'main' should not be declared static">, - InGroup<Main>; -def err_static_main : Error<"'main' is not allowed to be declared static">; -def err_inline_main : Error<"'main' is not allowed to be declared inline">; -def ext_variadic_main : ExtWarn< - "'main' is not allowed to be declared variadic">, InGroup<Main>; -def ext_noreturn_main : ExtWarn< - "'main' is not allowed to be declared _Noreturn">, InGroup<Main>; -def note_main_remove_noreturn : Note<"remove '_Noreturn'">; -def err_constexpr_main : Error< - "'main' is not allowed to be declared constexpr">; -def err_deleted_main : Error<"'main' is not allowed to be deleted">; -def err_mainlike_template_decl : Error<"%0 cannot be a template">; -def err_main_returns_nonint : Error<"'main' must return 'int'">; -def ext_main_returns_nonint : ExtWarn<"return type of 'main' is not 'int'">, - InGroup<MainReturnType>; -def note_main_change_return_type : Note<"change return type to 'int'">; -def err_main_surplus_args : Error<"too many parameters (%0) for 'main': " - "must be 0, 2, or 3">; -def warn_main_one_arg : Warning<"only one parameter on 'main' declaration">, - InGroup<Main>; -def err_main_arg_wrong : Error<"%select{first|second|third|fourth}0 " - "parameter of 'main' (%select{argument count|argument array|environment|" - "platform-specific data}0) must be of type %1">; -def err_main_global_variable : - Error<"main cannot be declared as global variable">; -def warn_main_redefined : Warning<"variable named 'main' with external linkage " - "has undefined behavior">, InGroup<Main>; -def ext_main_used : Extension< - "ISO C++ does not allow 'main' to be used by a program">, InGroup<Main>; - -/// parser diagnostics -def ext_no_declarators : ExtWarn<"declaration does not declare anything">, - InGroup<MissingDeclarations>; -def ext_typedef_without_a_name : ExtWarn<"typedef requires a name">, - InGroup<MissingDeclarations>; -def err_typedef_not_identifier : Error<"typedef name must be an identifier">; -def err_typedef_changes_linkage : Error<"unsupported: typedef changes linkage" - " of anonymous type, but linkage was already computed">; -def note_typedef_changes_linkage : Note<"use a tag name here to establish " - "linkage prior to definition">; -def err_statically_allocated_object : Error< - "interface type cannot be statically allocated">; -def err_object_cannot_be_passed_returned_by_value : Error< - "interface type %1 cannot be %select{returned|passed}0 by value" - "; did you forget * in %1?">; -def err_parameters_retval_cannot_have_fp16_type : Error< - "%select{parameters|function return value}0 cannot have __fp16 type; did you forget * ?">; -def err_opencl_half_load_store : Error< - "%select{loading directly from|assigning directly to}0 pointer to type %1 is not allowed">; -def err_opencl_cast_to_half : Error<"casting to type %0 is not allowed">; -def err_opencl_half_declaration : Error< - "declaring variable of type %0 is not allowed">; -def err_opencl_half_param : Error< - "declaring function parameter of type %0 is not allowed; did you forget * ?">; -def err_opencl_half_return : Error< - "declaring function return value of type %0 is not allowed; did you forget * ?">; -def warn_enum_value_overflow : Warning<"overflow in enumeration value">; -def warn_pragma_options_align_reset_failed : Warning< - "#pragma options align=reset failed: %0">, - InGroup<IgnoredPragmas>; -def err_pragma_options_align_mac68k_target_unsupported : Error< - "mac68k alignment pragma is not supported on this target">; -def warn_pragma_pack_invalid_alignment : Warning< - "expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">, - InGroup<IgnoredPragmas>; -// Follow the Microsoft implementation. -def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">; -def warn_pragma_pack_pop_identifer_and_alignment : Warning< - "specifying both a name and alignment to 'pop' is undefined">; -def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">, - InGroup<IgnoredPragmas>; -def warn_cxx_ms_struct : - Warning<"ms_struct may not produce Microsoft-compatible layouts for classes " - "with base classes or virtual functions">, - DefaultError, InGroup<IncompatibleMSStruct>; -def err_section_conflict : Error<"%0 causes a section type conflict with %1">; -def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">; -def err_invalid_super_scope : Error<"invalid use of '__super', " - "this keyword can only be used inside class or member function scope">; -def err_super_in_lambda_unsupported : Error< - "use of '__super' inside a lambda is unsupported">; - -def warn_pragma_unused_undeclared_var : Warning< - "undeclared variable %0 used as an argument for '#pragma unused'">, - InGroup<IgnoredPragmas>; -def warn_pragma_unused_expected_var_arg : Warning< - "only variables can be arguments to '#pragma unused'">, - InGroup<IgnoredPragmas>; -def err_pragma_push_visibility_mismatch : Error< - "#pragma visibility push with no matching #pragma visibility pop">; -def note_surrounding_namespace_ends_here : Note< - "surrounding namespace with visibility attribute ends here">; -def err_pragma_pop_visibility_mismatch : Error< - "#pragma visibility pop with no matching #pragma visibility push">; -def note_surrounding_namespace_starts_here : Note< - "surrounding namespace with visibility attribute starts here">; -def err_pragma_loop_invalid_argument_type : Error< - "invalid argument of type %0; expected an integer type">; -def err_pragma_loop_invalid_argument_value : Error< - "%select{invalid value '%0'; must be positive|value '%0' is too large}1">; -def err_pragma_loop_compatibility : Error< - "%select{incompatible|duplicate}0 directives '%1' and '%2'">; -def err_pragma_loop_precedes_nonloop : Error< - "expected a for, while, or do-while loop to follow '%0'">; - -/// Objective-C parser diagnostics -def err_duplicate_class_def : Error< - "duplicate interface definition for class %0">; -def err_undef_superclass : Error< - "cannot find interface declaration for %0, superclass of %1">; -def err_forward_superclass : Error< - "attempting to use the forward class %0 as superclass of %1">; -def err_no_nsconstant_string_class : Error< - "cannot find interface declaration for %0">; -def err_recursive_superclass : Error< - "trying to recursively use %0 as superclass of %1">; -def err_conflicting_aliasing_type : Error<"conflicting types for alias %0">; -def warn_undef_interface : Warning<"cannot find interface declaration for %0">; -def warn_duplicate_protocol_def : Warning<"duplicate protocol definition of %0 is ignored">; -def err_protocol_has_circular_dependency : Error< - "protocol has circular dependency">; -def err_undeclared_protocol : Error<"cannot find protocol declaration for %0">; -def warn_undef_protocolref : Warning<"cannot find protocol definition for %0">; -def warn_atprotocol_protocol : Warning< - "@protocol is using a forward protocol declaration of %0">, InGroup<AtProtocol>; -def warn_readonly_property : Warning< - "attribute 'readonly' of property %0 restricts attribute " - "'readwrite' of property inherited from %1">, - InGroup<PropertyAttr>; - -def warn_property_attribute : Warning< - "'%1' attribute on property %0 does not match the property inherited from %2">, - InGroup<PropertyAttr>; -def warn_property_types_are_incompatible : Warning< - "property type %0 is incompatible with type %1 inherited from %2">, - InGroup<DiagGroup<"incompatible-property-type">>; -def warn_protocol_property_mismatch : Warning< - "property of type %0 was selected for synthesis">, - InGroup<DiagGroup<"protocol-property-synthesis-ambiguity">>; -def err_undef_interface : Error<"cannot find interface declaration for %0">; -def err_category_forward_interface : Error< - "cannot define %select{category|class extension}0 for undefined class %1">; -def err_class_extension_after_impl : Error< - "cannot declare class extension for %0 after class implementation">; -def note_implementation_declared : Note< - "class implementation is declared here">; -def note_while_in_implementation : Note< - "detected while default synthesizing properties in class implementation">; -def note_class_declared : Note< - "class is declared here">; -def note_receiver_class_declared : Note< - "receiver is instance of class declared here">; -def note_receiver_expr_here : Note< - "receiver expression is here">; -def note_receiver_is_id : Note< - "receiver is treated with 'id' type for purpose of method lookup">; -def note_suppressed_class_declare : Note< - "class with specified objc_requires_property_definitions attribute is declared here">; -def err_objc_root_class_subclass : Error< - "objc_root_class attribute may only be specified on a root class declaration">; -def warn_objc_root_class_missing : Warning< - "class %0 defined without specifying a base class">, - InGroup<ObjCRootClass>; -def note_objc_needs_superclass : Note< - "add a super class to fix this problem">; -def warn_dup_category_def : Warning< - "duplicate definition of category %1 on interface %0">; -def err_conflicting_super_class : Error<"conflicting super class name %0">; -def err_dup_implementation_class : Error<"reimplementation of class %0">; -def err_dup_implementation_category : Error< - "reimplementation of category %1 for class %0">; -def err_conflicting_ivar_type : Error< - "instance variable %0 has conflicting type%diff{: $ vs $|}1,2">; -def err_duplicate_ivar_declaration : Error< - "instance variable is already declared">; -def warn_on_superclass_use : Warning< - "class implementation may not have super class">; -def err_conflicting_ivar_bitwidth : Error< - "instance variable %0 has conflicting bit-field width">; -def err_conflicting_ivar_name : Error< - "conflicting instance variable names: %0 vs %1">; -def err_inconsistent_ivar_count : Error< - "inconsistent number of instance variables specified">; -def warn_undef_method_impl : Warning<"method definition for %0 not found">, - InGroup<DiagGroup<"incomplete-implementation">>; - -def warn_conflicting_overriding_ret_types : Warning< - "conflicting return type in " - "declaration of %0%diff{: $ vs $|}1,2">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_conflicting_ret_types : Warning< - "conflicting return type in " - "implementation of %0%diff{: $ vs $|}1,2">, - InGroup<MismatchedReturnTypes>; - -def warn_conflicting_overriding_ret_type_modifiers : Warning< - "conflicting distributed object modifiers on return type " - "in declaration of %0">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_conflicting_ret_type_modifiers : Warning< - "conflicting distributed object modifiers on return type " - "in implementation of %0">, - InGroup<DistributedObjectModifiers>; - -def warn_non_covariant_overriding_ret_types : Warning< - "conflicting return type in " - "declaration of %0: %1 vs %2">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_non_covariant_ret_types : Warning< - "conflicting return type in " - "implementation of %0: %1 vs %2">, - InGroup<MethodSignatures>, DefaultIgnore; - -def warn_conflicting_overriding_param_types : Warning< - "conflicting parameter types in " - "declaration of %0%diff{: $ vs $|}1,2">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_conflicting_param_types : Warning< - "conflicting parameter types in " - "implementation of %0%diff{: $ vs $|}1,2">, - InGroup<MismatchedParameterTypes>; - -def warn_conflicting_param_modifiers : Warning< - "conflicting distributed object modifiers on parameter type " - "in implementation of %0">, - InGroup<DistributedObjectModifiers>; - -def warn_conflicting_overriding_param_modifiers : Warning< - "conflicting distributed object modifiers on parameter type " - "in declaration of %0">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_non_contravariant_overriding_param_types : Warning< - "conflicting parameter types in " - "declaration of %0: %1 vs %2">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_non_contravariant_param_types : Warning< - "conflicting parameter types in " - "implementation of %0: %1 vs %2">, - InGroup<MethodSignatures>, DefaultIgnore; - -def warn_conflicting_overriding_variadic :Warning< - "conflicting variadic declaration of method and its " - "implementation">, - InGroup<OverridingMethodMismatch>, DefaultIgnore; - -def warn_conflicting_variadic :Warning< - "conflicting variadic declaration of method and its " - "implementation">; - -def warn_category_method_impl_match:Warning< - "category is implementing a method which will also be implemented" - " by its primary class">, InGroup<ObjCProtocolMethodImpl>; - -def warn_implements_nscopying : Warning< -"default assign attribute on property %0 which implements " -"NSCopying protocol is not appropriate with -fobjc-gc[-only]">; - -def warn_multiple_method_decl : Warning<"multiple methods named %0 found">, - InGroup<ObjCMultipleMethodNames>; -def warn_strict_multiple_method_decl : Warning< - "multiple methods named %0 found">, InGroup<StrictSelector>, DefaultIgnore; -def warn_accessor_property_type_mismatch : Warning< - "type of property %0 does not match type of accessor %1">; -def not_conv_function_declared_at : Note<"type conversion function declared here">; -def note_method_declared_at : Note<"method %0 declared here">; -def note_property_attribute : Note<"property %0 is declared " - "%select{deprecated|unavailable|partial}1 here">; -def err_setter_type_void : Error<"type of setter must be void">; -def err_duplicate_method_decl : Error<"duplicate declaration of method %0">; -def warn_duplicate_method_decl : - Warning<"multiple declarations of method %0 found and ignored">, - InGroup<MethodDuplicate>, DefaultIgnore; -def warn_objc_cdirective_format_string : - Warning<"using %0 directive in %select{NSString|CFString}1 " - "which is being passed as a formatting argument to the formatting " - "%select{method|CFfunction}2">, - InGroup<ObjCCStringFormat>, DefaultIgnore; -def err_objc_var_decl_inclass : - Error<"cannot declare variable inside @interface or @protocol">; -def error_missing_method_context : Error< - "missing context for method declaration">; -def err_objc_property_attr_mutually_exclusive : Error< - "property attributes '%0' and '%1' are mutually exclusive">; -def err_objc_property_requires_object : Error< - "property with '%0' attribute must be of object type">; -def warn_objc_property_no_assignment_attribute : Warning< - "no 'assign', 'retain', or 'copy' attribute is specified - " - "'assign' is assumed">, - InGroup<ObjCPropertyNoAttribute>; -def warn_objc_isa_use : Warning< - "direct access to Objective-C's isa is deprecated in favor of " - "object_getClass()">, InGroup<DeprecatedObjCIsaUsage>; -def warn_objc_isa_assign : Warning< - "assignment to Objective-C's isa is deprecated in favor of " - "object_setClass()">, InGroup<DeprecatedObjCIsaUsage>; -def warn_objc_pointer_masking : Warning< - "bitmasking for introspection of Objective-C object pointers is strongly " - "discouraged">, - InGroup<ObjCPointerIntrospect>; -def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>, - InGroup<ObjCPointerIntrospectPerformSelector>; -def warn_objc_property_default_assign_on_object : Warning< - "default property attribute 'assign' not appropriate for non-GC object">, - InGroup<ObjCPropertyNoAttribute>; -def warn_property_attr_mismatch : Warning< - "property attribute in class extension does not match the primary class">, - InGroup<PropertyAttr>; -def warn_property_implicitly_mismatched : Warning < - "primary property declaration is implicitly strong while redeclaration " - "in class extension is weak">, - InGroup<DiagGroup<"objc-property-implicit-mismatch">>; -def warn_objc_property_copy_missing_on_block : Warning< - "'copy' attribute must be specified for the block property " - "when -fobjc-gc-only is specified">; -def warn_objc_property_retain_of_block : Warning< - "retain'ed block property does not copy the block " - "- use copy attribute instead">, InGroup<ObjCRetainBlockProperty>; -def warn_objc_readonly_property_has_setter : Warning< - "setter cannot be specified for a readonly property">, - InGroup<ObjCReadonlyPropertyHasSetter>; -def warn_atomic_property_rule : Warning< - "writable atomic property %0 cannot pair a synthesized %select{getter|setter}1 " - "with a user defined %select{getter|setter}2">, - InGroup<DiagGroup<"atomic-property-with-user-defined-accessor">>; -def note_atomic_property_fixup_suggest : Note<"setter and getter must both be " - "synthesized, or both be user defined,or the property must be nonatomic">; -def err_atomic_property_nontrivial_assign_op : Error< - "atomic property of reference type %0 cannot have non-trivial assignment" - " operator">; -def warn_cocoa_naming_owned_rule : Warning< - "property follows Cocoa naming" - " convention for returning 'owned' objects">, - InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>; -def err_cocoa_naming_owned_rule : Error< - "property follows Cocoa naming" - " convention for returning 'owned' objects">; -def note_cocoa_naming_declare_family : Note< - "explicitly declare getter %objcinstance0 with '%1' to return an 'unowned' " - "object">; -def warn_auto_synthesizing_protocol_property :Warning< - "auto property synthesis will not synthesize property %0" - " declared in protocol %1">, - InGroup<DiagGroup<"objc-protocol-property-synthesis">>; -def warn_no_autosynthesis_shared_ivar_property : Warning < - "auto property synthesis will not synthesize property " - "%0 because it cannot share an ivar with another synthesized property">, - InGroup<ObjCNoPropertyAutoSynthesis>; -def warn_no_autosynthesis_property : Warning< - "auto property synthesis will not synthesize property " - "%0 because it is 'readwrite' but it will be synthesized 'readonly' " - "via another property">, - InGroup<ObjCNoPropertyAutoSynthesis>; -def warn_autosynthesis_property_in_superclass : Warning< - "auto property synthesis will not synthesize property " - "%0; it will be implemented by its superclass, use @dynamic to " - "acknowledge intention">, - InGroup<ObjCNoPropertyAutoSynthesis>; -def warn_autosynthesis_property_ivar_match :Warning< - "autosynthesized property %0 will use %select{|synthesized}1 instance variable " - "%2, not existing instance variable %3">, - InGroup<DiagGroup<"objc-autosynthesis-property-ivar-name-match">>; -def warn_missing_explicit_synthesis : Warning < - "auto property synthesis is synthesizing property not explicitly synthesized">, - InGroup<DiagGroup<"objc-missing-property-synthesis">>, DefaultIgnore; -def warn_property_getter_owning_mismatch : Warning< - "property declared as returning non-retained objects" - "; getter returning retained objects">; -def warn_property_redecl_getter_mismatch : Warning< - "getter name mismatch between property redeclaration (%1) and its original " - "declaration (%0)">, InGroup<PropertyAttr>; -def error_property_setter_ambiguous_use : Error< - "synthesized properties %0 and %1 both claim setter %2 -" - " use of this setter will cause unexpected behavior">; -def warn_default_atomic_custom_getter_setter : Warning< - "atomic by default property %0 has a user defined %select{getter|setter}1 " - "(property should be marked 'atomic' if this is intended)">, - InGroup<CustomAtomic>, DefaultIgnore; -def err_use_continuation_class : Error< - "illegal redeclaration of property in class extension %0" - " (attribute must be 'readwrite', while its primary must be 'readonly')">; -def err_type_mismatch_continuation_class : Error< - "type of property %0 in class extension does not match " - "property type in primary class">; -def err_use_continuation_class_redeclaration_readwrite : Error< - "illegal redeclaration of 'readwrite' property in class extension %0" - " (perhaps you intended this to be a 'readwrite' redeclaration of a " - "'readonly' public property?)">; -def err_continuation_class : Error<"class extension has no primary class">; -def err_property_type : Error<"property cannot have array or function type %0">; -def error_missing_property_context : Error< - "missing context for property implementation declaration">; -def error_bad_property_decl : Error< - "property implementation must have its declaration in interface %0 or one of " - "its extensions">; -def error_category_property : Error< - "property declared in category %0 cannot be implemented in " - "class implementation">; -def note_property_declare : Note< - "property declared here">; -def note_protocol_property_declare : Note< - "it could also be property of type %0 declared here">; -def note_property_synthesize : Note< - "property synthesized here">; -def error_synthesize_category_decl : Error< - "@synthesize not allowed in a category's implementation">; -def error_reference_property : Error< - "property of reference type is not supported">; -def error_missing_property_interface : Error< - "property implementation in a category with no category declaration">; -def error_bad_category_property_decl : Error< - "property implementation must have its declaration in the category %0">; -def error_bad_property_context : Error< - "property implementation must be in a class or category implementation">; -def error_missing_property_ivar_decl : Error< - "synthesized property %0 must either be named the same as a compatible" - " instance variable or must explicitly name an instance variable">; -def err_arc_perform_selector_retains : Error< - "performSelector names a selector which retains the object">; -def warn_arc_perform_selector_leaks : Warning< - "performSelector may cause a leak because its selector is unknown">, - InGroup<DiagGroup<"arc-performSelector-leaks">>; -def warn_dealloc_in_category : Warning< -"-dealloc is being overridden in a category">, -InGroup<DeallocInCategory>; -def err_gc_weak_property_strong_type : Error< - "weak attribute declared on a __strong type property in GC mode">; -def warn_arc_repeated_use_of_weak : Warning < - "weak %select{variable|property|implicit property|instance variable}0 %1 is " - "accessed multiple times in this %select{function|method|block|lambda}2 " - "but may be unpredictably set to nil; assign to a strong variable to keep " - "the object alive">, - InGroup<ARCRepeatedUseOfWeak>, DefaultIgnore; -def warn_implicitly_retains_self : Warning < - "block implicitly retains 'self'; explicitly mention 'self' to indicate " - "this is intended behavior">, - InGroup<DiagGroup<"implicit-retain-self">>, DefaultIgnore; -def warn_arc_possible_repeated_use_of_weak : Warning < - "weak %select{variable|property|implicit property|instance variable}0 %1 may " - "be accessed multiple times in this %select{function|method|block|lambda}2 " - "and may be unpredictably set to nil; assign to a strong variable to keep " - "the object alive">, - InGroup<ARCRepeatedUseOfWeakMaybe>, DefaultIgnore; -def note_arc_weak_also_accessed_here : Note< - "also accessed here">; -def err_incomplete_synthesized_property : Error< - "cannot synthesize property %0 with incomplete type %1">; - -def error_property_ivar_type : Error< - "type of property %0 (%1) does not match type of instance variable %2 (%3)">; -def error_property_accessor_type : Error< - "type of property %0 (%1) does not match type of accessor %2 (%3)">; -def error_ivar_in_superclass_use : Error< - "property %0 attempting to use instance variable %1 declared in super class %2">; -def error_weak_property : Error< - "existing instance variable %1 for __weak property %0 must be __weak">; -def error_strong_property : Error< - "existing instance variable %1 for strong property %0 may not be __weak">; -def error_dynamic_property_ivar_decl : Error< - "dynamic property cannot have instance variable specification">; -def error_duplicate_ivar_use : Error< - "synthesized properties %0 and %1 both claim instance variable %2">; -def error_property_implemented : Error<"property %0 is already implemented">; -def warn_objc_missing_super_call : Warning< - "method possibly missing a [super %0] call">, - InGroup<ObjCMissingSuperCalls>; -def error_dealloc_bad_result_type : Error< - "dealloc return type must be correctly specified as 'void' under ARC, " - "instead of %0">; -def warn_undeclared_selector : Warning< - "undeclared selector %0">, InGroup<UndeclaredSelector>, DefaultIgnore; -def warn_undeclared_selector_with_typo : Warning< - "undeclared selector %0; did you mean %1?">, - InGroup<UndeclaredSelector>, DefaultIgnore; -def warn_implicit_atomic_property : Warning< - "property is assumed atomic by default">, InGroup<ImplicitAtomic>, DefaultIgnore; -def note_auto_readonly_iboutlet_fixup_suggest : Note< - "property should be changed to be readwrite">; -def warn_auto_readonly_iboutlet_property : Warning< - "readonly IBOutlet property %0 when auto-synthesized may " - "not work correctly with 'nib' loader">, - InGroup<DiagGroup<"readonly-iboutlet-property">>; -def warn_auto_implicit_atomic_property : Warning< - "property is assumed atomic when auto-synthesizing the property">, - InGroup<ImplicitAtomic>, DefaultIgnore; -def warn_unimplemented_selector: Warning< - "no method with selector %0 is implemented in this translation unit">, - InGroup<Selector>, DefaultIgnore; -def warn_unimplemented_protocol_method : Warning< - "method %0 in protocol %1 not implemented">, InGroup<Protocol>; -def warning_multiple_selectors: Warning< - "several methods with selector %0 of mismatched types are found " - "for the @selector expression">, - InGroup<SelectorTypeMismatch>, DefaultIgnore; - -def err_objc_kindof_nonobject : Error< - "'__kindof' specifier cannot be applied to non-object type %0">; -def err_objc_kindof_wrong_position : Error< - "'__kindof' type specifier must precede the declarator">; - -// C++ declarations -def err_static_assert_expression_is_not_constant : Error< - "static_assert expression is not an integral constant expression">; -def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">; -def ext_static_assert_no_message : ExtWarn< - "static_assert with no message is a C++1z extension">, InGroup<CXX1z>; -def warn_cxx14_compat_static_assert_no_message : Warning< - "static_assert with no message is incompatible with C++ standards before C++1z">, - DefaultIgnore, InGroup<CXXPre1zCompat>; - -def warn_inline_namespace_reopened_noninline : Warning< - "inline namespace cannot be reopened as a non-inline namespace">; -def err_inline_namespace_mismatch : Error< - "%select{|non-}0inline namespace " - "cannot be reopened as %select{non-|}0inline">; - -def err_unexpected_friend : Error< - "friends can only be classes or functions">; -def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_enum_friend : Warning< - "befriending enumeration type %0 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_nonclass_type_friend : ExtWarn< - "non-class friend type %0 is a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_nonclass_type_friend : Warning< - "non-class friend type %0 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_friend_is_member : Error< - "friends cannot be members of the declaring class">; -def warn_cxx98_compat_friend_is_member : Warning< - "friend declaration naming a member of the declaring class is incompatible " - "with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def ext_unelaborated_friend_type : ExtWarn< - "unelaborated friend declaration is a C++11 extension; specify " - "'%select{struct|interface|union|class|enum}0' to befriend %1">, - InGroup<CXX11>; -def warn_cxx98_compat_unelaborated_friend_type : Warning< - "befriending %1 without '%select{struct|interface|union|class|enum}0' " - "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def err_qualified_friend_not_found : Error< - "no function named %0 with type %1 was found in the specified scope">; -def err_introducing_special_friend : Error< - "must use a qualified name when declaring a %select{constructor|" - "destructor|conversion operator}0 as a friend">; -def err_tagless_friend_type_template : Error< - "friend type templates must use an elaborated type">; -def err_no_matching_local_friend : Error< - "no matching function found in local scope">; -def err_no_matching_local_friend_suggest : Error< - "no matching function %0 found in local scope; did you mean %3?">; -def err_partial_specialization_friend : Error< - "partial specialization cannot be declared as a friend">; -def err_qualified_friend_def : Error< - "friend function definition cannot be qualified with '%0'">; -def err_friend_def_in_local_class : Error< - "friend function cannot be defined in a local class">; -def err_friend_not_first_in_declaration : Error< - "'friend' must appear first in a non-function declaration">; -def err_using_decl_friend : Error< - "cannot befriend target of using declaration">; -def warn_template_qualified_friend_unsupported : Warning< - "dependent nested name specifier '%0' for friend class declaration is " - "not supported; turning off access control for %1">, - InGroup<UnsupportedFriend>; -def warn_template_qualified_friend_ignored : Warning< - "dependent nested name specifier '%0' for friend template declaration is " - "not supported; ignoring this friend declaration">, - InGroup<UnsupportedFriend>; -def ext_friend_tag_redecl_outside_namespace : ExtWarn< - "unqualified friend declaration referring to type outside of the nearest " - "enclosing namespace is a Microsoft extension; add a nested name specifier">, - InGroup<MicrosoftUnqualifiedFriend>; -def err_pure_friend : Error<"friend declaration cannot have a pure-specifier">; - -def err_invalid_member_in_interface : Error< - "%select{data member |non-public member function |static member function |" - "user-declared constructor|user-declared destructor|operator |" - "nested class }0%1 is not permitted within an interface type">; -def err_invalid_base_in_interface : Error< - "interface type cannot inherit from " - "%select{'struct|non-public 'interface|'class}0 %1'">; - -def err_abstract_type_in_decl : Error< - "%select{return|parameter|variable|field|instance variable|" - "synthesized instance variable}0 type %1 is an abstract class">; -def err_allocation_of_abstract_type : Error< - "allocating an object of abstract class type %0">; -def err_throw_abstract_type : Error< - "cannot throw an object of abstract type %0">; -def err_array_of_abstract_type : Error<"array of abstract class type %0">; -def err_capture_of_abstract_type : Error< - "by-copy capture of value of abstract type %0">; -def err_capture_of_incomplete_type : Error< - "by-copy capture of variable %0 with incomplete type %1">; -def err_capture_default_non_local : Error< - "non-local lambda expression cannot have a capture-default">; - -def err_multiple_final_overriders : Error< - "virtual function %q0 has more than one final overrider in %1">; -def note_final_overrider : Note<"final overrider of %q0 in %1">; - -def err_type_defined_in_type_specifier : Error< - "%0 cannot be defined in a type specifier">; -def err_type_defined_in_result_type : Error< - "%0 cannot be defined in the result type of a function">; -def err_type_defined_in_param_type : Error< - "%0 cannot be defined in a parameter type">; -def err_type_defined_in_alias_template : Error< - "%0 cannot be defined in a type alias template">; -def err_type_defined_in_condition : Error< - "%0 cannot be defined in a condition">; - -def note_pure_virtual_function : Note< - "unimplemented pure virtual method %0 in %1">; - -def note_pure_qualified_call_kext : Note< - "qualified call to %0::%1 is treated as a virtual call to %1 due to -fapple-kext">; - -def err_deleted_decl_not_first : Error< - "deleted definition must be first declaration">; - -def err_deleted_override : Error< - "deleted function %0 cannot override a non-deleted function">; - -def err_non_deleted_override : Error< - "non-deleted function %0 cannot override a deleted function">; - -def warn_weak_vtable : Warning< - "%0 has no out-of-line virtual method definitions; its vtable will be " - "emitted in every translation unit">, - InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore; -def warn_weak_template_vtable : Warning< - "explicit template instantiation %0 will emit a vtable in every " - "translation unit">, - InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore; - -def ext_using_undefined_std : ExtWarn< - "using directive refers to implicitly-defined namespace 'std'">; - -// C++ exception specifications -def err_exception_spec_in_typedef : Error< - "exception specifications are not allowed in %select{typedefs|type aliases}0">; -def err_distant_exception_spec : Error< - "exception specifications are not allowed beyond a single level " - "of indirection">; -def err_incomplete_in_exception_spec : Error< - "%select{|pointer to |reference to }0incomplete type %1 is not allowed " - "in exception specification">; -def err_rref_in_exception_spec : Error< - "rvalue reference type %0 is not allowed in exception specification">; -def err_mismatched_exception_spec : Error< - "exception specification in declaration does not match previous declaration">; -def ext_mismatched_exception_spec : ExtWarn<err_mismatched_exception_spec.Text>, - InGroup<MicrosoftExceptionSpec>; -def err_override_exception_spec : Error< - "exception specification of overriding function is more lax than " - "base version">; -def ext_override_exception_spec : ExtWarn<err_override_exception_spec.Text>, - InGroup<MicrosoftExceptionSpec>; -def err_incompatible_exception_specs : Error< - "target exception specification is not superset of source">; -def err_deep_exception_specs_differ : Error< - "exception specifications of %select{return|argument}0 types differ">; -def err_missing_exception_specification : Error< - "%0 is missing exception specification '%1'">; -def ext_missing_exception_specification : ExtWarn< - err_missing_exception_specification.Text>, - InGroup<DiagGroup<"missing-exception-spec">>; -def ext_ms_missing_exception_specification : ExtWarn< - err_missing_exception_specification.Text>, - InGroup<MicrosoftExceptionSpec>; -def err_noexcept_needs_constant_expression : Error< - "argument to noexcept specifier must be a constant expression">; -def err_exception_spec_not_parsed : Error< - "exception specification is not available until end of class definition">; - -// C++ access checking -def err_class_redeclared_with_different_access : Error< - "%0 redeclared with '%1' access">; -def err_access : Error< - "%1 is a %select{private|protected}0 member of %3">, AccessControl; -def ext_ms_using_declaration_inaccessible : ExtWarn< - "using declaration referring to inaccessible member '%0' (which refers " - "to accessible member '%1') is a Microsoft compatibility extension">, - AccessControl, InGroup<MicrosoftUsingDecl>; -def err_access_ctor : Error< - "calling a %select{private|protected}0 constructor of class %2">, - AccessControl; -def ext_rvalue_to_reference_access_ctor : Extension< - "C++98 requires an accessible copy constructor for class %2 when binding " - "a reference to a temporary; was %select{private|protected}0">, - AccessControl, InGroup<BindToTemporaryCopy>; -def err_access_base_ctor : Error< - // The ERRORs represent other special members that aren't constructors, in - // hopes that someone will bother noticing and reporting if they appear - "%select{base class|inherited virtual base class}0 %1 has %select{private|" - "protected}3 %select{default |copy |move |*ERROR* |*ERROR* " - "|*ERROR*|}2constructor">, AccessControl; -def err_access_field_ctor : Error< - // The ERRORs represent other special members that aren't constructors, in - // hopes that someone will bother noticing and reporting if they appear - "field of type %0 has %select{private|protected}2 " - "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}1constructor">, - AccessControl; -def err_access_friend_function : Error< - "friend function %1 is a %select{private|protected}0 member of %3">, - AccessControl; - -def err_access_dtor : Error< - "calling a %select{private|protected}1 destructor of class %0">, - AccessControl; -def err_access_dtor_base : - Error<"base class %0 has %select{private|protected}1 destructor">, - AccessControl; -def err_access_dtor_vbase : - Error<"inherited virtual base class %1 has " - "%select{private|protected}2 destructor">, - AccessControl; -def err_access_dtor_temp : - Error<"temporary of type %0 has %select{private|protected}1 destructor">, - AccessControl; -def err_access_dtor_exception : - Error<"exception object of type %0 has %select{private|protected}1 " - "destructor">, AccessControl; -def err_access_dtor_field : - Error<"field of type %1 has %select{private|protected}2 destructor">, - AccessControl; -def err_access_dtor_var : - Error<"variable of type %1 has %select{private|protected}2 destructor">, - AccessControl; -def err_access_dtor_ivar : - Error<"instance variable of type %0 has %select{private|protected}1 " - "destructor">, - AccessControl; -def note_previous_access_declaration : Note< - "previously declared '%1' here">; -def note_access_natural : Note< - "%select{|implicitly }1declared %select{private|protected}0 here">; -def note_access_constrained_by_path : Note< - "constrained by %select{|implicitly }1%select{private|protected}0" - " inheritance here">; -def note_access_protected_restricted_noobject : Note< - "must name member using the type of the current context %0">; -def note_access_protected_restricted_ctordtor : Note< - "protected %select{constructor|destructor}0 can only be used to " - "%select{construct|destroy}0 a base class subobject">; -def note_access_protected_restricted_object : Note< - "can only access this member on an object of type %0">; -def warn_cxx98_compat_sfinae_access_control : Warning< - "substitution failure due to access control is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE; - -// C++ name lookup -def err_incomplete_nested_name_spec : Error< - "incomplete type %0 named in nested name specifier">; -def err_dependent_nested_name_spec : Error< - "nested name specifier for a declaration cannot depend on a template " - "parameter">; -def err_nested_name_member_ref_lookup_ambiguous : Error< - "lookup of %0 in member access expression is ambiguous">; -def ext_nested_name_member_ref_lookup_ambiguous : ExtWarn< - "lookup of %0 in member access expression is ambiguous; using member of %1">, - InGroup<AmbigMemberTemplate>; -def note_ambig_member_ref_object_type : Note< - "lookup in the object type %0 refers here">; -def note_ambig_member_ref_scope : Note< - "lookup from the current scope refers here">; -def err_qualified_member_nonclass : Error< - "qualified member access refers to a member in %0">; -def err_incomplete_member_access : Error< - "member access into incomplete type %0">; -def err_incomplete_type : Error< - "incomplete type %0 where a complete type is required">; -def warn_cxx98_compat_enum_nested_name_spec : Warning< - "enumeration type in nested name specifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_nested_name_spec_is_not_class : Error< - "%0 cannot appear before '::' because it is not a class" - "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">; -def ext_nested_name_spec_is_enum : ExtWarn< - "use of enumeration in a nested name specifier is a C++11 extension">, - InGroup<CXX11>; - -// C++ class members -def err_storageclass_invalid_for_member : Error< - "storage class specified for a member declaration">; -def err_mutable_function : Error<"'mutable' cannot be applied to functions">; -def err_mutable_reference : Error<"'mutable' cannot be applied to references">; -def ext_mutable_reference : ExtWarn< - "'mutable' on a reference type is a Microsoft extension">, - InGroup<MicrosoftMutableReference>; -def err_mutable_const : Error<"'mutable' and 'const' cannot be mixed">; -def err_mutable_nonmember : Error< - "'mutable' can only be applied to member variables">; -def err_virtual_in_union : Error< - "unions cannot have virtual functions">; -def err_virtual_non_function : Error< - "'virtual' can only appear on non-static member functions">; -def err_virtual_out_of_class : Error< - "'virtual' can only be specified inside the class definition">; -def err_virtual_member_function_template : Error< - "'virtual' cannot be specified on member function templates">; -def err_static_overrides_virtual : Error< - "'static' member function %0 overrides a virtual function in a base class">; -def err_explicit_non_function : Error< - "'explicit' can only appear on non-static member functions">; -def err_explicit_out_of_class : Error< - "'explicit' can only be specified inside the class definition">; -def err_explicit_non_ctor_or_conv_function : Error< - "'explicit' can only be applied to a constructor or conversion function">; -def err_static_not_bitfield : Error<"static member %0 cannot be a bit-field">; -def err_static_out_of_line : Error< - "'static' can only be specified inside the class definition">; -def err_storage_class_for_static_member : Error< - "static data member definition cannot specify a storage class">; -def err_typedef_not_bitfield : Error<"typedef member %0 cannot be a bit-field">; -def err_not_integral_type_bitfield : Error< - "bit-field %0 has non-integral type %1">; -def err_not_integral_type_anon_bitfield : Error< - "anonymous bit-field has non-integral type %0">; -def err_member_function_initialization : Error< - "initializer on function does not look like a pure-specifier">; -def err_non_virtual_pure : Error< - "%0 is not virtual and cannot be declared pure">; -def ext_pure_function_definition : ExtWarn< - "function definition with pure-specifier is a Microsoft extension">, - InGroup<MicrosoftPureDefinition>; -def err_implicit_object_parameter_init : Error< - "cannot initialize object parameter of type %0 with an expression " - "of type %1">; -def err_qualified_member_of_unrelated : Error< - "%q0 is not a member of class %1">; - -def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning< - "call to pure virtual member function %0 has undefined behavior; " - "overrides of %0 in subclasses are not available in the " - "%select{constructor|destructor}1 of %2">; - -def note_member_declared_at : Note<"member is declared here">; -def note_ivar_decl : Note<"instance variable is declared here">; -def note_bitfield_decl : Note<"bit-field is declared here">; -def note_implicit_param_decl : Note<"%0 is an implicit parameter">; -def note_member_synthesized_at : Note< - "implicit %select{default constructor|copy constructor|move constructor|copy " - "assignment operator|move assignment operator|destructor}0 for %1 first " - "required here">; -def note_inhctor_synthesized_at : Note< - "inheriting constructor for %0 first required here">; -def err_missing_default_ctor : Error< - "%select{|implicit default |inheriting }0constructor for %1 must explicitly " - "initialize the %select{base class|member}2 %3 which does not have a default " - "constructor">; -def note_due_to_dllexported_class : Note< - "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">; - -def err_illegal_union_or_anon_struct_member : Error< - "%select{anonymous struct|union}0 member %1 has a non-trivial " - "%select{constructor|copy constructor|move constructor|copy assignment " - "operator|move assignment operator|destructor}2">; -def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning< - "%select{anonymous struct|union}0 member %1 with a non-trivial " - "%select{constructor|copy constructor|move constructor|copy assignment " - "operator|move assignment operator|destructor}2 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -def note_nontrivial_virtual_dtor : Note< - "destructor for %0 is not trivial because it is virtual">; -def note_nontrivial_has_virtual : Note< - "because type %0 has a virtual %select{member function|base class}1">; -def note_nontrivial_no_def_ctor : Note< - "because %select{base class of |field of |}0type %1 has no " - "default constructor">; -def note_user_declared_ctor : Note< - "implicit default constructor suppressed by user-declared constructor">; -def note_nontrivial_no_copy : Note< - "because no %select{<<ERROR>>|constructor|constructor|assignment operator|" - "assignment operator|<<ERROR>>}2 can be used to " - "%select{<<ERROR>>|copy|move|copy|move|<<ERROR>>}2 " - "%select{base class|field|an object}0 of type %3">; -def note_nontrivial_user_provided : Note< - "because %select{base class of |field of |}0type %1 has a user-provided " - "%select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}2">; -def note_nontrivial_in_class_init : Note< - "because field %0 has an initializer">; -def note_nontrivial_param_type : Note< - "because its parameter is %diff{of type $, not $|of the wrong type}2,3">; -def note_nontrivial_default_arg : Note<"because it has a default argument">; -def note_nontrivial_variadic : Note<"because it is a variadic function">; -def note_nontrivial_subobject : Note< - "because the function selected to %select{construct|copy|move|copy|move|" - "destroy}2 %select{base class|field}0 of type %1 is not trivial">; -def note_nontrivial_objc_ownership : Note< - "because type %0 has a member with %select{no|no|__strong|__weak|" - "__autoreleasing}1 ownership">; - -def err_static_data_member_not_allowed_in_anon_struct : Error< - "static data member %0 not allowed in anonymous struct">; -def ext_static_data_member_in_union : ExtWarn< - "static data member %0 in union is a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_static_data_member_in_union : Warning< - "static data member %0 in union is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_union_member_of_reference_type : ExtWarn< - "union member %0 has reference type %1, which is a Microsoft extension">, - InGroup<MicrosoftUnionMemberReference>; -def err_union_member_of_reference_type : Error< - "union member %0 has reference type %1">; -def ext_anonymous_struct_union_qualified : Extension< - "anonymous %select{struct|union}0 cannot be '%1'">; -def err_different_return_type_for_overriding_virtual_function : Error< - "virtual function %0 has a different return type " - "%diff{($) than the function it overrides (which has return type $)|" - "than the function it overrides}1,2">; -def note_overridden_virtual_function : Note< - "overridden virtual function is here">; -def err_conflicting_overriding_cc_attributes : Error< - "virtual function %0 has different calling convention attributes " - "%diff{($) than the function it overrides (which has calling convention $)|" - "than the function it overrides}1,2">; - -def err_covariant_return_inaccessible_base : Error< - "invalid covariant return for virtual function: %1 is a " - "%select{private|protected}2 base class of %0">, AccessControl; -def err_covariant_return_ambiguous_derived_to_base_conv : Error< - "return type of virtual function %3 is not covariant with the return type of " - "the function it overrides (ambiguous conversion from derived class " - "%0 to base class %1:%2)">; -def err_covariant_return_not_derived : Error< - "return type of virtual function %0 is not covariant with the return type of " - "the function it overrides (%1 is not derived from %2)">; -def err_covariant_return_incomplete : Error< - "return type of virtual function %0 is not covariant with the return type of " - "the function it overrides (%1 is incomplete)">; -def err_covariant_return_type_different_qualifications : Error< - "return type of virtual function %0 is not covariant with the return type of " - "the function it overrides (%1 has different qualifiers than %2)">; -def err_covariant_return_type_class_type_more_qualified : Error< - "return type of virtual function %0 is not covariant with the return type of " - "the function it overrides (class type %1 is more qualified than class " - "type %2">; - -// C++ constructors -def err_constructor_cannot_be : Error<"constructor cannot be declared '%0'">; -def err_invalid_qualified_constructor : Error< - "'%0' qualifier is not allowed on a constructor">; -def err_ref_qualifier_constructor : Error< - "ref-qualifier '%select{&&|&}0' is not allowed on a constructor">; - -def err_constructor_return_type : Error< - "constructor cannot have a return type">; -def err_constructor_redeclared : Error<"constructor cannot be redeclared">; -def err_constructor_byvalue_arg : Error< - "copy constructor must pass its first argument by reference">; -def warn_no_constructor_for_refconst : Warning< - "%select{struct|interface|union|class|enum}0 %1 does not declare any " - "constructor to initialize its non-modifiable members">; -def note_refconst_member_not_initialized : Note< - "%select{const|reference}0 member %1 will never be initialized">; -def ext_ms_explicit_constructor_call : ExtWarn< - "explicit constructor calls are a Microsoft extension">, - InGroup<MicrosoftExplicitConstructorCall>; - -// C++ destructors -def err_destructor_not_member : Error< - "destructor must be a non-static member function">; -def err_destructor_cannot_be : Error<"destructor cannot be declared '%0'">; -def err_invalid_qualified_destructor : Error< - "'%0' qualifier is not allowed on a destructor">; -def err_ref_qualifier_destructor : Error< - "ref-qualifier '%select{&&|&}0' is not allowed on a destructor">; -def err_destructor_return_type : Error<"destructor cannot have a return type">; -def err_destructor_redeclared : Error<"destructor cannot be redeclared">; -def err_destructor_with_params : Error<"destructor cannot have any parameters">; -def err_destructor_variadic : Error<"destructor cannot be variadic">; -def err_destructor_typedef_name : Error< - "destructor cannot be declared using a %select{typedef|type alias}1 %0 of the class name">; -def err_destructor_name : Error< - "expected the class name after '~' to name the enclosing class">; -def err_destructor_class_name : Error< - "expected the class name after '~' to name a destructor">; -def err_ident_in_dtor_not_a_type : Error< - "identifier %0 in object destruction expression does not name a type">; -def err_destructor_expr_type_mismatch : Error< - "destructor type %0 in object destruction expression does not match the " - "type %1 of the object being destroyed">; -def note_destructor_type_here : Note< - "type %0 is declared here">; - -def err_destructor_template : Error< - "destructor cannot be declared as a template">; - -// C++ initialization -def err_init_conversion_failed : Error< - "cannot initialize %select{a variable|a parameter|return object|an " - "exception object|a member subobject|an array element|a new value|a value|a " - "base class|a constructor delegation|a vector element|a block element|a " - "complex element|a lambda capture|a compound literal initializer|a " - "related result|a parameter of CF audited function}0 " - "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|" - "with an %select{rvalue|lvalue}2 of incompatible type}1,3" - "%select{|: different classes%diff{ ($ vs $)|}5,6" - "|: different number of parameters (%5 vs %6)" - "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" - "|: different return type%diff{ ($ vs $)|}5,6" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}5 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)}4">; - -def err_lvalue_to_rvalue_ref : Error<"rvalue reference %diff{to type $ cannot " - "bind to lvalue of type $|cannot bind to incompatible lvalue}0,1">; -def err_lvalue_reference_bind_to_initlist : Error< - "%select{non-const|volatile}0 lvalue reference to type %1 cannot bind to an " - "initializer list temporary">; -def err_lvalue_reference_bind_to_temporary : Error< - "%select{non-const|volatile}0 lvalue reference %diff{to type $ cannot bind " - "to a temporary of type $|cannot bind to incompatible temporary}1,2">; -def err_lvalue_reference_bind_to_unrelated : Error< - "%select{non-const|volatile}0 lvalue reference " - "%diff{to type $ cannot bind to a value of unrelated type $|" - "cannot bind to a value of unrelated type}1,2">; -def err_reference_bind_drops_quals : Error< - "binding value %diff{of type $ to reference to type $|to reference}0,1 " - "drops %select{<<ERROR>>|'const'|'restrict'|'const' and 'restrict'|" - "'volatile'|'const' and 'volatile'|'restrict' and 'volatile'|" - "'const', 'restrict', and 'volatile'}2 qualifier%plural{1:|2:|4:|:s}2">; -def err_reference_bind_failed : Error< - "reference %diff{to type $ could not bind to an %select{rvalue|lvalue}1 of " - "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">; -def err_reference_bind_init_list : Error< - "reference to type %0 cannot bind to an initializer list">; -def warn_temporary_array_to_pointer_decay : Warning< - "pointer is initialized by a temporary array, which will be destroyed at the " - "end of the full-expression">, - InGroup<DiagGroup<"address-of-array-temporary">>; -def err_init_list_bad_dest_type : Error< - "%select{|non-aggregate }0type %1 cannot be initialized with an initializer " - "list">; -def err_member_function_call_bad_cvr : Error<"member function %0 not viable: " - "'this' argument has type %1, but function is not marked " - "%select{const|restrict|const or restrict|volatile|const or volatile|" - "volatile or restrict|const, volatile, or restrict}2">; - -def err_reference_bind_to_bitfield : Error< - "%select{non-const|volatile}0 reference cannot bind to " - "bit-field%select{| %1}2">; -def err_reference_bind_to_vector_element : Error< - "%select{non-const|volatile}0 reference cannot bind to vector element">; -def err_reference_var_requires_init : Error< - "declaration of reference variable %0 requires an initializer">; -def err_reference_without_init : Error< - "reference to type %0 requires an initializer">; -def note_value_initialization_here : Note< - "in value-initialization of type %0 here">; -def err_reference_has_multiple_inits : Error< - "reference cannot be initialized with multiple values">; -def err_init_non_aggr_init_list : Error< - "initialization of non-aggregate type %0 with an initializer list">; -def err_init_reference_member_uninitialized : Error< - "reference member of type %0 uninitialized">; -def note_uninit_reference_member : Note< - "uninitialized reference member is here">; -def warn_field_is_uninit : Warning<"field %0 is uninitialized when used here">, - InGroup<Uninitialized>; -def warn_base_class_is_uninit : Warning< - "base class %0 is uninitialized when used here to access %q1">, - InGroup<Uninitialized>; -def warn_reference_field_is_uninit : Warning< - "reference %0 is not yet bound to a value when used here">, - InGroup<Uninitialized>; -def note_uninit_in_this_constructor : Note< - "during field initialization in %select{this|the implicit default}0 " - "constructor">; -def warn_static_self_reference_in_init : Warning< - "static variable %0 is suspiciously used within its own initialization">, - InGroup<UninitializedStaticSelfInit>; -def warn_uninit_self_reference_in_init : Warning< - "variable %0 is uninitialized when used within its own initialization">, - InGroup<Uninitialized>; -def warn_uninit_self_reference_in_reference_init : Warning< - "reference %0 is not yet bound to a value when used within its own" - " initialization">, - InGroup<Uninitialized>; -def warn_uninit_var : Warning< - "variable %0 is uninitialized when %select{used here|captured by block}1">, - InGroup<Uninitialized>, DefaultIgnore; -def warn_sometimes_uninit_var : Warning< - "variable %0 is %select{used|captured}1 uninitialized whenever " - "%select{'%3' condition is %select{true|false}4|" - "'%3' loop %select{is entered|exits because its condition is false}4|" - "'%3' loop %select{condition is true|exits because its condition is false}4|" - "switch %3 is taken|" - "its declaration is reached|" - "%3 is called}2">, - InGroup<UninitializedSometimes>, DefaultIgnore; -def warn_maybe_uninit_var : Warning< - "variable %0 may be uninitialized when " - "%select{used here|captured by block}1">, - InGroup<UninitializedMaybe>, DefaultIgnore; -def note_uninit_var_def : Note<"variable %0 is declared here">; -def note_uninit_var_use : Note< - "%select{uninitialized use occurs|variable is captured by block}0 here">; -def warn_uninit_byref_blockvar_captured_by_block : Warning< - "block pointer variable %0 is uninitialized when captured by block">, - InGroup<Uninitialized>, DefaultIgnore; -def note_block_var_fixit_add_initialization : Note< - "did you mean to use __block %0?">; -def note_in_omitted_aggregate_initializer : Note< - "in implicit initialization of %select{array element %1|field %1}0 " - "with omitted initializer">; -def note_in_reference_temporary_list_initializer : Note< - "in initialization of temporary of type %0 created to " - "list-initialize this reference">; -def note_var_fixit_add_initialization : Note< - "initialize the variable %0 to silence this warning">; -def note_uninit_fixit_remove_cond : Note< - "remove the %select{'%1' if its condition|condition if it}0 " - "is always %select{false|true}2">; -def err_init_incomplete_type : Error<"initialization of incomplete type %0">; - -def warn_unsequenced_mod_mod : Warning< - "multiple unsequenced modifications to %0">, InGroup<Unsequenced>; -def warn_unsequenced_mod_use : Warning< - "unsequenced modification and access to %0">, InGroup<Unsequenced>; - -def err_temp_copy_no_viable : Error< - "no viable constructor %select{copying variable|copying parameter|" - "returning object|throwing object|copying member subobject|copying array " - "element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1">; -def ext_rvalue_to_reference_temp_copy_no_viable : Extension< - "no viable constructor %select{copying variable|copying parameter|" - "returning object|throwing object|copying member subobject|copying array " - "element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1; C++98 requires a copy " - "constructor when binding a reference to a temporary">, - InGroup<BindToTemporaryCopy>; -def err_temp_copy_ambiguous : Error< - "ambiguous constructor call when %select{copying variable|copying " - "parameter|returning object|throwing object|copying member subobject|copying " - "array element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1">; -def err_temp_copy_deleted : Error< - "%select{copying variable|copying parameter|returning object|throwing " - "object|copying member subobject|copying array element|allocating object|" - "copying temporary|initializing base subobject|initializing vector element|" - "capturing value}0 of type %1 invokes deleted constructor">; -def err_temp_copy_incomplete : Error< - "copying a temporary object of incomplete type %0">; -def warn_cxx98_compat_temp_copy : Warning< - "%select{copying variable|copying parameter|returning object|throwing " - "object|copying member subobject|copying array element|allocating object|" - "copying temporary|initializing base subobject|initializing vector element}1 " - "of type %2 when binding a reference to a temporary would %select{invoke " - "an inaccessible constructor|find no viable constructor|find ambiguous " - "constructors|invoke a deleted constructor}0 in C++98">, - InGroup<CXX98CompatBindToTemporaryCopy>, DefaultIgnore; -def err_selected_explicit_constructor : Error< - "chosen constructor is explicit in copy-initialization">; -def note_constructor_declared_here : Note< - "constructor declared here">; - -// C++11 decltype -def err_decltype_in_declarator : Error< - "'decltype' cannot be used to name a declaration">; - -// C++11 auto -def warn_cxx98_compat_auto_type_specifier : Warning< - "'auto' type specifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_auto_variable_cannot_appear_in_own_initializer : Error< - "variable %0 declared with %select{'auto'|'decltype(auto)'|'__auto_type'}1 " - "type cannot appear in its own initializer">; -def err_illegal_decl_array_of_auto : Error< - "'%0' declared as array of %1">; -def err_new_array_of_auto : Error< - "cannot allocate array of 'auto'">; -def err_auto_not_allowed : Error< - "%select{'auto'|'decltype(auto)'|'__auto_type'}0 not allowed " - "%select{in function prototype" - "|in non-static struct member|in struct member" - "|in non-static union member|in union member" - "|in non-static class member|in interface member" - "|in exception declaration|in template parameter|in block literal" - "|in template argument|in typedef|in type alias|in function return type" - "|in conversion function type|here|in lambda parameter" - "|in type allocated by 'new'|in K&R-style function parameter}1">; -def err_auto_not_allowed_var_inst : Error< - "'auto' variable template instantiation is not allowed">; -def err_auto_var_requires_init : Error< - "declaration of variable %0 with type %1 requires an initializer">; -def err_auto_new_requires_ctor_arg : Error< - "new expression for type %0 requires a constructor argument">; -def err_auto_new_list_init : Error< - "new expression for type %0 cannot use list-initialization">; -def err_auto_var_init_no_expression : Error< - "initializer for variable %0 with type %1 is empty">; -def err_auto_var_init_multiple_expressions : Error< - "initializer for variable %0 with type %1 contains multiple expressions">; -def err_auto_var_init_paren_braces : Error< - "cannot deduce type for variable %1 with type %2 from " - "%select{parenthesized|nested}0 initializer list">; -def err_auto_new_ctor_multiple_expressions : Error< - "new expression for type %0 contains multiple constructor arguments">; -def err_auto_missing_trailing_return : Error< - "'auto' return without trailing return type; deduced return types are a " - "C++14 extension">; -def err_deduced_return_type : Error< - "deduced return types are a C++14 extension">; -def err_trailing_return_without_auto : Error< - "function with trailing return type must specify return type 'auto', not %0">; -def err_trailing_return_in_parens : Error< - "trailing return type may not be nested within parentheses">; -def err_auto_var_deduction_failure : Error< - "variable %0 with type %1 has incompatible initializer of type %2">; -def err_auto_var_deduction_failure_from_init_list : Error< - "cannot deduce actual type for variable %0 with type %1 from initializer list">; -def err_auto_new_deduction_failure : Error< - "new expression for type %0 has incompatible constructor argument of type %1">; -def err_auto_different_deductions : Error< - "'%select{auto|decltype(auto)|__auto_type}0' deduced as %1 in declaration " - "of %2 and deduced as %3 in declaration of %4">; -def err_implied_std_initializer_list_not_found : Error< - "cannot deduce type of initializer list because std::initializer_list was " - "not found; include <initializer_list>">; -def err_malformed_std_initializer_list : Error< - "std::initializer_list must be a class template with a single type parameter">; -def warn_dangling_std_initializer_list : Warning< - "array backing the initializer list will be destroyed at the end of " - "%select{the full-expression|the constructor}0">, - InGroup<DiagGroup<"dangling-initializer-list">>; -def err_auto_init_list_from_c : Error< - "cannot use __auto_type with initializer list in C">; -def err_auto_bitfield : Error< - "cannot pass bit-field as __auto_type initializer in C">; - -// C++1y decltype(auto) type -def err_decltype_auto_cannot_be_combined : Error< - "'decltype(auto)' cannot be combined with other type specifiers">; -def err_decltype_auto_function_declarator_not_declaration : Error< - "'decltype(auto)' can only be used as a return type " - "in a function declaration">; -def err_decltype_auto_compound_type : Error< - "cannot form %select{pointer to|reference to|array of}0 'decltype(auto)'">; -def err_decltype_auto_initializer_list : Error< - "cannot deduce 'decltype(auto)' from initializer list">; - -// C++1y deduced return types -def err_auto_fn_deduction_failure : Error< - "cannot deduce return type %0 from returned value of type %1">; -def err_auto_fn_different_deductions : Error< - "'%select{auto|decltype(auto)}0' in return type deduced as %1 here but " - "deduced as %2 in earlier return statement">; -def err_auto_fn_used_before_defined : Error< - "function %0 with deduced return type cannot be used before it is defined">; -def err_auto_fn_no_return_but_not_auto : Error< - "cannot deduce return type %0 for function with no return statements">; -def err_auto_fn_return_void_but_not_auto : Error< - "cannot deduce return type %0 from omitted return expression">; -def err_auto_fn_return_init_list : Error< - "cannot deduce return type from initializer list">; -def err_auto_fn_virtual : Error< - "function with deduced return type cannot be virtual">; - -// C++11 override control -def override_keyword_only_allowed_on_virtual_member_functions : Error< - "only virtual member functions can be marked '%0'">; -def override_keyword_hides_virtual_member_function : Error< - "non-virtual member function marked '%0' hides virtual member " - "%select{function|functions}1">; -def err_function_marked_override_not_overriding : Error< - "%0 marked 'override' but does not override any member functions">; -def warn_function_marked_not_override_overriding : Warning < - "%0 overrides a member function but is not marked 'override'">, - InGroup<CXX11WarnOverrideMethod>; -def err_class_marked_final_used_as_base : Error< - "base %0 is marked '%select{final|sealed}1'">; -def warn_abstract_final_class : Warning< - "abstract class is marked '%select{final|sealed}0'">, InGroup<AbstractFinalClass>; - -// C++11 attributes -def err_repeat_attribute : Error<"%0 attribute cannot be repeated">; - -// C++11 final -def err_final_function_overridden : Error< - "declaration of %0 overrides a '%select{final|sealed}1' function">; - -// C++11 scoped enumerations -def err_enum_invalid_underlying : Error< - "non-integral type %0 is an invalid underlying type">; -def err_enumerator_too_large : Error< - "enumerator value is not representable in the underlying type %0">; -def ext_enumerator_too_large : ExtWarn< - "enumerator value is not representable in the underlying type %0">, - InGroup<MicrosoftEnumValue>; -def err_enumerator_wrapped : Error< - "enumerator value %0 is not representable in the underlying type %1">; -def err_enum_redeclare_type_mismatch : Error< - "enumeration redeclared with different underlying type %0 (was %1)">; -def err_enum_redeclare_fixed_mismatch : Error< - "enumeration previously declared with %select{non|}0fixed underlying type">; -def err_enum_redeclare_scoped_mismatch : Error< - "enumeration previously declared as %select{un|}0scoped">; -def err_enum_class_reference : Error< - "reference to %select{|scoped }0enumeration must use 'enum' " - "not 'enum class'">; -def err_only_enums_have_underlying_types : Error< - "only enumeration types have underlying types">; -def err_underlying_type_of_incomplete_enum : Error< - "cannot determine underlying type of incomplete enumeration type %0">; - -// C++11 delegating constructors -def err_delegating_ctor : Error< - "delegating constructors are permitted only in C++11">; -def warn_cxx98_compat_delegating_ctor : Warning< - "delegating constructors are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_delegating_initializer_alone : Error< - "an initializer for a delegating constructor must appear alone">; -def warn_delegating_ctor_cycle : Warning< - "constructor for %0 creates a delegation cycle">, DefaultError, - InGroup<DelegatingCtorCycles>; -def note_it_delegates_to : Note<"it delegates to">; -def note_which_delegates_to : Note<"which delegates to">; - -// C++11 range-based for loop -def err_for_range_decl_must_be_var : Error< - "for range declaration must declare a variable">; -def err_for_range_storage_class : Error< - "loop variable %0 may not be declared %select{'extern'|'static'|" - "'__private_extern__'|'auto'|'register'|'constexpr'}1">; -def err_type_defined_in_for_range : Error< - "types may not be defined in a for range declaration">; -def err_for_range_deduction_failure : Error< - "cannot use type %0 as a range">; -def err_for_range_incomplete_type : Error< - "cannot use incomplete type %0 as a range">; -def err_for_range_iter_deduction_failure : Error< - "cannot use type %0 as an iterator">; -def err_for_range_member_begin_end_mismatch : Error< - "range type %0 has '%select{begin|end}1' member but no '%select{end|begin}1' member">; -def err_for_range_begin_end_types_differ : Error< - "'begin' and 'end' must return the same type (got %0 and %1)">; -def note_in_for_range: Note< - "when looking up '%select{begin|end}0' function for range expression " - "of type %1">; -def err_for_range_invalid: Error< - "invalid range expression of type %0; no viable '%select{begin|end}1' " - "function available">; -def err_range_on_array_parameter : Error< - "cannot build range expression with array function parameter %0 since " - "parameter with array type %1 is treated as pointer type %2">; -def err_for_range_dereference : Error< - "invalid range expression of type %0; did you mean to dereference it " - "with '*'?">; -def note_for_range_invalid_iterator : Note < - "in implicit call to 'operator%select{!=|*|++}0' for iterator of type %1">; -def note_for_range_begin_end : Note< - "selected '%select{begin|end}0' %select{function|template }1%2 with iterator type %3">; - -// C++11 constexpr -def warn_cxx98_compat_constexpr : Warning< - "'constexpr' specifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -// FIXME: Maybe this should also go in -Wc++14-compat? -def warn_cxx14_compat_constexpr_not_const : Warning< - "'constexpr' non-static member function will not be implicitly 'const' " - "in C++14; add 'const' to avoid a change in behavior">, - InGroup<DiagGroup<"constexpr-not-const">>; -def err_invalid_constexpr : Error< - "%select{function parameter|typedef|non-static data member}0 " - "cannot be constexpr">; -def err_invalid_constexpr_member : Error<"non-static data member cannot be " - "constexpr%select{; did you intend to make it %select{const|static}0?|}1">; -def err_constexpr_tag : Error< - "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">; -def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">; -def err_constexpr_no_declarators : Error< - "constexpr can only be used in variable and function declarations">; -def err_invalid_constexpr_var_decl : Error< - "constexpr variable declaration must be a definition">; -def err_constexpr_static_mem_var_requires_init : Error< - "declaration of constexpr static data member %0 requires an initializer">; -def err_constexpr_var_non_literal : Error< - "constexpr variable cannot have non-literal type %0">; -def err_constexpr_var_requires_const_init : Error< - "constexpr variable %0 must be initialized by a constant expression">; -def err_constexpr_redecl_mismatch : Error< - "%select{non-constexpr declaration of %0 follows constexpr declaration" - "|constexpr declaration of %0 follows non-constexpr declaration}1">; -def err_constexpr_virtual : Error<"virtual function cannot be constexpr">; -def err_constexpr_virtual_base : Error< - "constexpr %select{member function|constructor}0 not allowed in " - "%select{struct|interface|class}1 with virtual base " - "%plural{1:class|:classes}2">; -def note_non_literal_incomplete : Note< - "incomplete type %0 is not a literal type">; -def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 " - "with virtual base %plural{1:class|:classes}1 is not a literal type">; -def note_constexpr_virtual_base_here : Note<"virtual base class declared here">; -def err_constexpr_non_literal_return : Error< - "constexpr function's return type %0 is not a literal type">; -def err_constexpr_non_literal_param : Error< - "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is " - "not a literal type">; -def err_constexpr_body_invalid_stmt : Error< - "statement not allowed in constexpr %select{function|constructor}0">; -def ext_constexpr_body_invalid_stmt : ExtWarn< - "use of this statement in a constexpr %select{function|constructor}0 " - "is a C++14 extension">, InGroup<CXX14>; -def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning< - "use of this statement in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def ext_constexpr_type_definition : ExtWarn< - "type definition in a constexpr %select{function|constructor}0 " - "is a C++14 extension">, InGroup<CXX14>; -def warn_cxx11_compat_constexpr_type_definition : Warning< - "type definition in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def err_constexpr_vla : Error< - "variably-modified type %0 cannot be used in a constexpr " - "%select{function|constructor}1">; -def ext_constexpr_local_var : ExtWarn< - "variable declaration in a constexpr %select{function|constructor}0 " - "is a C++14 extension">, InGroup<CXX14>; -def warn_cxx11_compat_constexpr_local_var : Warning< - "variable declaration in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def err_constexpr_local_var_static : Error< - "%select{static|thread_local}1 variable not permitted in a constexpr " - "%select{function|constructor}0">; -def err_constexpr_local_var_non_literal_type : Error< - "variable of non-literal type %1 cannot be defined in a constexpr " - "%select{function|constructor}0">; -def err_constexpr_local_var_no_init : Error< - "variables defined in a constexpr %select{function|constructor}0 must be " - "initialized">; -def ext_constexpr_function_never_constant_expr : ExtWarn< - "constexpr %select{function|constructor}0 never produces a " - "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError; -def err_enable_if_never_constant_expr : Error< - "'enable_if' attribute expression never produces a constant expression">; -def err_constexpr_body_no_return : Error< - "no return statement in constexpr function">; -def err_constexpr_return_missing_expr : Error< - "non-void constexpr function %0 should return a value">; -def warn_cxx11_compat_constexpr_body_no_return : Warning< - "constexpr function with no return statements is incompatible with C++ " - "standards before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; -def ext_constexpr_body_multiple_return : ExtWarn< - "multiple return statements in constexpr function is a C++14 extension">, - InGroup<CXX14>; -def warn_cxx11_compat_constexpr_body_multiple_return : Warning< - "multiple return statements in constexpr function " - "is incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def note_constexpr_body_previous_return : Note< - "previous return statement is here">; -def err_constexpr_function_try_block : Error< - "function try block not allowed in constexpr %select{function|constructor}0">; -def err_constexpr_union_ctor_no_init : Error< - "constexpr union constructor does not initialize any member">; -def err_constexpr_ctor_missing_init : Error< - "constexpr constructor must initialize all members">; -def note_constexpr_ctor_missing_init : Note< - "member not initialized by constructor">; -def note_non_literal_no_constexpr_ctors : Note< - "%0 is not literal because it is not an aggregate and has no constexpr " - "constructors other than copy or move constructors">; -def note_non_literal_base_class : Note< - "%0 is not literal because it has base class %1 of non-literal type">; -def note_non_literal_field : Note< - "%0 is not literal because it has data member %1 of " - "%select{non-literal|volatile}3 type %2">; -def note_non_literal_user_provided_dtor : Note< - "%0 is not literal because it has a user-provided destructor">; -def note_non_literal_nontrivial_dtor : Note< - "%0 is not literal because it has a non-trivial destructor">; -def warn_private_extern : Warning< - "use of __private_extern__ on a declaration may not produce external symbol " - "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>; -def note_private_extern : Note< - "use __attribute__((visibility(\"hidden\"))) attribute instead">; - -// C++ Concepts TS -def err_concept_wrong_decl_kind : Error< - "'concept' can only appear on the definition of a function template or variable template">; -def err_concept_decls_may_only_appear_in_namespace_scope : Error< - "concept declarations may only appear in namespace scope">; -def err_function_concept_not_defined : Error< - "function concept declaration must be a definition">; -def err_var_concept_not_initialized : Error< - "variable concept declaration must be initialized">; -def err_function_concept_exception_spec : Error< - "function concept cannot have exception specification">; -def err_concept_decl_invalid_specifiers : Error< - "%select{variable|function}0 concept cannot be declared " - "'%select{thread_local|inline|friend|constexpr}1'">; -def err_function_concept_with_params : Error< - "function concept cannot have any parameters">; - -// C++11 char16_t/char32_t -def warn_cxx98_compat_unicode_type : Warning< - "'%0' type specifier is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -// __make_integer_seq -def err_integer_sequence_negative_length : Error< - "integer sequences must have non-negative sequence length">; -def err_integer_sequence_integral_element_type : Error< - "integer sequences must have integral element type">; - -// Objective-C++ -def err_objc_decls_may_only_appear_in_global_scope : Error< - "Objective-C declarations may only appear in global scope">; -def warn_auto_var_is_id : Warning< - "'auto' deduced as 'id' in declaration of %0">, - InGroup<DiagGroup<"auto-var-id">>; - -// Attributes -def err_nsobject_attribute : Error< - "'NSObject' attribute is for pointer types only">; -def err_attributes_are_not_compatible : Error< - "%0 and %1 attributes are not compatible">; -def err_attribute_wrong_number_arguments : Error< - "%0 attribute %plural{0:takes no arguments|1:takes one argument|" - ":requires exactly %1 arguments}1">; -def err_attribute_too_many_arguments : Error< - "%0 attribute takes no more than %1 argument%s1">; -def err_attribute_too_few_arguments : Error< - "%0 attribute takes at least %1 argument%s1">; -def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">; -def err_attribute_bad_neon_vector_size : Error< - "Neon vector size must be 64 or 128 bits">; -def warn_unsupported_target_attribute - : Warning<"Ignoring unsupported '%0' in the target attribute string">, - InGroup<IgnoredAttributes>; -def err_attribute_unsupported - : Error<"%0 attribute is not supported for this target">; -// The err_*_attribute_argument_not_int are seperate because they're used by -// VerifyIntegerConstantExpression. -def err_aligned_attribute_argument_not_int : Error< - "'aligned' attribute requires integer constant">; -def err_align_value_attribute_argument_not_int : Error< - "'align_value' attribute requires integer constant">; -def err_alignas_attribute_wrong_decl_type : Error< - "%0 attribute cannot be applied to a %select{function parameter|" - "variable with 'register' storage class|'catch' variable|bit-field}1">; -def err_alignas_missing_on_definition : Error< - "%0 must be specified on definition if it is specified on any declaration">; -def note_alignas_on_declaration : Note<"declared with %0 attribute here">; -def err_alignas_mismatch : Error< - "redeclaration has different alignment requirement (%1 vs %0)">; -def err_alignas_underaligned : Error< - "requested alignment is less than minimum alignment of %1 for type %0">; -def err_attribute_argument_n_type : Error< - "%0 attribute requires parameter %1 to be %select{int or bool|an integer " - "constant|a string|an identifier}2">; -def err_attribute_argument_type : Error< - "%0 attribute requires %select{int or bool|an integer " - "constant|a string|an identifier}1">; -def err_attribute_argument_outof_range : Error< - "%0 attribute requires integer constant between %1 and %2 inclusive">; -def err_init_priority_object_attr : Error< - "can only use 'init_priority' attribute on file-scope definitions " - "of objects of class type">; -def err_attribute_argument_vec_type_hint : Error< - "invalid attribute argument %0 - expecting a vector or vectorizable scalar type">; -def err_attribute_argument_out_of_bounds : Error< - "%0 attribute parameter %1 is out of bounds">; -def err_attribute_only_once_per_parameter : Error< - "%0 attribute can only be applied once per parameter">; -def err_attribute_uuid_malformed_guid : Error< - "uuid attribute contains a malformed GUID">; -def warn_attribute_pointers_only : Warning< - "%0 attribute only applies to%select{| constant}1 pointer arguments">, - InGroup<IgnoredAttributes>; -def err_attribute_pointers_only : Error<warn_attribute_pointers_only.Text>; -def warn_attribute_return_pointers_only : Warning< - "%0 attribute only applies to return values that are pointers">, - InGroup<IgnoredAttributes>; -def warn_attribute_return_pointers_refs_only : Warning< - "%0 attribute only applies to return values that are pointers or references">, - InGroup<IgnoredAttributes>; -def warn_attribute_pointer_or_reference_only : Warning< - "%0 attribute only applies to a pointer or reference (%1 is invalid)">, - InGroup<IgnoredAttributes>; -def err_attribute_no_member_pointers : Error< - "%0 attribute cannot be used with pointers to members">; -def err_attribute_invalid_implicit_this_argument : Error< - "%0 attribute is invalid for the implicit this argument">; -def err_ownership_type : Error< - "%0 attribute only applies to %select{pointer|integer}1 arguments">; -def err_ownership_returns_index_mismatch : Error< - "'ownership_returns' attribute index does not match; here it is %0">; -def note_ownership_returns_index_mismatch : Note< - "declared with index %0 here">; -def err_format_strftime_third_parameter : Error< - "strftime format attribute requires 3rd parameter to be 0">; -def err_format_attribute_requires_variadic : Error< - "format attribute requires variadic function">; -def err_format_attribute_not : Error<"format argument not %0">; -def err_format_attribute_result_not : Error<"function does not return %0">; -def err_format_attribute_implicit_this_format_string : Error< - "format attribute cannot specify the implicit this argument as the format " - "string">; -def err_init_method_bad_return_type : Error< - "init methods must return an object pointer type, not %0">; -def err_attribute_invalid_size : Error< - "vector size not an integral multiple of component size">; -def err_attribute_zero_size : Error<"zero vector size">; -def err_attribute_size_too_large : Error<"vector size too large">; -def err_typecheck_vector_not_convertable : Error< - "cannot convert between vector values of different size (%0 and %1)">; -def err_typecheck_vector_not_convertable_non_scalar : Error< - "cannot convert between vector and non-scalar values (%0 and %1)">; -def err_typecheck_vector_lengths_not_equal : Error< - "vector operands do not have the same number of elements (%0 and %1)">; -def err_ext_vector_component_exceeds_length : Error< - "vector component access exceeds type %0">; -def err_ext_vector_component_name_illegal : Error< - "illegal vector component name '%0'">; -def err_attribute_address_space_negative : Error< - "address space is negative">; -def err_attribute_address_space_too_high : Error< - "address space is larger than the maximum supported (%0)">; -def err_attribute_address_multiple_qualifiers : Error< - "multiple address spaces specified for type">; -def err_attribute_address_function_type : Error< - "function type may not be qualified with an address space">; -def err_as_qualified_auto_decl : Error< - "automatic variable qualified with an address space">; -def err_arg_with_address_space : Error< - "parameter may not be qualified with an address space">; -def err_field_with_address_space : Error< - "field may not be qualified with an address space">; -def err_attr_objc_ownership_redundant : Error< - "the type %0 is already explicitly ownership-qualified">; -def err_invalid_nsnumber_type : Error< - "%0 is not a valid literal type for NSNumber">; -def err_objc_illegal_boxed_expression_type : Error< - "illegal type %0 used in a boxed expression">; -def err_objc_non_trivially_copyable_boxed_expression_type : Error< - "non-trivially copyable type %0 cannot be used in a boxed expression">; -def err_objc_incomplete_boxed_expression_type : Error< - "incomplete type %0 used in a boxed expression">; -def err_undeclared_objc_literal_class : Error< - "definition of class %0 must be available to use Objective-C " - "%select{array literals|dictionary literals|numeric literals|boxed expressions|" - "string literals}1">; -def err_undeclared_boxing_method : Error< - "declaration of %0 is missing in %1 class">; -def err_objc_literal_method_sig : Error< - "literal construction method %0 has incompatible signature">; -def note_objc_literal_method_param : Note< - "%select{first|second|third}0 parameter has unexpected type %1 " - "(should be %2)">; -def note_objc_literal_method_return : Note< - "method returns unexpected type %0 (should be an object type)">; -def err_invalid_collection_element : Error< - "collection element of type %0 is not an Objective-C object">; -def err_box_literal_collection : Error< - "%select{string|character|boolean|numeric}0 literal must be prefixed by '@' " - "in a collection">; -def warn_objc_literal_comparison : Warning< - "direct comparison of %select{an array literal|a dictionary literal|" - "a numeric literal|a boxed expression|}0 has undefined behavior">, - InGroup<ObjCLiteralComparison>; -def err_missing_atsign_prefix : Error< - "string literal must be prefixed by '@' ">; -def warn_objc_string_literal_comparison : Warning< - "direct comparison of a string literal has undefined behavior">, - InGroup<ObjCStringComparison>; -def warn_concatenated_nsarray_literal : Warning< - "concatenated NSString literal for an NSArray expression - " - "possibly missing a comma">, - InGroup<ObjCStringConcatenation>; -def note_objc_literal_comparison_isequal : Note< - "use 'isEqual:' instead">; -def warn_objc_collection_literal_element : Warning< - "object of type %0 is not compatible with " - "%select{array element type|dictionary key type|dictionary value type}1 %2">, - InGroup<ObjCLiteralConversion>; - -def err_attribute_argument_is_zero : Error< - "%0 attribute must be greater than 0">; -def warn_attribute_argument_n_negative : Warning< - "%0 attribute parameter %1 is negative and will be ignored">, - InGroup<CudaCompat>; -def err_property_function_in_objc_container : Error< - "use of Objective-C property in function nested in Objective-C " - "container not supported, move function outside its container">; - -let CategoryName = "Cocoa API Issue" in { -def warn_objc_redundant_literal_use : Warning< - "using %0 with a literal is redundant">, InGroup<ObjCRedundantLiteralUse>; -} - -def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", " - "\"local-dynamic\", \"initial-exec\" or \"local-exec\"">; - -def err_tls_var_aligned_over_maximum : Error< - "alignment (%0) of thread-local variable %1 is greater than the maximum supported " - "alignment (%2) for a thread-local variable on this target">; - -def err_only_annotate_after_access_spec : Error< - "access specifier can only have annotation attributes">; - -def err_attribute_section_invalid_for_target : Error< - "argument to 'section' attribute is not valid for this target: %0">; -def warn_mismatched_section : Warning< - "section does not match previous declaration">, InGroup<Section>; - -def err_anonymous_property: Error< - "anonymous property is not supported">; -def err_property_is_variably_modified : Error< - "property %0 has a variably modified type">; -def err_no_accessor_for_property : Error< - "no %select{getter|setter}0 defined for property %1">; -def error_cannot_find_suitable_accessor : Error< - "cannot find suitable %select{getter|setter}0 for property %1">; - -def err_alignment_not_power_of_two : Error< - "requested alignment is not a power of 2">; -def err_alignment_dependent_typedef_name : Error< - "requested alignment is dependent but declaration is not dependent">; - -def err_attribute_aligned_too_great : Error< - "requested alignment must be %0 bytes or smaller">; -def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning< - "%q0 redeclared without %1 attribute: previous %1 ignored">, - InGroup<DiagGroup<"inconsistent-dllimport">>; -def warn_dllimport_dropped_from_inline_function : Warning< - "%q0 redeclared inline; %1 attribute ignored">, - InGroup<IgnoredAttributes>; -def warn_attribute_ignored : Warning<"%0 attribute ignored">, - InGroup<IgnoredAttributes>; -def warn_attribute_ignored_on_inline : - Warning<"%0 attribute ignored on inline function">, - InGroup<IgnoredAttributes>; -def warn_attribute_after_definition_ignored : Warning< - "attribute %0 after definition is ignored">, - InGroup<IgnoredAttributes>; -def warn_unknown_attribute_ignored : Warning< - "unknown attribute %0 ignored">, InGroup<UnknownAttributes>; -def warn_cxx11_gnu_attribute_on_type : Warning< - "attribute %0 ignored, because it cannot be applied to a type">, - InGroup<IgnoredAttributes>; -def warn_unhandled_ms_attribute_ignored : Warning< - "__declspec attribute %0 is not supported">, - InGroup<IgnoredAttributes>; -def err_attribute_invalid_on_stmt : Error< - "%0 attribute cannot be applied to a statement">; -def warn_declspec_attribute_ignored : Warning< - "attribute %0 is ignored, place it after " - "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " - "type declaration">, InGroup<IgnoredAttributes>; -def warn_attribute_precede_definition : Warning< - "attribute declaration must precede definition">, - InGroup<IgnoredAttributes>; -def warn_attribute_void_function_method : Warning< - "attribute %0 cannot be applied to " - "%select{functions|Objective-C method}1 without return value">, - InGroup<IgnoredAttributes>; -def warn_attribute_weak_on_field : Warning< - "__weak attribute cannot be specified on a field declaration">, - InGroup<IgnoredAttributes>; -def warn_gc_attribute_weak_on_local : Warning< - "Objective-C GC does not allow weak variables on the stack">, - InGroup<IgnoredAttributes>; -def warn_nsobject_attribute : Warning< - "'NSObject' attribute may be put on a typedef only; attribute is ignored">, - InGroup<NSobjectAttribute>; -def warn_independentclass_attribute : Warning< - "'objc_independent_class' attribute may be put on a typedef only; " - "attribute is ignored">, - InGroup<IndependentClassAttribute>; -def warn_ptr_independentclass_attribute : Warning< - "'objc_independent_class' attribute may be put on Objective-C object " - "pointer type only; attribute is ignored">, - InGroup<IndependentClassAttribute>; -def warn_attribute_weak_on_local : Warning< - "__weak attribute cannot be specified on an automatic variable when ARC " - "is not enabled">, - InGroup<IgnoredAttributes>; -def warn_weak_identifier_undeclared : Warning< - "weak identifier %0 never declared">; -def err_attribute_weak_static : Error< - "weak declaration cannot have internal linkage">; -def err_attribute_selectany_non_extern_data : Error< - "'selectany' can only be applied to data items with external linkage">; -def err_declspec_thread_on_thread_variable : Error< - "'__declspec(thread)' applied to variable that already has a " - "thread-local storage specifier">; -def err_attribute_dll_not_extern : Error< - "%q0 must have external linkage when declared %q1">; -def err_attribute_dll_thread_local : Error< - "%q0 cannot be thread local when declared %q1">; -def err_attribute_dll_lambda : Error< - "lambda cannot be declared %0">; -def warn_attribute_invalid_on_definition : Warning< - "'%0' attribute cannot be specified on a definition">, - InGroup<IgnoredAttributes>; -def err_attribute_dll_redeclaration : Error< - "redeclaration of %q0 cannot add %q1 attribute">; -def warn_attribute_dll_redeclaration : Warning< - "redeclaration of %q0 should not add %q1 attribute">, - InGroup<DiagGroup<"dll-attribute-on-redeclaration">>; -def err_attribute_dllimport_function_definition : Error< - "dllimport cannot be applied to non-inline function definition">; -def err_attribute_dll_deleted : Error< - "attribute %q0 cannot be applied to a deleted function">; -def err_attribute_dllimport_data_definition : Error< - "definition of dllimport data">; -def err_attribute_dllimport_static_field_definition : Error< - "definition of dllimport static field not allowed">; -def warn_attribute_dllimport_static_field_definition : Warning< - "definition of dllimport static field">, - InGroup<DiagGroup<"dllimport-static-field-def">>; -def warn_attribute_dllexport_explicit_instantiation_decl : Warning< - "explicit instantiation declaration should not be 'dllexport'">, - InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>; -def warn_invalid_initializer_from_system_header : Warning< - "invalid constructor form class in system header, should not be explicit">, - InGroup<DiagGroup<"invalid-initializer-from-system-header">>; -def note_used_in_initialization_here : Note<"used in initialization here">; -def err_attribute_dll_member_of_dll_class : Error< - "attribute %q0 cannot be applied to member of %q1 class">; -def warn_attribute_dll_instantiated_base_class : Warning< - "propagating dll attribute to %select{already instantiated|explicitly specialized}0 " - "base class template without dll attribute is not supported">, - InGroup<DiagGroup<"unsupported-dll-base-class-template">>, DefaultIgnore; -def err_attribute_dll_ambiguous_default_ctor : Error< - "'__declspec(dllexport)' cannot be applied to more than one default constructor in %0">; -def err_attribute_weakref_not_static : Error< - "weakref declaration must have internal linkage">; -def err_attribute_weakref_not_global_context : Error< - "weakref declaration of %0 must be in a global context">; -def err_attribute_weakref_without_alias : Error< - "weakref declaration of %0 must also have an alias attribute">; -def err_alias_not_supported_on_darwin : Error < - "only weak aliases are supported on darwin">; -def err_alias_to_undefined : Error< - "alias must point to a defined variable or function">; -def warn_alias_to_weak_alias : Warning< - "alias will always resolve to %0 even if weak definition of alias %1 is overridden">, - InGroup<IgnoredAttributes>; -def warn_alias_with_section : Warning< - "alias will not be in section '%0' but in the same section as the aliasee">, - InGroup<IgnoredAttributes>; -def err_duplicate_mangled_name : Error< - "definition with same mangled name as another definition">; -def err_cyclic_alias : Error< - "alias definition is part of a cycle">; -def warn_attribute_wrong_decl_type : Warning< - "%0 attribute only applies to %select{functions|unions|" - "variables and functions|functions and methods|parameters|" - "functions, methods and blocks|functions, methods, and classes|" - "functions, methods, and parameters|classes|enums|variables|methods|" - "variables, functions and labels|fields and global variables|structs|" - "variables and typedefs|thread-local variables|" - "variables and fields|variables, data members and tag types|" - "types and namespaces|Objective-C interfaces|methods and properties|" - "struct or union|struct, union or class|types|" - "Objective-C instance methods|init methods of interface or class extension declarations|" - "variables, functions and classes|Objective-C protocols|" - "functions and global variables|structs, unions, and typedefs|structs and typedefs|" - "interface or protocol declarations|kernel functions|non-K&R-style functions}1">, - InGroup<IgnoredAttributes>; -def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>; -def warn_type_attribute_wrong_type : Warning< - "'%0' only applies to %select{function|pointer|" - "Objective-C object or block pointer}1 types; type here is %2">, - InGroup<IgnoredAttributes>; -def warn_incomplete_encoded_type : Warning< - "encoding of %0 type is incomplete because %1 component has unknown encoding">, - InGroup<DiagGroup<"encode-type">>; -def warn_attribute_requires_functions_or_static_globals : Warning< - "%0 only applies to variables with static storage duration and functions">, - InGroup<IgnoredAttributes>; -def warn_gnu_inline_attribute_requires_inline : Warning< - "'gnu_inline' attribute requires function to be marked 'inline'," - " attribute ignored">, - InGroup<IgnoredAttributes>; -def err_attribute_vecreturn_only_vector_member : Error< - "the vecreturn attribute can only be used on a class or structure with one member, which must be a vector">; -def err_attribute_vecreturn_only_pod_record : Error< - "the vecreturn attribute can only be used on a POD (plain old data) class or structure (i.e. no virtual functions)">; -def err_cconv_change : Error< - "function declared '%0' here was previously declared " - "%select{'%2'|without calling convention}1">; -def warn_cconv_ignored : Warning< - "calling convention %0 ignored for this target">, InGroup<IgnoredAttributes>; -def err_cconv_knr : Error< - "function with no prototype cannot use the %0 calling convention">; -def warn_cconv_knr : Warning< - err_cconv_knr.Text>, - InGroup<DiagGroup<"missing-prototype-for-cc">>; -def err_cconv_varargs : Error< - "variadic function cannot use %0 calling convention">; -def warn_cconv_varargs : Warning< - "%0 calling convention ignored on variadic function">, - InGroup<IgnoredAttributes>; -def warn_cconv_structors : Warning< - "%0 calling convention ignored on constructor/destructor">, - InGroup<IgnoredAttributes>; -def err_regparm_mismatch : Error<"function declared with regparm(%0) " - "attribute was previously declared " - "%plural{0:without the regparm|:with the regparm(%1)}1 attribute">; -def err_returns_retained_mismatch : Error< - "function declared with the ns_returns_retained attribute " - "was previously declared without the ns_returns_retained attribute">; -def err_objc_precise_lifetime_bad_type : Error< - "objc_precise_lifetime only applies to retainable types; type here is %0">; -def warn_objc_precise_lifetime_meaningless : Error< - "objc_precise_lifetime is not meaningful for " - "%select{__unsafe_unretained|__autoreleasing}0 objects">; -def err_invalid_pcs : Error<"invalid PCS type">; -def warn_attribute_not_on_decl : Warning< - "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>; -def err_base_specifier_attribute : Error< - "%0 attribute cannot be applied to a base specifier">; -def err_invalid_attribute_on_virtual_function : Error< - "%0 attribute cannot be applied to virtual functions">; - -// Availability attribute -def warn_availability_unknown_platform : Warning< - "unknown platform %0 in availability macro">, InGroup<Availability>; -def warn_availability_version_ordering : Warning< - "feature cannot be %select{introduced|deprecated|obsoleted}0 in %1 version " - "%2 before it was %select{introduced|deprecated|obsoleted}3 in version %4; " - "attribute ignored">, InGroup<Availability>; -def warn_mismatched_availability: Warning< - "availability does not match previous declaration">, InGroup<Availability>; -def warn_mismatched_availability_override : Warning< - "%select{|overriding }4method %select{introduced after|" - "deprecated before|obsoleted before}0 " - "%select{the protocol method it implements|overridden method}4 " - "on %1 (%2 vs. %3)">, InGroup<Availability>; -def warn_mismatched_availability_override_unavail : Warning< - "%select{|overriding }1method cannot be unavailable on %0 when " - "%select{the protocol method it implements|its overridden method}1 is " - "available">, - InGroup<Availability>; -def note_overridden_method : Note< - "overridden method is here">; -def note_protocol_method : Note< - "protocol method is here">; - -// Thread Safety Attributes -def warn_invalid_capability_name : Warning< - "invalid capability name '%0'; capability name must be 'mutex' or 'role'">, - InGroup<ThreadSafetyAttributes>, DefaultIgnore; -def warn_thread_attribute_ignored : Warning< - "ignoring %0 attribute because its argument is invalid">, - InGroup<ThreadSafetyAttributes>, DefaultIgnore; -def warn_thread_attribute_argument_not_lockable : Warning< - "%0 attribute requires arguments whose type is annotated " - "with 'capability' attribute; type here is %1">, - InGroup<ThreadSafetyAttributes>, DefaultIgnore; -def warn_thread_attribute_decl_not_lockable : Warning< - "%0 attribute can only be applied in a context annotated " - "with 'capability(\"mutex\")' attribute">, - InGroup<ThreadSafetyAttributes>, DefaultIgnore; -def warn_thread_attribute_decl_not_pointer : Warning< - "%0 only applies to pointer types; type here is %1">, - InGroup<ThreadSafetyAttributes>, DefaultIgnore; -def err_attribute_argument_out_of_range : Error< - "%0 attribute parameter %1 is out of bounds: " - "%plural{0:no parameters to index into|" - "1:can only be 1, since there is one parameter|" - ":must be between 1 and %2}2">; - -// Thread Safety Analysis -def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_unlock_kind_mismatch : Warning< - "releasing %0 '%1' using %select{shared|exclusive}2 access, expected " - "%select{shared|exclusive}3 access">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_double_lock : Warning<"acquiring %0 '%1' that is already held">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_no_unlock : Warning< - "%0 '%1' is still held at the end of function">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_expecting_locked : Warning< - "expecting %0 '%1' to be held at the end of function">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -// FIXME: improve the error message about locks not in scope -def warn_lock_some_predecessors : Warning< - "%0 '%1' is not held on every path through here">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_expecting_lock_held_on_loop : Warning< - "expecting %0 '%1' to be held at start of each loop">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def note_locked_here : Note<"%0 acquired here">; -def warn_lock_exclusive_and_shared : Warning< - "%0 '%1' is acquired exclusively and shared in the same scope">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def note_lock_exclusive_and_shared : Note< - "the other acquisition of %0 '%1' is here">; -def warn_variable_requires_any_lock : Warning< - "%select{reading|writing}1 variable '%0' requires holding " - "%select{any mutex|any mutex exclusively}1">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_var_deref_requires_any_lock : Warning< - "%select{reading|writing}1 the value pointed to by '%0' requires holding " - "%select{any mutex|any mutex exclusively}1">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_fun_excludes_mutex : Warning< - "cannot call function '%1' while %0 '%2' is held">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_cannot_resolve_lock : Warning< - "cannot resolve lock expression">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_acquired_before : Warning< - "%0 '%1' must be acquired before '%2'">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_acquired_before_after_cycle : Warning< - "Cycle in acquired_before/after dependencies, starting with '%0'">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; - - -// Thread safety warnings negative capabilities -def warn_acquire_requires_negative_cap : Warning< - "acquiring %0 '%1' requires negative capability '%2'">, - InGroup<ThreadSafetyNegative>, DefaultIgnore; - -// Thread safety warnings on pass by reference -def warn_guarded_pass_by_reference : Warning< - "passing variable '%1' by reference requires holding %0 " - "%select{'%2'|'%2' exclusively}3">, - InGroup<ThreadSafetyReference>, DefaultIgnore; -def warn_pt_guarded_pass_by_reference : Warning< - "passing the value that '%1' points to by reference requires holding %0 " - "%select{'%2'|'%2' exclusively}3">, - InGroup<ThreadSafetyReference>, DefaultIgnore; - -// Imprecise thread safety warnings -def warn_variable_requires_lock : Warning< - "%select{reading|writing}3 variable '%1' requires holding %0 " - "%select{'%2'|'%2' exclusively}3">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_var_deref_requires_lock : Warning< - "%select{reading|writing}3 the value pointed to by '%1' requires " - "holding %0 %select{'%2'|'%2' exclusively}3">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; -def warn_fun_requires_lock : Warning< - "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">, - InGroup<ThreadSafetyAnalysis>, DefaultIgnore; - -// Precise thread safety warnings -def warn_variable_requires_lock_precise : - Warning<warn_variable_requires_lock.Text>, - InGroup<ThreadSafetyPrecise>, DefaultIgnore; -def warn_var_deref_requires_lock_precise : - Warning<warn_var_deref_requires_lock.Text>, - InGroup<ThreadSafetyPrecise>, DefaultIgnore; -def warn_fun_requires_lock_precise : - Warning<warn_fun_requires_lock.Text>, - InGroup<ThreadSafetyPrecise>, DefaultIgnore; -def note_found_mutex_near_match : Note<"found near match '%0'">; - -// Verbose thread safety warnings -def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, - InGroup<ThreadSafetyVerbose>, DefaultIgnore; -def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">; -def note_guarded_by_declared_here : Note<"Guarded_by declared here.">; - -// Dummy warning that will trigger "beta" warnings from the analysis if enabled. -def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, - InGroup<ThreadSafetyBeta>, DefaultIgnore; - -// Consumed warnings -def warn_use_in_invalid_state : Warning< - "invalid invocation of method '%0' on object '%1' while it is in the '%2' " - "state">, InGroup<Consumed>, DefaultIgnore; -def warn_use_of_temp_in_invalid_state : Warning< - "invalid invocation of method '%0' on a temporary object while it is in the " - "'%1' state">, InGroup<Consumed>, DefaultIgnore; -def warn_attr_on_unconsumable_class : Warning< - "consumed analysis attribute is attached to member of class '%0' which isn't " - "marked as consumable">, InGroup<Consumed>, DefaultIgnore; -def warn_return_typestate_for_unconsumable_type : Warning< - "return state set for an unconsumable type '%0'">, InGroup<Consumed>, - DefaultIgnore; -def warn_return_typestate_mismatch : Warning< - "return value not in expected state; expected '%0', observed '%1'">, - InGroup<Consumed>, DefaultIgnore; -def warn_loop_state_mismatch : Warning< - "state of variable '%0' must match at the entry and exit of loop">, - InGroup<Consumed>, DefaultIgnore; -def warn_param_return_typestate_mismatch : Warning< - "parameter '%0' not in expected state when the function returns: expected " - "'%1', observed '%2'">, InGroup<Consumed>, DefaultIgnore; -def warn_param_typestate_mismatch : Warning< - "argument not in expected state; expected '%0', observed '%1'">, - InGroup<Consumed>, DefaultIgnore; - -// no_sanitize attribute -def warn_unknown_sanitizer_ignored : Warning< - "unknown sanitizer '%0' ignored">, InGroup<UnknownSanitizers>; - -def warn_impcast_vector_scalar : Warning< - "implicit conversion turns vector to scalar: %0 to %1">, - InGroup<Conversion>, DefaultIgnore; -def warn_impcast_complex_scalar : Warning< - "implicit conversion discards imaginary component: %0 to %1">, - InGroup<Conversion>, DefaultIgnore; -def warn_impcast_float_precision : Warning< - "implicit conversion loses floating-point precision: %0 to %1">, - InGroup<Conversion>, DefaultIgnore; -def warn_impcast_double_promotion : Warning< - "implicit conversion increases floating-point precision: %0 to %1">, - InGroup<DoublePromotion>, DefaultIgnore; -def warn_impcast_float_integer : Warning< - "implicit conversion turns floating-point number into integer: %0 to %1">, - InGroup<FloatConversion>, DefaultIgnore; -def warn_impcast_integer_sign : Warning< - "implicit conversion changes signedness: %0 to %1">, - InGroup<SignConversion>, DefaultIgnore; -def warn_impcast_integer_sign_conditional : Warning< - "operand of ? changes signedness: %0 to %1">, - InGroup<SignConversion>, DefaultIgnore; -def warn_impcast_integer_precision : Warning< - "implicit conversion loses integer precision: %0 to %1">, - InGroup<Conversion>, DefaultIgnore; -def warn_impcast_integer_64_32 : Warning< - "implicit conversion loses integer precision: %0 to %1">, - InGroup<Shorten64To32>, DefaultIgnore; -def warn_impcast_integer_precision_constant : Warning< - "implicit conversion from %2 to %3 changes value from %0 to %1">, - InGroup<ConstantConversion>; -def warn_impcast_bitfield_precision_constant : Warning< - "implicit truncation from %2 to bitfield changes value from %0 to %1">, - InGroup<BitFieldConstantConversion>; -def warn_impcast_literal_float_to_integer : Warning< - "implicit conversion from %0 to %1 changes value from %2 to %3">, - InGroup<LiteralConversion>; -def warn_impcast_string_literal_to_bool : Warning< - "implicit conversion turns string literal into bool: %0 to %1">, - InGroup<StringConversion>, DefaultIgnore; -def warn_impcast_different_enum_types : Warning< - "implicit conversion from enumeration type %0 to different enumeration type " - "%1">, InGroup<EnumConversion>; -def warn_impcast_bool_to_null_pointer : Warning< - "initialization of pointer of type %0 to null from a constant boolean " - "expression">, InGroup<BoolConversion>; -def warn_non_literal_null_pointer : Warning< - "expression which evaluates to zero treated as a null pointer constant of " - "type %0">, InGroup<NonLiteralNullConversion>; -def warn_impcast_null_pointer_to_integer : Warning< - "implicit conversion of %select{NULL|nullptr}0 constant to %1">, - InGroup<NullConversion>; -def warn_impcast_floating_point_to_bool : Warning< - "implicit conversion turns floating-point number into bool: %0 to %1">, - InGroup<ImplicitConversionFloatingPointToBool>; -def ext_ms_impcast_fn_obj : ExtWarn< - "implicit conversion between pointer-to-function and pointer-to-object is a " - "Microsoft extension">, InGroup<MicrosoftCast>; - -def warn_impcast_pointer_to_bool : Warning< - "address of%select{| function| array}0 '%1' will always evaluate to " - "'true'">, - InGroup<PointerBoolConversion>; -def warn_cast_nonnull_to_bool : Warning< - "nonnull %select{function call|parameter}0 '%1' will evaluate to " - "'true' on first encounter">, - InGroup<PointerBoolConversion>; -def warn_this_bool_conversion : Warning< - "'this' pointer cannot be null in well-defined C++ code; pointer may be " - "assumed to always convert to true">, InGroup<UndefinedBoolConversion>; -def warn_address_of_reference_bool_conversion : Warning< - "reference cannot be bound to dereferenced null pointer in well-defined C++ " - "code; pointer may be assumed to always convert to true">, - InGroup<UndefinedBoolConversion>; - -def warn_null_pointer_compare : Warning< - "comparison of %select{address of|function|array}0 '%1' %select{not |}2" - "equal to a null pointer is always %select{true|false}2">, - InGroup<TautologicalPointerCompare>; -def warn_nonnull_expr_compare : Warning< - "comparison of nonnull %select{function call|parameter}0 '%1' " - "%select{not |}2equal to a null pointer is '%select{true|false}2' on first " - "encounter">, - InGroup<TautologicalPointerCompare>; -def warn_this_null_compare : Warning< - "'this' pointer cannot be null in well-defined C++ code; comparison may be " - "assumed to always evaluate to %select{true|false}0">, - InGroup<TautologicalUndefinedCompare>; -def warn_address_of_reference_null_compare : Warning< - "reference cannot be bound to dereferenced null pointer in well-defined C++ " - "code; comparison may be assumed to always evaluate to " - "%select{true|false}0">, - InGroup<TautologicalUndefinedCompare>; -def note_reference_is_return_value : Note<"%0 returns a reference">; - -def note_function_warning_silence : Note< - "prefix with the address-of operator to silence this warning">; -def note_function_to_function_call : Note< - "suffix with parentheses to turn this into a function call">; -def warn_impcast_objective_c_literal_to_bool : Warning< - "implicit boolean conversion of Objective-C object literal always " - "evaluates to true">, - InGroup<ObjCLiteralConversion>; - -def warn_cast_align : Warning< - "cast from %0 to %1 increases required alignment from %2 to %3">, - InGroup<CastAlign>, DefaultIgnore; -def warn_old_style_cast : Warning< - "use of old-style cast">, InGroup<OldStyleCast>, DefaultIgnore; - -// Separate between casts to void* and non-void* pointers. -// Some APIs use (abuse) void* for something like a user context, -// and often that value is an integer even if it isn't a pointer itself. -// Having a separate warning flag allows users to control the warning -// for their workflow. -def warn_int_to_pointer_cast : Warning< - "cast to %1 from smaller integer type %0">, - InGroup<IntToPointerCast>; -def warn_int_to_void_pointer_cast : Warning< - "cast to %1 from smaller integer type %0">, - InGroup<IntToVoidPointerCast>; - -def warn_attribute_packed_for_bitfield : Warning< - "'packed' attribute was ignored on bit-fields with single-byte alignment " - "in older versions of GCC and Clang">, - InGroup<DiagGroup<"attribute-packed-for-bitfield">>; -def warn_transparent_union_attribute_field_size_align : Warning< - "%select{alignment|size}0 of field %1 (%2 bits) does not match the " - "%select{alignment|size}0 of the first field in transparent union; " - "transparent_union attribute ignored">, - InGroup<IgnoredAttributes>; -def note_transparent_union_first_field_size_align : Note< - "%select{alignment|size}0 of first field is %1 bits">; -def warn_transparent_union_attribute_not_definition : Warning< - "transparent_union attribute can only be applied to a union definition; " - "attribute ignored">, - InGroup<IgnoredAttributes>; -def warn_transparent_union_attribute_floating : Warning< - "first field of a transparent union cannot have %select{floating point|" - "vector}0 type %1; transparent_union attribute ignored">, - InGroup<IgnoredAttributes>; -def warn_transparent_union_attribute_zero_fields : Warning< - "transparent union definition must contain at least one field; " - "transparent_union attribute ignored">, - InGroup<IgnoredAttributes>; -def warn_attribute_type_not_supported : Warning< - "%0 attribute argument not supported: %1">, - InGroup<IgnoredAttributes>; -def warn_attribute_unknown_visibility : Warning<"unknown visibility %0">, - InGroup<IgnoredAttributes>; -def warn_attribute_protected_visibility : - Warning<"target does not support 'protected' visibility; using 'default'">, - InGroup<DiagGroup<"unsupported-visibility">>; -def err_mismatched_visibility: Error<"visibility does not match previous declaration">; -def note_previous_attribute : Note<"previous attribute is here">; -def note_conflicting_attribute : Note<"conflicting attribute is here">; -def note_attribute : Note<"attribute is here">; -def err_mismatched_ms_inheritance : Error< - "inheritance model does not match %select{definition|previous declaration}0">; -def warn_ignored_ms_inheritance : Warning< - "inheritance model ignored on %select{primary template|partial specialization}0">, - InGroup<IgnoredAttributes>; -def note_previous_ms_inheritance : Note< - "previous inheritance model specified here">; -def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">; -def err_mode_not_primitive : Error< - "mode attribute only supported for integer and floating-point types">; -def err_mode_wrong_type : Error< - "type of machine mode does not match type of base type">; -def warn_vector_mode_deprecated : Warning< - "specifying vector types with the 'mode' attribute is deprecated; " - "use the 'vector_size' attribute instead">, - InGroup<DeprecatedAttributes>; -def err_complex_mode_vector_type : Error< - "type of machine mode does not support base vector types">; -def err_attr_wrong_decl : Error< - "%0 attribute invalid on this declaration, requires typedef or value">; -def warn_attribute_nonnull_no_pointers : Warning< - "'nonnull' attribute applied to function with no pointer arguments">, - InGroup<IgnoredAttributes>; -def warn_attribute_nonnull_parm_no_args : Warning< - "'nonnull' attribute when used on parameters takes no arguments">, - InGroup<IgnoredAttributes>; -def warn_attribute_sentinel_named_arguments : Warning< - "'sentinel' attribute requires named arguments">, - InGroup<IgnoredAttributes>; -def warn_attribute_sentinel_not_variadic : Warning< - "'sentinel' attribute only supported for variadic %select{functions|blocks}0">, - InGroup<IgnoredAttributes>; -def err_attribute_sentinel_less_than_zero : Error< - "'sentinel' parameter 1 less than zero">; -def err_attribute_sentinel_not_zero_or_one : Error< - "'sentinel' parameter 2 not 0 or 1">; -def warn_cleanup_ext : Warning< - "GCC does not allow the 'cleanup' attribute argument to be anything other " - "than a simple identifier">, - InGroup<GccCompat>; -def err_attribute_cleanup_arg_not_function : Error< - "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">; -def err_attribute_cleanup_func_must_take_one_arg : Error< - "'cleanup' function %0 must take 1 parameter">; -def err_attribute_cleanup_func_arg_incompatible_type : Error< - "'cleanup' function %0 parameter has " - "%diff{type $ which is incompatible with type $|incompatible type}1,2">; -def err_attribute_regparm_wrong_platform : Error< - "'regparm' is not valid on this platform">; -def err_attribute_regparm_invalid_number : Error< - "'regparm' parameter must be between 0 and %0 inclusive">; -def err_attribute_not_supported_in_lang : Error< - "%0 attribute is not supported in %select{C|C++|Objective-C}1">; - - -// Clang-Specific Attributes -def warn_attribute_iboutlet : Warning< - "%0 attribute can only be applied to instance variables or properties">, - InGroup<IgnoredAttributes>; -def err_iboutletcollection_type : Error< - "invalid type %0 as argument of iboutletcollection attribute">; -def err_iboutletcollection_builtintype : Error< - "type argument of iboutletcollection attribute cannot be a builtin type">; -def warn_iboutlet_object_type : Warning< - "%select{instance variable|property}2 with %0 attribute must " - "be an object type (invalid %1)">, InGroup<ObjCInvalidIBOutletProperty>; -def warn_iboutletcollection_property_assign : Warning< - "IBOutletCollection properties should be copy/strong and not assign">, - InGroup<ObjCInvalidIBOutletProperty>; - -def err_attribute_overloadable_missing : Error< - "%select{overloaded function|redeclaration of}0 %1 must have the " - "'overloadable' attribute">; -def note_attribute_overloadable_prev_overload : Note< - "previous overload of function is here">; -def err_attribute_overloadable_no_prototype : Error< - "'overloadable' function %0 must have a prototype">; -def warn_ns_attribute_wrong_return_type : Warning< - "%0 attribute only applies to %select{functions|methods|properties}1 that " - "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">, - InGroup<IgnoredAttributes>; -def warn_ns_attribute_wrong_parameter_type : Warning< - "%0 attribute only applies to " - "%select{Objective-C object|pointer|pointer-to-CF-pointer}1 parameters">, - InGroup<IgnoredAttributes>; -def warn_objc_requires_super_protocol : Warning< - "%0 attribute cannot be applied to %select{methods in protocols|dealloc}1">, - InGroup<DiagGroup<"requires-super-attribute">>; -def note_protocol_decl : Note< - "protocol is declared here">; -def note_protocol_decl_undefined : Note< - "protocol %0 has no definition">; - -// objc_designated_initializer attribute diagnostics. -def warn_objc_designated_init_missing_super_call : Warning< - "designated initializer missing a 'super' call to a designated initializer of the super class">, - InGroup<ObjCDesignatedInit>; -def note_objc_designated_init_marked_here : Note< - "method marked as designated initializer of the class here">; -def warn_objc_designated_init_non_super_designated_init_call : Warning< - "designated initializer should only invoke a designated initializer on 'super'">, - InGroup<ObjCDesignatedInit>; -def warn_objc_designated_init_non_designated_init_call : Warning< - "designated initializer invoked a non-designated initializer">, - InGroup<ObjCDesignatedInit>; -def warn_objc_secondary_init_super_init_call : Warning< - "convenience initializer should not invoke an initializer on 'super'">, - InGroup<ObjCDesignatedInit>; -def warn_objc_secondary_init_missing_init_call : Warning< - "convenience initializer missing a 'self' call to another initializer">, - InGroup<ObjCDesignatedInit>; -def warn_objc_implementation_missing_designated_init_override : Warning< - "method override for the designated initializer of the superclass %objcinstance0 not found">, - InGroup<ObjCDesignatedInit>; - -// objc_bridge attribute diagnostics. -def err_objc_attr_not_id : Error< - "parameter of %0 attribute must be a single name of an Objective-C %select{class|protocol}1">; -def err_objc_attr_typedef_not_id : Error< - "parameter of %0 attribute must be 'id' when used on a typedef">; -def err_objc_attr_typedef_not_void_pointer : Error< - "'objc_bridge(id)' is only allowed on structs and typedefs of void pointers">; -def err_objc_cf_bridged_not_interface : Error< - "CF object of type %0 is bridged to %1, which is not an Objective-C class">; -def err_objc_ns_bridged_invalid_cfobject : Error< - "ObjectiveC object of type %0 is bridged to %1, which is not valid CF object">; -def warn_objc_invalid_bridge : Warning< - "%0 bridges to %1, not %2">, InGroup<ObjCBridge>; -def warn_objc_invalid_bridge_to_cf : Warning< - "%0 cannot bridge to %1">, InGroup<ObjCBridge>; - -// objc_bridge_related attribute diagnostics. -def err_objc_bridged_related_invalid_class : Error< - "could not find Objective-C class %0 to convert %1 to %2">; -def err_objc_bridged_related_invalid_class_name : Error< - "%0 must be name of an Objective-C class to be able to convert %1 to %2">; -def err_objc_bridged_related_known_method : Error< - "%0 must be explicitly converted to %1; use %select{%objcclass2|%objcinstance2}3 " - "method for this conversion">; - -def err_objc_attr_protocol_requires_definition : Error< - "attribute %0 can only be applied to @protocol definitions, not forward declarations">; - -// Function Parameter Semantic Analysis. -def err_param_with_void_type : Error<"argument may not have 'void' type">; -def err_void_only_param : Error< - "'void' must be the first and only parameter if specified">; -def err_void_param_qualified : Error< - "'void' as parameter must not have type qualifiers">; -def err_ident_list_in_fn_declaration : Error< - "a parameter list without types is only allowed in a function definition">; -def ext_param_not_declared : Extension< - "parameter %0 was not declared, defaulting to type 'int'">; -def err_param_default_argument : Error< - "C does not support default arguments">; -def err_param_default_argument_redefinition : Error< - "redefinition of default argument">; -def ext_param_default_argument_redefinition : ExtWarn< - err_param_default_argument_redefinition.Text>, - InGroup<MicrosoftDefaultArgRedefinition>; -def err_param_default_argument_missing : Error< - "missing default argument on parameter">; -def err_param_default_argument_missing_name : Error< - "missing default argument on parameter %0">; -def err_param_default_argument_references_param : Error< - "default argument references parameter %0">; -def err_param_default_argument_references_local : Error< - "default argument references local variable %0 of enclosing function">; -def err_param_default_argument_references_this : Error< - "default argument references 'this'">; -def err_param_default_argument_nonfunc : Error< - "default arguments can only be specified for parameters in a function " - "declaration">; -def err_param_default_argument_template_redecl : Error< - "default arguments cannot be added to a function template that has already " - "been declared">; -def err_param_default_argument_member_template_redecl : Error< - "default arguments cannot be added to an out-of-line definition of a member " - "of a %select{class template|class template partial specialization|nested " - "class in a template}0">; -def err_param_default_argument_on_parameter_pack : Error< - "parameter pack cannot have a default argument">; -def err_uninitialized_member_for_assign : Error< - "cannot define the implicit copy assignment operator for %0, because " - "non-static %select{reference|const}1 member %2 cannot use copy " - "assignment operator">; -def err_uninitialized_member_in_ctor : Error< - "%select{|implicit default |inheriting }0constructor for %1 must explicitly " - "initialize the %select{reference|const}2 member %3">; -def err_default_arg_makes_ctor_special : Error< - "addition of default argument on redeclaration makes this constructor a " - "%select{default|copy|move}0 constructor">; - -def err_use_of_default_argument_to_function_declared_later : Error< - "use of default argument to function %0 that is declared later in class %1">; -def note_default_argument_declared_here : Note< - "default argument declared here">; - -def ext_param_promoted_not_compatible_with_prototype : ExtWarn< - "%diff{promoted type $ of K&R function parameter is not compatible with the " - "parameter type $|promoted type of K&R function parameter is not compatible " - "with parameter type}0,1 declared in a previous prototype">, - InGroup<KNRPromotedParameter>; - - -// C++ Overloading Semantic Analysis. -def err_ovl_diff_return_type : Error< - "functions that differ only in their return type cannot be overloaded">; -def err_ovl_static_nonstatic_member : Error< - "static and non-static member functions with the same parameter types " - "cannot be overloaded">; - -def err_ovl_no_viable_function_in_call : Error< - "no matching function for call to %0">; -def err_ovl_no_viable_member_function_in_call : Error< - "no matching member function for call to %0">; -def err_ovl_ambiguous_call : Error< - "call to %0 is ambiguous">; -def err_ovl_deleted_call : Error< - "call to %select{unavailable|deleted}0 function %1%2">; -def err_ovl_ambiguous_member_call : Error< - "call to member function %0 is ambiguous">; -def err_ovl_deleted_member_call : Error< - "call to %select{unavailable|deleted}0 member function %1%2">; -def note_ovl_too_many_candidates : Note< - "remaining %0 candidate%s0 omitted; " - "pass -fshow-overloads=all to show them">; -def note_ovl_candidate : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "is the implicit default constructor|" - "is the implicit copy constructor|" - "is the implicit move constructor|" - "is the implicit copy assignment operator|" - "is the implicit move assignment operator|" - "is an inherited constructor}0%1" - "%select{| has different class%diff{ (expected $ but has $)|}3,4" - "| has different number of parameters (expected %3 but has %4)" - "| has type mismatch at %ordinal3 parameter" - "%diff{ (expected $ but has $)|}4,5" - "| has different return type%diff{ ($ expected but has $)|}3,4" - "| has different qualifiers (expected " - "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}3 but found " - "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}4)}2">; - -def note_ovl_candidate_inherited_constructor : Note<"inherited from here">; -def note_ovl_candidate_illegal_constructor : Note< - "candidate %select{constructor|template}0 ignored: " - "instantiation %select{takes|would take}0 its own class type by value">; -def note_ovl_candidate_bad_deduction : Note< - "candidate template ignored: failed template argument deduction">; -def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: " - "couldn't infer template argument %0">; -def note_ovl_candidate_inconsistent_deduction : Note< - "candidate template ignored: deduced conflicting %select{types|values|" - "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">; -def note_ovl_candidate_explicit_arg_mismatch_named : Note< - "candidate template ignored: invalid explicitly-specified argument " - "for template parameter %0">; -def note_ovl_candidate_explicit_arg_mismatch_unnamed : Note< - "candidate template ignored: invalid explicitly-specified argument " - "for %ordinal0 template parameter">; -def note_ovl_candidate_instantiation_depth : Note< - "candidate template ignored: substitution exceeded maximum template " - "instantiation depth">; -def note_ovl_candidate_underqualified : Note< - "candidate template ignored: cannot deduce a type for %0 that would " - "make %2 equal %1">; -def note_ovl_candidate_substitution_failure : Note< - "candidate template ignored: substitution failure%0%1">; -def note_ovl_candidate_disabled_by_enable_if : Note< - "candidate template ignored: disabled by %0%1">; -def note_ovl_candidate_has_pass_object_size_params: Note< - "candidate address cannot be taken because parameter %0 has " - "pass_object_size attribute">; -def note_ovl_candidate_disabled_by_enable_if_attr : Note< - "candidate disabled: %0">; -def err_addrof_function_disabled_by_enable_if_attr : Error< - "cannot take address of function %0 becuase it has one or more " - "non-tautological enable_if conditions">; -def note_addrof_ovl_candidate_disabled_by_enable_if_attr : Note< - "candidate function made ineligible by enable_if">; -def note_ovl_candidate_failed_overload_resolution : Note< - "candidate template ignored: couldn't resolve reference to overloaded " - "function %0">; -def note_ovl_candidate_deduced_mismatch : Note< - "candidate template ignored: deduced type " - "%diff{$ of %ordinal0 parameter does not match adjusted type $ of argument" - "|of %ordinal0 parameter does not match adjusted type of argument}1,2%3">; -def note_ovl_candidate_non_deduced_mismatch : Note< - "candidate template ignored: could not match %diff{$ against $|types}0,1">; -// This note is needed because the above note would sometimes print two -// different types with the same name. Remove this note when the above note -// can handle that case properly. -def note_ovl_candidate_non_deduced_mismatch_qualified : Note< - "candidate template ignored: could not match %q0 against %q1">; - -// Note that we don't treat templates differently for this diagnostic. -def note_ovl_candidate_arity : Note<"candidate " - "%select{function|function|constructor|function|function|constructor|" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0 %select{|template }1" - "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 " - "%plural{1:was|:were}4 provided">; - -def note_ovl_candidate_arity_one : Note<"candidate " - "%select{function|function|constructor|function|function|constructor|" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0 %select{|template }1not viable: " - "%select{requires at least|allows at most single|requires single}2 " - "argument %3, but %plural{0:no|:%4}4 arguments were provided">; - -def note_ovl_candidate_deleted : Note< - "candidate %select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 has been " - "%select{explicitly made unavailable|explicitly deleted|" - "implicitly deleted}2">; - -// Giving the index of the bad argument really clutters this message, and -// it's relatively unimportant because 1) it's generally obvious which -// argument(s) are of the given object type and 2) the fix is usually -// to complete the type, which doesn't involve changes to the call line -// anyway. If people complain, we can change it. -def note_ovl_candidate_bad_conv_incomplete : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 " - "not viable: cannot convert argument of incomplete type " - "%diff{$ to $|to parameter type}2,3">; -def note_ovl_candidate_bad_list_argument : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 " - "not viable: cannot convert initializer list argument to %3">; -def note_ovl_candidate_bad_overload : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: no overload of %3 matching %2 for %ordinal4 argument">; -def note_ovl_candidate_bad_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: no known conversion " - "%diff{from $ to $|from argument type to parameter type}2,3 for " - "%select{%ordinal5 argument|object argument}4" - "%select{|; dereference the argument with *|" - "; take the address of the argument with &|" - "; remove *|" - "; remove &}6">; -def note_ovl_candidate_bad_arc_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: cannot implicitly convert argument " - "%diff{of type $ to $|type to parameter type}2,3 for " - "%select{%ordinal5 argument|object argument}4 under ARC">; -def note_ovl_candidate_bad_lvalue : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: expects an l-value for " - "%select{%ordinal3 argument|object argument}2">; -def note_ovl_candidate_bad_addrspace : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) is in " - "address space %3, but parameter must be in address space %4">; -def note_ovl_candidate_bad_gc : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 " - "ownership, but parameter has %select{no|__weak|__strong}4 ownership">; -def note_ovl_candidate_bad_ownership : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) has " - "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership," - " but parameter has %select{no|__unsafe_unretained|__strong|__weak|" - "__autoreleasing}4 ownership">; -def note_ovl_candidate_bad_cvr_this : Note<"candidate " - "%select{|function|||function|||||" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|}0 not viable: " - "'this' argument has type %2, but method is not marked " - "%select{const|restrict|const or restrict|volatile|const or volatile|" - "volatile or restrict|const, volatile, or restrict}3">; -def note_ovl_candidate_bad_cvr : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1 not viable: " - "%ordinal4 argument (%2) would lose " - "%select{const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}3 qualifier" - "%select{||s||s|s|s}3">; -def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0%1" - " not viable: cannot %select{convert from|convert from|bind}2 " - "%select{base class pointer|superclass|base class object of type}2 %3 to " - "%select{derived class pointer|subclass|derived class reference}2 %4 for " - "%ordinal5 argument">; -def note_ovl_candidate_bad_target : Note< - "candidate %select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "constructor (inherited)}0 not viable: call to " - "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from" - " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">; -def note_implicit_member_target_infer_collision : Note< - "implicit %select{" - "default constructor|" - "copy constructor|" - "move constructor|" - "copy assignment operator|" - "move assignment operator|" - "destructor}0 inferred target collision: call to both " - "%select{__device__|__global__|__host__|__host__ __device__}1 and " - "%select{__device__|__global__|__host__|__host__ __device__}2 members">; - -def note_ambiguous_type_conversion: Note< - "because of ambiguity in conversion %diff{of $ to $|between types}0,1">; -def note_ovl_builtin_binary_candidate : Note< - "built-in candidate %0">; -def note_ovl_builtin_unary_candidate : Note< - "built-in candidate %0">; -def err_ovl_no_viable_function_in_init : Error< - "no matching constructor for initialization of %0">; -def err_ovl_no_conversion_in_cast : Error< - "cannot convert %1 to %2 without a conversion operator">; -def err_ovl_no_viable_conversion_in_cast : Error< - "no matching conversion for %select{|static_cast|reinterpret_cast|" - "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">; -def err_ovl_ambiguous_conversion_in_cast : Error< - "ambiguous conversion for %select{|static_cast|reinterpret_cast|" - "dynamic_cast|C-style cast|functional-style cast}0 from %1 to %2">; -def err_ovl_deleted_conversion_in_cast : Error< - "%select{|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from %1 to %2 uses deleted function">; -def err_ovl_ambiguous_init : Error<"call to constructor of %0 is ambiguous">; -def err_ref_init_ambiguous : Error< - "reference initialization of type %0 with initializer of type %1 is ambiguous">; -def err_ovl_deleted_init : Error< - "call to %select{unavailable|deleted}0 constructor of %1">; -def err_ovl_deleted_special_init : Error< - "call to implicitly-deleted %select{default constructor|copy constructor|" - "move constructor|copy assignment operator|move assignment operator|" - "destructor|function}0 of %1">; -def err_ovl_ambiguous_oper_unary : Error< - "use of overloaded operator '%0' is ambiguous (operand type %1)">; -def err_ovl_ambiguous_oper_binary : Error< - "use of overloaded operator '%0' is ambiguous (with operand types %1 and %2)">; -def err_ovl_no_viable_oper : Error<"no viable overloaded '%0'">; -def note_assign_lhs_incomplete : Note<"type %0 is incomplete">; -def err_ovl_deleted_oper : Error< - "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">; -def err_ovl_deleted_special_oper : Error< - "object of type %0 cannot be %select{constructed|copied|moved|assigned|" - "assigned|destroyed}1 because its %select{default constructor|" - "copy constructor|move constructor|copy assignment operator|" - "move assignment operator|destructor}1 is implicitly deleted">; -def err_ovl_no_viable_subscript : - Error<"no viable overloaded operator[] for type %0">; -def err_ovl_no_oper : - Error<"type %0 does not provide a %select{subscript|call}1 operator">; -def err_ovl_unresolvable : Error< - "reference to overloaded function could not be resolved; " - "did you mean to call it%select{| with no arguments}0?">; -def err_bound_member_function : Error< - "reference to non-static member function must be called" - "%select{|; did you mean to call it with no arguments?}0">; -def note_possible_target_of_call : Note<"possible target for call">; - -def err_ovl_no_viable_object_call : Error< - "no matching function for call to object of type %0">; -def err_ovl_ambiguous_object_call : Error< - "call to object of type %0 is ambiguous">; -def err_ovl_deleted_object_call : Error< - "call to %select{unavailable|deleted}0 function call operator in type %1%2">; -def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">; -def err_member_call_without_object : Error< - "call to non-static member function without an object argument">; - -// C++ Address of Overloaded Function -def err_addr_ovl_no_viable : Error< - "address of overloaded function %0 does not match required type %1">; -def err_addr_ovl_ambiguous : Error< - "address of overloaded function %0 is ambiguous">; -def err_addr_ovl_not_func_ptrref : Error< - "address of overloaded function %0 cannot be converted to type %1">; -def err_addr_ovl_no_qualifier : Error< - "cannot form member pointer of type %0 without '&' and class name">; - -// C++11 Literal Operators -def err_ovl_no_viable_literal_operator : Error< - "no matching literal operator for call to %0" - "%select{| with argument of type %2| with arguments of types %2 and %3}1" - "%select{| or 'const char *'}4" - "%select{|, and no matching literal operator template}5">; - -// C++ Template Declarations -def err_template_param_shadow : Error< - "declaration of %0 shadows template parameter">; -def note_template_param_here : Note<"template parameter is declared here">; -def warn_template_export_unsupported : Warning< - "exported templates are unsupported">; -def err_template_outside_namespace_or_class_scope : Error< - "templates can only be declared in namespace or class scope">; -def err_template_inside_local_class : Error< - "templates cannot be declared inside of a local class">; -def err_template_linkage : Error<"templates must have C++ linkage">; -def err_template_typedef : Error<"a typedef cannot be a template">; -def err_template_unnamed_class : Error< - "cannot declare a class template with no name">; -def err_template_param_list_different_arity : Error< - "%select{too few|too many}0 template parameters in template " - "%select{|template parameter }1redeclaration">; -def note_template_param_list_different_arity : Note< - "%select{too few|too many}0 template parameters in template template " - "argument">; -def note_template_prev_declaration : Note< - "previous template %select{declaration|template parameter}0 is here">; -def err_template_param_different_kind : Error< - "template parameter has a different kind in template " - "%select{|template parameter }0redeclaration">; -def note_template_param_different_kind : Note< - "template parameter has a different kind in template argument">; - -def err_template_nontype_parm_different_type : Error< - "template non-type parameter has a different type %0 in template " - "%select{|template parameter }1redeclaration">; - -def note_template_nontype_parm_different_type : Note< - "template non-type parameter has a different type %0 in template argument">; -def note_template_nontype_parm_prev_declaration : Note< - "previous non-type template parameter with type %0 is here">; -def err_template_nontype_parm_bad_type : Error< - "a non-type template parameter cannot have type %0">; -def err_template_param_default_arg_redefinition : Error< - "template parameter redefines default argument">; -def note_template_param_prev_default_arg : Note< - "previous default template argument defined here">; -def err_template_param_default_arg_missing : Error< - "template parameter missing a default argument">; -def ext_template_parameter_default_in_function_template : ExtWarn< - "default template arguments for a function template are a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_template_parameter_default_in_function_template : Warning< - "default template arguments for a function template are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_template_parameter_default_template_member : Error< - "cannot add a default template argument to the definition of a member of a " - "class template">; -def err_template_parameter_default_friend_template : Error< - "default template argument not permitted on a friend template">; -def err_template_template_parm_no_parms : Error< - "template template parameter must have its own template parameters">; - -def ext_variable_template : ExtWarn<"variable templates are a C++14 extension">, - InGroup<CXX14>; -def warn_cxx11_compat_variable_template : Warning< - "variable templates are incompatible with C++ standards before C++14">, - InGroup<CXXPre14Compat>, DefaultIgnore; -def err_template_variable_noparams : Error< - "extraneous 'template<>' in declaration of variable %0">; -def err_template_member : Error<"member %0 declared as a template">; -def err_template_member_noparams : Error< - "extraneous 'template<>' in declaration of member %0">; -def err_template_tag_noparams : Error< - "extraneous 'template<>' in declaration of %0 %1">; -def err_template_decl_ref : Error< - "cannot refer to %select{class|variable}0 template %1 without a template argument list">; - -// C++ Template Argument Lists -def err_template_missing_args : Error< - "use of class template %0 requires template arguments">; -def err_template_arg_list_different_arity : Error< - "%select{too few|too many}0 template arguments for " - "%select{class template|function template|template template parameter" - "|template}1 %2">; -def note_template_decl_here : Note<"template is declared here">; -def err_template_arg_must_be_type : Error< - "template argument for template type parameter must be a type">; -def err_template_arg_must_be_type_suggest : Error< - "template argument for template type parameter must be a type; " - "did you forget 'typename'?">; -def ext_ms_template_type_arg_missing_typename : ExtWarn< - "template argument for template type parameter must be a type; " - "omitted 'typename' is a Microsoft extension">, - InGroup<MicrosoftTemplate>; -def err_template_arg_must_be_expr : Error< - "template argument for non-type template parameter must be an expression">; -def err_template_arg_nontype_ambig : Error< - "template argument for non-type template parameter is treated as function type %0">; -def err_template_arg_must_be_template : Error< - "template argument for template template parameter must be a class template%select{| or type alias template}0">; -def ext_template_arg_local_type : ExtWarn< - "template argument uses local type %0">, InGroup<LocalTypeTemplateArgs>; -def ext_template_arg_unnamed_type : ExtWarn< - "template argument uses unnamed type">, InGroup<UnnamedTypeTemplateArgs>; -def warn_cxx98_compat_template_arg_local_type : Warning< - "local type %0 as template argument is incompatible with C++98">, - InGroup<CXX98CompatLocalTypeTemplateArgs>, DefaultIgnore; -def warn_cxx98_compat_template_arg_unnamed_type : Warning< - "unnamed type as template argument is incompatible with C++98">, - InGroup<CXX98CompatUnnamedTypeTemplateArgs>, DefaultIgnore; -def note_template_unnamed_type_here : Note< - "unnamed type used in template argument was declared here">; -def err_template_arg_overload_type : Error< - "template argument is the type of an unresolved overloaded function">; -def err_template_arg_not_class_template : Error< - "template argument does not refer to a class template or template " - "template parameter">; -def note_template_arg_refers_here_func : Note< - "template argument refers to function template %0, here">; -def err_template_arg_template_params_mismatch : Error< - "template template argument has different template parameters than its " - "corresponding template template parameter">; -def err_template_arg_not_integral_or_enumeral : Error< - "non-type template argument of type %0 must have an integral or enumeration" - " type">; -def err_template_arg_not_ice : Error< - "non-type template argument of type %0 is not an integral constant " - "expression">; -def err_template_arg_not_address_constant : Error< - "non-type template argument of type %0 is not a constant expression">; -def warn_cxx98_compat_template_arg_null : Warning< - "use of null pointer as non-type template argument is incompatible with " - "C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def err_template_arg_untyped_null_constant : Error< - "null non-type template argument must be cast to template parameter type %0">; -def err_template_arg_wrongtype_null_constant : Error< - "null non-type template argument of type %0 does not match template parameter " - "of type %1">; -def err_deduced_non_type_template_arg_type_mismatch : Error< - "deduced non-type template argument does not have the same type as the " - "its corresponding template parameter%diff{ ($ vs $)|}0,1">; -def err_non_type_template_arg_subobject : Error< - "non-type template argument refers to subobject '%0'">; -def err_non_type_template_arg_addr_label_diff : Error< - "template argument / label address difference / what did you expect?">; -def err_template_arg_not_convertible : Error< - "non-type template argument of type %0 cannot be converted to a value " - "of type %1">; -def warn_template_arg_negative : Warning< - "non-type template argument with value '%0' converted to '%1' for unsigned " - "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; -def warn_template_arg_too_large : Warning< - "non-type template argument value '%0' truncated to '%1' for " - "template parameter of type %2">, InGroup<Conversion>, DefaultIgnore; -def err_template_arg_no_ref_bind : Error< - "non-type template parameter of reference type " - "%diff{$ cannot bind to template argument of type $" - "|cannot bind to template of incompatible argument type}0,1">; -def err_template_arg_ref_bind_ignores_quals : Error< - "reference binding of non-type template parameter " - "%diff{of type $ to template argument of type $|to template argument}0,1 " - "ignores qualifiers">; -def err_template_arg_not_decl_ref : Error< - "non-type template argument does not refer to any declaration">; -def err_template_arg_not_address_of : Error< - "non-type template argument for template parameter of pointer type %0 must " - "have its address taken">; -def err_template_arg_address_of_non_pointer : Error< - "address taken in non-type template argument for template parameter of " - "reference type %0">; -def err_template_arg_reference_var : Error< - "non-type template argument of reference type %0 is not an object">; -def err_template_arg_field : Error< - "non-type template argument refers to non-static data member %0">; -def err_template_arg_method : Error< - "non-type template argument refers to non-static member function %0">; -def err_template_arg_object_no_linkage : Error< - "non-type template argument refers to %select{function|object}0 %1 that " - "does not have linkage">; -def warn_cxx98_compat_template_arg_object_internal : Warning< - "non-type template argument referring to %select{function|object}0 %1 with " - "internal linkage is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def ext_template_arg_object_internal : ExtWarn< - "non-type template argument referring to %select{function|object}0 %1 with " - "internal linkage is a C++11 extension">, InGroup<CXX11>; -def err_template_arg_thread_local : Error< - "non-type template argument refers to thread-local object">; -def note_template_arg_internal_object : Note< - "non-type template argument refers to %select{function|object}0 here">; -def note_template_arg_refers_here : Note< - "non-type template argument refers here">; -def err_template_arg_not_object_or_func : Error< - "non-type template argument does not refer to an object or function">; -def err_template_arg_not_pointer_to_member_form : Error< - "non-type template argument is not a pointer to member constant">; -def err_template_arg_member_ptr_base_derived_not_supported : Error< - "sorry, non-type template argument of pointer-to-member type %1 that refers " - "to member %q0 of a different class is not supported yet">; -def ext_template_arg_extra_parens : ExtWarn< - "address non-type template argument cannot be surrounded by parentheses">; -def warn_cxx98_compat_template_arg_extra_parens : Warning< - "redundant parentheses surrounding address non-type template argument are " - "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def err_pointer_to_member_type : Error< - "invalid use of pointer to member type after %select{.*|->*}0">; -def err_pointer_to_member_call_drops_quals : Error< - "call to pointer to member function of type %0 drops '%1' qualifier%s2">; -def err_pointer_to_member_oper_value_classify: Error< - "pointer-to-member function type %0 can only be called on an " - "%select{rvalue|lvalue}1">; -def ext_ms_deref_template_argument: ExtWarn< - "non-type template argument containing a dereference operation is a " - "Microsoft extension">, InGroup<MicrosoftTemplate>; -def ext_ms_delayed_template_argument: ExtWarn< - "using the undeclared type %0 as a default template argument is a " - "Microsoft extension">, InGroup<MicrosoftTemplate>; - -// C++ template specialization -def err_template_spec_unknown_kind : Error< - "can only provide an explicit specialization for a class template, function " - "template, variable template, or a member function, static data member, " - "%select{or member class|member class, or member enumeration}0 of a " - "class template">; -def note_specialized_entity : Note< - "explicitly specialized declaration is here">; -def err_template_spec_decl_function_scope : Error< - "explicit specialization of %0 in function scope">; -def err_template_spec_decl_class_scope : Error< - "explicit specialization of %0 in class scope">; -def err_template_spec_decl_friend : Error< - "cannot declare an explicit specialization in a friend">; -def err_template_spec_decl_out_of_scope_global : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member function|" - "static data member|member class|member enumeration}0 " - "specialization of %1 must originally be declared in the global scope">; -def err_template_spec_decl_out_of_scope : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 must originally be declared in namespace %2">; -def ext_template_spec_decl_out_of_scope : ExtWarn< - "first declaration of %select{class template|class template partial|" - "variable template|variable template partial|" - "function template|member function|static data member|member class|" - "member enumeration}0 specialization of %1 outside namespace %2 is a " - "C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 outside namespace %2 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_template_spec_redecl_out_of_scope : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 not in a namespace enclosing %2">; -def ext_ms_template_spec_redecl_out_of_scope: ExtWarn< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 outside namespace enclosing %2 " - "is a Microsoft extension">, InGroup<MicrosoftTemplate>; -def err_template_spec_redecl_global_scope : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 must occur at global scope">; -def err_spec_member_not_instantiated : Error< - "specialization of member %q0 does not specialize an instantiated member">; -def note_specialized_decl : Note<"attempt to specialize declaration here">; -def err_specialization_after_instantiation : Error< - "explicit specialization of %0 after instantiation">; -def note_instantiation_required_here : Note< - "%select{implicit|explicit}0 instantiation first required here">; -def err_template_spec_friend : Error< - "template specialization declaration cannot be a friend">; -def err_template_spec_default_arg : Error< - "default argument not permitted on an explicit " - "%select{instantiation|specialization}0 of function %1">; -def err_not_class_template_specialization : Error< - "cannot specialize a %select{dependent template|template template " - "parameter}0">; -def err_function_specialization_in_class : Error< - "cannot specialize a function %0 within class scope">; -def ext_function_specialization_in_class : ExtWarn< - "explicit specialization of %0 within class scope is a Microsoft extension">, - InGroup<MicrosoftTemplate>; -def ext_explicit_specialization_storage_class : ExtWarn< - "explicit specialization cannot have a storage class">; -def err_explicit_specialization_inconsistent_storage_class : Error< - "explicit specialization has extraneous, inconsistent storage class " - "'%select{none|extern|static|__private_extern__|auto|register}0'">; - -// C++ class template specializations and out-of-line definitions -def err_template_spec_needs_header : Error< - "template specialization requires 'template<>'">; -def err_template_spec_needs_template_parameters : Error< - "template specialization or definition requires a template parameter list " - "corresponding to the nested type %0">; -def err_template_param_list_matches_nontemplate : Error< - "template parameter list matching the non-templated nested type %0 should " - "be empty ('template<>')">; -def err_alias_template_extra_headers : Error< - "extraneous template parameter list in alias template declaration">; -def err_template_spec_extra_headers : Error< - "extraneous template parameter list in template specialization or " - "out-of-line template definition">; -def warn_template_spec_extra_headers : Warning< - "extraneous template parameter list in template specialization">; -def note_explicit_template_spec_does_not_need_header : Note< - "'template<>' header not required for explicitly-specialized class %0 " - "declared here">; -def err_template_qualified_declarator_no_match : Error< - "nested name specifier '%0' for declaration does not refer into a class, " - "class template or class template partial specialization">; -def err_specialize_member_of_template : Error< - "cannot specialize %select{|(with 'template<>') }0a member of an " - "unspecialized template">; - -// C++ Class Template Partial Specialization -def err_default_arg_in_partial_spec : Error< - "default template argument in a class template partial specialization">; -def err_dependent_non_type_arg_in_partial_spec : Error< - "non-type template argument depends on a template parameter of the " - "partial specialization">; -def note_dependent_non_type_default_arg_in_partial_spec : Note< - "template parameter is used in default argument declared here">; -def err_dependent_typed_non_type_arg_in_partial_spec : Error< - "non-type template argument specializes a template parameter with " - "dependent type %0">; -def err_partial_spec_args_match_primary_template : Error< - "%select{class|variable}0 template partial specialization does not " - "specialize any template argument; to %select{declare|define}1 the " - "primary template, remove the template argument list">; -def warn_partial_specs_not_deducible : Warning< - "%select{class|variable}0 template partial specialization contains " - "%select{a template parameter|template parameters}1 that cannot be " - "deduced; this partial specialization will never be used">; -def note_partial_spec_unused_parameter : Note< - "non-deducible template parameter %0">; -def err_partial_spec_ordering_ambiguous : Error< - "ambiguous partial specializations of %0">; -def note_partial_spec_match : Note<"partial specialization matches %0">; -def err_partial_spec_redeclared : Error< - "class template partial specialization %0 cannot be redeclared">; -def note_prev_partial_spec_here : Note< - "previous declaration of class template partial specialization %0 is here">; -def err_partial_spec_fully_specialized : Error< - "partial specialization of %0 does not use any of its template parameters">; - -// C++ Variable Template Partial Specialization -def err_var_partial_spec_redeclared : Error< - "variable template partial specialization %0 cannot be redefined">; -def note_var_prev_partial_spec_here : Note< - "previous declaration of variable template partial specialization is here">; -def err_var_spec_no_template : Error< - "no variable template matches%select{| partial}0 specialization">; -def err_var_spec_no_template_but_method : Error< - "no variable template matches specialization; " - "did you mean to use %0 as function template instead?">; - -// C++ Function template specializations -def err_function_template_spec_no_match : Error< - "no function template matches function template specialization %0">; -def err_function_template_spec_ambiguous : Error< - "function template specialization %0 ambiguously refers to more than one " - "function template; explicitly specify%select{| additional}1 template " - "arguments to identify a particular function template">; -def note_function_template_spec_matched : Note< - "function template matches specialization %0">; -def err_function_template_partial_spec : Error< - "function template partial specialization is not allowed">; - -// C++ Template Instantiation -def err_template_recursion_depth_exceeded : Error< - "recursive template instantiation exceeded maximum depth of %0">, - DefaultFatal, NoSFINAE; -def note_template_recursion_depth : Note< - "use -ftemplate-depth=N to increase recursive template instantiation depth">; - -def err_template_instantiate_within_definition : Error< - "%select{implicit|explicit}0 instantiation of template %1 within its" - " own definition">; -def err_template_instantiate_undefined : Error< - "%select{implicit|explicit}0 instantiation of undefined template %1">; -def err_implicit_instantiate_member_undefined : Error< - "implicit instantiation of undefined member %0">; -def note_template_class_instantiation_was_here : Note< - "class template %0 was instantiated here">; -def note_template_class_explicit_specialization_was_here : Note< - "class template %0 was explicitly specialized here">; -def note_template_class_instantiation_here : Note< - "in instantiation of template class %0 requested here">; -def note_template_member_class_here : Note< - "in instantiation of member class %0 requested here">; -def note_template_member_function_here : Note< - "in instantiation of member function %q0 requested here">; -def note_function_template_spec_here : Note< - "in instantiation of function template specialization %q0 requested here">; -def note_template_static_data_member_def_here : Note< - "in instantiation of static data member %q0 requested here">; -def note_template_variable_def_here : Note< - "in instantiation of variable template specialization %q0 requested here">; -def note_template_enum_def_here : Note< - "in instantiation of enumeration %q0 requested here">; -def note_template_nsdmi_here : Note< - "in instantiation of default member initializer %q0 requested here">; -def note_template_type_alias_instantiation_here : Note< - "in instantiation of template type alias %0 requested here">; -def note_template_exception_spec_instantiation_here : Note< - "in instantiation of exception specification for %0 requested here">; - -def note_default_arg_instantiation_here : Note< - "in instantiation of default argument for '%0' required here">; -def note_default_function_arg_instantiation_here : Note< - "in instantiation of default function argument expression " - "for '%0' required here">; -def note_explicit_template_arg_substitution_here : Note< - "while substituting explicitly-specified template arguments into function " - "template %0 %1">; -def note_function_template_deduction_instantiation_here : Note< - "while substituting deduced template arguments into function template %0 " - "%1">; -def note_partial_spec_deduct_instantiation_here : Note< - "during template argument deduction for class template partial " - "specialization %0 %1">; -def note_prior_template_arg_substitution : Note< - "while substituting prior template arguments into %select{non-type|template}0" - " template parameter%1 %2">; -def note_template_default_arg_checking : Note< - "while checking a default template argument used here">; -def note_instantiation_contexts_suppressed : Note< - "(skipping %0 context%s0 in backtrace; use -ftemplate-backtrace-limit=0 to " - "see all)">; - -def err_field_instantiates_to_function : Error< - "data member instantiated with function type %0">; -def err_variable_instantiates_to_function : Error< - "%select{variable|static data member}0 instantiated with function type %1">; -def err_nested_name_spec_non_tag : Error< - "type %0 cannot be used prior to '::' because it has no members">; - -// C++ Explicit Instantiation -def err_explicit_instantiation_duplicate : Error< - "duplicate explicit instantiation of %0">; -def ext_explicit_instantiation_duplicate : ExtWarn< - "duplicate explicit instantiation of %0 ignored as a Microsoft extension">, - InGroup<MicrosoftTemplate>; -def note_previous_explicit_instantiation : Note< - "previous explicit instantiation is here">; -def ext_explicit_instantiation_after_specialization : Extension< - "explicit instantiation of %0 that occurs after an explicit " - "specialization will be ignored (C++11 extension)">, - InGroup<CXX11>; -def warn_cxx98_compat_explicit_instantiation_after_specialization : Warning< - "explicit instantiation of %0 that occurs after an explicit " - "specialization is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def note_previous_template_specialization : Note< - "previous template specialization is here">; -def err_explicit_instantiation_nontemplate_type : Error< - "explicit instantiation of non-templated type %0">; -def note_nontemplate_decl_here : Note< - "non-templated declaration is here">; -def err_explicit_instantiation_in_class : Error< - "explicit instantiation of %0 in class scope">; -def err_explicit_instantiation_out_of_scope : Error< - "explicit instantiation of %0 not in a namespace enclosing %1">; -def err_explicit_instantiation_must_be_global : Error< - "explicit instantiation of %0 must occur at global scope">; -def warn_explicit_instantiation_out_of_scope_0x : Warning< - "explicit instantiation of %0 not in a namespace enclosing %1">, - InGroup<CXX11Compat>, DefaultIgnore; -def warn_explicit_instantiation_must_be_global_0x : Warning< - "explicit instantiation of %0 must occur at global scope">, - InGroup<CXX11Compat>, DefaultIgnore; - -def err_explicit_instantiation_requires_name : Error< - "explicit instantiation declaration requires a name">; -def err_explicit_instantiation_of_typedef : Error< - "explicit instantiation of typedef %0">; -def err_explicit_instantiation_storage_class : Error< - "explicit instantiation cannot have a storage class">; -def err_explicit_instantiation_not_known : Error< - "explicit instantiation of %0 does not refer to a function template, " - "variable template, member function, member class, or static data member">; -def note_explicit_instantiation_here : Note< - "explicit instantiation refers here">; -def err_explicit_instantiation_data_member_not_instantiated : Error< - "explicit instantiation refers to static data member %q0 that is not an " - "instantiation">; -def err_explicit_instantiation_member_function_not_instantiated : Error< - "explicit instantiation refers to member function %q0 that is not an " - "instantiation">; -def err_explicit_instantiation_ambiguous : Error< - "partial ordering for explicit instantiation of %0 is ambiguous">; -def note_explicit_instantiation_candidate : Note< - "explicit instantiation candidate function template here %0">; -def err_explicit_instantiation_inline : Error< - "explicit instantiation cannot be 'inline'">; -def warn_explicit_instantiation_inline_0x : Warning< - "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>, - DefaultIgnore; -def err_explicit_instantiation_constexpr : Error< - "explicit instantiation cannot be 'constexpr'">; -def ext_explicit_instantiation_without_qualified_id : Extension< - "qualifier in explicit instantiation of %q0 requires a template-id " - "(a typedef is not permitted)">; -def err_explicit_instantiation_without_template_id : Error< - "explicit instantiation of %q0 must specify a template argument list">; -def err_explicit_instantiation_unqualified_wrong_namespace : Error< - "explicit instantiation of %q0 must occur in namespace %1">; -def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning< - "explicit instantiation of %q0 must occur in namespace %1">, - InGroup<CXX11Compat>, DefaultIgnore; -def err_explicit_instantiation_undefined_member : Error< - "explicit instantiation of undefined %select{member class|member function|" - "static data member}0 %1 of class template %2">; -def err_explicit_instantiation_undefined_func_template : Error< - "explicit instantiation of undefined function template %0">; -def err_explicit_instantiation_undefined_var_template : Error< - "explicit instantiation of undefined variable template %q0">; -def err_explicit_instantiation_declaration_after_definition : Error< - "explicit instantiation declaration (with 'extern') follows explicit " - "instantiation definition (without 'extern')">; -def note_explicit_instantiation_definition_here : Note< - "explicit instantiation definition is here">; -def err_invalid_var_template_spec_type : Error<"type %2 " - "of %select{explicit instantiation|explicit specialization|" - "partial specialization|redeclaration}0 of %1 does not match" - " expected type %3">; -def err_mismatched_exception_spec_explicit_instantiation : Error< - "exception specification in explicit instantiation does not match " - "instantiated one">; -def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn< - err_mismatched_exception_spec_explicit_instantiation.Text>, - InGroup<MicrosoftExceptionSpec>; - -// C++ typename-specifiers -def err_typename_nested_not_found : Error<"no type named %0 in %1">; -def err_typename_nested_not_found_enable_if : Error< - "no type named 'type' in %0; 'enable_if' cannot be used to disable " - "this declaration">; -def err_typename_nested_not_type : Error< - "typename specifier refers to non-type member %0 in %1">; -def note_typename_refers_here : Note< - "referenced member %0 is declared here">; -def err_typename_missing : Error< - "missing 'typename' prior to dependent type name '%0%1'">; -def ext_typename_missing : ExtWarn< - "missing 'typename' prior to dependent type name '%0%1'">, - InGroup<DiagGroup<"typename-missing">>; -def ext_typename_outside_of_template : ExtWarn< - "'typename' occurs outside of a template">, InGroup<CXX11>; -def warn_cxx98_compat_typename_outside_of_template : Warning< - "use of 'typename' outside of a template is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_typename_refers_to_using_value_decl : Error< - "typename specifier refers to a dependent using declaration for a value " - "%0 in %1">; -def note_using_value_decl_missing_typename : Note< - "add 'typename' to treat this using declaration as a type">; - -def err_template_kw_refers_to_non_template : Error< - "%0 following the 'template' keyword does not refer to a template">; -def err_template_kw_refers_to_class_template : Error< - "'%0%1' instantiated to a class template, not a function template">; -def note_referenced_class_template : Error< - "class template declared here">; -def err_template_kw_missing : Error< - "missing 'template' keyword prior to dependent template name '%0%1'">; -def ext_template_outside_of_template : ExtWarn< - "'template' keyword outside of a template">, InGroup<CXX11>; -def warn_cxx98_compat_template_outside_of_template : Warning< - "use of 'template' keyword outside of a template is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -def err_non_type_template_in_nested_name_specifier : Error< - "qualified name refers into a specialization of %select{function|variable}0 " - "template %1">; -def err_template_id_not_a_type : Error< - "template name refers to non-type template %0">; -def note_template_declared_here : Note< - "%select{function template|class template|variable template" - "|type alias template|template template parameter}0 " - "%1 declared here">; -def err_alias_template_expansion_into_fixed_list : Error< - "pack expansion used as argument for non-pack parameter of alias template">; -def note_parameter_type : Note< - "parameter of type %0 is declared here">; - -// C++11 Variadic Templates -def err_template_param_pack_default_arg : Error< - "template parameter pack cannot have a default argument">; -def err_template_param_pack_must_be_last_template_parameter : Error< - "template parameter pack must be the last template parameter">; - -def err_template_parameter_pack_non_pack : Error< - "%select{template type|non-type template|template template}0 parameter" - "%select{| pack}1 conflicts with previous %select{template type|" - "non-type template|template template}0 parameter%select{ pack|}1">; -def note_template_parameter_pack_non_pack : Note< - "%select{template type|non-type template|template template}0 parameter" - "%select{| pack}1 does not match %select{template type|non-type template" - "|template template}0 parameter%select{ pack|}1 in template argument">; -def note_template_parameter_pack_here : Note< - "previous %select{template type|non-type template|template template}0 " - "parameter%select{| pack}1 declared here">; - -def err_unexpanded_parameter_pack : Error< - "%select{expression|base type|declaration type|data member type|bit-field " - "size|static assertion|fixed underlying type|enumerator value|" - "using declaration|friend declaration|qualifier|initializer|default argument|" - "non-type template parameter type|exception type|partial specialization|" - "__if_exists name|__if_not_exists name|lambda|block}0 contains" - "%plural{0: an|:}1 unexpanded parameter pack" - "%plural{0:|1: %2|2:s %2 and %3|:s %2, %3, ...}1">; - -def err_pack_expansion_without_parameter_packs : Error< - "pack expansion does not contain any unexpanded parameter packs">; -def err_pack_expansion_length_conflict : Error< - "pack expansion contains parameter packs %0 and %1 that have different " - "lengths (%2 vs. %3)">; -def err_pack_expansion_length_conflict_multilevel : Error< - "pack expansion contains parameter pack %0 that has a different " - "length (%1 vs. %2) from outer parameter packs">; -def err_pack_expansion_member_init : Error< - "pack expansion for initialization of member %0">; - -def err_function_parameter_pack_without_parameter_packs : Error< - "type %0 of function parameter pack does not contain any unexpanded " - "parameter packs">; -def err_ellipsis_in_declarator_not_parameter : Error< - "only function and template parameters can be parameter packs">; - -def err_sizeof_pack_no_pack_name : Error< - "%0 does not refer to the name of a parameter pack">; - -def err_fold_expression_packs_both_sides : Error< - "binary fold expression has unexpanded parameter packs in both operands">; -def err_fold_expression_empty : Error< - "unary fold expression has empty expansion for operator '%0' " - "with no fallback value">; -def err_fold_expression_bad_operand : Error< - "expression not permitted as operand of fold expression">; - -def err_unexpected_typedef : Error< - "unexpected type name %0: expected expression">; -def err_unexpected_namespace : Error< - "unexpected namespace name %0: expected expression">; -def err_undeclared_var_use : Error<"use of undeclared identifier %0">; -def ext_undeclared_unqual_id_with_dependent_base : ExtWarn< - "use of undeclared identifier %0; " - "unqualified lookup into dependent bases of class template %1 is a Microsoft extension">, - InGroup<MicrosoftTemplate>; -def ext_found_via_dependent_bases_lookup : ExtWarn<"use of identifier %0 " - "found via unqualified lookup into dependent bases of class templates is a " - "Microsoft extension">, InGroup<MicrosoftTemplate>; -def note_dependent_var_use : Note<"must qualify identifier to find this " - "declaration in dependent base class">; -def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither " - "visible in the template definition nor found by argument-dependent lookup">; -def note_not_found_by_two_phase_lookup : Note<"%0 should be declared prior to the " - "call site%select{| or in %2| or in an associated namespace of one of its arguments}1">; -def err_undeclared_use : Error<"use of undeclared %0">; -def warn_partial_availability : Warning<"%0 is only available conditionally">, - InGroup<PartialAvailability>, DefaultIgnore; -def note_partial_availability_silence : Note< - "explicitly redeclare %0 to silence this warning">; -def warn_partial_message : Warning<"%0 is partial: %1">, - InGroup<PartialAvailability>, DefaultIgnore; -def warn_partial_fwdclass_message : Warning< - "%0 may be partial because the receiver type is unknown">, - InGroup<PartialAvailability>, DefaultIgnore; -def warn_deprecated : Warning<"%0 is deprecated">, - InGroup<DeprecatedDeclarations>; -def warn_property_method_deprecated : - Warning<"property access is using %0 method which is deprecated">, - InGroup<DeprecatedDeclarations>; -def warn_deprecated_message : Warning<"%0 is deprecated: %1">, - InGroup<DeprecatedDeclarations>; -def warn_deprecated_anonymous_namespace : Warning< - "'deprecated' attribute on anonymous namespace ignored">, - InGroup<IgnoredAttributes>; -def warn_deprecated_fwdclass_message : Warning< - "%0 may be deprecated because the receiver type is unknown">, - InGroup<DeprecatedDeclarations>; -def warn_deprecated_def : Warning< - "Implementing deprecated %select{method|class|category}0">, - InGroup<DeprecatedImplementations>, DefaultIgnore; -def err_unavailable : Error<"%0 is unavailable">; -def err_property_method_unavailable : - Error<"property access is using %0 method which is unavailable">; -def err_unavailable_message : Error<"%0 is unavailable: %1">; -def warn_unavailable_fwdclass_message : Warning< - "%0 may be unavailable because the receiver type is unknown">, - InGroup<UnavailableDeclarations>; -def note_availability_specified_here : Note< - "%0 has been explicitly marked " - "%select{unavailable|deleted|deprecated|partial}1 here">; -def note_implicitly_deleted : Note< - "explicitly defaulted function was implicitly deleted here">; -def note_inherited_deleted_here : Note< - "deleted constructor was inherited here">; -def note_cannot_inherit : Note< - "constructor cannot be inherited">; -def warn_not_enough_argument : Warning< - "not enough variable arguments in %0 declaration to fit a sentinel">, - InGroup<Sentinel>; -def warn_missing_sentinel : Warning < - "missing sentinel in %select{function call|method dispatch|block call}0">, - InGroup<Sentinel>; -def note_sentinel_here : Note< - "%select{function|method|block}0 has been explicitly marked sentinel here">; -def warn_missing_prototype : Warning< - "no previous prototype for function %0">, - InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore; -def note_declaration_not_a_prototype : Note< - "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; -def warn_missing_variable_declarations : Warning< - "no previous extern declaration for non-static variable %0">, - InGroup<DiagGroup<"missing-variable-declarations">>, DefaultIgnore; -def err_static_data_member_reinitialization : - Error<"static data member %0 already has an initializer">; -def err_redefinition : Error<"redefinition of %0">; -def err_alias_after_tentative : - Error<"alias definition of %0 after tentative definition">; -def err_alias_is_definition : - Error<"definition %0 cannot also be an alias">; -def err_definition_of_implicitly_declared_member : Error< - "definition of implicitly declared %select{default constructor|copy " - "constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor|function}1">; -def err_definition_of_explicitly_defaulted_member : Error< - "definition of explicitly defaulted %select{default constructor|copy " - "constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor}0">; -def err_redefinition_extern_inline : Error< - "redefinition of a 'extern inline' function %0 is not supported in " - "%select{C99 mode|C++}1">; - -def note_deleted_dtor_no_operator_delete : Note< - "virtual destructor requires an unambiguous, accessible 'operator delete'">; -def note_deleted_special_member_class_subobject : Note< - "%select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}0 of " - "%1 is implicitly deleted because " - "%select{base class %3|%select{||||variant }4field %3}2 has " - "%select{no|a deleted|multiple|an inaccessible|a non-trivial}4 " - "%select{%select{default constructor|copy constructor|move constructor|copy " - "assignment operator|move assignment operator|destructor}0|destructor}5" - "%select{||s||}4">; -def note_deleted_default_ctor_uninit_field : Note< - "default constructor of %0 is implicitly deleted because field %1 of " - "%select{reference|const-qualified}3 type %2 would not be initialized">; -def note_deleted_default_ctor_all_const : Note< - "default constructor of %0 is implicitly deleted because all " - "%select{data members|data members of an anonymous union member}1" - " are const-qualified">; -def note_deleted_copy_ctor_rvalue_reference : Note< - "copy constructor of %0 is implicitly deleted because field %1 is of " - "rvalue reference type %2">; -def note_deleted_copy_user_declared_move : Note< - "copy %select{constructor|assignment operator}0 is implicitly deleted because" - " %1 has a user-declared move %select{constructor|assignment operator}2">; -def note_deleted_assign_field : Note< - "%select{copy|move}0 assignment operator of %1 is implicitly deleted " - "because field %2 is of %select{reference|const-qualified}4 type %3">; - -// These should be errors. -def warn_undefined_internal : Warning< - "%select{function|variable}0 %q1 has internal linkage but is not defined">, - InGroup<DiagGroup<"undefined-internal">>; -def warn_undefined_inline : Warning<"inline function %q0 is not defined">, - InGroup<DiagGroup<"undefined-inline">>; -def note_used_here : Note<"used here">; - -def err_internal_linkage_redeclaration : Error< - "'internal_linkage' attribute does not appear on the first declaration of %0">; -def warn_internal_linkage_local_storage : Warning< - "'internal_linkage' attribute on a non-static local variable is ignored">, - InGroup<IgnoredAttributes>; - -def ext_internal_in_extern_inline : ExtWarn< - "static %select{function|variable}0 %1 is used in an inline function with " - "external linkage">, InGroup<StaticInInline>; -def ext_internal_in_extern_inline_quiet : Extension< - "static %select{function|variable}0 %1 is used in an inline function with " - "external linkage">, InGroup<StaticInInline>; -def warn_static_local_in_extern_inline : Warning< - "non-constant static local variable in inline function may be different " - "in different files">, InGroup<StaticLocalInInline>; -def note_convert_inline_to_static : Note< - "use 'static' to give inline function %0 internal linkage">; - -def ext_redefinition_of_typedef : ExtWarn< - "redefinition of typedef %0 is a C11 feature">, - InGroup<DiagGroup<"typedef-redefinition"> >; -def err_redefinition_variably_modified_typedef : Error< - "redefinition of %select{typedef|type alias}0 for variably-modified type %1">; - -def err_inline_decl_follows_def : Error< - "inline declaration of %0 follows non-inline definition">; -def err_inline_declaration_block_scope : Error< - "inline declaration of %0 not allowed in block scope">; -def err_static_non_static : Error< - "static declaration of %0 follows non-static declaration">; -def err_different_language_linkage : Error< - "declaration of %0 has a different language linkage">; -def ext_retained_language_linkage : Extension< - "friend function %0 retaining previous language linkage is an extension">, - InGroup<DiagGroup<"retained-language-linkage">>; -def err_extern_c_global_conflict : Error< - "declaration of %1 %select{with C language linkage|in global scope}0 " - "conflicts with declaration %select{in global scope|with C language linkage}0">; -def note_extern_c_global_conflict : Note< - "declared %select{in global scope|with C language linkage}0 here">; -def warn_weak_import : Warning < - "an already-declared variable is made a weak_import declaration %0">; -def ext_static_non_static : Extension< - "redeclaring non-static %0 as static is a Microsoft extension">, - InGroup<MicrosoftRedeclareStatic>; -def err_non_static_static : Error< - "non-static declaration of %0 follows static declaration">; -def err_extern_non_extern : Error< - "extern declaration of %0 follows non-extern declaration">; -def err_non_extern_extern : Error< - "non-extern declaration of %0 follows extern declaration">; -def err_non_thread_thread : Error< - "non-thread-local declaration of %0 follows thread-local declaration">; -def err_thread_non_thread : Error< - "thread-local declaration of %0 follows non-thread-local declaration">; -def err_thread_thread_different_kind : Error< - "thread-local declaration of %0 with %select{static|dynamic}1 initialization " - "follows declaration with %select{dynamic|static}1 initialization">; -def err_redefinition_different_type : Error< - "redefinition of %0 with a different type%diff{: $ vs $|}1,2">; -def err_redefinition_different_kind : Error< - "redefinition of %0 as different kind of symbol">; -def err_redefinition_different_namespace_alias : Error< - "redefinition of %0 as an alias for a different namespace">; -def note_previous_namespace_alias : Note< - "previously defined as an alias for %0">; -def warn_forward_class_redefinition : Warning< - "redefinition of forward class %0 of a typedef name of an object type is ignored">, - InGroup<DiagGroup<"objc-forward-class-redefinition">>; -def err_redefinition_different_typedef : Error< - "%select{typedef|type alias|type alias template}0 " - "redefinition with different types%diff{ ($ vs $)|}1,2">; -def err_tag_reference_non_tag : Error< - "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">; -def err_tag_reference_conflict : Error< - "implicit declaration introduced by elaborated type conflicts with " - "%select{a declaration|a typedef|a type alias|a template}0 of the same name">; -def err_dependent_tag_decl : Error< - "%select{declaration|definition}0 of " - "%select{struct|interface|union|class|enum}1 in a dependent scope">; -def err_tag_definition_of_typedef : Error< - "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">; -def err_conflicting_types : Error<"conflicting types for %0">; -def err_different_pass_object_size_params : Error< - "conflicting pass_object_size attributes on parameters">; -def err_late_asm_label_name : Error< - "cannot apply asm label to %select{variable|function}0 after its first use">; -def err_different_asm_label : Error<"conflicting asm label">; -def err_nested_redefinition : Error<"nested redefinition of %0">; -def err_use_with_wrong_tag : Error< - "use of %0 with tag type that does not match previous declaration">; -def warn_struct_class_tag_mismatch : Warning< - "%select{struct|interface|class}0%select{| template}1 %2 was previously " - "declared as a %select{struct|interface|class}3%select{| template}1">, - InGroup<MismatchedTags>, DefaultIgnore; -def warn_struct_class_previous_tag_mismatch : Warning< - "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 " - "here but previously declared as " - "%select{a struct|an interface|a class}3%select{| template}1">, - InGroup<MismatchedTags>, DefaultIgnore; -def note_struct_class_suggestion : Note< - "did you mean %select{struct|interface|class}0 here?">; -def ext_forward_ref_enum : Extension< - "ISO C forbids forward references to 'enum' types">; -def err_forward_ref_enum : Error< - "ISO C++ forbids forward references to 'enum' types">; -def ext_ms_forward_ref_enum : Extension< - "forward references to 'enum' types are a Microsoft extension">, - InGroup<MicrosoftEnumForwardReference>; -def ext_forward_ref_enum_def : Extension< - "redeclaration of already-defined enum %0 is a GNU extension">, - InGroup<GNURedeclaredEnum>; - -def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">; -def err_duplicate_member : Error<"duplicate member %0">; -def err_misplaced_ivar : Error< - "instance variables may not be placed in %select{categories|class extension}0">; -def warn_ivars_in_interface : Warning< - "declaration of instance variables in the interface is deprecated">, - InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore; -def ext_enum_value_not_int : Extension< - "ISO C restricts enumerator values to range of 'int' (%0 is too " - "%select{small|large}1)">; -def ext_enum_too_large : ExtWarn< - "enumeration values exceed range of largest integer">, InGroup<EnumTooLarge>; -def ext_enumerator_increment_too_large : ExtWarn< - "incremented enumerator value %0 is not representable in the " - "largest integer type">, InGroup<EnumTooLarge>; -def warn_flag_enum_constant_out_of_range : Warning< - "enumeration value %0 is out of range of flags in enumeration type %1">, - InGroup<FlagEnum>; - -def warn_illegal_constant_array_size : Extension< - "size of static array must be an integer constant expression">; -def err_vm_decl_in_file_scope : Error< - "variably modified type declaration not allowed at file scope">; -def err_vm_decl_has_extern_linkage : Error< - "variably modified type declaration cannot have 'extern' linkage">; -def err_typecheck_field_variable_size : Error< - "fields must have a constant size: 'variable length array in structure' " - "extension will never be supported">; -def err_vm_func_decl : Error< - "function declaration cannot have variably modified type">; -def err_array_too_large : Error< - "array is too large (%0 elements)">; -def warn_array_new_too_large : Warning<"array is too large (%0 elements)">, - // FIXME PR11644: ", will throw std::bad_array_new_length at runtime" - InGroup<BadArrayNewLength>; - -// -Wpadded, -Wpacked -def warn_padded_struct_field : Warning< - "padding %select{struct|interface|class}0 %1 with %2 " - "%select{byte|bit}3%s2 to align %4">, - InGroup<Padded>, DefaultIgnore; -def warn_padded_struct_anon_field : Warning< - "padding %select{struct|interface|class}0 %1 with %2 " - "%select{byte|bit}3%s2 to align anonymous bit-field">, - InGroup<Padded>, DefaultIgnore; -def warn_padded_struct_size : Warning< - "padding size of %0 with %1 %select{byte|bit}2%s1 to alignment boundary">, - InGroup<Padded>, DefaultIgnore; -def warn_unnecessary_packed : Warning< - "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore; - -def err_typecheck_negative_array_size : Error<"array size is negative">; -def warn_typecheck_negative_array_new_size : Warning<"array size is negative">, - // FIXME PR11644: ", will throw std::bad_array_new_length at runtime" - InGroup<BadArrayNewLength>; -def warn_typecheck_function_qualifiers_ignored : Warning< - "'%0' qualifier on function type %1 has no effect">, - InGroup<IgnoredQualifiers>; -def warn_typecheck_function_qualifiers_unspecified : Warning< - "'%0' qualifier on function type %1 has unspecified behavior">; -def warn_typecheck_reference_qualifiers : Warning< - "'%0' qualifier on reference type %1 has no effect">, - InGroup<IgnoredQualifiers>; -def err_typecheck_invalid_restrict_not_pointer : Error< - "restrict requires a pointer or reference (%0 is invalid)">; -def err_typecheck_invalid_restrict_not_pointer_noarg : Error< - "restrict requires a pointer or reference">; -def err_typecheck_invalid_restrict_invalid_pointee : Error< - "pointer to function type %0 may not be 'restrict' qualified">; -def ext_typecheck_zero_array_size : Extension< - "zero size arrays are an extension">, InGroup<ZeroLengthArray>; -def err_typecheck_zero_array_size : Error< - "zero-length arrays are not permitted in C++">; -def warn_typecheck_zero_static_array_size : Warning< - "'static' has no effect on zero-length arrays">, - InGroup<ArrayBounds>; -def err_array_size_non_int : Error<"size of array has non-integer type %0">; -def err_init_element_not_constant : Error< - "initializer element is not a compile-time constant">; -def ext_aggregate_init_not_constant : Extension< - "initializer for aggregate is not a compile-time constant">, InGroup<C99>; -def err_local_cant_init : Error< - "'__local' variable cannot have an initializer">; -def err_block_extern_cant_init : Error< - "'extern' variable cannot have an initializer">; -def warn_extern_init : Warning<"'extern' variable has an initializer">, - InGroup<DiagGroup<"extern-initializer">>; -def err_variable_object_no_init : Error< - "variable-sized object may not be initialized">; -def err_excess_initializers : Error< - "excess elements in %select{array|vector|scalar|union|struct}0 initializer">; -def ext_excess_initializers : ExtWarn< - "excess elements in %select{array|vector|scalar|union|struct}0 initializer">; -def err_excess_initializers_in_char_array_initializer : Error< - "excess elements in char array initializer">; -def ext_excess_initializers_in_char_array_initializer : ExtWarn< - "excess elements in char array initializer">; -def err_initializer_string_for_char_array_too_long : Error< - "initializer-string for char array is too long">; -def ext_initializer_string_for_char_array_too_long : ExtWarn< - "initializer-string for char array is too long">; -def warn_missing_field_initializers : Warning< - "missing field %0 initializer">, - InGroup<MissingFieldInitializers>, DefaultIgnore; -def warn_braces_around_scalar_init : Warning< - "braces around scalar initializer">, InGroup<DiagGroup<"braced-scalar-init">>; -def ext_many_braces_around_scalar_init : ExtWarn< - "too many braces around scalar initializer">, - InGroup<DiagGroup<"many-braces-around-scalar-init">>; -def ext_complex_component_init : Extension< - "complex initialization specifying real and imaginary components " - "is an extension">, InGroup<DiagGroup<"complex-component-init">>; -def err_empty_scalar_initializer : Error<"scalar initializer cannot be empty">; -def warn_cxx98_compat_empty_scalar_initializer : Warning< - "scalar initialized from empty initializer list is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_reference_list_init : Warning< - "reference initialized from initializer list is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_initializer_list_init : Warning< - "initialization of initializer_list object is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_cxx98_compat_ctor_list_init : Warning< - "constructor call from initializer list is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_illegal_initializer : Error< - "illegal initializer (only variables can be initialized)">; -def err_illegal_initializer_type : Error<"illegal initializer type %0">; -def ext_init_list_type_narrowing : ExtWarn< - "type %0 cannot be narrowed to %1 in initializer list">, - InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; -def ext_init_list_variable_narrowing : ExtWarn< - "non-constant-expression cannot be narrowed from type %0 to %1 in " - "initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; -def ext_init_list_constant_narrowing : ExtWarn< - "constant expression evaluates to %0 which cannot be narrowed to type %1">, - InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; -def warn_init_list_type_narrowing : Warning< - "type %0 cannot be narrowed to %1 in initializer list in C++11">, - InGroup<CXX11Narrowing>, DefaultIgnore; -def warn_init_list_variable_narrowing : Warning< - "non-constant-expression cannot be narrowed from type %0 to %1 in " - "initializer list in C++11">, - InGroup<CXX11Narrowing>, DefaultIgnore; -def warn_init_list_constant_narrowing : Warning< - "constant expression evaluates to %0 which cannot be narrowed to type %1 in " - "C++11">, - InGroup<CXX11Narrowing>, DefaultIgnore; -def note_init_list_narrowing_silence : Note< - "insert an explicit cast to silence this issue">; -def err_init_objc_class : Error< - "cannot initialize Objective-C class type %0">; -def err_implicit_empty_initializer : Error< - "initializer for aggregate with no elements requires explicit braces">; -def err_bitfield_has_negative_width : Error< - "bit-field %0 has negative width (%1)">; -def err_anon_bitfield_has_negative_width : Error< - "anonymous bit-field has negative width (%0)">; -def err_bitfield_has_zero_width : Error<"named bit-field %0 has zero width">; -def err_bitfield_width_exceeds_type_width : Error< - "width of bit-field %0 (%1 bits) exceeds %select{width|size}2 " - "of its type (%3 bit%s3)">; -def err_anon_bitfield_width_exceeds_type_width : Error< - "width of anonymous bit-field (%0 bits) exceeds %select{width|size}1 " - "of its type (%2 bit%s2)">; -def err_incorrect_number_of_vector_initializers : Error< - "number of elements must be either one or match the size of the vector">; - -// Used by C++ which allows bit-fields that are wider than the type. -def warn_bitfield_width_exceeds_type_width: Warning< - "width of bit-field %0 (%1 bits) exceeds the width of its type; value will " - "be truncated to %2 bit%s2">, InGroup<BitFieldWidth>; -def warn_anon_bitfield_width_exceeds_type_width : Warning< - "width of anonymous bit-field (%0 bits) exceeds width of its type; value " - "will be truncated to %1 bit%s1">, InGroup<BitFieldWidth>; - -def warn_missing_braces : Warning< - "suggest braces around initialization of subobject">, - InGroup<MissingBraces>, DefaultIgnore; - -def err_redefinition_of_label : Error<"redefinition of label %0">; -def err_undeclared_label_use : Error<"use of undeclared label %0">; -def err_goto_ms_asm_label : Error< - "cannot jump from this goto statement to label %0 inside an inline assembly block">; -def note_goto_ms_asm_label : Note< - "inline assembly label %0 declared here">; -def warn_unused_label : Warning<"unused label %0">, - InGroup<UnusedLabel>, DefaultIgnore; - -def err_goto_into_protected_scope : Error< - "cannot jump from this goto statement to its label">; -def ext_goto_into_protected_scope : ExtWarn< - "jump from this goto statement to its label is a Microsoft extension">, - InGroup<MicrosoftGoto>; -def warn_cxx98_compat_goto_into_protected_scope : Warning< - "jump from this goto statement to its label is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_switch_into_protected_scope : Error< - "cannot jump from switch statement to this case label">; -def warn_cxx98_compat_switch_into_protected_scope : Warning< - "jump from switch statement to this case label is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def err_indirect_goto_without_addrlabel : Error< - "indirect goto in function with no address-of-label expressions">; -def err_indirect_goto_in_protected_scope : Error< - "cannot jump from this indirect goto statement to one of its possible targets">; -def warn_cxx98_compat_indirect_goto_in_protected_scope : Warning< - "jump from this indirect goto statement to one of its possible targets " - "is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def note_indirect_goto_target : Note< - "possible target of indirect goto statement">; -def note_protected_by_variable_init : Note< - "jump bypasses variable initialization">; -def note_protected_by_variable_nontriv_destructor : Note< - "jump bypasses variable with a non-trivial destructor">; -def note_protected_by_variable_non_pod : Note< - "jump bypasses initialization of non-POD variable">; -def note_protected_by_cleanup : Note< - "jump bypasses initialization of variable with __attribute__((cleanup))">; -def note_protected_by_vla_typedef : Note< - "jump bypasses initialization of VLA typedef">; -def note_protected_by_vla_type_alias : Note< - "jump bypasses initialization of VLA type alias">; -def note_protected_by_vla : Note< - "jump bypasses initialization of variable length array">; -def note_protected_by_objc_try : Note< - "jump bypasses initialization of @try block">; -def note_protected_by_objc_catch : Note< - "jump bypasses initialization of @catch block">; -def note_protected_by_objc_finally : Note< - "jump bypasses initialization of @finally block">; -def note_protected_by_objc_synchronized : Note< - "jump bypasses initialization of @synchronized block">; -def note_protected_by_objc_autoreleasepool : Note< - "jump bypasses auto release push of @autoreleasepool block">; -def note_protected_by_cxx_try : Note< - "jump bypasses initialization of try block">; -def note_protected_by_cxx_catch : Note< - "jump bypasses initialization of catch block">; -def note_protected_by_seh_try : Note< - "jump bypasses initialization of __try block">; -def note_protected_by_seh_except : Note< - "jump bypasses initialization of __except block">; -def note_protected_by_seh_finally : Note< - "jump bypasses initialization of __finally block">; -def note_protected_by___block : Note< - "jump bypasses setup of __block variable">; -def note_protected_by_objc_strong_init : Note< - "jump bypasses initialization of __strong variable">; -def note_protected_by_objc_weak_init : Note< - "jump bypasses initialization of __weak variable">; -def note_enters_block_captures_cxx_obj : Note< - "jump enters lifetime of block which captures a destructible C++ object">; -def note_enters_block_captures_strong : Note< - "jump enters lifetime of block which strongly captures a variable">; -def note_enters_block_captures_weak : Note< - "jump enters lifetime of block which weakly captures a variable">; - -def note_exits_cleanup : Note< - "jump exits scope of variable with __attribute__((cleanup))">; -def note_exits_dtor : Note< - "jump exits scope of variable with non-trivial destructor">; -def note_exits_temporary_dtor : Note< - "jump exits scope of lifetime-extended temporary with non-trivial " - "destructor">; -def note_exits___block : Note< - "jump exits scope of __block variable">; -def note_exits_objc_try : Note< - "jump exits @try block">; -def note_exits_objc_catch : Note< - "jump exits @catch block">; -def note_exits_objc_finally : Note< - "jump exits @finally block">; -def note_exits_objc_synchronized : Note< - "jump exits @synchronized block">; -def note_exits_cxx_try : Note< - "jump exits try block">; -def note_exits_cxx_catch : Note< - "jump exits catch block">; -def note_exits_seh_try : Note< - "jump exits __try block">; -def note_exits_seh_except : Note< - "jump exits __except block">; -def note_exits_seh_finally : Note< - "jump exits __finally block">; -def note_exits_objc_autoreleasepool : Note< - "jump exits autoreleasepool block">; -def note_exits_objc_strong : Note< - "jump exits scope of __strong variable">; -def note_exits_objc_weak : Note< - "jump exits scope of __weak variable">; -def note_exits_block_captures_cxx_obj : Note< - "jump exits lifetime of block which captures a destructible C++ object">; -def note_exits_block_captures_strong : Note< - "jump exits lifetime of block which strongly captures a variable">; -def note_exits_block_captures_weak : Note< - "jump exits lifetime of block which weakly captures a variable">; - -def err_func_returning_qualified_void : ExtWarn< - "function cannot return qualified void type %0">, - InGroup<DiagGroup<"qualified-void-return-type">>; -def err_func_returning_array_function : Error< - "function cannot return %select{array|function}0 type %1">; -def err_field_declared_as_function : Error<"field %0 declared as a function">; -def err_field_incomplete : Error<"field has incomplete type %0">; -def ext_variable_sized_type_in_struct : ExtWarn< - "field %0 with variable sized type %1 not at the end of a struct or class is" - " a GNU extension">, InGroup<GNUVariableSizedTypeNotAtEnd>; - -def ext_c99_flexible_array_member : Extension< - "flexible array members are a C99 feature">, InGroup<C99>; -def err_flexible_array_virtual_base : Error< - "flexible array member %0 not allowed in " - "%select{struct|interface|union|class|enum}1 which has a virtual base class">; -def err_flexible_array_empty_aggregate : Error< - "flexible array member %0 not allowed in otherwise empty " - "%select{struct|interface|union|class|enum}1">; -def err_flexible_array_has_nontrivial_dtor : Error< - "flexible array member %0 of type %1 with non-trivial destruction">; -def ext_flexible_array_in_struct : Extension< - "%0 may not be nested in a struct due to flexible array member">, - InGroup<FlexibleArrayExtensions>; -def ext_flexible_array_in_array : Extension< - "%0 may not be used as an array element due to flexible array member">, - InGroup<FlexibleArrayExtensions>; -def err_flexible_array_init : Error< - "initialization of flexible array member is not allowed">; -def ext_flexible_array_empty_aggregate_ms : Extension< - "flexible array member %0 in otherwise empty " - "%select{struct|interface|union|class|enum}1 is a Microsoft extension">, - InGroup<MicrosoftFlexibleArray>; -def err_flexible_array_union : Error< - "flexible array member %0 in a union is not allowed">; -def ext_flexible_array_union_ms : Extension< - "flexible array member %0 in a union is a Microsoft extension">, - InGroup<MicrosoftFlexibleArray>; -def ext_flexible_array_empty_aggregate_gnu : Extension< - "flexible array member %0 in otherwise empty " - "%select{struct|interface|union|class|enum}1 is a GNU extension">, - InGroup<GNUEmptyStruct>; -def ext_flexible_array_union_gnu : Extension< - "flexible array member %0 in a union is a GNU extension">, InGroup<GNUFlexibleArrayUnionMember>; - -let CategoryName = "ARC Semantic Issue" in { - -// ARC-mode diagnostics. - -let CategoryName = "ARC Weak References" in { - -def err_arc_weak_no_runtime : Error< - "cannot create __weak reference because the current deployment target " - "does not support weak references">; -def err_arc_weak_disabled : Error< - "cannot create __weak reference in file using manual reference counting">; -def err_synthesizing_arc_weak_property_disabled : Error< - "cannot synthesize weak property in file using manual reference counting">; -def err_synthesizing_arc_weak_property_no_runtime : Error< - "cannot synthesize weak property because the current deployment target " - "does not support weak references">; -def err_arc_unsupported_weak_class : Error< - "class is incompatible with __weak references">; -def err_arc_weak_unavailable_assign : Error< - "assignment of a weak-unavailable object to a __weak object">; -def err_arc_weak_unavailable_property : Error< - "synthesizing __weak instance variable of type %0, which does not " - "support weak references">; -def note_implemented_by_class : Note< - "when implemented by class %0">; -def err_arc_convesion_of_weak_unavailable : Error< - "%select{implicit conversion|cast}0 of weak-unavailable object of type %1 to" - " a __weak object of type %2">; - -} // end "ARC Weak References" category - -let CategoryName = "ARC Restrictions" in { - -def err_unavailable_in_arc : Error< - "%0 is unavailable in ARC">; -def note_arc_forbidden_type : Note< - "declaration uses type that is ill-formed in ARC">; -def note_performs_forbidden_arc_conversion : Note< - "inline function performs a conversion which is forbidden in ARC">; -def note_arc_init_returns_unrelated : Note< - "init method must return a type related to its receiver type">; -def note_arc_weak_disabled : Note< - "declaration uses __weak, but ARC is disabled">; -def note_arc_weak_no_runtime : Note<"declaration uses __weak, which " - "the current deployment target does not support">; -def note_arc_field_with_ownership : Note< - "field has non-trivial ownership qualification">; - -def err_arc_illegal_explicit_message : Error< - "ARC forbids explicit message send of %0">; -def err_arc_unused_init_message : Error< - "the result of a delegate init call must be immediately returned " - "or assigned to 'self'">; -def err_arc_mismatched_cast : Error< - "%select{implicit conversion|cast}0 of " - "%select{%2|a non-Objective-C pointer type %2|a block pointer|" - "an Objective-C pointer|an indirect pointer to an Objective-C pointer}1" - " to %3 is disallowed with ARC">; -def err_arc_nolifetime_behavior : Error< - "explicit ownership qualifier on cast result has no effect">; -def err_arc_objc_object_in_tag : Error< - "ARC forbids %select{Objective-C objects|blocks}0 in " - "%select{struct|interface|union|<<ERROR>>|enum}1">; -def err_arc_objc_property_default_assign_on_object : Error< - "ARC forbids synthesizing a property of an Objective-C object " - "with unspecified ownership or storage attribute">; -def err_arc_illegal_selector : Error< - "ARC forbids use of %0 in a @selector">; -def err_arc_illegal_method_def : Error< - "ARC forbids %select{implementation|synthesis}0 of %1">; -def warn_arc_strong_pointer_objc_pointer : Warning< - "method parameter of type %0 with no explicit ownership">, - InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore; - -} // end "ARC Restrictions" category - -def err_arc_lost_method_convention : Error< - "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 " - "method, but its implementation doesn't match because %select{" - "its result type is not an object pointer|" - "its result type is unrelated to its receiver type}1">; -def note_arc_lost_method_convention : Note<"declaration in interface">; -def err_arc_gained_method_convention : Error< - "method implementation does not match its declaration">; -def note_arc_gained_method_convention : Note< - "declaration in interface is not in the '%select{alloc|copy|init|new}0' " - "family because %select{its result type is not an object pointer|" - "its result type is unrelated to its receiver type}1">; -def err_typecheck_arc_assign_self : Error< - "cannot assign to 'self' outside of a method in the init family">; -def err_typecheck_arc_assign_self_class_method : Error< - "cannot assign to 'self' in a class method">; -def err_typecheck_arr_assign_enumeration : Error< - "fast enumeration variables cannot be modified in ARC by default; " - "declare the variable __strong to allow this">; -def warn_arc_retained_assign : Warning< - "assigning retained object to %select{weak|unsafe_unretained}0 " - "%select{property|variable}1" - "; object will be released after assignment">, - InGroup<ARCUnsafeRetainedAssign>; -def warn_arc_retained_property_assign : Warning< - "assigning retained object to unsafe property" - "; object will be released after assignment">, - InGroup<ARCUnsafeRetainedAssign>; -def warn_arc_literal_assign : Warning< - "assigning %select{array literal|dictionary literal|numeric literal|boxed expression|<should not happen>|block literal}0" - " to a weak %select{property|variable}1" - "; object will be released after assignment">, - InGroup<ARCUnsafeRetainedAssign>; -def err_arc_new_array_without_ownership : Error< - "'new' cannot allocate an array of %0 with no explicit ownership">; -def err_arc_autoreleasing_var : Error< - "%select{__block variables|global variables|fields|instance variables}0 cannot have " - "__autoreleasing ownership">; -def err_arc_autoreleasing_capture : Error< - "cannot capture __autoreleasing variable in a " - "%select{block|lambda by copy}0">; -def err_arc_thread_ownership : Error< - "thread-local variable has non-trivial ownership: type is %0">; -def err_arc_indirect_no_ownership : Error< - "%select{pointer|reference}1 to non-const type %0 with no explicit ownership">; -def err_arc_array_param_no_ownership : Error< - "must explicitly describe intended ownership of an object array parameter">; -def err_arc_pseudo_dtor_inconstant_quals : Error< - "pseudo-destructor destroys object of type %0 with inconsistently-qualified " - "type %1">; -def err_arc_init_method_unrelated_result_type : Error< - "init methods must return a type related to the receiver type">; -def err_arc_nonlocal_writeback : Error< - "passing address of %select{non-local|non-scalar}0 object to " - "__autoreleasing parameter for write-back">; -def err_arc_method_not_found : Error< - "no known %select{instance|class}1 method for selector %0">; -def err_arc_receiver_forward_class : Error< - "receiver %0 for class message is a forward declaration">; -def err_arc_may_not_respond : Error< - "no visible @interface for %0 declares the selector %1">; -def err_arc_receiver_forward_instance : Error< - "receiver type %0 for instance message is a forward declaration">; -def warn_receiver_forward_instance : Warning< - "receiver type %0 for instance message is a forward declaration">, - InGroup<ForwardClassReceiver>, DefaultIgnore; -def err_arc_collection_forward : Error< - "collection expression type %0 is a forward declaration">; -def err_arc_multiple_method_decl : Error< - "multiple methods named %0 found with mismatched result, " - "parameter type or attributes">; -def warn_arc_lifetime_result_type : Warning< - "ARC %select{unused|__unsafe_unretained|__strong|__weak|__autoreleasing}0 " - "lifetime qualifier on return type is ignored">, - InGroup<IgnoredQualifiers>; - -let CategoryName = "ARC Retain Cycle" in { - -def warn_arc_retain_cycle : Warning< - "capturing %0 strongly in this block is likely to lead to a retain cycle">, - InGroup<ARCRetainCycles>; -def note_arc_retain_cycle_owner : Note< - "block will be retained by %select{the captured object|an object strongly " - "retained by the captured object}0">; - -} // end "ARC Retain Cycle" category - -def warn_arc_object_memaccess : Warning< - "%select{destination for|source of}0 this %1 call is a pointer to " - "ownership-qualified type %2">, InGroup<ARCNonPodMemAccess>; - -let CategoryName = "ARC and @properties" in { - -def err_arc_strong_property_ownership : Error< - "existing instance variable %1 for strong property %0 may not be " - "%select{|__unsafe_unretained||__weak}2">; -def err_arc_assign_property_ownership : Error< - "existing instance variable %1 for property %0 with %select{unsafe_unretained|assign}2 " - "attribute must be __unsafe_unretained">; -def err_arc_inconsistent_property_ownership : Error< - "%select{|unsafe_unretained|strong|weak}1 property %0 may not also be " - "declared %select{|__unsafe_unretained|__strong|__weak|__autoreleasing}2">; - -} // end "ARC and @properties" category - -def err_arc_atomic_ownership : Error< - "cannot perform atomic operation on a pointer to type %0: type has " - "non-trivial ownership">; - -let CategoryName = "ARC Casting Rules" in { - -def err_arc_bridge_cast_incompatible : Error< - "incompatible types casting %0 to %1 with a %select{__bridge|" - "__bridge_transfer|__bridge_retained}2 cast">; -def err_arc_bridge_cast_wrong_kind : Error< - "cast of %select{Objective-C|block|C}0 pointer type %1 to " - "%select{Objective-C|block|C}2 pointer type %3 cannot use %select{__bridge|" - "__bridge_transfer|__bridge_retained}4">; -def err_arc_cast_requires_bridge : Error< - "%select{cast|implicit conversion}0 of %select{Objective-C|block|C}1 " - "pointer type %2 to %select{Objective-C|block|C}3 pointer type %4 " - "requires a bridged cast">; -def note_arc_bridge : Note< - "use __bridge to convert directly (no change in ownership)">; -def note_arc_cstyle_bridge : Note< - "use __bridge with C-style cast to convert directly (no change in ownership)">; -def note_arc_bridge_transfer : Note< - "use %select{__bridge_transfer|CFBridgingRelease call}1 to transfer " - "ownership of a +1 %0 into ARC">; -def note_arc_cstyle_bridge_transfer : Note< - "use __bridge_transfer with C-style cast to transfer " - "ownership of a +1 %0 into ARC">; -def note_arc_bridge_retained : Note< - "use %select{__bridge_retained|CFBridgingRetain call}1 to make an " - "ARC object available as a +1 %0">; -def note_arc_cstyle_bridge_retained : Note< - "use __bridge_retained with C-style cast to make an " - "ARC object available as a +1 %0">; - -} // ARC Casting category - -} // ARC category name - -def err_flexible_array_init_needs_braces : Error< - "flexible array requires brace-enclosed initializer">; -def err_illegal_decl_array_of_functions : Error< - "'%0' declared as array of functions of type %1">; -def err_illegal_decl_array_incomplete_type : Error< - "array has incomplete element type %0">; -def err_illegal_message_expr_incomplete_type : Error< - "Objective-C message has incomplete result type %0">; -def err_illegal_decl_array_of_references : Error< - "'%0' declared as array of references of type %1">; -def err_decl_negative_array_size : Error< - "'%0' declared as an array with a negative size">; -def err_array_static_outside_prototype : Error< - "%0 used in array declarator outside of function prototype">; -def err_array_static_not_outermost : Error< - "%0 used in non-outermost array type derivation">; -def err_array_star_outside_prototype : Error< - "star modifier used outside of function prototype">; -def err_illegal_decl_pointer_to_reference : Error< - "'%0' declared as a pointer to a reference of type %1">; -def err_illegal_decl_mempointer_to_reference : Error< - "'%0' declared as a member pointer to a reference of type %1">; -def err_illegal_decl_mempointer_to_void : Error< - "'%0' declared as a member pointer to void">; -def err_illegal_decl_mempointer_in_nonclass : Error< - "'%0' does not point into a class">; -def err_mempointer_in_nonclass_type : Error< - "member pointer refers into non-class type %0">; -def err_reference_to_void : Error<"cannot form a reference to 'void'">; -def err_nonfunction_block_type : Error< - "block pointer to non-function type is invalid">; -def err_return_block_has_expr : Error<"void block should not return a value">; -def err_block_return_missing_expr : Error< - "non-void block should return a value">; -def err_func_def_incomplete_result : Error< - "incomplete result type %0 in function definition">; -def err_atomic_specifier_bad_type : Error< - "_Atomic cannot be applied to " - "%select{incomplete |array |function |reference |atomic |qualified |}0type " - "%1 %select{||||||which is not trivially copyable}0">; - -// Expressions. -def ext_sizeof_alignof_function_type : Extension< - "invalid application of '%select{sizeof|alignof|vec_step}0' to a " - "function type">, InGroup<PointerArith>; -def ext_sizeof_alignof_void_type : Extension< - "invalid application of '%select{sizeof|alignof|vec_step}0' to a void " - "type">, InGroup<PointerArith>; -def err_opencl_sizeof_alignof_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a void type">; -def err_sizeof_alignof_incomplete_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to an " - "incomplete type %1">; -def err_sizeof_alignof_function_type : Error< - "invalid application of '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to a " - "function type">; -def err_openmp_default_simd_align_expr : Error< - "invalid application of '__builtin_omp_required_simd_align' to an expression, only type is allowed">; -def err_sizeof_alignof_typeof_bitfield : Error< - "invalid application of '%select{sizeof|alignof|typeof}0' to bit-field">; -def err_alignof_member_of_incomplete_type : Error< - "invalid application of 'alignof' to a field of a class still being defined">; -def err_vecstep_non_scalar_vector_type : Error< - "'vec_step' requires built-in scalar or vector type, %0 invalid">; -def err_offsetof_incomplete_type : Error< - "offsetof of incomplete type %0">; -def err_offsetof_record_type : Error< - "offsetof requires struct, union, or class type, %0 invalid">; -def err_offsetof_array_type : Error<"offsetof requires array type, %0 invalid">; -def ext_offsetof_extended_field_designator : Extension< - "using extended field designator is an extension">, - InGroup<DiagGroup<"extended-offsetof">>; -def ext_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">, - InGroup<InvalidOffsetof>; -def ext_offsetof_non_standardlayout_type : ExtWarn< - "offset of on non-standard-layout type %0">, InGroup<InvalidOffsetof>; -def err_offsetof_bitfield : Error<"cannot compute offset of bit-field %0">; -def err_offsetof_field_of_virtual_base : Error< - "invalid application of 'offsetof' to a field of a virtual base">; -def warn_sub_ptr_zero_size_types : Warning< - "subtraction of pointers to type %0 of zero size has undefined behavior">, - InGroup<PointerArith>; - -def warn_floatingpoint_eq : Warning< - "comparing floating point with == or != is unsafe">, - InGroup<DiagGroup<"float-equal">>, DefaultIgnore; - -def warn_remainder_division_by_zero : Warning< - "%select{remainder|division}0 by zero is undefined">, - InGroup<DivZero>; -def warn_shift_lhs_negative : Warning<"shifting a negative signed value is undefined">, - InGroup<DiagGroup<"shift-negative-value">>; -def warn_shift_negative : Warning<"shift count is negative">, - InGroup<DiagGroup<"shift-count-negative">>; -def warn_shift_gt_typewidth : Warning<"shift count >= width of type">, - InGroup<DiagGroup<"shift-count-overflow">>; -def warn_shift_result_gt_typewidth : Warning< - "signed shift result (%0) requires %1 bits to represent, but %2 only has " - "%3 bits">, InGroup<DiagGroup<"shift-overflow">>; -def warn_shift_result_sets_sign_bit : Warning< - "signed shift result (%0) sets the sign bit of the shift expression's " - "type (%1) and becomes negative">, - InGroup<DiagGroup<"shift-sign-overflow">>, DefaultIgnore; - -def warn_precedence_bitwise_rel : Warning< - "%0 has lower precedence than %1; %1 will be evaluated first">, - InGroup<Parentheses>; -def note_precedence_bitwise_first : Note< - "place parentheses around the %0 expression to evaluate it first">; -def note_precedence_silence : Note< - "place parentheses around the '%0' expression to silence this warning">; - -def warn_precedence_conditional : Warning< - "operator '?:' has lower precedence than '%0'; '%0' will be evaluated first">, - InGroup<Parentheses>; -def note_precedence_conditional_first : Note< - "place parentheses around the '?:' expression to evaluate it first">; - -def warn_logical_instead_of_bitwise : Warning< - "use of logical '%0' with constant operand">, - InGroup<DiagGroup<"constant-logical-operand">>; -def note_logical_instead_of_bitwise_change_operator : Note< - "use '%0' for a bitwise operation">; -def note_logical_instead_of_bitwise_remove_constant : Note< - "remove constant to silence this warning">; - -def warn_bitwise_op_in_bitwise_op : Warning< - "'%0' within '%1'">, InGroup<BitwiseOpParentheses>; - -def warn_logical_and_in_logical_or : Warning< - "'&&' within '||'">, InGroup<LogicalOpParentheses>; - -def warn_overloaded_shift_in_comparison :Warning< - "overloaded operator %select{>>|<<}0 has higher precedence than " - "comparison operator">, - InGroup<OverloadedShiftOpParentheses>; -def note_evaluate_comparison_first :Note< - "place parentheses around comparison expression to evaluate it first">; - -def warn_addition_in_bitshift : Warning< - "operator '%0' has lower precedence than '%1'; " - "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>; - -def warn_self_assignment : Warning< - "explicitly assigning value of variable of type %0 to itself">, - InGroup<SelfAssignment>, DefaultIgnore; -def warn_self_move : Warning< - "explicitly moving variable of type %0 to itself">, - InGroup<SelfMove>, DefaultIgnore; - -def warn_redundant_move_on_return : Warning< - "redundant move in return statement">, - InGroup<RedundantMove>, DefaultIgnore; -def warn_pessimizing_move_on_return : Warning< - "moving a local object in a return statement prevents copy elision">, - InGroup<PessimizingMove>, DefaultIgnore; -def warn_pessimizing_move_on_initialization : Warning< - "moving a temporary object prevents copy elision">, - InGroup<PessimizingMove>, DefaultIgnore; -def note_remove_move : Note<"remove std::move call here">; - -def warn_string_plus_int : Warning< - "adding %0 to a string does not append to the string">, - InGroup<StringPlusInt>; -def warn_string_plus_char : Warning< - "adding %0 to a string pointer does not append to the string">, - InGroup<StringPlusChar>; -def note_string_plus_scalar_silence : Note< - "use array indexing to silence this warning">; - -def warn_sizeof_array_param : Warning< - "sizeof on array function parameter will return size of %0 instead of %1">, - InGroup<SizeofArrayArgument>; - -def warn_sizeof_array_decay : Warning< - "sizeof on pointer operation will return size of %0 instead of %1">, - InGroup<SizeofArrayDecay>; - -def err_sizeof_nonfragile_interface : Error< - "application of '%select{alignof|sizeof}1' to interface %0 is " - "not supported on this architecture and platform">; -def err_atdef_nonfragile_interface : Error< - "use of @defs is not supported on this architecture and platform">; -def err_subscript_nonfragile_interface : Error< - "subscript requires size of interface %0, which is not constant for " - "this architecture and platform">; - -def err_arithmetic_nonfragile_interface : Error< - "arithmetic on pointer to interface %0, which is not a constant size for " - "this architecture and platform">; - - -def ext_subscript_non_lvalue : Extension< - "ISO C90 does not allow subscripting non-lvalue array">; -def err_typecheck_subscript_value : Error< - "subscripted value is not an array, pointer, or vector">; -def err_typecheck_subscript_not_integer : Error< - "array subscript is not an integer">; -def err_subscript_function_type : Error< - "subscript of pointer to function type %0">; -def err_subscript_incomplete_type : Error< - "subscript of pointer to incomplete type %0">; -def err_dereference_incomplete_type : Error< - "dereference of pointer to incomplete type %0">; -def ext_gnu_subscript_void_type : Extension< - "subscript of a pointer to void is a GNU extension">, InGroup<PointerArith>; -def err_typecheck_member_reference_struct_union : Error< - "member reference base type %0 is not a structure or union">; -def err_typecheck_member_reference_ivar : Error< - "%0 does not have a member named %1">; -def error_arc_weak_ivar_access : Error< - "dereferencing a __weak pointer is not allowed due to possible " - "null value caused by race condition, assign it to strong variable first">; -def err_typecheck_member_reference_arrow : Error< - "member reference type %0 is not a pointer">; -def err_typecheck_member_reference_suggestion : Error< - "member reference type %0 is %select{a|not a}1 pointer; did you mean to use '%select{->|.}1'?">; -def note_typecheck_member_reference_suggestion : Note< - "did you mean to use '.' instead?">; -def note_member_reference_arrow_from_operator_arrow : Note< - "'->' applied to return value of the operator->() declared here">; -def err_typecheck_member_reference_type : Error< - "cannot refer to type member %0 in %1 with '%select{.|->}2'">; -def err_typecheck_member_reference_unknown : Error< - "cannot refer to member %0 in %1 with '%select{.|->}2'">; -def err_member_reference_needs_call : Error< - "base of member reference is a function; perhaps you meant to call " - "it%select{| with no arguments}0?">; -def warn_subscript_is_char : Warning<"array subscript is of type 'char'">, - InGroup<CharSubscript>, DefaultIgnore; - -def err_typecheck_incomplete_tag : Error<"incomplete definition of type %0">; -def err_no_member : Error<"no member named %0 in %1">; -def err_no_member_overloaded_arrow : Error< - "no member named %0 in %1; did you mean to use '->' instead of '.'?">; - -def err_member_not_yet_instantiated : Error< - "no member %0 in %1; it has not yet been instantiated">; -def note_non_instantiated_member_here : Note< - "not-yet-instantiated member is declared here">; - -def err_enumerator_does_not_exist : Error< - "enumerator %0 does not exist in instantiation of %1">; -def note_enum_specialized_here : Note< - "enum %0 was explicitly specialized here">; - -def err_member_redeclared : Error<"class member cannot be redeclared">; -def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">, - InGroup<RedeclaredClassMember>; -def err_member_redeclared_in_instantiation : Error< - "multiple overloads of %0 instantiate to the same signature %1">; -def err_member_name_of_class : Error<"member %0 has the same name as its class">; -def err_member_def_undefined_record : Error< - "out-of-line definition of %0 from class %1 without definition">; -def err_member_decl_does_not_match : Error< - "out-of-line %select{declaration|definition}2 of %0 " - "does not match any declaration in %1">; -def err_friend_decl_with_def_arg_must_be_def : Error< - "friend declaration specifying a default argument must be a definition">; -def err_friend_decl_with_def_arg_redeclared : Error< - "friend declaration specifying a default argument must be the only declaration">; -def err_friend_decl_does_not_match : Error< - "friend declaration of %0 does not match any declaration in %1">; -def err_member_decl_does_not_match_suggest : Error< - "out-of-line %select{declaration|definition}2 of %0 " - "does not match any declaration in %1; did you mean %3?">; -def err_member_def_does_not_match_ret_type : Error< - "return type of out-of-line definition of %q0 differs from " - "that in the declaration">; -def err_nonstatic_member_out_of_line : Error< - "non-static data member defined out-of-line">; -def err_qualified_typedef_declarator : Error< - "typedef declarator cannot be qualified">; -def err_qualified_param_declarator : Error< - "parameter declarator cannot be qualified">; -def ext_out_of_line_declaration : ExtWarn< - "out-of-line declaration of a member must be a definition">, - InGroup<OutOfLineDeclaration>, DefaultError; -def err_member_extra_qualification : Error< - "extra qualification on member %0">; -def warn_member_extra_qualification : Warning< - err_member_extra_qualification.Text>, InGroup<MicrosoftExtraQualification>; -def warn_namespace_member_extra_qualification : Warning< - "extra qualification on member %0">, - InGroup<DiagGroup<"extra-qualification">>; -def err_member_qualification : Error< - "non-friend class member %0 cannot have a qualified name">; -def note_member_def_close_match : Note<"member declaration nearly matches">; -def note_member_def_close_const_match : Note< - "member declaration does not match because " - "it %select{is|is not}0 const qualified">; -def note_member_def_close_param_match : Note< - "type of %ordinal0 parameter of member declaration does not match definition" - "%diff{ ($ vs $)|}1,2">; -def note_local_decl_close_match : Note<"local declaration nearly matches">; -def note_local_decl_close_param_match : Note< - "type of %ordinal0 parameter of local declaration does not match definition" - "%diff{ ($ vs $)|}1,2">; -def err_typecheck_ivar_variable_size : Error< - "instance variables must have a constant size">; -def err_ivar_reference_type : Error< - "instance variables cannot be of reference type">; -def err_typecheck_illegal_increment_decrement : Error< - "cannot %select{decrement|increment}1 value of type %0">; -def err_typecheck_expect_int : Error< - "used type %0 where integer is required">; -def err_typecheck_arithmetic_incomplete_type : Error< - "arithmetic on a pointer to an incomplete type %0">; -def err_typecheck_pointer_arith_function_type : Error< - "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 " - "function type%select{|s}2 %1%select{| and %3}2">; -def err_typecheck_pointer_arith_void_type : Error< - "arithmetic on%select{ a|}0 pointer%select{|s}0 to void">; -def err_typecheck_decl_incomplete_type : Error< - "variable has incomplete type %0">; -def err_typecheck_decl_incomplete_type___float128 : Error< - "support for type '__float128' is not yet implemented">; -def ext_typecheck_decl_incomplete_type : ExtWarn< - "tentative definition of variable with internal linkage has incomplete non-array type %0">, - InGroup<DiagGroup<"tentative-definition-incomplete-type">>; -def err_tentative_def_incomplete_type : Error< - "tentative definition has type %0 that is never completed">; -def warn_tentative_incomplete_array : Warning< - "tentative array definition assumed to have one element">; -def err_typecheck_incomplete_array_needs_initializer : Error< - "definition of variable with array type needs an explicit size " - "or an initializer">; -def err_array_init_not_init_list : Error< - "array initializer must be an initializer " - "list%select{| or string literal| or wide string literal}0">; -def err_array_init_narrow_string_into_wchar : Error< - "initializing wide char array with non-wide string literal">; -def err_array_init_wide_string_into_char : Error< - "initializing char array with wide string literal">; -def err_array_init_incompat_wide_string_into_wchar : Error< - "initializing wide char array with incompatible wide string literal">; -def err_array_init_different_type : Error< - "cannot initialize array %diff{of type $ with array of type $|" - "with different type of array}0,1">; -def err_array_init_non_constant_array : Error< - "cannot initialize array %diff{of type $ with non-constant array of type $|" - "with different type of array}0,1">; -def ext_array_init_copy : Extension< - "initialization of an array " - "%diff{of type $ from a compound literal of type $|" - "from a compound literal}0,1 is a GNU extension">, InGroup<GNUCompoundLiteralInitializer>; -// This is intentionally not disabled by -Wno-gnu. -def ext_array_init_parens : ExtWarn< - "parenthesized initialization of a member array is a GNU extension">, - InGroup<DiagGroup<"gnu-array-member-paren-init">>, DefaultError; -def warn_deprecated_string_literal_conversion : Warning< - "conversion from string literal to %0 is deprecated">, - InGroup<CXX11CompatDeprecatedWritableStr>; -def ext_deprecated_string_literal_conversion : ExtWarn< - "ISO C++11 does not allow conversion from string literal to %0">, - InGroup<WritableStrings>, SFINAEFailure; -def err_realimag_invalid_type : Error<"invalid type %0 to %1 operator">; -def err_typecheck_sclass_fscope : Error< - "illegal storage class on file-scoped variable">; -def warn_standalone_specifier : Warning<"'%0' ignored on this declaration">, - InGroup<MissingDeclarations>; -def ext_standalone_specifier : ExtWarn<"'%0' is not permitted on a declaration " - "of a type">, InGroup<MissingDeclarations>; -def err_standalone_class_nested_name_specifier : Error< - "forward declaration of %select{class|struct|interface|union|enum}0 cannot " - "have a nested name specifier">; -def err_typecheck_sclass_func : Error<"illegal storage class on function">; -def err_static_block_func : Error< - "function declared in block scope cannot have 'static' storage class">; -def err_typecheck_address_of : Error<"address of %select{bit-field" - "|vector element|property expression|register variable}0 requested">; -def ext_typecheck_addrof_void : Extension< - "ISO C forbids taking the address of an expression of type 'void'">; -def err_unqualified_pointer_member_function : Error< - "must explicitly qualify name of member function when taking its address">; -def err_invalid_form_pointer_member_function : Error< - "cannot create a non-constant pointer to member function">; -def err_address_of_function_with_pass_object_size_params: Error< - "cannot take address of function %0 because parameter %1 has " - "pass_object_size attribute">; -def err_parens_pointer_member_function : Error< - "cannot parenthesize the name of a method when forming a member pointer">; -def err_typecheck_invalid_lvalue_addrof_addrof_function : Error< - "extra '&' taking address of overloaded function">; -def err_typecheck_invalid_lvalue_addrof : Error< - "cannot take the address of an rvalue of type %0">; -def ext_typecheck_addrof_temporary : ExtWarn< - "taking the address of a temporary object of type %0">, - InGroup<DiagGroup<"address-of-temporary">>, DefaultError; -def err_typecheck_addrof_temporary : Error< - "taking the address of a temporary object of type %0">; -def err_typecheck_addrof_dtor : Error< - "taking the address of a destructor">; -def err_typecheck_unary_expr : Error< - "invalid argument type %0 to unary expression">; -def err_typecheck_indirection_requires_pointer : Error< - "indirection requires pointer operand (%0 invalid)">; -def ext_typecheck_indirection_through_void_pointer : ExtWarn< - "ISO C++ does not allow indirection on operand of type %0">, - InGroup<DiagGroup<"void-ptr-dereference">>; -def warn_indirection_through_null : Warning< - "indirection of non-volatile null pointer will be deleted, not trap">, InGroup<NullDereference>; -def note_indirection_through_null : Note< - "consider using __builtin_trap() or qualifying pointer with 'volatile'">; -def warn_pointer_indirection_from_incompatible_type : Warning< - "dereference of type %1 that was reinterpret_cast from type %0 has undefined " - "behavior">, - InGroup<UndefinedReinterpretCast>, DefaultIgnore; - -def err_objc_object_assignment : Error< - "cannot assign to class object (%0 invalid)">; -def err_typecheck_invalid_operands : Error< - "invalid operands to binary expression (%0 and %1)">; -def err_typecheck_sub_ptr_compatible : Error< - "%diff{$ and $ are not pointers to compatible types|" - "pointers to incompatible types}0,1">; -def ext_typecheck_ordered_comparison_of_pointer_integer : ExtWarn< - "ordered comparison between pointer and integer (%0 and %1)">; -def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension< - "ordered comparison between pointer and zero (%0 and %1) is an extension">; -def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn< - "ordered comparison of function pointers (%0 and %1)">; -def ext_typecheck_comparison_of_fptr_to_void : Extension< - "equality comparison between function pointer and void pointer (%0 and %1)">; -def err_typecheck_comparison_of_fptr_to_void : Error< - "equality comparison between function pointer and void pointer (%0 and %1)">; -def ext_typecheck_comparison_of_pointer_integer : ExtWarn< - "comparison between pointer and integer (%0 and %1)">; -def err_typecheck_comparison_of_pointer_integer : Error< - "comparison between pointer and integer (%0 and %1)">; -def ext_typecheck_comparison_of_distinct_pointers : ExtWarn< - "comparison of distinct pointer types%diff{ ($ and $)|}0,1">, - InGroup<CompareDistinctPointerType>; -def ext_typecheck_cond_incompatible_operands : ExtWarn< - "incompatible operand types (%0 and %1)">; -def err_cond_voidptr_arc : Error < - "operands to conditional of types%diff{ $ and $|}0,1 are incompatible " - "in ARC mode">; -def err_typecheck_comparison_of_distinct_pointers : Error< - "comparison of distinct pointer types%diff{ ($ and $)|}0,1">; -def ext_typecheck_comparison_of_distinct_pointers_nonstandard : ExtWarn< - "comparison of distinct pointer types (%0 and %1) uses non-standard " - "composite pointer type %2">, InGroup<CompareDistinctPointerType>; -def err_typecheck_op_on_nonoverlapping_address_space_pointers : Error< - "%select{comparison between %diff{ ($ and $)|}0,1" - "|arithmetic operation with operands of type %diff{ ($ and $)|}0,1}2" - " which are pointers to non-overlapping address spaces">; - -def err_typecheck_assign_const : Error< - "%select{" - "cannot assign to return value because function %1 returns a const value|" - "cannot assign to variable %1 with const-qualified type %2|" - "cannot assign to %select{non-|}1static data member %2 " - "with const-qualified type %3|" - "cannot assign to non-static data member within const member function %1|" - "read-only variable is not assignable}0">; - -def note_typecheck_assign_const : Note< - "%select{" - "function %1 which returns const-qualified type %2 declared here|" - "variable %1 declared const here|" - "%select{non-|}1static data member %2 declared const here|" - "member function %q1 is declared const here}0">; - -def warn_mixed_sign_comparison : Warning< - "comparison of integers of different signs: %0 and %1">, - InGroup<SignCompare>, DefaultIgnore; -def warn_lunsigned_always_true_comparison : Warning< - "comparison of unsigned%select{| enum}2 expression %0 is always %1">, - InGroup<TautologicalCompare>; -def warn_out_of_range_compare : Warning< - "comparison of %select{constant %0|true|false}1 with " - "%select{expression of type %2|boolean expression}3 is always " - "%select{false|true}4">, InGroup<TautologicalOutOfRangeCompare>; -def warn_runsigned_always_true_comparison : Warning< - "comparison of %0 unsigned%select{| enum}2 expression is always %1">, - InGroup<TautologicalCompare>; -def warn_comparison_of_mixed_enum_types : Warning< - "comparison of two values with different enumeration types" - "%diff{ ($ and $)|}0,1">, - InGroup<DiagGroup<"enum-compare">>; -def warn_null_in_arithmetic_operation : Warning< - "use of NULL in arithmetic operation">, - InGroup<NullArithmetic>; -def warn_null_in_comparison_operation : Warning< - "comparison between NULL and non-pointer " - "%select{(%1 and NULL)|(NULL and %1)}0">, - InGroup<NullArithmetic>; -def err_shift_rhs_only_vector : Error< - "requested shift is a vector of type %0 but the first operand is not a " - "vector (%1)">; - -def warn_logical_not_on_lhs_of_comparison : Warning< - "logical not is only applied to the left hand side of this comparison">, - InGroup<LogicalNotParentheses>; -def note_logical_not_fix : Note< - "add parentheses after the '!' to evaluate the comparison first">; -def note_logical_not_silence_with_parens : Note< - "add parentheses around left hand side expression to silence this warning">; - -def err_invalid_this_use : Error< - "invalid use of 'this' outside of a non-static member function">; -def err_this_static_member_func : Error< - "'this' cannot be%select{| implicitly}0 used in a static member function " - "declaration">; -def err_invalid_member_use_in_static_method : Error< - "invalid use of member %0 in static member function">; -def err_invalid_qualified_function_type : Error< - "%select{static |non-}0member function %select{of type %2 |}1" - "cannot have '%3' qualifier">; -def err_compound_qualified_function_type : Error< - "%select{block pointer|pointer|reference}0 to function type %select{%2 |}1" - "cannot have '%3' qualifier">; - -def err_ref_qualifier_overload : Error< - "cannot overload a member function %select{without a ref-qualifier|with " - "ref-qualifier '&'|with ref-qualifier '&&'}0 with a member function %select{" - "without a ref-qualifier|with ref-qualifier '&'|with ref-qualifier '&&'}1">; - -def err_invalid_non_static_member_use : Error< - "invalid use of non-static data member %0">; -def err_nested_non_static_member_use : Error< - "%select{call to non-static member function|use of non-static data member}0 " - "%2 of %1 from nested type %3">; -def warn_cxx98_compat_non_static_member_use : Warning< - "use of non-static data member %0 in an unevaluated context is " - "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; -def err_invalid_incomplete_type_use : Error< - "invalid use of incomplete type %0">; -def err_builtin_func_cast_more_than_one_arg : Error< - "function-style cast to a builtin type can only take one argument">; -def err_value_init_for_array_type : Error< - "array types cannot be value-initialized">; -def err_value_init_for_function_type : Error< - "function types cannot be value-initialized">; -def warn_format_nonliteral_noargs : Warning< - "format string is not a string literal (potentially insecure)">, - InGroup<FormatSecurity>; -def warn_format_nonliteral : Warning< - "format string is not a string literal">, - InGroup<FormatNonLiteral>, DefaultIgnore; - -def err_unexpected_interface : Error< - "unexpected interface name %0: expected expression">; -def err_ref_non_value : Error<"%0 does not refer to a value">; -def err_ref_vm_type : Error< - "cannot refer to declaration with a variably modified type inside block">; -def err_ref_flexarray_type : Error< - "cannot refer to declaration of structure variable with flexible array member " - "inside block">; -def err_ref_array_type : Error< - "cannot refer to declaration with an array type inside block">; -def err_property_not_found : Error< - "property %0 not found on object of type %1">; -def err_invalid_property_name : Error< - "%0 is not a valid property name (accessing an object of type %1)">; -def err_getter_not_found : Error< - "no getter method for read from property">; -def err_objc_subscript_method_not_found : Error< - "expected method to %select{read|write}1 %select{dictionary|array}2 element not " - "found on object of type %0">; -def err_objc_subscript_index_type : Error< - "method index parameter type %0 is not integral type">; -def err_objc_subscript_key_type : Error< - "method key parameter type %0 is not object type">; -def err_objc_subscript_dic_object_type : Error< - "method object parameter type %0 is not object type">; -def err_objc_subscript_object_type : Error< - "cannot assign to this %select{dictionary|array}1 because assigning method's " - "2nd parameter of type %0 is not an Objective-C pointer type">; -def err_objc_subscript_base_type : Error< - "%select{dictionary|array}1 subscript base type %0 is not an Objective-C object">; -def err_objc_multiple_subscript_type_conversion : Error< - "indexing expression is invalid because subscript type %0 has " - "multiple type conversion functions">; -def err_objc_subscript_type_conversion : Error< - "indexing expression is invalid because subscript type %0 is not an integral" - " or Objective-C pointer type">; -def err_objc_subscript_pointer : Error< - "indexing expression is invalid because subscript type %0 is not an" - " Objective-C pointer">; -def err_objc_indexing_method_result_type : Error< - "method for accessing %select{dictionary|array}1 element must have Objective-C" - " object return type instead of %0">; -def err_objc_index_incomplete_class_type : Error< - "Objective-C index expression has incomplete class type %0">; -def err_illegal_container_subscripting_op : Error< - "illegal operation on Objective-C container subscripting">; -def err_property_not_found_forward_class : Error< - "property %0 cannot be found in forward class object %1">; -def err_property_not_as_forward_class : Error< - "property %0 refers to an incomplete Objective-C class %1 " - "(with no @interface available)">; -def note_forward_class : Note< - "forward declaration of class here">; -def err_duplicate_property : Error< - "property has a previous declaration">; -def ext_gnu_void_ptr : Extension< - "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">, - InGroup<PointerArith>; -def ext_gnu_ptr_func_arith : Extension< - "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " - "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, - InGroup<PointerArith>; -def error_readonly_message_assignment : Error< - "assigning to 'readonly' return result of an Objective-C message not allowed">; -def ext_integer_increment_complex : Extension< - "ISO C does not support '++'/'--' on complex integer type %0">; -def ext_integer_complement_complex : Extension< - "ISO C does not support '~' for complex conjugation of %0">; -def err_nosetter_property_assignment : Error< - "%select{assignment to readonly property|" - "no setter method %1 for assignment to property}0">; -def err_nosetter_property_incdec : Error< - "%select{%select{increment|decrement}1 of readonly property|" - "no setter method %2 for %select{increment|decrement}1 of property}0">; -def err_nogetter_property_compound_assignment : Error< - "a getter method is needed to perform a compound assignment on a property">; -def err_nogetter_property_incdec : Error< - "no getter method %1 for %select{increment|decrement}0 of property">; -def error_no_subobject_property_setting : Error< - "expression is not assignable">; -def err_qualified_objc_access : Error< - "%select{property|instance variable}0 access cannot be qualified with '%1'">; - -def ext_freestanding_complex : Extension< - "complex numbers are an extension in a freestanding C99 implementation">; - -// FIXME: Remove when we support imaginary. -def err_imaginary_not_supported : Error<"imaginary types are not supported">; - -// Obj-c expressions -def warn_root_inst_method_not_found : Warning< - "instance method %0 is being used on 'Class' which is not in the root class">, - InGroup<MethodAccess>; -def warn_class_method_not_found : Warning< - "class method %objcclass0 not found (return type defaults to 'id')">, - InGroup<MethodAccess>; -def warn_instance_method_on_class_found : Warning< - "instance method %0 found instead of class method %1">, - InGroup<MethodAccess>; -def warn_inst_method_not_found : Warning< - "instance method %objcinstance0 not found (return type defaults to 'id')">, - InGroup<MethodAccess>; -def warn_instance_method_not_found_with_typo : Warning< - "instance method %objcinstance0 not found (return type defaults to 'id')" - "; did you mean %objcinstance2?">, InGroup<MethodAccess>; -def warn_class_method_not_found_with_typo : Warning< - "class method %objcclass0 not found (return type defaults to 'id')" - "; did you mean %objcclass2?">, InGroup<MethodAccess>; -def error_method_not_found_with_typo : Error< - "%select{instance|class}1 method %0 not found " - "; did you mean %2?">; -def error_no_super_class_message : Error< - "no @interface declaration found in class messaging of %0">; -def error_root_class_cannot_use_super : Error< - "%0 cannot use 'super' because it is a root class">; -def err_invalid_receiver_to_message_super : Error< - "'super' is only valid in a method body">; -def err_invalid_receiver_class_message : Error< - "receiver type %0 is not an Objective-C class">; -def err_missing_open_square_message_send : Error< - "missing '[' at start of message send expression">; -def warn_bad_receiver_type : Warning< - "receiver type %0 is not 'id' or interface pointer, consider " - "casting it to 'id'">,InGroup<ObjCReceiver>; -def err_bad_receiver_type : Error<"bad receiver type %0">; -def err_incomplete_receiver_type : Error<"incomplete receiver type %0">; -def err_unknown_receiver_suggest : Error< - "unknown receiver %0; did you mean %1?">; -def error_objc_throw_expects_object : Error< - "@throw requires an Objective-C object type (%0 invalid)">; -def error_objc_synchronized_expects_object : Error< - "@synchronized requires an Objective-C object type (%0 invalid)">; -def error_rethrow_used_outside_catch : Error< - "@throw (rethrow) used outside of a @catch block">; -def err_attribute_multiple_objc_gc : Error< - "multiple garbage collection attributes specified for type">; -def err_catch_param_not_objc_type : Error< - "@catch parameter is not a pointer to an interface type">; -def err_illegal_qualifiers_on_catch_parm : Error< - "illegal qualifiers on @catch parameter">; -def err_storage_spec_on_catch_parm : Error< - "@catch parameter cannot have storage specifier '%0'">; -def warn_register_objc_catch_parm : Warning< - "'register' storage specifier on @catch parameter will be ignored">; -def err_qualified_objc_catch_parm : Error< - "@catch parameter declarator cannot be qualified">; -def warn_objc_pointer_cxx_catch_fragile : Warning< - "cannot catch an exception thrown with @throw in C++ in the non-unified " - "exception model">, InGroup<ObjCNonUnifiedException>; -def err_objc_object_catch : Error< - "cannot catch an Objective-C object by value">; -def err_incomplete_type_objc_at_encode : Error< - "'@encode' of incomplete type %0">; -def warn_objc_circular_container : Warning< - "adding '%0' to '%1' might cause circular dependency in container">, - InGroup<DiagGroup<"objc-circular-container">>; -def note_objc_circular_container_declared_here : Note<"'%0' declared here">; - -def warn_setter_getter_impl_required : Warning< - "property %0 requires method %1 to be defined - " - "use @synthesize, @dynamic or provide a method implementation " - "in this class implementation">, - InGroup<ObjCPropertyImpl>; -def warn_setter_getter_impl_required_in_category : Warning< - "property %0 requires method %1 to be defined - " - "use @dynamic or provide a method implementation in this category">, - InGroup<ObjCPropertyImpl>; -def note_parameter_named_here : Note< - "passing argument to parameter %0 here">; -def note_parameter_here : Note< - "passing argument to parameter here">; -def note_method_return_type_change : Note< - "compiler has implicitly changed method %0 return type">; - -// C++ casts -// These messages adhere to the TryCast pattern: %0 is an int specifying the -// cast type, %1 is the source type, %2 is the destination type. -def err_bad_reinterpret_cast_overload : Error< - "reinterpret_cast cannot resolve overloaded function %0 to type %1">; - -def warn_reinterpret_different_from_static : Warning< - "'reinterpret_cast' %select{from|to}3 class %0 %select{to|from}3 its " - "%select{virtual base|base at non-zero offset}2 %1 behaves differently from " - "'static_cast'">, InGroup<ReinterpretBaseClass>; -def note_reinterpret_updowncast_use_static: Note< - "use 'static_cast' to adjust the pointer correctly while " - "%select{upcasting|downcasting}0">; - -def err_bad_static_cast_overload : Error< - "address of overloaded function %0 cannot be static_cast to type %1">; - -def err_bad_cstyle_cast_overload : Error< - "address of overloaded function %0 cannot be cast to type %1">; - - -def err_bad_cxx_cast_generic : Error< - "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from %1 to %2 is not allowed">; -def err_bad_cxx_cast_unrelated_class : Error< - "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from %1 to %2, which are not related by " - "inheritance, is not allowed">; -def note_type_incomplete : Note<"%0 is incomplete">; -def err_bad_cxx_cast_rvalue : Error< - "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from rvalue to reference type %2">; -def err_bad_cxx_cast_bitfield : Error< - "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from bit-field lvalue to reference type %2">; -def err_bad_cxx_cast_qualifiers_away : Error< - "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" - "functional-style cast}0 from %1 to %2 casts away qualifiers">; -def err_bad_const_cast_dest : Error< - "%select{const_cast||||C-style cast|functional-style cast}0 to %2, " - "which is not a reference, pointer-to-object, or pointer-to-data-member">; -def ext_cast_fn_obj : Extension< - "cast between pointer-to-function and pointer-to-object is an extension">; -def ext_ms_cast_fn_obj : ExtWarn< - "static_cast between pointer-to-function and pointer-to-object is a " - "Microsoft extension">, InGroup<MicrosoftCast>; -def warn_cxx98_compat_cast_fn_obj : Warning< - "cast between pointer-to-function and pointer-to-object is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def err_bad_reinterpret_cast_small_int : Error< - "cast from pointer to smaller type %2 loses information">; -def err_bad_cxx_cast_vector_to_scalar_different_size : Error< - "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " - "to scalar %2 of different size">; -def err_bad_cxx_cast_scalar_to_vector_different_size : Error< - "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " - "to vector %2 of different size">; -def err_bad_cxx_cast_vector_to_vector_different_size : Error< - "%select{||reinterpret_cast||C-style cast|}0 from vector %1 " - "to vector %2 of different size">; -def err_bad_lvalue_to_rvalue_cast : Error< - "cannot cast from lvalue of type %1 to rvalue reference type %2; types are " - "not compatible">; -def err_bad_static_cast_pointer_nonpointer : Error< - "cannot cast from type %1 to pointer type %2">; -def err_bad_static_cast_member_pointer_nonmp : Error< - "cannot cast from type %1 to member pointer type %2">; -def err_bad_cxx_cast_member_pointer_size : Error< - "cannot %select{||reinterpret_cast||C-style cast|}0 from member pointer " - "type %1 to member pointer type %2 of different size">; -def err_bad_reinterpret_cast_reference : Error< - "reinterpret_cast of a %0 to %1 needs its address, which is not allowed">; -def warn_undefined_reinterpret_cast : Warning< - "reinterpret_cast from %0 to %1 has undefined behavior">, - InGroup<UndefinedReinterpretCast>, DefaultIgnore; - -// These messages don't adhere to the pattern. -// FIXME: Display the path somehow better. -def err_ambiguous_base_to_derived_cast : Error< - "ambiguous cast from base %0 to derived %1:%2">; -def err_static_downcast_via_virtual : Error< - "cannot cast %0 to %1 via virtual base %2">; -def err_downcast_from_inaccessible_base : Error< - "cannot cast %select{private|protected}2 base class %1 to %0">; -def err_upcast_to_inaccessible_base : Error< - "cannot cast %0 to its %select{private|protected}2 base class %1">; -def err_bad_dynamic_cast_not_ref_or_ptr : Error< - "%0 is not a reference or pointer">; -def err_bad_dynamic_cast_not_class : Error<"%0 is not a class">; -def err_bad_dynamic_cast_incomplete : Error<"%0 is an incomplete type">; -def err_bad_dynamic_cast_not_ptr : Error<"%0 is not a pointer">; -def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">; - -// Other C++ expressions -def err_need_header_before_typeid : Error< - "you need to include <typeinfo> before using the 'typeid' operator">; -def err_need_header_before_ms_uuidof : Error< - "you need to include <guiddef.h> before using the '__uuidof' operator">; -def err_ms___leave_not_in___try : Error< - "'__leave' statement not in __try block">; -def err_uuidof_without_guid : Error< - "cannot call operator __uuidof on a type with no GUID">; -def err_uuidof_with_multiple_guids : Error< - "cannot call operator __uuidof on a type with multiple GUIDs">; -def err_incomplete_typeid : Error<"'typeid' of incomplete type %0">; -def err_variably_modified_typeid : Error<"'typeid' of variably modified type %0">; -def err_static_illegal_in_new : Error< - "the 'static' modifier for the array size is not legal in new expressions">; -def err_array_new_needs_size : Error< - "array size must be specified in new expressions">; -def err_bad_new_type : Error< - "cannot allocate %select{function|reference}1 type %0 with new">; -def err_new_incomplete_type : Error< - "allocation of incomplete type %0">; -def err_new_array_nonconst : Error< - "only the first dimension of an allocated array may have dynamic size">; -def err_new_array_init_args : Error< - "array 'new' cannot have initialization arguments">; -def ext_new_paren_array_nonconst : ExtWarn< - "when type is in parentheses, array cannot have dynamic size">; -def err_placement_new_non_placement_delete : Error< - "'new' expression with placement arguments refers to non-placement " - "'operator delete'">; -def err_array_size_not_integral : Error< - "array size expression must have integral or %select{|unscoped }0" - "enumeration type, not %1">; -def err_array_size_incomplete_type : Error< - "array size expression has incomplete class type %0">; -def err_array_size_explicit_conversion : Error< - "array size expression of type %0 requires explicit conversion to type %1">; -def note_array_size_conversion : Note< - "conversion to %select{integral|enumeration}0 type %1 declared here">; -def err_array_size_ambiguous_conversion : Error< - "ambiguous conversion of array size expression of type %0 to an integral or " - "enumeration type">; -def ext_array_size_conversion : Extension< - "implicit conversion from array size expression of type %0 to " - "%select{integral|enumeration}1 type %2 is a C++11 extension">, - InGroup<CXX11>; -def warn_cxx98_compat_array_size_conversion : Warning< - "implicit conversion from array size expression of type %0 to " - "%select{integral|enumeration}1 type %2 is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; -def err_address_space_qualified_new : Error< - "'new' cannot allocate objects of type %0 in address space '%1'">; -def err_address_space_qualified_delete : Error< - "'delete' cannot delete objects of type %0 in address space '%1'">; - -def err_default_init_const : Error< - "default initialization of an object of const type %0" - "%select{| without a user-provided default constructor}1">; -def ext_default_init_const : ExtWarn< - "default initialization of an object of const type %0" - "%select{| without a user-provided default constructor}1 " - "is a Microsoft extension">, - InGroup<MicrosoftConstInit>; -def err_delete_operand : Error<"cannot delete expression of type %0">; -def ext_delete_void_ptr_operand : ExtWarn< - "cannot delete expression with pointer-to-'void' type %0">, - InGroup<DeleteIncomplete>; -def err_ambiguous_delete_operand : Error< - "ambiguous conversion of delete expression of type %0 to a pointer">; -def warn_delete_incomplete : Warning< - "deleting pointer to incomplete type %0 may cause undefined behavior">, - InGroup<DeleteIncomplete>; -def err_delete_incomplete_class_type : Error< - "deleting incomplete class type %0; no conversions to pointer type">; -def err_delete_explicit_conversion : Error< - "converting delete expression from type %0 to type %1 invokes an explicit " - "conversion function">; -def note_delete_conversion : Note<"conversion to pointer type %0">; -def warn_delete_array_type : Warning< - "'delete' applied to a pointer-to-array type %0 treated as 'delete[]'">; -def warn_mismatched_delete_new : Warning< - "'delete%select{|[]}0' applied to a pointer that was allocated with " - "'new%select{[]|}0'; did you mean 'delete%select{[]|}0'?">, - InGroup<DiagGroup<"mismatched-new-delete">>; -def note_allocated_here : Note<"allocated with 'new%select{[]|}0' here">; -def err_no_suitable_delete_member_function_found : Error< - "no suitable member %0 in %1">; -def err_ambiguous_suitable_delete_member_function_found : Error< - "multiple suitable %0 functions in %1">; -def note_member_declared_here : Note< - "member %0 declared here">; -def err_decrement_bool : Error<"cannot decrement expression of type bool">; -def warn_increment_bool : Warning< - "incrementing expression of type bool is deprecated and " - "incompatible with C++1z">, InGroup<DeprecatedIncrementBool>; -def ext_increment_bool : ExtWarn< - "ISO C++1z does not allow incrementing expression of type bool">, - DefaultError, InGroup<IncrementBool>; -def err_increment_decrement_enum : Error< - "cannot %select{decrement|increment}0 expression of enum type %1">; -def err_catch_incomplete_ptr : Error< - "cannot catch pointer to incomplete type %0">; -def err_catch_incomplete_ref : Error< - "cannot catch reference to incomplete type %0">; -def err_catch_incomplete : Error<"cannot catch incomplete type %0">; -def err_catch_rvalue_ref : Error<"cannot catch exceptions by rvalue reference">; -def err_qualified_catch_declarator : Error< - "exception declarator cannot be qualified">; -def err_early_catch_all : Error<"catch-all handler must come last">; -def err_bad_memptr_rhs : Error< - "right hand operand to %0 has non-pointer-to-member type %1">; -def err_bad_memptr_lhs : Error< - "left hand operand to %0 must be a %select{|pointer to }1class " - "compatible with the right hand operand, but is %2">; -def warn_exception_caught_by_earlier_handler : Warning< - "exception of type %0 will be caught by earlier handler">, - InGroup<Exceptions>; -def note_previous_exception_handler : Note<"for type %0">; -def err_exceptions_disabled : Error< - "cannot use '%0' with exceptions disabled">; -def err_objc_exceptions_disabled : Error< - "cannot use '%0' with Objective-C exceptions disabled">; -def err_seh_try_outside_functions : Error< - "cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">; -def err_mixing_cxx_try_seh_try : Error< - "cannot use C++ 'try' in the same function as SEH '__try'">; -def err_seh_try_unsupported : Error< - "SEH '__try' is not supported on this target">; -def note_conflicting_try_here : Note< - "conflicting %0 here">; -def warn_jump_out_of_seh_finally : Warning< - "jump out of __finally block has undefined behavior">, - InGroup<DiagGroup<"jump-seh-finally">>; -def warn_non_virtual_dtor : Warning< - "%0 has virtual functions but non-virtual destructor">, - InGroup<NonVirtualDtor>, DefaultIgnore; -def warn_delete_non_virtual_dtor : Warning< - "delete called on non-final %0 that has virtual functions " - "but non-virtual destructor">, - InGroup<DeleteNonVirtualDtor>, DefaultIgnore; -def warn_delete_abstract_non_virtual_dtor : Warning< - "delete called on %0 that is abstract but has non-virtual destructor">, - InGroup<DeleteNonVirtualDtor>; -def warn_overloaded_virtual : Warning< - "%q0 hides overloaded virtual %select{function|functions}1">, - InGroup<OverloadedVirtual>, DefaultIgnore; -def note_hidden_overloaded_virtual_declared_here : Note< - "hidden overloaded virtual function %q0 declared here" - "%select{|: different classes%diff{ ($ vs $)|}2,3" - "|: different number of parameters (%2 vs %3)" - "|: type mismatch at %ordinal2 parameter%diff{ ($ vs $)|}3,4" - "|: different return type%diff{ ($ vs $)|}2,3" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}2 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}3)}1">; -def warn_using_directive_in_header : Warning< - "using namespace directive in global context in header">, - InGroup<HeaderHygiene>, DefaultIgnore; -def warn_overaligned_type : Warning< - "type %0 requires %1 bytes of alignment and the default allocator only " - "guarantees %2 bytes">, - InGroup<OveralignedType>, DefaultIgnore; - -def err_conditional_void_nonvoid : Error< - "%select{left|right}1 operand to ? is void, but %select{right|left}1 operand " - "is of type %0">; -def err_conditional_ambiguous : Error< - "conditional expression is ambiguous; " - "%diff{$ can be converted to $ and vice versa|" - "types can be convert to each other}0,1">; -def err_conditional_ambiguous_ovl : Error< - "conditional expression is ambiguous; %diff{$ and $|types}0,1 " - "can be converted to several common types">; -def err_conditional_vector_size : Error< - "vector condition type %0 and result type %1 do not have the same number " - "of elements">; -def err_conditional_vector_element_size : Error< - "vector condition type %0 and result type %1 do not have elements of the " - "same size">; - -def err_throw_incomplete : Error< - "cannot throw object of incomplete type %0">; -def err_throw_incomplete_ptr : Error< - "cannot throw pointer to object of incomplete type %0">; -def err_return_in_constructor_handler : Error< - "return in the catch of a function try block of a constructor is illegal">; -def warn_cdtor_function_try_handler_mem_expr : Warning< - "cannot refer to a non-static member from the handler of a " - "%select{constructor|destructor}0 function try block">, InGroup<Exceptions>; - -let CategoryName = "Lambda Issue" in { - def err_capture_more_than_once : Error< - "%0 can appear only once in a capture list">; - def err_reference_capture_with_reference_default : Error< - "'&' cannot precede a capture when the capture default is '&'">; - def err_this_capture_with_copy_default : Error< - "'this' cannot be explicitly captured when the capture default is '='">; - def err_copy_capture_with_copy_default : Error< - "'&' must precede a capture when the capture default is '='">; - def err_capture_does_not_name_variable : Error< - "%0 in capture list does not name a variable">; - def err_capture_non_automatic_variable : Error< - "%0 cannot be captured because it does not have automatic storage " - "duration">; - def err_this_capture : Error< - "'this' cannot be %select{implicitly |}0captured in this context">; - def err_lambda_capture_anonymous_var : Error< - "unnamed variable cannot be implicitly captured in a lambda expression">; - def err_lambda_capture_flexarray_type : Error< - "variable %0 with flexible array member cannot be captured in " - "a lambda expression">; - def err_lambda_impcap : Error< - "variable %0 cannot be implicitly captured in a lambda with no " - "capture-default specified">; - def note_lambda_decl : Note<"lambda expression begins here">; - def err_lambda_unevaluated_operand : Error< - "lambda expression in an unevaluated operand">; - def err_lambda_in_constant_expression : Error< - "a lambda expression may not appear inside of a constant expression">; - def err_lambda_return_init_list : Error< - "cannot deduce lambda return type from initializer list">; - def err_lambda_capture_default_arg : Error< - "lambda expression in default argument cannot capture any entity">; - def err_lambda_incomplete_result : Error< - "incomplete result type %0 in lambda expression">; - def err_noreturn_lambda_has_return_expr : Error< - "lambda declared 'noreturn' should not return">; - def warn_maybe_falloff_nonvoid_lambda : Warning< - "control may reach end of non-void lambda">, - InGroup<ReturnType>; - def warn_falloff_nonvoid_lambda : Warning< - "control reaches end of non-void lambda">, - InGroup<ReturnType>; - def err_access_lambda_capture : Error< - // The ERRORs represent other special members that aren't constructors, in - // hopes that someone will bother noticing and reporting if they appear - "capture of variable '%0' as type %1 calls %select{private|protected}3 " - "%select{default |copy |move |*ERROR* |*ERROR* |*ERROR* |}2constructor">, - AccessControl; - def note_lambda_to_block_conv : Note< - "implicit capture of lambda object due to conversion to block pointer " - "here">; - - // C++14 lambda init-captures. - def warn_cxx11_compat_init_capture : Warning< - "initialized lambda captures are incompatible with C++ standards " - "before C++14">, InGroup<CXXPre14Compat>, DefaultIgnore; - def ext_init_capture : ExtWarn< - "initialized lambda captures are a C++14 extension">, InGroup<CXX14>; - def err_init_capture_no_expression : Error< - "initializer missing for lambda capture %0">; - def err_init_capture_multiple_expressions : Error< - "initializer for lambda capture %0 contains multiple expressions">; - def err_init_capture_paren_braces : Error< - "cannot deduce type for lambda capture %1 from " - "%select{parenthesized|nested}0 initializer list">; - def err_init_capture_deduction_failure : Error< - "cannot deduce type for lambda capture %0 from initializer of type %2">; - def err_init_capture_deduction_failure_from_init_list : Error< - "cannot deduce type for lambda capture %0 from initializer list">; -} - -def err_return_in_captured_stmt : Error< - "cannot return from %0">; -def err_capture_block_variable : Error< - "__block variable %0 cannot be captured in a " - "%select{lambda expression|captured statement}1">; - -def err_operator_arrow_circular : Error< - "circular pointer delegation detected">; -def err_operator_arrow_depth_exceeded : Error< - "use of 'operator->' on type %0 would invoke a sequence of more than %1 " - "'operator->' calls">; -def note_operator_arrow_here : Note< - "'operator->' declared here produces an object of type %0">; -def note_operator_arrows_suppressed : Note< - "(skipping %0 'operator->'%s0 in backtrace)">; -def note_operator_arrow_depth : Note< - "use -foperator-arrow-depth=N to increase 'operator->' limit">; - -def err_pseudo_dtor_base_not_scalar : Error< - "object expression of non-scalar type %0 cannot be used in a " - "pseudo-destructor expression">; -def ext_pseudo_dtor_on_void : ExtWarn< - "pseudo-destructors on type void are a Microsoft extension">, - InGroup<MicrosoftVoidPseudoDtor>; -def err_pseudo_dtor_type_mismatch : Error< - "the type of object expression " - "%diff{($) does not match the type being destroyed ($)|" - "does not match the type being destroyed}0,1 " - "in pseudo-destructor expression">; -def err_pseudo_dtor_call_with_args : Error< - "call to pseudo-destructor cannot have any arguments">; -def err_dtor_expr_without_call : Error< - "reference to %select{destructor|pseudo-destructor}0 must be called" - "%select{|; did you mean to call it with no arguments?}1">; -def err_pseudo_dtor_destructor_non_type : Error< - "%0 does not refer to a type name in pseudo-destructor expression; expected " - "the name of type %1">; -def err_invalid_use_of_function_type : Error< - "a function type is not allowed here">; -def err_invalid_use_of_array_type : Error<"an array type is not allowed here">; -def err_typecheck_bool_condition : Error< - "value of type %0 is not contextually convertible to 'bool'">; -def err_typecheck_ambiguous_condition : Error< - "conversion %diff{from $ to $|between types}0,1 is ambiguous">; -def err_typecheck_nonviable_condition : Error< - "no viable conversion%select{%diff{ from $ to $|}1,2|" - "%diff{ from returned value of type $ to function return type $|}1,2}0">; -def err_typecheck_nonviable_condition_incomplete : Error< - "no viable conversion%diff{ from $ to incomplete type $|}0,1">; -def err_typecheck_deleted_function : Error< - "conversion function %diff{from $ to $|between types}0,1 " - "invokes a deleted function">; - -def err_expected_class_or_namespace : Error<"%0 is not a class" - "%select{ or namespace|, namespace, or enumeration}1">; -def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here " - "because namespace %1 does not enclose namespace %2">; -def err_invalid_declarator_global_scope : Error< - "definition or redeclaration of %0 cannot name the global scope">; -def err_invalid_declarator_in_function : Error< - "definition or redeclaration of %0 not allowed inside a function">; -def err_invalid_declarator_in_block : Error< - "definition or redeclaration of %0 not allowed inside a block">; -def err_not_tag_in_scope : Error< - "no %select{struct|interface|union|class|enum}0 named %1 in %2">; - -def err_no_typeid_with_fno_rtti : Error< - "cannot use typeid with -fno-rtti">; -def err_no_dynamic_cast_with_fno_rtti : Error< - "cannot use dynamic_cast with -fno-rtti">; - -def err_cannot_form_pointer_to_member_of_reference_type : Error< - "cannot form a pointer-to-member to member %0 of reference type %1">; -def err_incomplete_object_call : Error< - "incomplete type in call to object of type %0">; - -def warn_condition_is_assignment : Warning<"using the result of an " - "assignment as a condition without parentheses">, - InGroup<Parentheses>; -// Completely identical except off by default. -def warn_condition_is_idiomatic_assignment : Warning<"using the result " - "of an assignment as a condition without parentheses">, - InGroup<DiagGroup<"idiomatic-parentheses">>, DefaultIgnore; -def note_condition_assign_to_comparison : Note< - "use '==' to turn this assignment into an equality comparison">; -def note_condition_or_assign_to_comparison : Note< - "use '!=' to turn this compound assignment into an inequality comparison">; -def note_condition_assign_silence : Note< - "place parentheses around the assignment to silence this warning">; - -def warn_equality_with_extra_parens : Warning<"equality comparison with " - "extraneous parentheses">, InGroup<ParenthesesOnEquality>; -def note_equality_comparison_to_assign : Note< - "use '=' to turn this equality comparison into an assignment">; -def note_equality_comparison_silence : Note< - "remove extraneous parentheses around the comparison to silence this warning">; - -// assignment related diagnostics (also for argument passing, returning, etc). -// In most of these diagnostics the %2 is a value from the -// Sema::AssignmentAction enumeration -def err_typecheck_convert_incompatible : Error< - "%select{%diff{assigning to $ from incompatible type $|" - "assigning to type from incompatible type}0,1" - "|%diff{passing $ to parameter of incompatible type $|" - "passing type to parameter of incompatible type}0,1" - "|%diff{returning $ from a function with incompatible result type $|" - "returning type from a function with incompatible result type}0,1" - "|%diff{converting $ to incompatible type $|" - "converting type to incompatible type}0,1" - "|%diff{initializing $ with an expression of incompatible type $|" - "initializing type with an expression of incompatible type}0,1" - "|%diff{sending $ to parameter of incompatible type $|" - "sending type to parameter of incompatible type}0,1" - "|%diff{casting $ to incompatible type $|" - "casting type to incompatible type}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3" - "%select{|: different classes%diff{ ($ vs $)|}5,6" - "|: different number of parameters (%5 vs %6)" - "|: type mismatch at %ordinal5 parameter%diff{ ($ vs $)|}6,7" - "|: different return type%diff{ ($ vs $)|}5,6" - "|: different qualifiers (" - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}5 vs " - "%select{none|const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}6)}4">; -def err_typecheck_missing_return_type_incompatible : Error< - "%diff{return type $ must match previous return type $|" - "return type must match previous return type}0,1 when %select{block " - "literal|lambda expression}2 has unspecified explicit return type">; - -def not_incomplete_class_and_qualified_id : Note< - "conformance of forward class %0 to protocol %1 can not be confirmed">; -def warn_incompatible_qualified_id : Warning< - "%select{%diff{assigning to $ from incompatible type $|" - "assigning to type from incompatible type}0,1" - "|%diff{passing $ to parameter of incompatible type $|" - "passing type to parameter of incompatible type}0,1" - "|%diff{returning $ from a function with incompatible result type $|" - "returning type from a function with incompatible result type}0,1" - "|%diff{converting $ to incompatible type $|" - "converting type to incompatible type}0,1" - "|%diff{initializing $ with an expression of incompatible type $|" - "initializing type with an expression of incompatible type}0,1" - "|%diff{sending $ to parameter of incompatible type $|" - "sending type to parameter of incompatible type}0,1" - "|%diff{casting $ to incompatible type $|" - "casting type to incompatible type}0,1}2">; -def ext_typecheck_convert_pointer_int : ExtWarn< - "incompatible pointer to integer conversion " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3">, - InGroup<IntConversion>; -def ext_typecheck_convert_int_pointer : ExtWarn< - "incompatible integer to pointer conversion " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3">, - InGroup<IntConversion>; -def ext_typecheck_convert_pointer_void_func : Extension< - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " converts between void pointer and function pointer">; -def ext_typecheck_convert_incompatible_pointer_sign : ExtWarn< - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " converts between pointers to integer types with different sign">, - InGroup<DiagGroup<"pointer-sign">>; -def ext_typecheck_convert_incompatible_pointer : ExtWarn< - "incompatible pointer types " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3">, - InGroup<IncompatiblePointerTypes>; -def ext_typecheck_convert_discards_qualifiers : ExtWarn< - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " discards qualifiers">, - InGroup<IncompatiblePointerTypesDiscardsQualifiers>; -def ext_nested_pointer_qualifier_mismatch : ExtWarn< - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " discards qualifiers in nested pointer types">, - InGroup<IncompatiblePointerTypesDiscardsQualifiers>; -def warn_incompatible_vectors : Warning< - "incompatible vector types " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2">, - InGroup<VectorConversion>, DefaultIgnore; -def err_int_to_block_pointer : Error< - "invalid block pointer conversion " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2">; -def err_typecheck_convert_incompatible_block_pointer : Error< - "incompatible block pointer types " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2">; -def err_typecheck_incompatible_address_space : Error< - "%select{%diff{assigning $ to $|assigning to different types}1,0" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " changes address space of pointer">; -def err_typecheck_incompatible_ownership : Error< - "%select{%diff{assigning $ to $|assigning to different types}1,0" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - " changes retain/release properties of pointer">; -def err_typecheck_comparison_of_distinct_blocks : Error< - "comparison of distinct block types%diff{ ($ and $)|}0,1">; - -def err_typecheck_array_not_modifiable_lvalue : Error< - "array type %0 is not assignable">; -def err_typecheck_non_object_not_modifiable_lvalue : Error< - "non-object type %0 is not assignable">; -def err_typecheck_expression_not_modifiable_lvalue : Error< - "expression is not assignable">; -def err_typecheck_incomplete_type_not_modifiable_lvalue : Error< - "incomplete type %0 is not assignable">; -def err_typecheck_lvalue_casts_not_supported : Error< - "assignment to cast is illegal, lvalue casts are not supported">; - -def err_typecheck_duplicate_vector_components_not_mlvalue : Error< - "vector is not assignable (contains duplicate components)">; -def err_block_decl_ref_not_modifiable_lvalue : Error< - "variable is not assignable (missing __block type specifier)">; -def err_lambda_decl_ref_not_modifiable_lvalue : Error< - "cannot assign to a variable captured by copy in a non-mutable lambda">; -def err_typecheck_call_not_function : Error< - "called object type %0 is not a function or function pointer">; -def err_call_incomplete_return : Error< - "calling function with incomplete return type %0">; -def err_call_function_incomplete_return : Error< - "calling %0 with incomplete return type %1">; -def err_call_incomplete_argument : Error< - "argument type %0 is incomplete">; -def err_typecheck_call_too_few_args : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2">; -def err_typecheck_call_too_few_args_one : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "single argument %1 was not specified">; -def err_typecheck_call_too_few_args_at_least : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected at least %1, have %2">; -def err_typecheck_call_too_few_args_at_least_one : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "at least argument %1 must be specified">; -def err_typecheck_call_too_few_args_suggest : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2; did you mean %3?">; -def err_typecheck_call_too_few_args_at_least_suggest : Error< - "too few %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected at least %1, have %2; did you mean %3?">; -def err_typecheck_call_too_many_args : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2">; -def err_typecheck_call_too_many_args_one : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected single argument %1, have %2 arguments">; -def err_typecheck_call_too_many_args_at_most : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected at most %1, have %2">; -def err_typecheck_call_too_many_args_at_most_one : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected at most single argument %1, have %2 arguments">; -def err_typecheck_call_too_many_args_suggest : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected %1, have %2; did you mean %3?">; -def err_typecheck_call_too_many_args_at_most_suggest : Error< - "too many %select{|||execution configuration }0arguments to " - "%select{function|block|method|kernel function}0 call, " - "expected at most %1, have %2; did you mean %3?">; - -def err_arc_typecheck_convert_incompatible_pointer : Error< - "incompatible pointer types passing retainable parameter of type %0" - "to a CF function expecting %1 type">; - -def err_builtin_fn_use : Error<"builtin functions must be directly called">; - -def warn_call_wrong_number_of_arguments : Warning< - "too %select{few|many}0 arguments in call to %1">; -def err_atomic_builtin_must_be_pointer : Error< - "address argument to atomic builtin must be a pointer (%0 invalid)">; -def err_atomic_builtin_must_be_pointer_intptr : Error< - "address argument to atomic builtin must be a pointer to integer or pointer" - " (%0 invalid)">; -def err_atomic_builtin_must_be_pointer_intfltptr : Error< - "address argument to atomic builtin must be a pointer to integer," - " floating-point or pointer (%0 invalid)">; -def err_atomic_builtin_pointer_size : Error< - "address argument to atomic builtin must be a pointer to 1,2,4,8 or 16 byte " - "type (%0 invalid)">; -def err_atomic_exclusive_builtin_pointer_size : Error< - "address argument to load or store exclusive builtin must be a pointer to" - " 1,2,4 or 8 byte type (%0 invalid)">; -def err_atomic_op_needs_atomic : Error< - "address argument to atomic operation must be a pointer to _Atomic " - "type (%0 invalid)">; -def err_atomic_op_needs_non_const_atomic : Error< - "address argument to atomic operation must be a pointer to non-const _Atomic " - "type (%0 invalid)">; -def err_atomic_op_needs_non_const_pointer : Error< - "address argument to atomic operation must be a pointer to non-const " - "type (%0 invalid)">; -def err_atomic_op_needs_trivial_copy : Error< - "address argument to atomic operation must be a pointer to a " - "trivially-copyable type (%0 invalid)">; -def err_atomic_op_needs_atomic_int_or_ptr : Error< - "address argument to atomic operation must be a pointer to %select{|atomic }0" - "integer or pointer (%1 invalid)">; -def err_atomic_op_bitwise_needs_atomic_int : Error< - "address argument to bitwise atomic operation must be a pointer to " - "%select{|atomic }0integer (%1 invalid)">; -def warn_atomic_op_has_invalid_memory_order : Warning< - "memory order argument to atomic operation is invalid">, - InGroup<DiagGroup<"atomic-memory-ordering">>; - -def err_overflow_builtin_must_be_int : Error< - "operand argument to overflow builtin must be an integer (%0 invalid)">; -def err_overflow_builtin_must_be_ptr_int : Error< - "result argument to overflow builtin must be a pointer " - "to a non-const integer (%0 invalid)">; - -def err_atomic_load_store_uses_lib : Error< - "atomic %select{load|store}0 requires runtime support that is not " - "available for this target">; - -def err_nontemporal_builtin_must_be_pointer : Error< - "address argument to nontemporal builtin must be a pointer (%0 invalid)">; -def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error< - "address argument to nontemporal builtin must be a pointer to integer, float, " - "pointer, or a vector of such types (%0 invalid)">; - -def err_deleted_function_use : Error<"attempt to use a deleted function">; - -def err_kern_type_not_void_return : Error< - "kernel function type %0 must have void return type">; -def err_config_scalar_return : Error< - "CUDA special function 'cudaConfigureCall' must have scalar return type">; -def err_kern_call_not_global_function : Error< - "kernel call to non-global function %0">; -def err_global_call_not_config : Error< - "call to global function %0 not configured">; -def err_ref_bad_target : Error< - "reference to %select{__device__|__global__|__host__|__host__ __device__}0 " - "function %1 in %select{__device__|__global__|__host__|__host__ __device__}2 function">; -def warn_host_calls_from_host_device : Warning< - "calling __host__ function %0 from __host__ __device__ function %1 can lead to runtime errors">, - InGroup<CudaCompat>; - -def warn_non_pod_vararg_with_format_string : Warning< - "cannot pass %select{non-POD|non-trivial}0 object of type %1 to variadic " - "%select{function|block|method|constructor}2; expected type from format " - "string was %3">, InGroup<NonPODVarargs>, DefaultError; -// The arguments to this diagnostic should match the warning above. -def err_cannot_pass_objc_interface_to_vararg_format : Error< - "cannot pass object with interface type %1 by value to variadic " - "%select{function|block|method|constructor}2; expected type from format " - "string was %3">; - -def err_cannot_pass_objc_interface_to_vararg : Error< - "cannot pass object with interface type %0 by value through variadic " - "%select{function|block|method|constructor}1">; -def warn_cannot_pass_non_pod_arg_to_vararg : Warning< - "cannot pass object of %select{non-POD|non-trivial}0 type %1 through variadic" - " %select{function|block|method|constructor}2; call will abort at runtime">, - InGroup<NonPODVarargs>, DefaultError; -def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning< - "passing object of trivial but non-POD type %0 through variadic" - " %select{function|block|method|constructor}1 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; -def warn_pass_class_arg_to_vararg : Warning< - "passing object of class type %0 through variadic " - "%select{function|block|method|constructor}1" - "%select{|; did you mean to call '%3'?}2">, - InGroup<ClassVarargs>, DefaultIgnore; -def err_cannot_pass_to_vararg : Error< - "cannot pass %select{expression of type %1|initializer list}0 to variadic " - "%select{function|block|method|constructor}2">; -def err_cannot_pass_to_vararg_format : Error< - "cannot pass %select{expression of type %1|initializer list}0 to variadic " - "%select{function|block|method|constructor}2; expected type from format " - "string was %3">; - -def err_typecheck_call_invalid_ordered_compare : Error< - "ordered compare requires two args of floating point type" - "%diff{ ($ and $)|}0,1">; -def err_typecheck_call_invalid_unary_fp : Error< - "floating point classification requires argument of floating point type " - "(passed in %0)">; -def err_typecheck_cond_expect_int_float : Error< - "used type %0 where integer or floating point type is required">; -def err_typecheck_cond_expect_scalar : Error< - "used type %0 where arithmetic or pointer type is required">; -def err_typecheck_cond_expect_nonfloat : Error< - "used type %0 where floating point type is not allowed">; -def ext_typecheck_cond_one_void : Extension< - "C99 forbids conditional expressions with only one void side">; -def err_typecheck_cast_to_incomplete : Error< - "cast to incomplete type %0">; -def ext_typecheck_cast_nonscalar : Extension< - "C99 forbids casting nonscalar type %0 to the same type">; -def ext_typecheck_cast_to_union : Extension< - "cast to union type is a GNU extension">, - InGroup<GNUUnionCast>; -def err_typecheck_cast_to_union_no_type : Error< - "cast to union type from type %0 not present in union">; -def err_cast_pointer_from_non_pointer_int : Error< - "operand of type %0 cannot be cast to a pointer type">; -def warn_cast_pointer_from_sel : Warning< - "cast of type %0 to %1 is deprecated; use sel_getName instead">, - InGroup<SelTypeCast>; -def warn_function_def_in_objc_container : Warning< - "function definition inside an Objective-C container is deprecated">, - InGroup<FunctionDefInObjCContainer>; - -def warn_bad_function_cast : Warning< - "cast from function call of type %0 to non-matching type %1">, - InGroup<BadFunctionCast>, DefaultIgnore; -def err_cast_pointer_to_non_pointer_int : Error< - "pointer cannot be cast to type %0">; -def err_typecheck_expect_scalar_operand : Error< - "operand of type %0 where arithmetic or pointer type is required">; -def err_typecheck_cond_incompatible_operands : Error< - "incompatible operand types%diff{ ($ and $)|}0,1">; -def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn< - "incompatible operand types%diff{ ($ and $)|}0,1 use non-standard composite " - "pointer type %2">; -def err_cast_selector_expr : Error< - "cannot type cast @selector expression">; -def ext_typecheck_cond_incompatible_pointers : ExtWarn< - "pointer type mismatch%diff{ ($ and $)|}0,1">, - InGroup<DiagGroup<"pointer-type-mismatch">>; -def ext_typecheck_cond_pointer_integer_mismatch : ExtWarn< - "pointer/integer type mismatch in conditional expression" - "%diff{ ($ and $)|}0,1">, - InGroup<DiagGroup<"conditional-type-mismatch">>; -def err_typecheck_choose_expr_requires_constant : Error< - "'__builtin_choose_expr' requires a constant expression">; -def warn_unused_expr : Warning<"expression result unused">, - InGroup<UnusedValue>; -def warn_unused_voidptr : Warning< - "expression result unused; should this cast be to 'void'?">, - InGroup<UnusedValue>; -def warn_unused_property_expr : Warning< - "property access result unused - getters should not be used for side effects">, - InGroup<UnusedGetterReturnValue>; -def warn_unused_container_subscript_expr : Warning< - "container access result unused - container access should not be used for side effects">, - InGroup<UnusedValue>; -def warn_unused_call : Warning< - "ignoring return value of function declared with %0 attribute">, - InGroup<UnusedValue>; -def warn_side_effects_unevaluated_context : Warning< - "expression with side effects has no effect in an unevaluated context">, - InGroup<UnevaluatedExpression>; -def warn_side_effects_typeid : Warning< - "expression with side effects will be evaluated despite being used as an " - "operand to 'typeid'">, InGroup<PotentiallyEvaluatedExpression>; -def warn_unused_result : Warning< - "ignoring return value of function declared with warn_unused_result " - "attribute">, InGroup<DiagGroup<"unused-result">>; -def warn_unused_volatile : Warning< - "expression result unused; assign into a variable to force a volatile load">, - InGroup<DiagGroup<"unused-volatile-lvalue">>; - -def warn_unused_comparison : Warning< - "%select{%select{|in}1equality|relational}0 comparison result unused">, - InGroup<UnusedComparison>; -def note_inequality_comparison_to_or_assign : Note< - "use '|=' to turn this inequality comparison into an or-assignment">; - -def err_incomplete_type_used_in_type_trait_expr : Error< - "incomplete type %0 used in type trait expression">; - -def err_dimension_expr_not_constant_integer : Error< - "dimension expression does not evaluate to a constant unsigned int">; - -def err_typecheck_cond_incompatible_operands_null : Error< - "non-pointer operand type %0 incompatible with %select{NULL|nullptr}1">; -def ext_empty_struct_union : Extension< - "empty %select{struct|union}0 is a GNU extension">, InGroup<GNUEmptyStruct>; -def ext_no_named_members_in_struct_union : Extension< - "%select{struct|union}0 without named members is a GNU extension">, InGroup<GNUEmptyStruct>; -def warn_zero_size_struct_union_compat : Warning<"%select{|empty }0" - "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, - InGroup<CXXCompat>, DefaultIgnore; -def warn_zero_size_struct_union_in_extern_c : Warning<"%select{|empty }0" - "%select{struct|union}1 has size 0 in C, %select{size 1|non-zero size}2 in C++">, - InGroup<ExternCCompat>; -def warn_cast_qual : Warning<"cast from %0 to %1 drops %select{const and " - "volatile qualifiers|const qualifier|volatile qualifier}2">, - InGroup<CastQual>, DefaultIgnore; -def warn_cast_qual2 : Warning<"cast from %0 to %1 must have all intermediate " - "pointers const qualified to be safe">, InGroup<CastQual>, DefaultIgnore; -def warn_redefine_extname_not_applied : Warning< - "#pragma redefine_extname is applicable to external C declarations only; " - "not applied to %select{function|variable}0 %1">, - InGroup<Pragmas>; -} // End of general sema category. - -// inline asm. -let CategoryName = "Inline Assembly Issue" in { - def err_asm_invalid_lvalue_in_output : Error<"invalid lvalue in asm output">; - def err_asm_invalid_output_constraint : Error< - "invalid output constraint '%0' in asm">; - def err_asm_invalid_lvalue_in_input : Error< - "invalid lvalue in asm input for constraint '%0'">; - def err_asm_invalid_input_constraint : Error< - "invalid input constraint '%0' in asm">; - def err_asm_immediate_expected : Error<"constraint '%0' expects " - "an integer constant expression">; - def err_asm_invalid_type_in_input : Error< - "invalid type %0 in asm input for constraint '%1'">; - def err_asm_tying_incompatible_types : Error< - "unsupported inline asm: input with type " - "%diff{$ matching output with type $|}0,1">; - def err_asm_unexpected_constraint_alternatives : Error< - "asm constraint has an unexpected number of alternatives: %0 vs %1">; - def err_asm_incomplete_type : Error<"asm operand has incomplete type %0">; - def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">; - def err_asm_invalid_global_var_reg : Error<"register '%0' unsuitable for " - "global register variables on this target">; - def err_asm_register_size_mismatch : Error<"size of register '%0' does not " - "match variable size">; - def err_asm_bad_register_type : Error<"bad type for named register variable">; - def err_asm_invalid_input_size : Error< - "invalid input size for constraint '%0'">; - def err_asm_invalid_output_size : Error< - "invalid output size for constraint '%0'">; - def err_invalid_asm_cast_lvalue : Error< - "invalid use of a cast in a inline asm context requiring an l-value: " - "remove the cast or build with -fheinous-gnu-extensions">; - def err_invalid_asm_value_for_constraint - : Error <"value '%0' out of range for constraint '%1'">; - def err_asm_non_addr_value_in_memory_constraint : Error < - "reference to a %select{bit-field|vector element|global register variable}0" - " in asm %select{input|output}1 with a memory constraint '%2'">; - def err_asm_input_duplicate_match : Error< - "more than one input constraint matches the same output '%0'">; - - def warn_asm_label_on_auto_decl : Warning< - "ignored asm label '%0' on automatic variable">; - def warn_invalid_asm_cast_lvalue : Warning< - "invalid use of a cast in an inline asm context requiring an l-value: " - "accepted due to -fheinous-gnu-extensions, but clang may remove support " - "for this in the future">; - def warn_asm_mismatched_size_modifier : Warning< - "value size does not match register size specified by the constraint " - "and modifier">, - InGroup<ASMOperandWidths>; - - def note_asm_missing_constraint_modifier : Note< - "use constraint modifier \"%0\"">; - def note_asm_input_duplicate_first : Note< - "constraint '%0' is already present here">; -} - -let CategoryName = "Semantic Issue" in { - -def err_invalid_conversion_between_vectors : Error< - "invalid conversion between vector type%diff{ $ and $|}0,1 of different " - "size">; -def err_invalid_conversion_between_vector_and_integer : Error< - "invalid conversion between vector type %0 and integer type %1 " - "of different size">; - -def err_opencl_function_pointer_variable : Error< - "pointers to functions are not allowed">; - -def err_opencl_taking_function_address : Error< - "taking address of function is not allowed">; - -def err_invalid_conversion_between_vector_and_scalar : Error< - "invalid conversion between vector type %0 and scalar type %1">; - -// C++ member initializers. -def err_only_constructors_take_base_inits : Error< - "only constructors take base initializers">; - -def err_multiple_mem_initialization : Error < - "multiple initializations given for non-static member %0">; -def err_multiple_mem_union_initialization : Error < - "initializing multiple members of union">; -def err_multiple_base_initialization : Error < - "multiple initializations given for base %0">; - -def err_mem_init_not_member_or_class : Error< - "member initializer %0 does not name a non-static data member or base " - "class">; - -def warn_initializer_out_of_order : Warning< - "%select{field|base class}0 %1 will be initialized after " - "%select{field|base}2 %3">, - InGroup<Reorder>, DefaultIgnore; -def warn_abstract_vbase_init_ignored : Warning< - "initializer for virtual base class %0 of abstract class %1 " - "will never be used">, - InGroup<DiagGroup<"abstract-vbase-init">>, DefaultIgnore; - -def err_base_init_does_not_name_class : Error< - "constructor initializer %0 does not name a class">; -def err_base_init_direct_and_virtual : Error< - "base class initializer %0 names both a direct base class and an " - "inherited virtual base class">; -def err_not_direct_base_or_virtual : Error< - "type %0 is not a direct or virtual base of %1">; - -def err_in_class_initializer_non_const : Error< - "non-const static data member must be initialized out of line">; -def err_in_class_initializer_volatile : Error< - "static const volatile data member must be initialized out of line">; -def err_in_class_initializer_bad_type : Error< - "static data member of type %0 must be initialized out of line">; -def ext_in_class_initializer_float_type : ExtWarn< - "in-class initializer for static data member of type %0 is a GNU extension">, - InGroup<GNUStaticFloatInit>; -def ext_in_class_initializer_float_type_cxx11 : ExtWarn< - "in-class initializer for static data member of type %0 requires " - "'constexpr' specifier">, InGroup<StaticFloatInit>, DefaultError; -def note_in_class_initializer_float_type_cxx11 : Note<"add 'constexpr'">; -def err_in_class_initializer_literal_type : Error< - "in-class initializer for static data member of type %0 requires " - "'constexpr' specifier">; -def err_in_class_initializer_non_constant : Error< - "in-class initializer for static data member is not a constant expression">; -def err_in_class_initializer_not_yet_parsed - : Error<"cannot use defaulted default constructor of %0 within the class " - "outside of member functions because %1 has an initializer">; -def err_in_class_initializer_not_yet_parsed_outer_class - : Error<"cannot use defaulted default constructor of %0 within " - "%1 outside of member functions because %2 has an initializer">; - -def ext_in_class_initializer_non_constant : Extension< - "in-class initializer for static data member is not a constant expression; " - "folding it to a constant is a GNU extension">, InGroup<GNUFoldingConstant>; - -def err_thread_dynamic_init : Error< - "initializer for thread-local variable must be a constant expression">; -def err_thread_nontrivial_dtor : Error< - "type of thread-local variable has non-trivial destruction">; -def note_use_thread_local : Note< - "use 'thread_local' to allow this">; - -// C++ anonymous unions and GNU anonymous structs/unions -def ext_anonymous_union : Extension< - "anonymous unions are a C11 extension">, InGroup<C11>; -def ext_gnu_anonymous_struct : Extension< - "anonymous structs are a GNU extension">, InGroup<GNUAnonymousStruct>; -def ext_c11_anonymous_struct : Extension< - "anonymous structs are a C11 extension">, InGroup<C11>; -def err_anonymous_union_not_static : Error< - "anonymous unions at namespace or global scope must be declared 'static'">; -def err_anonymous_union_with_storage_spec : Error< - "anonymous union at class scope must not have a storage specifier">; -def err_anonymous_struct_not_member : Error< - "anonymous %select{structs|structs and classes}0 must be " - "%select{struct or union|class}0 members">; -def err_anonymous_record_member_redecl : Error< - "member of anonymous %select{struct|union}0 redeclares %1">; -def err_anonymous_record_with_type : Error< - "types cannot be declared in an anonymous %select{struct|union}0">; -def ext_anonymous_record_with_type : Extension< - "types declared in an anonymous %select{struct|union}0 are a Microsoft " - "extension">, InGroup<MicrosoftAnonTag>; -def ext_anonymous_record_with_anonymous_type : Extension< - "anonymous types declared in an anonymous %select{struct|union}0 " - "are an extension">, InGroup<DiagGroup<"nested-anon-types">>; -def err_anonymous_record_with_function : Error< - "functions cannot be declared in an anonymous %select{struct|union}0">; -def err_anonymous_record_with_static : Error< - "static members cannot be declared in an anonymous %select{struct|union}0">; -def err_anonymous_record_bad_member : Error< - "anonymous %select{struct|union}0 can only contain non-static data members">; -def err_anonymous_record_nonpublic_member : Error< - "anonymous %select{struct|union}0 cannot contain a " - "%select{private|protected}1 data member">; -def ext_ms_anonymous_record : ExtWarn< - "anonymous %select{structs|unions}0 are a Microsoft extension">, - InGroup<MicrosoftAnonTag>; - -// C++ local classes -def err_reference_to_local_var_in_enclosing_function : Error< - "reference to local variable %0 declared in enclosing function %1">; -def err_reference_to_local_var_in_enclosing_block : Error< - "reference to local variable %0 declared in enclosing block literal">; -def err_reference_to_local_var_in_enclosing_lambda : Error< - "reference to local variable %0 declared in enclosing lambda expression">; -def err_reference_to_local_var_in_enclosing_context : Error< - "reference to local variable %0 declared in enclosing context">; - -def err_static_data_member_not_allowed_in_local_class : Error< - "static data member %0 not allowed in local class %1">; - -// C++ derived classes -def err_base_clause_on_union : Error<"unions cannot have base classes">; -def err_base_must_be_class : Error<"base specifier must name a class">; -def err_union_as_base_class : Error<"unions cannot be base classes">; -def err_circular_inheritance : Error< - "circular inheritance between %0 and %1">; -def err_base_class_has_flexible_array_member : Error< - "base class %0 has a flexible array member">; -def err_incomplete_base_class : Error<"base class has incomplete type">; -def err_duplicate_base_class : Error< - "base class %0 specified more than once as a direct base class">; -def warn_inaccessible_base_class : Warning< - "direct base %0 is inaccessible due to ambiguity:%1">, - InGroup<DiagGroup<"inaccessible-base">>; -// FIXME: better way to display derivation? Pass entire thing into diagclient? -def err_ambiguous_derived_to_base_conv : Error< - "ambiguous conversion from derived class %0 to base class %1:%2">; -def err_ambiguous_memptr_conv : Error< - "ambiguous conversion from pointer to member of %select{base|derived}0 " - "class %1 to pointer to member of %select{derived|base}0 class %2:%3">; - -def err_memptr_conv_via_virtual : Error< - "conversion from pointer to member of class %0 to pointer to member " - "of class %1 via virtual base %2 is not allowed">; - -// C++ member name lookup -def err_ambiguous_member_multiple_subobjects : Error< - "non-static member %0 found in multiple base-class subobjects of type %1:%2">; -def err_ambiguous_member_multiple_subobject_types : Error< - "member %0 found in multiple base classes of different types">; -def note_ambiguous_member_found : Note<"member found by ambiguous name lookup">; -def err_ambiguous_reference : Error<"reference to %0 is ambiguous">; -def note_ambiguous_candidate : Note<"candidate found by name lookup is %q0">; -def err_ambiguous_tag_hiding : Error<"a type named %0 is hidden by a " - "declaration in a different namespace">; -def note_hidden_tag : Note<"type declaration hidden">; -def note_hiding_object : Note<"declaration hides type">; - -// C++ operator overloading -def err_operator_overload_needs_class_or_enum : Error< - "overloaded %0 must have at least one parameter of class " - "or enumeration type">; - -def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">; -def err_operator_overload_static : Error< - "overloaded %0 cannot be a static member function">; -def err_operator_overload_default_arg : Error< - "parameter of overloaded %0 cannot have a default argument">; -def err_operator_overload_must_be : Error< - "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator " - "(has %1 parameter%s1)">; - -def err_operator_overload_must_be_member : Error< - "overloaded %0 must be a non-static member function">; -def err_operator_overload_post_incdec_must_be_int : Error< - "parameter of overloaded post-%select{increment|decrement}1 operator must " - "have type 'int' (not %0)">; - -// C++ allocation and deallocation functions. -def err_operator_new_delete_declared_in_namespace : Error< - "%0 cannot be declared inside a namespace">; -def err_operator_new_delete_declared_static : Error< - "%0 cannot be declared static in global scope">; -def ext_operator_new_delete_declared_inline : ExtWarn< - "replacement function %0 cannot be declared 'inline'">, - InGroup<DiagGroup<"inline-new-delete">>; -def err_operator_new_delete_invalid_result_type : Error< - "%0 must return type %1">; -def err_operator_new_delete_dependent_result_type : Error< - "%0 cannot have a dependent return type; use %1 instead">; -def err_operator_new_delete_too_few_parameters : Error< - "%0 must have at least one parameter">; -def err_operator_new_delete_template_too_few_parameters : Error< - "%0 template must have at least two parameters">; -def warn_operator_new_returns_null : Warning< - "%0 should not return a null pointer unless it is declared 'throw()'" - "%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>; - -def err_operator_new_dependent_param_type : Error< - "%0 cannot take a dependent type as first parameter; " - "use size_t (%1) instead">; -def err_operator_new_param_type : Error< - "%0 takes type size_t (%1) as first parameter">; -def err_operator_new_default_arg: Error< - "parameter of %0 cannot have a default argument">; -def err_operator_delete_dependent_param_type : Error< - "%0 cannot take a dependent type as first parameter; use %1 instead">; -def err_operator_delete_param_type : Error< - "first parameter of %0 must have type %1">; - -// C++ literal operators -def err_literal_operator_outside_namespace : Error< - "literal operator %0 must be in a namespace or global scope">; -def err_literal_operator_id_outside_namespace : Error< - "non-namespace scope '%0' cannot have a literal operator member">; -def err_literal_operator_default_argument : Error< - "literal operator cannot have a default argument">; -// FIXME: This diagnostic sucks -def err_literal_operator_params : Error< - "parameter declaration for literal operator %0 is not valid">; -def err_literal_operator_extern_c : Error< - "literal operator must have C++ linkage">; -def ext_string_literal_operator_template : ExtWarn< - "string literal operator templates are a GNU extension">, - InGroup<GNUStringLiteralOperatorTemplate>; -def warn_user_literal_reserved : Warning< - "user-defined literal suffixes not starting with '_' are reserved" - "%select{; no literal will invoke this operator|}0">, - InGroup<UserDefinedLiterals>; - -// C++ conversion functions -def err_conv_function_not_member : Error< - "conversion function must be a non-static member function">; -def err_conv_function_return_type : Error< - "conversion function cannot have a return type">; -def err_conv_function_with_params : Error< - "conversion function cannot have any parameters">; -def err_conv_function_variadic : Error< - "conversion function cannot be variadic">; -def err_conv_function_to_array : Error< - "conversion function cannot convert to an array type">; -def err_conv_function_to_function : Error< - "conversion function cannot convert to a function type">; -def err_conv_function_with_complex_decl : Error< - "cannot specify any part of a return type in the " - "declaration of a conversion function" - "%select{" - "; put the complete type after 'operator'|" - "; use a typedef to declare a conversion to %1|" - "; use an alias template to declare a conversion to %1|" - "}0">; -def err_conv_function_redeclared : Error< - "conversion function cannot be redeclared">; -def warn_conv_to_self_not_used : Warning< - "conversion function converting %0 to itself will never be used">; -def warn_conv_to_base_not_used : Warning< - "conversion function converting %0 to its base class %1 will never be used">; -def warn_conv_to_void_not_used : Warning< - "conversion function converting %0 to %1 will never be used">; - -def warn_not_compound_assign : Warning< - "use of unary operator that may be intended as compound assignment (%0=)">; - -// C++11 explicit conversion operators -def ext_explicit_conversion_functions : ExtWarn< - "explicit conversion functions are a C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_explicit_conversion_functions : Warning< - "explicit conversion functions are incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; - -// C++11 defaulted functions -def err_defaulted_special_member_params : Error< - "an explicitly-defaulted %select{|copy |move }0constructor cannot " - "have default arguments">; -def err_defaulted_special_member_variadic : Error< - "an explicitly-defaulted %select{|copy |move }0constructor cannot " - "be variadic">; -def err_defaulted_special_member_return_type : Error< - "explicitly-defaulted %select{copy|move}0 assignment operator must " - "return %1">; -def err_defaulted_special_member_quals : Error< - "an explicitly-defaulted %select{copy|move}0 assignment operator may not " - "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">; -def err_defaulted_special_member_volatile_param : Error< - "the parameter for an explicitly-defaulted %select{<<ERROR>>|" - "copy constructor|move constructor|copy assignment operator|" - "move assignment operator|<<ERROR>>}0 may not be volatile">; -def err_defaulted_special_member_move_const_param : Error< - "the parameter for an explicitly-defaulted move " - "%select{constructor|assignment operator}0 may not be const">; -def err_defaulted_special_member_copy_const_param : Error< - "the parameter for this explicitly-defaulted copy " - "%select{constructor|assignment operator}0 is const, but a member or base " - "requires it to be non-const">; -def err_defaulted_copy_assign_not_ref : Error< - "the parameter for an explicitly-defaulted copy assignment operator must be an " - "lvalue reference type">; -def err_incorrect_defaulted_exception_spec : Error< - "exception specification of explicitly defaulted %select{default constructor|" - "copy constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor}0 does not match the " - "calculated one">; -def err_incorrect_defaulted_constexpr : Error< - "defaulted definition of %select{default constructor|copy constructor|" - "move constructor|copy assignment operator|move assignment operator}0 " - "is not constexpr">; -def err_out_of_line_default_deletes : Error< - "defaulting this %select{default constructor|copy constructor|move " - "constructor|copy assignment operator|move assignment operator|destructor}0 " - "would delete it after its first declaration">; -def warn_vbase_moved_multiple_times : Warning< - "defaulted move assignment operator of %0 will move assign virtual base " - "class %1 multiple times">, InGroup<DiagGroup<"multiple-move-vbase">>; -def note_vbase_moved_here : Note< - "%select{%1 is a virtual base class of base class %2 declared here|" - "virtual base class %1 declared here}0">; - -def ext_implicit_exception_spec_mismatch : ExtWarn< - "function previously declared with an %select{explicit|implicit}0 exception " - "specification redeclared with an %select{implicit|explicit}0 exception " - "specification">, InGroup<DiagGroup<"implicit-exception-spec-mismatch">>; - -def warn_ptr_arith_precedes_bounds : Warning< - "the pointer decremented by %0 refers before the beginning of the array">, - InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; -def warn_ptr_arith_exceeds_bounds : Warning< - "the pointer incremented by %0 refers past the end of the array (that " - "contains %1 element%s2)">, - InGroup<ArrayBoundsPointerArithmetic>, DefaultIgnore; -def warn_array_index_precedes_bounds : Warning< - "array index %0 is before the beginning of the array">, - InGroup<ArrayBounds>; -def warn_array_index_exceeds_bounds : Warning< - "array index %0 is past the end of the array (which contains %1 " - "element%s2)">, InGroup<ArrayBounds>; -def note_array_index_out_of_bounds : Note< - "array %0 declared here">; - -def warn_printf_insufficient_data_args : Warning< - "more '%%' conversions than data arguments">, InGroup<Format>; -def warn_printf_data_arg_not_used : Warning< - "data argument not used by format string">, InGroup<FormatExtraArgs>; -def warn_format_invalid_conversion : Warning< - "invalid conversion specifier '%0'">, InGroup<FormatInvalidSpecifier>; -def warn_printf_incomplete_specifier : Warning< - "incomplete format specifier">, InGroup<Format>; -def warn_missing_format_string : Warning< - "format string missing">, InGroup<Format>; -def warn_scanf_nonzero_width : Warning< - "zero field width in scanf format string is unused">, - InGroup<Format>; -def warn_format_conversion_argument_type_mismatch : Warning< - "format specifies type %0 but the argument has " - "%select{type|underlying type}2 %1">, - InGroup<Format>; -def warn_format_conversion_argument_type_mismatch_pedantic : Extension< - "format specifies type %0 but the argument has " - "%select{type|underlying type}2 %1">, - InGroup<FormatPedantic>; -def warn_format_argument_needs_cast : Warning< - "%select{values of type|enum values with underlying type}2 '%0' should not " - "be used as format arguments; add an explicit cast to %1 instead">, - InGroup<Format>; -def warn_printf_positional_arg_exceeds_data_args : Warning < - "data argument position '%0' exceeds the number of data arguments (%1)">, - InGroup<Format>; -def warn_format_zero_positional_specifier : Warning< - "position arguments in format strings start counting at 1 (not 0)">, - InGroup<Format>; -def warn_format_invalid_positional_specifier : Warning< - "invalid position specified for %select{field width|field precision}0">, - InGroup<Format>; -def warn_format_mix_positional_nonpositional_args : Warning< - "cannot mix positional and non-positional arguments in format string">, - InGroup<Format>; -def warn_static_array_too_small : Warning< - "array argument is too small; contains %0 elements, callee requires at least %1">, - InGroup<ArrayBounds>; -def note_callee_static_array : Note< - "callee declares array parameter as static here">; -def warn_empty_format_string : Warning< - "format string is empty">, InGroup<FormatZeroLength>; -def warn_format_string_is_wide_literal : Warning< - "format string should not be a wide string">, InGroup<Format>; -def warn_printf_format_string_contains_null_char : Warning< - "format string contains '\\0' within the string body">, InGroup<Format>; -def warn_printf_format_string_not_null_terminated : Warning< - "format string is not null-terminated">, InGroup<Format>; -def warn_printf_asterisk_missing_arg : Warning< - "'%select{*|.*}0' specified field %select{width|precision}0 is missing a matching 'int' argument">, - InGroup<Format>; -def warn_printf_asterisk_wrong_type : Warning< - "field %select{width|precision}0 should have type %1, but argument has type %2">, - InGroup<Format>; -def warn_printf_nonsensical_optional_amount: Warning< - "%select{field width|precision}0 used with '%1' conversion specifier, resulting in undefined behavior">, - InGroup<Format>; -def warn_printf_nonsensical_flag: Warning< - "flag '%0' results in undefined behavior with '%1' conversion specifier">, - InGroup<Format>; -def warn_format_nonsensical_length: Warning< - "length modifier '%0' results in undefined behavior or no effect with '%1' conversion specifier">, - InGroup<Format>; -def warn_format_non_standard_positional_arg: Warning< - "positional arguments are not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore; -def warn_format_non_standard: Warning< - "'%0' %select{length modifier|conversion specifier}1 is not supported by ISO C">, - InGroup<FormatNonStandard>, DefaultIgnore; -def warn_format_non_standard_conversion_spec: Warning< - "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C">, - InGroup<FormatNonStandard>, DefaultIgnore; -def warn_printf_ignored_flag: Warning< - "flag '%0' is ignored when flag '%1' is present">, - InGroup<Format>; -def warn_printf_empty_objc_flag: Warning< - "missing object format flag">, - InGroup<Format>; -def warn_printf_ObjCflags_without_ObjCConversion: Warning< - "object format flags cannot be used with '%0' conversion specifier">, - InGroup<Format>; -def warn_printf_invalid_objc_flag: Warning< - "'%0' is not a valid object format flag">, - InGroup<Format>; -def warn_scanf_scanlist_incomplete : Warning< - "no closing ']' for '%%[' in scanf format string">, - InGroup<Format>; -def note_format_string_defined : Note<"format string is defined here">; -def note_format_fix_specifier : Note<"did you mean to use '%0'?">; -def note_printf_c_str: Note<"did you mean to call the %0 method?">; - -def warn_null_arg : Warning< - "null passed to a callee that requires a non-null argument">, - InGroup<NonNull>; -def warn_null_ret : Warning< - "null returned from %select{function|method}0 that requires a non-null return value">, - InGroup<NonNull>; - -// CHECK: returning address/reference of stack memory -def warn_ret_stack_addr_ref : Warning< - "%select{address of|reference to}0 stack memory associated with local " - "variable %1 returned">, - InGroup<ReturnStackAddress>; -def warn_ret_local_temp_addr_ref : Warning< - "returning %select{address of|reference to}0 local temporary object">, - InGroup<ReturnStackAddress>; -def warn_ret_addr_label : Warning< - "returning address of label, which is local">, - InGroup<ReturnStackAddress>; -def err_ret_local_block : Error< - "returning block that lives on the local stack">; -def note_ref_var_local_bind : Note< - "binding reference variable %0 here">; - -// Check for initializing a member variable with the address or a reference to -// a constructor parameter. -def warn_bind_ref_member_to_parameter : Warning< - "binding reference member %0 to stack allocated parameter %1">, - InGroup<DanglingField>; -def warn_init_ptr_member_to_parameter_addr : Warning< - "initializing pointer member %0 with the stack address of parameter %1">, - InGroup<DanglingField>; -def warn_bind_ref_member_to_temporary : Warning< - "binding reference %select{|subobject of }1member %0 to a temporary value">, - InGroup<DanglingField>; -def note_ref_or_ptr_member_declared_here : Note< - "%select{reference|pointer}0 member declared here">; -def note_ref_subobject_of_member_declared_here : Note< - "member with reference subobject declared here">; - -// For non-floating point, expressions of the form x == x or x != x -// should result in a warning, since these always evaluate to a constant. -// Array comparisons have similar warnings -def warn_comparison_always : Warning< - "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">, - InGroup<TautologicalCompare>; -def warn_comparison_bitwise_always : Warning< - "bitwise comparison always evaluates to %select{false|true}0">, - InGroup<TautologicalCompare>; -def warn_tautological_overlap_comparison : Warning< - "overlapping comparisons always evaluate to %select{false|true}0">, - InGroup<TautologicalOverlapCompare>, DefaultIgnore; - -def warn_stringcompare : Warning< - "result of comparison against %select{a string literal|@encode}0 is " - "unspecified (use strncmp instead)">, - InGroup<StringCompare>; - -def warn_identity_field_assign : Warning< - "assigning %select{field|instance variable}0 to itself">, - InGroup<SelfAssignmentField>; - -// Type safety attributes -def err_type_tag_for_datatype_not_ice : Error< - "'type_tag_for_datatype' attribute requires the initializer to be " - "an %select{integer|integral}0 constant expression">; -def err_type_tag_for_datatype_too_large : Error< - "'type_tag_for_datatype' attribute requires the initializer to be " - "an %select{integer|integral}0 constant expression " - "that can be represented by a 64 bit integer">; -def warn_type_tag_for_datatype_wrong_kind : Warning< - "this type tag was not designed to be used with this function">, - InGroup<TypeSafety>; -def warn_type_safety_type_mismatch : Warning< - "argument type %0 doesn't match specified %1 type tag " - "%select{that requires %3|}2">, InGroup<TypeSafety>; -def warn_type_safety_null_pointer_required : Warning< - "specified %0 type tag requires a null pointer">, InGroup<TypeSafety>; - -// Generic selections. -def err_assoc_type_incomplete : Error< - "type %0 in generic association incomplete">; -def err_assoc_type_nonobject : Error< - "type %0 in generic association not an object type">; -def err_assoc_type_variably_modified : Error< - "type %0 in generic association is a variably modified type">; -def err_assoc_compatible_types : Error< - "type %0 in generic association compatible with previously specified type %1">; -def note_compat_assoc : Note< - "compatible type %0 specified here">; -def err_generic_sel_no_match : Error< - "controlling expression type %0 not compatible with any generic association type">; -def err_generic_sel_multi_match : Error< - "controlling expression type %0 compatible with %1 generic association types">; - - -// Blocks -def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" - " or pick a deployment target that supports them">; -def err_block_returning_array_function : Error< - "block cannot return %select{array|function}0 type %1">; - -// Builtin annotation -def err_builtin_annotation_first_arg : Error< - "first argument to __builtin_annotation must be an integer">; -def err_builtin_annotation_second_arg : Error< - "second argument to __builtin_annotation must be a non-wide string constant">; - -// CFString checking -def err_cfstring_literal_not_string_constant : Error< - "CFString literal is not a string constant">; -def warn_cfstring_truncated : Warning< - "input conversion stopped due to an input byte that does not " - "belong to the input codeset UTF-8">, - InGroup<DiagGroup<"CFString-literal">>; - -// Statements. -def err_continue_not_in_loop : Error< - "'continue' statement not in loop statement">; -def err_break_not_in_loop_or_switch : Error< - "'break' statement not in loop or switch statement">; -def warn_loop_ctrl_binds_to_inner : Warning< - "'%0' is bound to current loop, GCC binds it to the enclosing loop">, - InGroup<GccCompat>; -def warn_break_binds_to_switch : Warning< - "'break' is bound to loop, GCC binds it to switch">, - InGroup<GccCompat>; -def err_default_not_in_switch : Error< - "'default' statement not in switch statement">; -def err_case_not_in_switch : Error<"'case' statement not in switch statement">; -def warn_bool_switch_condition : Warning< - "switch condition has boolean value">, InGroup<SwitchBool>; -def warn_case_value_overflow : Warning< - "overflow converting case value to switch condition type (%0 to %1)">, - InGroup<Switch>; -def err_duplicate_case : Error<"duplicate case value '%0'">; -def err_duplicate_case_differing_expr : Error< - "duplicate case value: '%0' and '%1' both equal '%2'">; -def warn_case_empty_range : Warning<"empty case range specified">; -def warn_missing_case_for_condition : - Warning<"no case matching constant switch condition '%0'">; - -def warn_def_missing_case : Warning<"%plural{" - "1:enumeration value %1 not explicitly handled in switch|" - "2:enumeration values %1 and %2 not explicitly handled in switch|" - "3:enumeration values %1, %2, and %3 not explicitly handled in switch|" - ":%0 enumeration values not explicitly handled in switch: %1, %2, %3...}0">, - InGroup<SwitchEnum>, DefaultIgnore; - -def warn_missing_case : Warning<"%plural{" - "1:enumeration value %1 not handled in switch|" - "2:enumeration values %1 and %2 not handled in switch|" - "3:enumeration values %1, %2, and %3 not handled in switch|" - ":%0 enumeration values not handled in switch: %1, %2, %3...}0">, - InGroup<Switch>; - -def warn_unannotated_fallthrough : Warning< - "unannotated fall-through between switch labels">, - InGroup<ImplicitFallthrough>, DefaultIgnore; -def warn_unannotated_fallthrough_per_function : Warning< - "unannotated fall-through between switch labels in partly-annotated " - "function">, InGroup<ImplicitFallthroughPerFunction>, DefaultIgnore; -def note_insert_fallthrough_fixit : Note< - "insert '%0;' to silence this warning">; -def note_insert_break_fixit : Note< - "insert 'break;' to avoid fall-through">; -def err_fallthrough_attr_wrong_target : Error< - "clang::fallthrough attribute is only allowed on empty statements">; -def note_fallthrough_insert_semi_fixit : Note<"did you forget ';'?">; -def err_fallthrough_attr_outside_switch : Error< - "fallthrough annotation is outside switch statement">; -def warn_fallthrough_attr_invalid_placement : Warning< - "fallthrough annotation does not directly precede switch label">, - InGroup<ImplicitFallthrough>; -def warn_fallthrough_attr_unreachable : Warning< - "fallthrough annotation in unreachable code">, - InGroup<ImplicitFallthrough>; - -def warn_unreachable_default : Warning< - "default label in switch which covers all enumeration values">, - InGroup<CoveredSwitchDefault>, DefaultIgnore; -def warn_not_in_enum : Warning<"case value not in enumerated type %0">, - InGroup<Switch>; -def warn_not_in_enum_assignment : Warning<"integer constant not in range " - "of enumerated type %0">, InGroup<DiagGroup<"assign-enum">>, DefaultIgnore; -def err_typecheck_statement_requires_scalar : Error< - "statement requires expression of scalar type (%0 invalid)">; -def err_typecheck_statement_requires_integer : Error< - "statement requires expression of integer type (%0 invalid)">; -def err_multiple_default_labels_defined : Error< - "multiple default labels in one switch">; -def err_switch_multiple_conversions : Error< - "multiple conversions from switch condition type %0 to an integral or " - "enumeration type">; -def note_switch_conversion : Note< - "conversion to %select{integral|enumeration}0 type %1">; -def err_switch_explicit_conversion : Error< - "switch condition type %0 requires explicit conversion to %1">; -def err_switch_incomplete_class_type : Error< - "switch condition has incomplete class type %0">; - -def warn_empty_if_body : Warning< - "if statement has empty body">, InGroup<EmptyBody>; -def warn_empty_for_body : Warning< - "for loop has empty body">, InGroup<EmptyBody>; -def warn_empty_range_based_for_body : Warning< - "range-based for loop has empty body">, InGroup<EmptyBody>; -def warn_empty_while_body : Warning< - "while loop has empty body">, InGroup<EmptyBody>; -def warn_empty_switch_body : Warning< - "switch statement has empty body">, InGroup<EmptyBody>; -def note_empty_body_on_separate_line : Note< - "put the semicolon on a separate line to silence this warning">; - -def err_va_start_used_in_non_variadic_function : Error< - "'va_start' used in function with fixed args">; -def err_va_start_used_in_wrong_abi_function : Error< - "'va_start' used in %select{System V|Win64}0 ABI function">; -def err_ms_va_start_used_in_sysv_function : Error< - "'__builtin_ms_va_start' used in System V ABI function">; -def warn_second_parameter_of_va_start_not_last_named_argument : Warning< - "second parameter of 'va_start' not last named argument">, InGroup<Varargs>; -def warn_va_start_of_reference_type_is_undefined : Warning< - "'va_start' has undefined behavior with reference types">, InGroup<Varargs>; -def err_first_argument_to_va_arg_not_of_type_va_list : Error< - "first argument to 'va_arg' is of type %0 and not 'va_list'">; -def err_second_parameter_to_va_arg_incomplete: Error< - "second argument to 'va_arg' is of incomplete type %0">; -def err_second_parameter_to_va_arg_abstract: Error< - "second argument to 'va_arg' is of abstract type %0">; -def warn_second_parameter_to_va_arg_not_pod : Warning< - "second argument to 'va_arg' is of non-POD type %0">, - InGroup<NonPODVarargs>, DefaultError; -def warn_second_parameter_to_va_arg_ownership_qualified : Warning< - "second argument to 'va_arg' is of ARC ownership-qualified type %0">, - InGroup<NonPODVarargs>, DefaultError; -def warn_second_parameter_to_va_arg_never_compatible : Warning< - "second argument to 'va_arg' is of promotable type %0; this va_arg has " - "undefined behavior because arguments will be promoted to %1">, InGroup<Varargs>; - -def warn_return_missing_expr : Warning< - "non-void %select{function|method}1 %0 should return a value">, DefaultError, - InGroup<ReturnType>; -def ext_return_missing_expr : ExtWarn< - "non-void %select{function|method}1 %0 should return a value">, DefaultError, - InGroup<ReturnType>; -def ext_return_has_expr : ExtWarn< - "%select{void function|void method|constructor|destructor}1 %0 " - "should not return a value">, - DefaultError, InGroup<ReturnType>; -def ext_return_has_void_expr : Extension< - "void %select{function|method|block}1 %0 should not return void expression">; -def err_return_init_list : Error< - "%select{void function|void method|constructor|destructor}1 %0 " - "must not return a value">; -def err_ctor_dtor_returns_void : Error< - "%select{constructor|destructor}1 %0 must not return void expression">; -def warn_noreturn_function_has_return_expr : Warning< - "function %0 declared 'noreturn' should not return">, - InGroup<InvalidNoreturn>; -def warn_falloff_noreturn_function : Warning< - "function declared 'noreturn' should not return">, - InGroup<InvalidNoreturn>; -def err_noreturn_block_has_return_expr : Error< - "block declared 'noreturn' should not return">; -def err_noreturn_missing_on_first_decl : Error< - "function declared '[[noreturn]]' after its first declaration">; -def note_noreturn_missing_first_decl : Note< - "declaration missing '[[noreturn]]' attribute is here">; -def err_carries_dependency_missing_on_first_decl : Error< - "%select{function|parameter}0 declared '[[carries_dependency]]' " - "after its first declaration">; -def note_carries_dependency_missing_first_decl : Note< - "declaration missing '[[carries_dependency]]' attribute is here">; -def err_carries_dependency_param_not_function_decl : Error< - "'[[carries_dependency]]' attribute only allowed on parameter in a function " - "declaration or lambda">; -def err_block_on_nonlocal : Error< - "__block attribute not allowed, only allowed on local variables">; -def err_block_on_vm : Error< - "__block attribute not allowed on declaration with a variably modified type">; - -def err_shufflevector_non_vector : Error< - "first two arguments to __builtin_shufflevector must be vectors">; -def err_shufflevector_incompatible_vector : Error< - "first two arguments to __builtin_shufflevector must have the same type">; -def err_shufflevector_nonconstant_argument : Error< - "index for __builtin_shufflevector must be a constant integer">; -def err_shufflevector_argument_too_large : Error< - "index for __builtin_shufflevector must be less than the total number " - "of vector elements">; - -def err_convertvector_non_vector : Error< - "first argument to __builtin_convertvector must be a vector">; -def err_convertvector_non_vector_type : Error< - "second argument to __builtin_convertvector must be a vector type">; -def err_convertvector_incompatible_vector : Error< - "first two arguments to __builtin_convertvector must have the same number of elements">; - -def err_first_argument_to_cwsc_not_call : Error< - "first argument to __builtin_call_with_static_chain must be a non-member call expression">; -def err_first_argument_to_cwsc_block_call : Error< - "first argument to __builtin_call_with_static_chain must not be a block call">; -def err_first_argument_to_cwsc_builtin_call : Error< - "first argument to __builtin_call_with_static_chain must not be a builtin call">; -def err_first_argument_to_cwsc_pdtor_call : Error< - "first argument to __builtin_call_with_static_chain must not be a pseudo-destructor call">; -def err_second_argument_to_cwsc_not_pointer : Error< - "second argument to __builtin_call_with_static_chain must be of pointer type">; - -def err_vector_incorrect_num_initializers : Error< - "%select{too many|too few}0 elements in vector initialization (expected %1 elements, have %2)">; -def err_altivec_empty_initializer : Error<"expected initializer">; - -def err_invalid_neon_type_code : Error< - "incompatible constant for this __builtin_neon function">; -def err_argument_invalid_range : Error< - "argument should be a value from %0 to %1">; -def warn_neon_vector_initializer_non_portable : Warning< - "vector initializers are not compatible with NEON intrinsics in big endian " - "mode">, InGroup<DiagGroup<"nonportable-vector-initialization">>; -def note_neon_vector_initializer_non_portable : Note< - "consider using vld1_%0%1() to initialize a vector from memory, or " - "vcreate_%0%1() to initialize from an integer constant">; -def note_neon_vector_initializer_non_portable_q : Note< - "consider using vld1q_%0%1() to initialize a vector from memory, or " - "vcombine_%0%1(vcreate_%0%1(), vcreate_%0%1()) to initialize from integer " - "constants">; -def err_systemz_invalid_tabort_code : Error< - "invalid transaction abort code">; -def err_64_bit_builtin_32_bit_tgt : Error< - "this builtin is only available on 64-bit targets">; -def err_ppc_builtin_only_on_pwr7 : Error< - "this builtin is only valid on POWER7 or later CPUs">; -def err_x86_builtin_32_bit_tgt : Error< - "this builtin is only available on x86-64 targets">; - -def err_builtin_longjmp_unsupported : Error< - "__builtin_longjmp is not supported for the current target">; -def err_builtin_setjmp_unsupported : Error< - "__builtin_setjmp is not supported for the current target">; - -def err_builtin_longjmp_invalid_val : Error< - "argument to __builtin_longjmp must be a constant 1">; -def err_builtin_requires_language : Error<"'%0' is only available in %1">; - -def err_constant_integer_arg_type : Error< - "argument to %0 must be a constant integer">; - -def ext_mixed_decls_code : Extension< - "ISO C90 forbids mixing declarations and code">, - InGroup<DiagGroup<"declaration-after-statement">>; - -def err_non_local_variable_decl_in_for : Error< - "declaration of non-local variable in 'for' loop">; -def err_non_variable_decl_in_for : Error< - "non-variable declaration in 'for' loop">; -def err_toomany_element_decls : Error< - "only one element declaration is allowed">; -def err_selector_element_not_lvalue : Error< - "selector element is not a valid lvalue">; -def err_selector_element_type : Error< - "selector element type %0 is not a valid object">; -def err_selector_element_const_type : Error< - "selector element of type %0 cannot be a constant l-value expression">; -def err_collection_expr_type : Error< - "the type %0 is not a pointer to a fast-enumerable object">; -def warn_collection_expr_type : Warning< - "collection expression type %0 may not respond to %1">; - -def err_invalid_conversion_between_ext_vectors : Error< - "invalid conversion between ext-vector type %0 and %1">; - -def warn_duplicate_attribute_exact : Warning< - "attribute %0 is already applied">, InGroup<IgnoredAttributes>; - -def warn_duplicate_attribute : Warning< - "attribute %0 is already applied with different parameters">, - InGroup<IgnoredAttributes>; - -def warn_sync_fetch_and_nand_semantics_change : Warning< - "the semantics of this intrinsic changed with GCC " - "version 4.4 - the newer semantics are provided here">, - InGroup<DiagGroup<"sync-fetch-and-nand-semantics-changed">>; - -// Type -def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">; -def warn_receiver_forward_class : Warning< - "receiver %0 is a forward class and corresponding @interface may not exist">, - InGroup<ForwardClassReceiver>; -def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; -def ext_missing_declspec : ExtWarn< - "declaration specifier missing, defaulting to 'int'">; -def ext_missing_type_specifier : ExtWarn< - "type specifier missing, defaults to 'int'">, - InGroup<ImplicitInt>; -def err_decimal_unsupported : Error< - "GNU decimal type extension not supported">; -def err_missing_type_specifier : Error< - "C++ requires a type specifier for all declarations">; -def err_objc_array_of_interfaces : Error< - "array of interface %0 is invalid (probably should be an array of pointers)">; -def ext_c99_array_usage : Extension< - "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " - "feature">, InGroup<C99>; -def err_c99_array_usage_cxx : Error< - "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 " - "feature, not permitted in C++">; - def err_type_requires_extension : Error< - "use of type %0 requires %1 extension to be enabled">; -def err_int128_unsupported : Error< - "__int128 is not supported on this target">; -def err_nsconsumed_attribute_mismatch : Error< - "overriding method has mismatched ns_consumed attribute on its" - " parameter">; -def err_nsreturns_retained_attribute_mismatch : Error< - "overriding method has mismatched ns_returns_%select{not_retained|retained}0" - " attributes">; - -def note_getter_unavailable : Note< - "or because setter is declared here, but no getter method %0 is found">; -def err_invalid_protocol_qualifiers : Error< - "invalid protocol qualifiers on non-ObjC type">; -def warn_ivar_use_hidden : Warning< - "local declaration of %0 hides instance variable">, - InGroup<DiagGroup<"shadow-ivar">>; -def warn_direct_initialize_call : Warning< - "explicit call to +initialize results in duplicate call to +initialize">, - InGroup<ExplicitInitializeCall>; -def warn_direct_super_initialize_call : Warning< - "explicit call to [super initialize] should only be in implementation " - "of +initialize">, - InGroup<ExplicitInitializeCall>; -def error_ivar_use_in_class_method : Error< - "instance variable %0 accessed in class method">; -def error_implicit_ivar_access : Error< - "instance variable %0 cannot be accessed because 'self' has been redeclared">; -def error_private_ivar_access : Error<"instance variable %0 is private">, - AccessControl; -def error_protected_ivar_access : Error<"instance variable %0 is protected">, - AccessControl; -def warn_maynot_respond : Warning<"%0 may not respond to %1">; -def ext_typecheck_base_super : Warning< - "method parameter type " - "%diff{$ does not match super class method parameter type $|" - "does not match super class method parameter type}0,1">, - InGroup<SuperSubClassMismatch>, DefaultIgnore; -def warn_missing_method_return_type : Warning< - "method has no return type specified; defaults to 'id'">, - InGroup<MissingMethodReturnType>, DefaultIgnore; -def warn_direct_ivar_access : Warning<"instance variable %0 is being " - "directly accessed">, InGroup<DiagGroup<"direct-ivar-access">>, DefaultIgnore; - -// Spell-checking diagnostics -def err_unknown_typename : Error< - "unknown type name %0">; -def err_unknown_type_or_class_name_suggest : Error< - "unknown %select{type|class}1 name %0; did you mean %2?">; -def err_unknown_typename_suggest : Error< - "unknown type name %0; did you mean %1?">; -def err_unknown_nested_typename_suggest : Error< - "no type named %0 in %1; did you mean %select{|simply }2%3?">; -def err_no_member_suggest : Error<"no member named %0 in %1; did you mean %select{|simply }2%3?">; -def err_undeclared_use_suggest : Error< - "use of undeclared %0; did you mean %1?">; -def err_undeclared_var_use_suggest : Error< - "use of undeclared identifier %0; did you mean %1?">; -def err_no_template_suggest : Error<"no template named %0; did you mean %1?">; -def err_no_member_template_suggest : Error< - "no template named %0 in %1; did you mean %select{|simply }2%3?">; -def err_mem_init_not_member_or_class_suggest : Error< - "initializer %0 does not name a non-static data member or base " - "class; did you mean the %select{base class|member}1 %2?">; -def err_field_designator_unknown_suggest : Error< - "field designator %0 does not refer to any field in type %1; did you mean " - "%2?">; -def err_typecheck_member_reference_ivar_suggest : Error< - "%0 does not have a member named %1; did you mean %2?">; -def err_property_not_found_suggest : Error< - "property %0 not found on object of type %1; did you mean %2?">; -def err_ivar_access_using_property_syntax_suggest : Error< - "property %0 not found on object of type %1; did you mean to access instance variable %2?">; -def warn_property_access_suggest : Warning< -"property %0 not found on object of type %1; did you mean to access property %2?">, -InGroup<PropertyAccessDotSyntax>; -def err_property_found_suggest : Error< - "property %0 found on object of type %1; did you mean to access " - "it with the \".\" operator?">; -def err_undef_interface_suggest : Error< - "cannot find interface declaration for %0; did you mean %1?">; -def warn_undef_interface_suggest : Warning< - "cannot find interface declaration for %0; did you mean %1?">; -def err_undef_superclass_suggest : Error< - "cannot find interface declaration for %0, superclass of %1; did you mean " - "%2?">; -def err_undeclared_protocol_suggest : Error< - "cannot find protocol declaration for %0; did you mean %1?">; -def note_base_class_specified_here : Note< - "base class %0 specified here">; -def err_using_directive_suggest : Error< - "no namespace named %0; did you mean %1?">; -def err_using_directive_member_suggest : Error< - "no namespace named %0 in %1; did you mean %select{|simply }2%3?">; -def note_namespace_defined_here : Note<"namespace %0 defined here">; -def err_sizeof_pack_no_pack_name_suggest : Error< - "%0 does not refer to the name of a parameter pack; did you mean %1?">; -def note_parameter_pack_here : Note<"parameter pack %0 declared here">; - -def err_uncasted_use_of_unknown_any : Error< - "%0 has unknown type; cast it to its declared type to use it">; -def err_uncasted_call_of_unknown_any : Error< - "%0 has unknown return type; cast the call to its declared return type">; -def err_uncasted_send_to_unknown_any_method : Error< - "no known method %select{%objcinstance1|%objcclass1}0; cast the " - "message send to the method's return type">; -def err_unsupported_unknown_any_decl : Error< - "%0 has unknown type, which is not supported for this kind of declaration">; -def err_unsupported_unknown_any_expr : Error< - "unsupported expression with unknown type">; -def err_unsupported_unknown_any_call : Error< - "call to unsupported expression with unknown type">; -def err_unknown_any_addrof : Error< - "the address of a declaration with unknown type " - "can only be cast to a pointer type">; -def err_unknown_any_var_function_type : Error< - "variable %0 with unknown type cannot be given a function type">; -def err_unknown_any_function : Error< - "function %0 with unknown type must be given a function type">; - -def err_filter_expression_integral : Error< - "filter expression type should be an integral value not %0">; - -def err_non_asm_stmt_in_naked_function : Error< - "non-ASM statement in naked function is not supported">; -def err_asm_naked_this_ref : Error< - "'this' pointer references not allowed in naked functions">; -def err_asm_naked_parm_ref : Error< - "parameter references not allowed in naked functions">; - -def ext_deprecated_attr_is_a_cxx14_extension : ExtWarn< - "use of the 'deprecated' attribute is a C++14 extension">, InGroup<CXX14>; - -// OpenCL warnings and errors. -def err_invalid_astype_of_different_size : Error< - "invalid reinterpretation: sizes of %0 and %1 must match">; -def err_static_kernel : Error< - "kernel functions cannot be declared static">; -def err_opencl_ptrptr_kernel_param : Error< - "kernel parameter cannot be declared as a pointer to a pointer">; -def err_opencl_private_ptr_kernel_param : Error< - "kernel parameter cannot be declared as a pointer to the __private address space">; -def err_opencl_non_kernel_variable : Error< - "non-kernel function variable cannot be declared in %0 address space">; -def err_static_function_scope : Error< - "variables in function scope cannot be declared static">; -def err_opencl_bitfields : Error< - "bitfields are not supported in OpenCL">; -def err_opencl_vla : Error< - "variable length arrays are not supported in OpenCL">; -def err_bad_kernel_param_type : Error< - "%0 cannot be used as the type of a kernel parameter">; -def err_record_with_pointers_kernel_param : Error< - "%select{struct|union}0 kernel parameters may not contain pointers">; -def note_within_field_of_type : Note< - "within field of type %0 declared here">; -def note_illegal_field_declared_here : Note< - "field of illegal %select{type|pointer type}0 %1 declared here">; -def err_event_t_global_var : Error< - "the event_t type cannot be used to declare a program scope variable">; -def err_event_t_struct_field : Error< - "the event_t type cannot be used to declare a structure or union field">; -def err_event_t_addr_space_qual : Error< - "the event_t type can only be used with __private address space qualifier">; -def err_expected_kernel_void_return_type : Error< - "kernel must have void return type">; -def err_sampler_argument_required : Error< - "sampler_t variable required - got %0">; -def err_wrong_sampler_addressspace: Error< - "sampler type cannot be used with the __local and __global address space qualifiers">; -def err_opencl_global_invalid_addr_space : Error< - "program scope variable must reside in %0 address space">; -def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">; -def err_opencl_kernel_attr : - Error<"attribute %0 can only be applied to a kernel function">; -def err_opencl_return_value_with_address_space : Error< - "return value cannot be qualified with address space">; -def err_opencl_constant_no_init : Error< - "variable in constant address space must be initialized">; -def err_atomic_init_constant : Error< - "atomic variable can only be assigned to a compile time constant" - " in the declaration statement in the program scope">; -def err_opencl_implicit_vector_conversion : Error< - "implicit conversions between vector types (%0 and %1) are not permitted">; - -// OpenCL Section 6.8.g -def err_opencl_unknown_type_specifier : Error< - "OpenCL does not support the '%0' %select{type qualifier|storage class specifier}1">; - -} // end of sema category - -let CategoryName = "OpenMP Issue" in { -// OpenMP support. -def err_omp_expected_var_arg : Error< - "%0 is not a global variable, static local variable or static data member">; -def err_omp_expected_var_arg_suggest : Error< - "%0 is not a global variable, static local variable or static data member; " - "did you mean %1">; -def err_omp_global_var_arg : Error< - "arguments of '#pragma omp %0' must have %select{global storage|static storage duration}1">; -def err_omp_ref_type_arg : Error< - "arguments of '#pragma omp %0' cannot be of reference type %1">; -def err_omp_var_scope : Error< - "'#pragma omp %0' must appear in the scope of the %q1 variable declaration">; -def err_omp_var_used : Error< - "'#pragma omp %0' must precede all references to variable %q1">; -def err_omp_var_thread_local : Error< - "variable %0 cannot be threadprivate because it is %select{thread-local|a global named register variable}1">; -def err_omp_private_incomplete_type : Error< - "a private variable with incomplete type %0">; -def err_omp_firstprivate_incomplete_type : Error< - "a firstprivate variable with incomplete type %0">; -def err_omp_lastprivate_incomplete_type : Error< - "a lastprivate variable with incomplete type %0">; -def err_omp_reduction_incomplete_type : Error< - "a reduction list item with incomplete type %0">; -def err_omp_unexpected_clause_value : Error< - "expected %0 in OpenMP clause '%1'">; -def err_omp_expected_var_name : Error< - "expected variable name">; -def err_omp_expected_var_name_or_array_item : Error< - "expected variable name, array element or array section">; -def note_omp_task_predetermined_firstprivate_here : Note< - "predetermined as a firstprivate in a task construct here">; -def err_omp_threadprivate_incomplete_type : Error< - "threadprivate variable with incomplete type %0">; -def err_omp_no_dsa_for_variable : Error< - "variable %0 must have explicitly specified data sharing attributes">; -def err_omp_wrong_dsa : Error< - "%0 variable cannot be %1">; -def err_omp_variably_modified_type_not_supported : Error< - "arguments of OpenMP clause '%0' in '#pragma omp %2' directive cannot be of variably-modified type %1">; -def note_omp_explicit_dsa : Note< - "defined as %0">; -def note_omp_predetermined_dsa : Note< - "%select{static data member is predetermined as shared|" - "variable with static storage duration is predetermined as shared|" - "loop iteration variable is predetermined as private|" - "loop iteration variable is predetermined as linear|" - "loop iteration variable is predetermined as lastprivate|" - "constant variable is predetermined as shared|" - "global variable is predetermined as shared|" - "non-shared variable in a task construct is predetermined as firstprivate|" - "variable with automatic storage duration is predetermined as private}0" - "%select{|; perhaps you forget to enclose 'omp %2' directive into a parallel or another task region?}1">; -def note_omp_implicit_dsa : Note< - "implicitly determined as %0">; -def err_omp_loop_var_dsa : Error< - "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">; -def err_omp_not_for : Error< - "%select{statement after '#pragma omp %1' must be a for loop|" - "expected %2 for loops after '#pragma omp %1'%select{|, but found only %4}3}0">; -def note_omp_collapse_ordered_expr : Note< - "as specified in %select{'collapse'|'ordered'|'collapse' and 'ordered'}0 clause%select{||s}0">; -def err_omp_negative_expression_in_clause : Error< - "argument to '%0' clause must be a %select{non-negative|strictly positive}1 integer value">; -def err_omp_not_integral : Error< - "expression must have integral or unscoped enumeration " - "type, not %0">; -def err_omp_incomplete_type : Error< - "expression has incomplete class type %0">; -def err_omp_explicit_conversion : Error< - "expression requires explicit conversion from %0 to %1">; -def note_omp_conversion_here : Note< - "conversion to %select{integral|enumeration}0 type %1 declared here">; -def err_omp_ambiguous_conversion : Error< - "ambiguous conversion from type %0 to an integral or unscoped " - "enumeration type">; -def err_omp_required_access : Error< - "%0 variable must be %1">; -def err_omp_const_variable : Error< - "const-qualified variable cannot be %0">; -def err_omp_const_reduction_list_item : Error< - "const-qualified list item cannot be reduction">; -def err_omp_linear_incomplete_type : Error< - "a linear variable with incomplete type %0">; -def err_omp_linear_expected_int_or_ptr : Error< - "argument of a linear clause should be of integral or pointer " - "type, not %0">; -def warn_omp_linear_step_zero : Warning< - "zero linear step (%0 %select{|and other variables in clause }1should probably be const)">, - InGroup<OpenMPClauses>; -def warn_omp_alignment_not_power_of_two : Warning< - "aligned clause will be ignored because the requested alignment is not a power of 2">, - InGroup<OpenMPClauses>; -def err_omp_aligned_expected_array_or_ptr : Error< - "argument of aligned clause should be array" - "%select{ or pointer|, pointer, reference to array or reference to pointer}1" - ", not %0">; -def err_omp_aligned_twice : Error< - "a variable cannot appear in more than one aligned clause">; -def err_omp_local_var_in_threadprivate_init : Error< - "variable with local storage in initial value of threadprivate variable">; -def err_omp_loop_not_canonical_init : Error< - "initialization clause of OpenMP for loop is not in canonical form " - "('var = init' or 'T var = init')">; -def ext_omp_loop_not_canonical_init : ExtWarn< - "initialization clause of OpenMP for loop is not in canonical form " - "('var = init' or 'T var = init')">, InGroup<OpenMPLoopForm>; -def err_omp_loop_not_canonical_cond : Error< - "condition of OpenMP for loop must be a relational comparison " - "('<', '<=', '>', or '>=') of loop variable %0">; -def err_omp_loop_not_canonical_incr : Error< - "increment clause of OpenMP for loop must perform simple addition " - "or subtraction on loop variable %0">; -def err_omp_loop_variable_type : Error< - "variable must be of integer or %select{pointer|random access iterator}0 type">; -def err_omp_loop_incr_not_compatible : Error< - "increment expression must cause %0 to %select{decrease|increase}1 " - "on each iteration of OpenMP for loop">; -def note_omp_loop_cond_requres_compatible_incr : Note< - "loop step is expected to be %select{negative|positive}0 due to this condition">; -def err_omp_loop_diff_cxx : Error< - "could not calculate number of iterations calling 'operator-' with " - "upper and lower loop bounds">; -def err_omp_loop_cannot_use_stmt : Error< - "'%0' statement cannot be used in OpenMP for loop">; -def err_omp_simd_region_cannot_use_stmt : Error< - "'%0' statement cannot be used in OpenMP simd region">; -def warn_omp_loop_64_bit_var : Warning< - "OpenMP loop iteration variable cannot have more than 64 bits size and will be narrowed">, - InGroup<OpenMPLoopForm>; -def err_omp_unknown_reduction_identifier : Error< - "incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'">; -def err_omp_reduction_type_array : Error< - "a reduction list item with array type %0">; -def err_omp_reduction_ref_type_arg : Error< - "argument of OpenMP clause 'reduction' must reference the same object in all threads">; -def err_omp_clause_not_arithmetic_type_arg : Error< - "arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of %select{scalar|arithmetic}0 type">; -def err_omp_clause_floating_type_arg : Error< - "arguments of OpenMP clause 'reduction' with bitwise operators cannot be of floating type">; -def err_omp_once_referenced : Error< - "variable can appear only once in OpenMP '%0' clause">; -def note_omp_referenced : Note< - "previously referenced here">; -def err_omp_reduction_in_task : Error< - "reduction variables may not be accessed in an explicit task">; -def err_omp_reduction_id_not_compatible : Error< - "list item of type %0 is not valid for specified reduction operation: unable to provide default initialization value">; -def err_omp_prohibited_region : Error< - "region cannot be%select{| closely}0 nested inside '%1' region" - "%select{|; perhaps you forget to enclose 'omp %3' directive into a parallel region?|" - "; perhaps you forget to enclose 'omp %3' directive into a for or a parallel for region with 'ordered' clause?|" - "; perhaps you forget to enclose 'omp %3' directive into a target region?|" - "; perhaps you forget to enclose 'omp %3' directive into a teams region?}2">; -def err_omp_prohibited_region_simd : Error< - "OpenMP constructs may not be nested inside a simd region">; -def err_omp_prohibited_region_atomic : Error< - "OpenMP constructs may not be nested inside an atomic region">; -def err_omp_prohibited_region_critical_same_name : Error< - "cannot nest 'critical' regions having the same name %0">; -def note_omp_previous_critical_region : Note< - "previous 'critical' region starts here">; -def err_omp_sections_not_compound_stmt : Error< - "the statement for '#pragma omp sections' must be a compound statement">; -def err_omp_parallel_sections_not_compound_stmt : Error< - "the statement for '#pragma omp parallel sections' must be a compound statement">; -def err_omp_orphaned_section_directive : Error< - "%select{orphaned 'omp section' directives are prohibited, it|'omp section' directive}0" - " must be closely nested to a sections region%select{|, not a %1 region}0">; -def err_omp_sections_substmt_not_section : Error< - "statement in 'omp sections' directive must be enclosed into a section region">; -def err_omp_parallel_sections_substmt_not_section : Error< - "statement in 'omp parallel sections' directive must be enclosed into a section region">; -def err_omp_parallel_reduction_in_task_firstprivate : Error< - "argument of a reduction clause of a %0 construct must not appear in a firstprivate clause on a task construct">; -def err_omp_atomic_read_not_expression_statement : Error< - "the statement for 'atomic read' must be an expression statement of form 'v = x;'," - " where v and x are both lvalue expressions with scalar type">; -def note_omp_atomic_read_write: Note< - "%select{expected an expression statement|expected built-in assignment operator|expected expression of scalar type|expected lvalue expression}0">; -def err_omp_atomic_write_not_expression_statement : Error< - "the statement for 'atomic write' must be an expression statement of form 'x = expr;'," - " where x is a lvalue expression with scalar type">; -def err_omp_atomic_update_not_expression_statement : Error< - "the statement for 'atomic update' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x'," - " where x is an l-value expression with scalar type">; -def err_omp_atomic_not_expression_statement : Error< - "the statement for 'atomic' must be an expression statement of form '++x;', '--x;', 'x++;', 'x--;', 'x binop= expr;', 'x = x binop expr' or 'x = expr binop x'," - " where x is an l-value expression with scalar type">; -def note_omp_atomic_update: Note< - "%select{expected an expression statement|expected built-in binary or unary operator|expected unary decrement/increment operation|" - "expected expression of scalar type|expected assignment expression|expected built-in binary operator|" - "expected one of '+', '*', '-', '/', '&', '^', '%|', '<<', or '>>' built-in operations|expected in right hand side of expression}0">; -def err_omp_atomic_capture_not_expression_statement : Error< - "the statement for 'atomic capture' must be an expression statement of form 'v = ++x;', 'v = --x;', 'v = x++;', 'v = x--;', 'v = x binop= expr;', 'v = x = x binop expr' or 'v = x = expr binop x'," - " where x and v are both l-value expressions with scalar type">; -def err_omp_atomic_capture_not_compound_statement : Error< - "the statement for 'atomic capture' must be a compound statement of form '{v = x; x binop= expr;}', '{x binop= expr; v = x;}'," - " '{v = x; x = x binop expr;}', '{v = x; x = expr binop x;}', '{x = x binop expr; v = x;}', '{x = expr binop x; v = x;}' or '{v = x; x = expr;}'," - " '{v = x; x++;}', '{v = x; ++x;}', '{++x; v = x;}', '{x++; v = x;}', '{v = x; x--;}', '{v = x; --x;}', '{--x; v = x;}', '{x--; v = x;}'" - " where x is an l-value expression with scalar type">; -def note_omp_atomic_capture: Note< - "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">; -def err_omp_atomic_several_clauses : Error< - "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update' or 'capture' clause">; -def note_omp_atomic_previous_clause : Note< - "'%0' clause used here">; -def err_omp_target_contains_not_only_teams : Error< - "target construct with nested teams region contains statements outside of the teams construct">; -def note_omp_nested_teams_construct_here : Note< - "nested teams construct here">; -def note_omp_nested_statement_here : Note< - "%select{statement|directive}0 outside teams construct here">; -def err_omp_single_copyprivate_with_nowait : Error< - "the 'copyprivate' clause must not be used with the 'nowait' clause">; -def note_omp_nowait_clause_here : Note< - "'nowait' clause is here">; -def err_omp_wrong_cancel_region : Error< - "one of 'for', 'parallel', 'sections' or 'taskgroup' is expected">; -def err_omp_parent_cancel_region_nowait : Error< - "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be nowait">; -def err_omp_parent_cancel_region_ordered : Error< - "parent region for 'omp %select{cancellation point/cancel}0' construct cannot be ordered">; -def err_omp_array_section_use : Error<"OpenMP array section is not allowed here">; -def err_omp_typecheck_section_value : Error< - "subscripted value is not an array or pointer">; -def err_omp_typecheck_section_not_integer : Error< - "array section %select{lower bound|length}0 is not an integer">; -def err_omp_section_function_type : Error< - "section of pointer to function type %0">; -def warn_omp_section_is_char : Warning<"array section %select{lower bound|length}0 is of type 'char'">, - InGroup<CharSubscript>, DefaultIgnore; -def err_omp_section_incomplete_type : Error< - "section of pointer to incomplete type %0">; -def err_omp_section_negative : Error< - "section %select{lower bound|length}0 is evaluated to a negative value %1">; -def err_omp_section_length_undefined : Error< - "section length is unspecified and cannot be inferred because subscripted value is %select{not an array|an array of unknown bound}0">; -def err_omp_wrong_linear_modifier : Error< - "expected %select{'val' modifier|one of 'ref', val' or 'uval' modifiers}0">; -def err_omp_wrong_linear_modifier_non_reference : Error< - "variable of non-reference type %0 can be used only with 'val' modifier, but used with '%1'">; -def err_omp_wrong_simdlen_safelen_values : Error< - "the value of 'simdlen' parameter must be less than or equal to the value of the 'safelen' parameter">; -def err_omp_wrong_if_directive_name_modifier : Error< - "directive name modifier '%0' is not allowed for '#pragma omp %1'">; -def err_omp_no_more_if_clause : Error< - "no more 'if' clause is allowed">; -def err_omp_unnamed_if_clause : Error< - "expected %select{|one of}0 %1 directive name modifier%select{|s}0">; -def note_omp_previous_named_if_clause : Note< - "previous clause with directive name modifier specified here">; -def err_omp_ordered_directive_with_param : Error< - "'ordered' directive %select{without any clauses|with 'threads' clause}0 cannot be closely nested inside ordered region with specified parameter">; -def err_omp_ordered_directive_without_param : Error< - "'ordered' directive with 'depend' clause cannot be closely nested inside ordered region without specified parameter">; -def note_omp_ordered_param : Note< - "'ordered' clause with specified parameter">; -def err_omp_expected_base_var_name : Error< - "expected variable name as a base of the array %select{subscript|section}0">; -def err_omp_map_shared_storage : Error< - "variable already marked as mapped in current construct">; -def err_omp_not_mappable_type : Error< - "type %0 is not mappable to target">; -def note_omp_polymorphic_in_target : Note< - "mappable type cannot be polymorphic">; -def note_omp_static_member_in_target : Note< - "mappable type cannot contain static members">; -def err_omp_threadprivate_in_map : Error< - "threadprivate variables are not allowed in map clause">; -def err_omp_wrong_ordered_loop_count : Error< - "the parameter of the 'ordered' clause must be greater than or equal to the parameter of the 'collapse' clause">; -def note_collapse_loop_count : Note< - "parameter of the 'collapse' clause">; -def err_omp_grainsize_num_tasks_mutually_exclusive : Error< - "'%0' and '%1' clause are mutually exclusive and may not appear on the same directive">; -def note_omp_previous_grainsize_num_tasks : Note< - "'%0' clause is specified here">; -def err_omp_hint_clause_no_name : Error< - "the name of the construct must be specified in presence of 'hint' clause">; -def err_omp_critical_with_hint : Error< - "constructs with the same name must have a 'hint' clause with the same value">; -def note_omp_critical_hint_here : Note< - "%select{|previous }0'hint' clause with value '%1'">; -def note_omp_critical_no_hint : Note< - "%select{|previous }0directive with no 'hint' clause specified">; -def err_omp_firstprivate_distribute_private_teams : Error< - "private variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">; -def err_omp_firstprivate_and_lastprivate_in_distribute : Error< - "lastprivate variable cannot be firstprivate in '#pragma omp distribute'">; -def err_omp_firstprivate_distribute_in_teams_reduction : Error< - "reduction variable in '#pragma omp teams' cannot be firstprivate in '#pragma omp distribute'">; -def err_omp_depend_clause_thread_simd : Error< - "'depend' clauses cannot be mixed with '%0' clause">; -def err_omp_depend_sink_wrong_expr : Error< - "expected expression form x[+-d], where x is the loop iteration variable and d is a constant non-negative integer">; -def err_omp_depend_sink_expected_loop_iteration : Error< - "expected %0 loop iteration variable">; -def err_omp_depend_sink_unexpected_expr : Error< - "unexpected expression: number of expressions is larger than the number of associated loops">; -def err_omp_depend_sink_expected_plus_minus : Error< - "expected '+' or '-' operation">; -def err_omp_depend_sink_source_not_allowed : Error< - "'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">; -def err_omp_linear_ordered : Error< - "'linear' clause cannot be specified along with 'ordered' clause with a parameter">; -def err_omp_unexpected_schedule_modifier : Error< - "modifier '%0' cannot be used along with modifier '%1'">; -def err_omp_schedule_nonmonotonic_static : Error< - "'nonmonotonic' modifier can only be specified with 'dynamic' or 'guided' schedule kind">; -def err_omp_schedule_nonmonotonic_ordered : Error< - "'schedule' clause with 'nonmonotonic' modifier cannot be specified if an 'ordered' clause is specified">; -def err_omp_ordered_simd : Error< - "'ordered' clause with a parameter can not be specified in '#pragma omp %0' directive">; -} // end of OpenMP category - -let CategoryName = "Related Result Type Issue" in { -// Objective-C related result type compatibility -def warn_related_result_type_compatibility_class : Warning< - "method is expected to return an instance of its class type " - "%diff{$, but is declared to return $|" - ", but is declared to return different type}0,1">; -def warn_related_result_type_compatibility_protocol : Warning< - "protocol method is expected to return an instance of the implementing " - "class, but is declared to return %0">; -def note_related_result_type_family : Note< - "%select{overridden|current}0 method is part of the '%select{|alloc|copy|init|" - "mutableCopy|new|autorelease|dealloc|finalize|release|retain|retainCount|" - "self}1' method family%select{| and is expected to return an instance of its " - "class type}0">; -def note_related_result_type_overridden : Note< - "overridden method returns an instance of its class type">; -def note_related_result_type_inferred : Note< - "%select{class|instance}0 method %1 is assumed to return an instance of " - "its receiver type (%2)">; -def note_related_result_type_explicit : Note< - "%select{overridden|current}0 method is explicitly declared 'instancetype'" - "%select{| and is expected to return an instance of its class type}0">; - -} - -let CategoryName = "Modules Issue" in { -def err_module_private_specialization : Error< - "%select{template|partial|member}0 specialization cannot be " - "declared __module_private__">; -def err_module_private_local : Error< - "%select{local variable|parameter|typedef}0 %1 cannot be declared " - "__module_private__">; -def err_module_private_local_class : Error< - "local %select{struct|interface|union|class|enum}0 cannot be declared " - "__module_private__">; -def err_module_unimported_use : Error< - "%select{declaration|definition|default argument}0 of %1 must be imported " - "from module '%2' before it is required">; -def err_module_unimported_use_multiple : Error< - "%select{declaration|definition|default argument}0 of %1 must be imported " - "from one of the following modules before it is required:%2">; -def ext_module_import_in_extern_c : ExtWarn< - "import of C++ module '%0' appears within extern \"C\" language linkage " - "specification">, DefaultError, - InGroup<DiagGroup<"module-import-in-extern-c">>; -def note_module_import_in_extern_c : Note< - "extern \"C\" language linkage specification begins here">; -def err_module_import_not_at_top_level_fatal : Error< - "import of module '%0' appears within %1">, DefaultFatal; -def ext_module_import_not_at_top_level_noop : ExtWarn< - "redundant #include of module '%0' appears within %1">, DefaultError, - InGroup<DiagGroup<"modules-import-nested-redundant">>; -def note_module_import_not_at_top_level : Note<"%0 begins here">; -def err_module_self_import : Error< - "import of module '%0' appears within same top-level module '%1'">; -def err_module_import_in_implementation : Error< - "@import of module '%0' in implementation of '%1'; use #import">; - -def ext_equivalent_internal_linkage_decl_in_modules : ExtWarn< - "ambiguous use of internal linkage declaration %0 defined in multiple modules">, - InGroup<DiagGroup<"modules-ambiguous-internal-linkage">>; -def note_equivalent_internal_linkage_decl : Note< - "declared here%select{ in module '%1'|}0">; -} - -let CategoryName = "Coroutines Issue" in { -def err_return_in_coroutine : Error< - "return statement not allowed in coroutine; did you mean 'co_return'?">; -def note_declared_coroutine_here : Note< - "function is a coroutine due to use of " - "'%select{co_await|co_yield|co_return}0' here">; -def err_coroutine_objc_method : Error< - "Objective-C methods as coroutines are not yet supported">; -def err_coroutine_unevaluated_context : Error< - "'%0' cannot be used in an unevaluated context">; -def err_coroutine_outside_function : Error< - "'%0' cannot be used outside a function">; -def err_coroutine_ctor_dtor : Error< - "'%1' cannot be used in a %select{constructor|destructor}0">; -def err_coroutine_constexpr : Error< - "'%0' cannot be used in a constexpr function">; -def err_coroutine_varargs : Error< - "'%0' cannot be used in a varargs function">; -def ext_coroutine_without_co_await_co_yield : ExtWarn< - "'co_return' used in a function " - "that uses neither 'co_await' nor 'co_yield'">, - InGroup<DiagGroup<"coreturn-without-coawait">>; -def err_implied_std_coroutine_traits_not_found : Error< - "you need to include <coroutine> before defining a coroutine">; -def err_malformed_std_coroutine_traits : Error< - "'std::coroutine_traits' must be a class template">; -def err_implied_std_coroutine_traits_promise_type_not_found : Error< - "this function cannot be a coroutine: %q0 has no member named 'promise_type'">; -def err_implied_std_coroutine_traits_promise_type_not_class : Error< - "this function cannot be a coroutine: %0 is not a class">; -def err_coroutine_traits_missing_specialization : Error< - "this function cannot be a coroutine: missing definition of " - "specialization %q0">; -} - -let CategoryName = "Documentation Issue" in { -def warn_not_a_doxygen_trailing_member_comment : Warning< - "not a Doxygen trailing comment">, InGroup<Documentation>, DefaultIgnore; -} // end of documentation issue category - -let CategoryName = "Instrumentation Issue" in { -def warn_profile_data_out_of_date : Warning< - "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1" - " no data and %2 %plural{1:has|:have}2 mismatched data that will be ignored">, - InGroup<ProfileInstrOutOfDate>; -def warn_profile_data_unprofiled : Warning< - "no profile data available for file \"%0\"">, - InGroup<ProfileInstrUnprofiled>; - -} // end of instrumentation issue category - -let CategoryName = "Nullability Issue" in { - -def warn_mismatched_nullability_attr : Warning< - "nullability specifier %0 conflicts with existing specifier %1">, - InGroup<Nullability>; - -def warn_nullability_declspec : Warning< - "nullability specifier %0 cannot be applied " - "to non-pointer type %1; did you mean to apply the specifier to the " - "%select{pointer|block pointer|member pointer|function pointer|" - "member function pointer}2?">, - InGroup<NullabilityDeclSpec>, - DefaultError; - -def note_nullability_here : Note<"%0 specified here">; - -def err_nullability_nonpointer : Error< - "nullability specifier %0 cannot be applied to non-pointer type %1">; - -def warn_nullability_lost : Warning< - "implicit conversion from nullable pointer %0 to non-nullable pointer " - "type %1">, - InGroup<NullableToNonNullConversion>, DefaultIgnore; - -def err_nullability_cs_multilevel : Error< - "nullability keyword %0 cannot be applied to multi-level pointer type %1">; -def note_nullability_type_specifier : Note< - "use nullability type specifier %0 to affect the innermost " - "pointer type of %1">; - -def warn_null_resettable_setter : Warning< - "synthesized setter %0 for null_resettable property %1 does not handle nil">, - InGroup<Nullability>; - -def warn_nullability_missing : Warning< - "%select{pointer|block pointer|member pointer}0 is missing a nullability " - "type specifier (_Nonnull, _Nullable, or _Null_unspecified)">, - InGroup<NullabilityCompleteness>; - -def err_objc_type_arg_explicit_nullability : Error< - "type argument %0 cannot explicitly specify nullability">; - -def err_objc_type_param_bound_explicit_nullability : Error< - "type parameter %0 bound %1 cannot explicitly specify nullability">; - -} - -let CategoryName = "Generics Issue" in { - -def err_objc_type_param_bound_nonobject : Error< - "type bound %0 for type parameter %1 is not an Objective-C pointer type">; - -def err_objc_type_param_bound_missing_pointer : Error< - "missing '*' in type bound %0 for type parameter %1">; -def err_objc_type_param_bound_qualified : Error< - "type bound %1 for type parameter %0 cannot be qualified with '%2'">; - -def err_objc_type_param_redecl : Error< - "redeclaration of type parameter %0">; - -def err_objc_type_param_arity_mismatch : Error< - "%select{forward class declaration|class definition|category|extension}0 has " - "too %select{few|many}1 type parameters (expected %2, have %3)">; - -def err_objc_type_param_bound_conflict : Error< - "type bound %0 for type parameter %1 conflicts with " - "%select{implicit|previous}2 bound %3%select{for type parameter %5|}4">; - -def err_objc_type_param_variance_conflict : Error< - "%select{in|co|contra}0variant type parameter %1 conflicts with previous " - "%select{in|co|contra}2variant type parameter %3">; - -def note_objc_type_param_here : Note<"type parameter %0 declared here">; - -def err_objc_type_param_bound_missing : Error< - "missing type bound %0 for type parameter %1 in %select{@interface|@class}2">; - -def err_objc_parameterized_category_nonclass : Error< - "%select{extension|category}0 of non-parameterized class %1 cannot have type " - "parameters">; - -def err_objc_parameterized_forward_class : Error< - "forward declaration of non-parameterized class %0 cannot have type " - "parameters">; - -def err_objc_parameterized_forward_class_first : Error< - "class %0 previously declared with type parameters">; - -def err_objc_type_arg_missing_star : Error< - "type argument %0 must be a pointer (requires a '*')">; -def err_objc_type_arg_qualified : Error< - "type argument %0 cannot be qualified with '%1'">; - -def err_objc_type_arg_missing : Error< - "no type or protocol named %0">; - -def err_objc_type_args_and_protocols : Error< - "angle brackets contain both a %select{type|protocol}0 (%1) and a " - "%select{protocol|type}0 (%2)">; - -def err_objc_type_args_non_class : Error< - "type arguments cannot be applied to non-class type %0">; - -def err_objc_type_args_non_parameterized_class : Error< - "type arguments cannot be applied to non-parameterized class %0">; - -def err_objc_type_args_specialized_class : Error< - "type arguments cannot be applied to already-specialized class type %0">; - -def err_objc_type_args_wrong_arity : Error< - "too %select{many|few}0 type arguments for class %1 (have %2, expected %3)">; -} - -def err_objc_type_arg_not_id_compatible : Error< - "type argument %0 is neither an Objective-C object nor a block type">; - -def err_objc_type_arg_does_not_match_bound : Error< - "type argument %0 does not satisfy the bound (%1) of type parameter %2">; - -def warn_objc_redundant_qualified_class_type : Warning< - "parameterized class %0 already conforms to the protocols listed; did you " - "forget a '*'?">, InGroup<ObjCProtocolQualifiers>; - -} // end of sema component. diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td deleted file mode 100644 index 16c7743..0000000 --- a/include/clang/Basic/DiagnosticSerializationKinds.td +++ /dev/null @@ -1,124 +0,0 @@ -//==--- DiagnosticSerializationKinds.td - serialization diagnostics -------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -let Component = "Serialization" in { -let CategoryName = "AST Deserialization Issue" in { - -def err_fe_unable_to_read_pch_file : Error< - "unable to read PCH file %0: '%1'">; -def err_fe_not_a_pch_file : Error< - "input is not a PCH file: '%0'">; -def err_fe_pch_malformed : Error< - "malformed or corrupted AST file: '%0'">, DefaultFatal; -def err_fe_pch_malformed_block : Error< - "malformed block record in PCH file: '%0'">, DefaultFatal; -def err_fe_pch_file_modified : Error< - "file '%0' has been modified since the precompiled header '%1' was built">, - DefaultFatal; -def err_fe_pch_file_overridden : Error< - "file '%0' from the precompiled header has been overridden">; -def note_pch_required_by : Note<"'%0' required by '%1'">; -def note_pch_rebuild_required : Note<"please rebuild precompiled header '%0'">; -def note_module_cache_path : Note< - "after modifying system headers, please delete the module cache at '%0'">; - -def err_pch_targetopt_mismatch : Error< - "PCH file was compiled for the %0 '%1' but the current translation " - "unit is being compiled for target '%2'">; -def err_pch_targetopt_feature_mismatch : Error< - "%select{AST file|current translation unit}0 was compiled with the target " - "feature'%1' but the %select{current translation unit is|AST file was}0 " - "not">; -def err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in " - "PCH file but is currently %select{disabled|enabled}2">; -def err_pch_langopt_value_mismatch : Error< - "%0 differs in PCH file vs. current file">; -def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in " - "the PCH file">; -def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache " - "path '%0', but the path is currently '%1'">; - -def err_pch_version_too_old : Error< - "PCH file uses an older PCH format that is no longer supported">; -def err_pch_version_too_new : Error< - "PCH file uses a newer PCH format that cannot be read">; -def err_pch_different_branch : Error< - "PCH file built from a different branch (%0) than the compiler (%1)">; -def err_pch_with_compiler_errors : Error< - "PCH file contains compiler errors">; - -def err_module_file_conflict : Error< - "module '%0' is defined in both '%1' and '%2'">, DefaultFatal; -def err_module_file_not_found : Error< - "%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal; -def err_module_file_out_of_date : Error< - "%select{PCH|module|AST}0 file '%1' is out of date and " - "needs to be rebuilt%select{|: %3}2">, DefaultFatal; -def err_module_file_invalid : Error< - "file '%1' is not a valid precompiled %select{PCH|module|AST}0 file">, DefaultFatal; -def note_module_file_imported_by : Note< - "imported by %select{|module '%2' in }1'%0'">; -def err_module_file_not_module : Error< - "AST file '%0' was not built as a module">, DefaultFatal; - -def err_imported_module_not_found : Error< - "module '%0' in AST file '%1' (imported by AST file '%2') " - "is not defined in any loaded module map file; " - "maybe you need to load '%3'?">, DefaultFatal; -def err_imported_module_modmap_changed : Error< - "module '%0' imported by AST file '%1' found in a different module map file" - " (%2) than when the importing AST file was built (%3)">, DefaultFatal; -def err_imported_module_relocated : Error< - "module '%0' was built in directory '%1' but now resides in " - "directory '%2'">, DefaultFatal; -def err_module_different_modmap : Error< - "module '%0' %select{uses|does not use}1 additional module map '%2'" - "%select{| not}1 used when the module was built">; - -def err_pch_macro_def_undef : Error< - "macro '%0' was %select{defined|undef'd}1 in the precompiled header but " - "%select{undef'd|defined}1 on the command line">; -def err_pch_macro_def_conflict : Error< - "definition of macro '%0' differs between the precompiled header ('%1') " - "and the command line ('%2')">; -def err_pch_undef : Error< - "%select{command line contains|precompiled header was built with}0 " - "'-undef' but %select{precompiled header was not built with it|" - "it is not present on the command line}0">; -def err_pch_pp_detailed_record : Error< - "%select{command line contains|precompiled header was built with}0 " - "'-detailed-preprocessing-record' but %select{precompiled header was not " - "built with it|it is not present on the command line}0">; - -def err_module_odr_violation_missing_decl : Error< - "%q0 from module '%1' is not present in definition of %q2" - "%select{ in module '%4'| provided earlier}3">, NoSFINAE; -def note_module_odr_violation_no_possible_decls : Note< - "definition has no member %0">; -def note_module_odr_violation_possible_decl : Note< - "declaration of %0 does not match">; -def err_module_odr_violation_different_definitions : Error< - "%q0 has different definitions in different modules; " - "%select{definition in module '%2' is here|defined here}1">; -def note_module_odr_violation_different_definitions : Note< - "definition in module '%0' is here">; -def err_module_odr_violation_different_instantiations : Error< - "instantiation of %q0 is different in different modules">; - -def warn_module_uses_date_time : Warning< - "%select{precompiled header|module}0 uses __DATE__ or __TIME__">, - InGroup<DiagGroup<"pch-date-time">>; - -def warn_duplicate_module_file_extension : Warning< - "duplicate module file extension block name '%0'">, - InGroup<ModuleFileExtension>; - -} // let CategoryName -} // let Component - diff --git a/include/clang/Basic/ExceptionSpecificationType.h b/include/clang/Basic/ExceptionSpecificationType.h deleted file mode 100644 index 132b5ba..0000000 --- a/include/clang/Basic/ExceptionSpecificationType.h +++ /dev/null @@ -1,60 +0,0 @@ -//===--- ExceptionSpecificationType.h ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the ExceptionSpecificationType enumeration and various -/// utility functions. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H -#define LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H - -namespace clang { - -/// \brief The various types of exception specifications that exist in C++11. -enum ExceptionSpecificationType { - EST_None, ///< no exception specification - EST_DynamicNone, ///< throw() - EST_Dynamic, ///< throw(T1, T2) - EST_MSAny, ///< Microsoft throw(...) extension - EST_BasicNoexcept, ///< noexcept - EST_ComputedNoexcept, ///< noexcept(expression) - EST_Unevaluated, ///< not evaluated yet, for special member function - EST_Uninstantiated, ///< not instantiated yet - EST_Unparsed ///< not parsed yet -}; - -inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) { - return ESpecType >= EST_DynamicNone && ESpecType <= EST_MSAny; -} - -inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) { - return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept; -} - -inline bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType) { - return ESpecType == EST_Unevaluated || ESpecType == EST_Uninstantiated; -} - -/// \brief Possible results from evaluation of a noexcept expression. -enum CanThrowResult { - CT_Cannot, - CT_Dependent, - CT_Can -}; - -inline CanThrowResult mergeCanThrow(CanThrowResult CT1, CanThrowResult CT2) { - // CanThrowResult constants are ordered so that the maximum is the correct - // merge result. - return CT1 > CT2 ? CT1 : CT2; -} - -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H diff --git a/include/clang/Basic/ExpressionTraits.h b/include/clang/Basic/ExpressionTraits.h deleted file mode 100644 index 0363a1d..0000000 --- a/include/clang/Basic/ExpressionTraits.h +++ /dev/null @@ -1,26 +0,0 @@ -//===- ExpressionTraits.h - C++ Expression Traits Support Enums -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines enumerations for expression traits intrinsics. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_EXPRESSIONTRAITS_H -#define LLVM_CLANG_BASIC_EXPRESSIONTRAITS_H - -namespace clang { - - enum ExpressionTrait { - ET_IsLValueExpr, - ET_IsRValueExpr - }; -} - -#endif diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h deleted file mode 100644 index 17758ec..0000000 --- a/include/clang/Basic/FileManager.h +++ /dev/null @@ -1,288 +0,0 @@ -//===--- FileManager.h - File System Probing and Caching --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::FileManager interface and associated types. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_FILEMANAGER_H -#define LLVM_CLANG_BASIC_FILEMANAGER_H - -#include "clang/Basic/FileSystemOptions.h" -#include "clang/Basic/LLVM.h" -#include "clang/Basic/VirtualFileSystem.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Allocator.h" -#include <memory> -#include <map> - -namespace llvm { -class MemoryBuffer; -} - -namespace clang { -class FileManager; -class FileSystemStatCache; - -/// \brief Cached information about one directory (either on disk or in -/// the virtual file system). -class DirectoryEntry { - const char *Name; // Name of the directory. - friend class FileManager; -public: - DirectoryEntry() : Name(nullptr) {} - const char *getName() const { return Name; } -}; - -/// \brief Cached information about one file (either on disk -/// or in the virtual file system). -/// -/// If the 'File' member is valid, then this FileEntry has an open file -/// descriptor for the file. -class FileEntry { - const char *Name; // Name of the file. - off_t Size; // File size in bytes. - time_t ModTime; // Modification time of file. - const DirectoryEntry *Dir; // Directory file lives in. - unsigned UID; // A unique (small) ID for the file. - llvm::sys::fs::UniqueID UniqueID; - bool IsNamedPipe; - bool InPCH; - bool IsValid; // Is this \c FileEntry initialized and valid? - - /// \brief The open file, if it is owned by the \p FileEntry. - mutable std::unique_ptr<vfs::File> File; - friend class FileManager; - - void operator=(const FileEntry &) = delete; - -public: - FileEntry() - : UniqueID(0, 0), IsNamedPipe(false), InPCH(false), IsValid(false) - {} - - // FIXME: this is here to allow putting FileEntry in std::map. Once we have - // emplace, we shouldn't need a copy constructor anymore. - /// Intentionally does not copy fields that are not set in an uninitialized - /// \c FileEntry. - FileEntry(const FileEntry &FE) : UniqueID(FE.UniqueID), - IsNamedPipe(FE.IsNamedPipe), InPCH(FE.InPCH), IsValid(FE.IsValid) { - assert(!isValid() && "Cannot copy an initialized FileEntry"); - } - - const char *getName() const { return Name; } - bool isValid() const { return IsValid; } - off_t getSize() const { return Size; } - unsigned getUID() const { return UID; } - const llvm::sys::fs::UniqueID &getUniqueID() const { return UniqueID; } - bool isInPCH() const { return InPCH; } - time_t getModificationTime() const { return ModTime; } - - /// \brief Return the directory the file lives in. - const DirectoryEntry *getDir() const { return Dir; } - - bool operator<(const FileEntry &RHS) const { return UniqueID < RHS.UniqueID; } - - /// \brief Check whether the file is a named pipe (and thus can't be opened by - /// the native FileManager methods). - bool isNamedPipe() const { return IsNamedPipe; } - - void closeFile() const { - File.reset(); // rely on destructor to close File - } -}; - -struct FileData; - -/// \brief Implements support for file system lookup, file system caching, -/// and directory search management. -/// -/// This also handles more advanced properties, such as uniquing files based -/// on "inode", so that a file with two names (e.g. symlinked) will be treated -/// as a single file. -/// -class FileManager : public RefCountedBase<FileManager> { - IntrusiveRefCntPtr<vfs::FileSystem> FS; - FileSystemOptions FileSystemOpts; - - /// \brief Cache for existing real directories. - std::map<llvm::sys::fs::UniqueID, DirectoryEntry> UniqueRealDirs; - - /// \brief Cache for existing real files. - std::map<llvm::sys::fs::UniqueID, FileEntry> UniqueRealFiles; - - /// \brief The virtual directories that we have allocated. - /// - /// For each virtual file (e.g. foo/bar/baz.cpp), we add all of its parent - /// directories (foo/ and foo/bar/) here. - SmallVector<std::unique_ptr<DirectoryEntry>, 4> VirtualDirectoryEntries; - /// \brief The virtual files that we have allocated. - SmallVector<std::unique_ptr<FileEntry>, 4> VirtualFileEntries; - - /// \brief A cache that maps paths to directory entries (either real or - /// virtual) we have looked up - /// - /// The actual Entries for real directories/files are - /// owned by UniqueRealDirs/UniqueRealFiles above, while the Entries - /// for virtual directories/files are owned by - /// VirtualDirectoryEntries/VirtualFileEntries above. - /// - llvm::StringMap<DirectoryEntry*, llvm::BumpPtrAllocator> SeenDirEntries; - - /// \brief A cache that maps paths to file entries (either real or - /// virtual) we have looked up. - /// - /// \see SeenDirEntries - llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> SeenFileEntries; - - /// \brief The canonical names of directories. - llvm::DenseMap<const DirectoryEntry *, llvm::StringRef> CanonicalDirNames; - - /// \brief Storage for canonical names that we have computed. - llvm::BumpPtrAllocator CanonicalNameStorage; - - /// \brief Each FileEntry we create is assigned a unique ID #. - /// - unsigned NextFileUID; - - // Statistics. - unsigned NumDirLookups, NumFileLookups; - unsigned NumDirCacheMisses, NumFileCacheMisses; - - // Caching. - std::unique_ptr<FileSystemStatCache> StatCache; - - bool getStatValue(const char *Path, FileData &Data, bool isFile, - std::unique_ptr<vfs::File> *F); - - /// Add all ancestors of the given path (pointing to either a file - /// or a directory) as virtual directories. - void addAncestorsAsVirtualDirs(StringRef Path); - -public: - FileManager(const FileSystemOptions &FileSystemOpts, - IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr); - ~FileManager(); - - /// \brief Installs the provided FileSystemStatCache object within - /// the FileManager. - /// - /// Ownership of this object is transferred to the FileManager. - /// - /// \param statCache the new stat cache to install. Ownership of this - /// object is transferred to the FileManager. - /// - /// \param AtBeginning whether this new stat cache must be installed at the - /// beginning of the chain of stat caches. Otherwise, it will be added to - /// the end of the chain. - void addStatCache(std::unique_ptr<FileSystemStatCache> statCache, - bool AtBeginning = false); - - /// \brief Removes the specified FileSystemStatCache object from the manager. - void removeStatCache(FileSystemStatCache *statCache); - - /// \brief Removes all FileSystemStatCache objects from the manager. - void clearStatCaches(); - - /// \brief Lookup, cache, and verify the specified directory (real or - /// virtual). - /// - /// This returns NULL if the directory doesn't exist. - /// - /// \param CacheFailure If true and the file does not exist, we'll cache - /// the failure to find this file. - const DirectoryEntry *getDirectory(StringRef DirName, - bool CacheFailure = true); - - /// \brief Lookup, cache, and verify the specified file (real or - /// virtual). - /// - /// This returns NULL if the file doesn't exist. - /// - /// \param OpenFile if true and the file exists, it will be opened. - /// - /// \param CacheFailure If true and the file does not exist, we'll cache - /// the failure to find this file. - const FileEntry *getFile(StringRef Filename, bool OpenFile = false, - bool CacheFailure = true); - - /// \brief Returns the current file system options - FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } - const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; } - - IntrusiveRefCntPtr<vfs::FileSystem> getVirtualFileSystem() const { - return FS; - } - - /// \brief Retrieve a file entry for a "virtual" file that acts as - /// if there were a file with the given name on disk. - /// - /// The file itself is not accessed. - const FileEntry *getVirtualFile(StringRef Filename, off_t Size, - time_t ModificationTime); - - /// \brief Open the specified file as a MemoryBuffer, returning a new - /// MemoryBuffer if successful, otherwise returning null. - llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBufferForFile(const FileEntry *Entry, bool isVolatile = false, - bool ShouldCloseOpenFile = true); - llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBufferForFile(StringRef Filename); - - /// \brief Get the 'stat' information for the given \p Path. - /// - /// If the path is relative, it will be resolved against the WorkingDir of the - /// FileManager's FileSystemOptions. - /// - /// \returns false on success, true on error. - bool getNoncachedStatValue(StringRef Path, - vfs::Status &Result); - - /// \brief Remove the real file \p Entry from the cache. - void invalidateCache(const FileEntry *Entry); - - /// \brief If path is not absolute and FileSystemOptions set the working - /// directory, the path is modified to be relative to the given - /// working directory. - /// \returns true if \c path changed. - bool FixupRelativePath(SmallVectorImpl<char> &path) const; - - /// Makes \c Path absolute taking into account FileSystemOptions and the - /// working directory option. - /// \returns true if \c Path changed to absolute. - bool makeAbsolutePath(SmallVectorImpl<char> &Path) const; - - /// \brief Produce an array mapping from the unique IDs assigned to each - /// file to the corresponding FileEntry pointer. - void GetUniqueIDMapping( - SmallVectorImpl<const FileEntry *> &UIDToFiles) const; - - /// \brief Modifies the size and modification time of a previously created - /// FileEntry. Use with caution. - static void modifyFileEntry(FileEntry *File, off_t Size, - time_t ModificationTime); - - /// \brief Retrieve the canonical name for a given directory. - /// - /// This is a very expensive operation, despite its results being cached, - /// and should only be used when the physical layout of the file system is - /// required, which is (almost) never. - StringRef getCanonicalName(const DirectoryEntry *Dir); - - void PrintStats() const; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/FileSystemOptions.h b/include/clang/Basic/FileSystemOptions.h deleted file mode 100644 index 38f1346..0000000 --- a/include/clang/Basic/FileSystemOptions.h +++ /dev/null @@ -1,32 +0,0 @@ -//===--- FileSystemOptions.h - File System Options --------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::FileSystemOptions interface. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_FILESYSTEMOPTIONS_H -#define LLVM_CLANG_BASIC_FILESYSTEMOPTIONS_H - -#include <string> - -namespace clang { - -/// \brief Keeps track of options that affect how file operations are performed. -class FileSystemOptions { -public: - /// \brief If set, paths are resolved as if the working directory was - /// set to the value of WorkingDir. - std::string WorkingDir; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h deleted file mode 100644 index cad9189..0000000 --- a/include/clang/Basic/FileSystemStatCache.h +++ /dev/null @@ -1,131 +0,0 @@ -//===--- FileSystemStatCache.h - Caching for 'stat' calls -------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the FileSystemStatCache interface. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_FILESYSTEMSTATCACHE_H -#define LLVM_CLANG_BASIC_FILESYSTEMSTATCACHE_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/Support/FileSystem.h" -#include <memory> - -namespace clang { - -namespace vfs { -class File; -class FileSystem; -} - -// FIXME: should probably replace this with vfs::Status -struct FileData { - std::string Name; - uint64_t Size; - time_t ModTime; - llvm::sys::fs::UniqueID UniqueID; - bool IsDirectory; - bool IsNamedPipe; - bool InPCH; - bool IsVFSMapped; // FIXME: remove this when files support multiple names - FileData() - : Size(0), ModTime(0), IsDirectory(false), IsNamedPipe(false), - InPCH(false), IsVFSMapped(false) {} -}; - -/// \brief Abstract interface for introducing a FileManager cache for 'stat' -/// system calls, which is used by precompiled and pretokenized headers to -/// improve performance. -class FileSystemStatCache { - virtual void anchor(); -protected: - std::unique_ptr<FileSystemStatCache> NextStatCache; - -public: - virtual ~FileSystemStatCache() {} - - enum LookupResult { - CacheExists, ///< We know the file exists and its cached stat data. - CacheMissing ///< We know that the file doesn't exist. - }; - - /// \brief Get the 'stat' information for the specified path, using the cache - /// to accelerate it if possible. - /// - /// \returns \c true if the path does not exist or \c false if it exists. - /// - /// If isFile is true, then this lookup should only return success for files - /// (not directories). If it is false this lookup should only return - /// success for directories (not files). On a successful file lookup, the - /// implementation can optionally fill in \p F with a valid \p File object and - /// the client guarantees that it will close it. - static bool get(const char *Path, FileData &Data, bool isFile, - std::unique_ptr<vfs::File> *F, FileSystemStatCache *Cache, - vfs::FileSystem &FS); - - /// \brief Sets the next stat call cache in the chain of stat caches. - /// Takes ownership of the given stat cache. - void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) { - NextStatCache = std::move(Cache); - } - - /// \brief Retrieve the next stat call cache in the chain. - FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); } - - /// \brief Retrieve the next stat call cache in the chain, transferring - /// ownership of this cache (and, transitively, all of the remaining caches) - /// to the caller. - std::unique_ptr<FileSystemStatCache> takeNextStatCache() { - return std::move(NextStatCache); - } - -protected: - // FIXME: The pointer here is a non-owning/optional reference to the - // unique_ptr. Optional<unique_ptr<vfs::File>&> might be nicer, but - // Optional needs some work to support references so this isn't possible yet. - virtual LookupResult getStat(const char *Path, FileData &Data, bool isFile, - std::unique_ptr<vfs::File> *F, - vfs::FileSystem &FS) = 0; - - LookupResult statChained(const char *Path, FileData &Data, bool isFile, - std::unique_ptr<vfs::File> *F, vfs::FileSystem &FS) { - if (FileSystemStatCache *Next = getNextStatCache()) - return Next->getStat(Path, Data, isFile, F, FS); - - // If we hit the end of the list of stat caches to try, just compute and - // return it without a cache. - return get(Path, Data, isFile, F, nullptr, FS) ? CacheMissing : CacheExists; - } -}; - -/// \brief A stat "cache" that can be used by FileManager to keep -/// track of the results of stat() calls that occur throughout the -/// execution of the front end. -class MemorizeStatCalls : public FileSystemStatCache { -public: - /// \brief The set of stat() calls that have been seen. - llvm::StringMap<FileData, llvm::BumpPtrAllocator> StatCalls; - - typedef llvm::StringMap<FileData, llvm::BumpPtrAllocator>::const_iterator - iterator; - - iterator begin() const { return StatCalls.begin(); } - iterator end() const { return StatCalls.end(); } - - LookupResult getStat(const char *Path, FileData &Data, bool isFile, - std::unique_ptr<vfs::File> *F, - vfs::FileSystem &FS) override; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h deleted file mode 100644 index d672314..0000000 --- a/include/clang/Basic/IdentifierTable.h +++ /dev/null @@ -1,876 +0,0 @@ -//===--- IdentifierTable.h - Hash table for identifier lookup ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::IdentifierInfo, clang::IdentifierTable, and -/// clang::Selector interfaces. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_IDENTIFIERTABLE_H -#define LLVM_CLANG_BASIC_IDENTIFIERTABLE_H - -#include "clang/Basic/LLVM.h" -#include "clang/Basic/TokenKinds.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/StringRef.h" -#include <cassert> -#include <string> - -namespace llvm { - template <typename T> struct DenseMapInfo; -} - -namespace clang { - class LangOptions; - class IdentifierInfo; - class IdentifierTable; - class SourceLocation; - class MultiKeywordSelector; // private class used by Selector - class DeclarationName; // AST class that stores declaration names - - /// \brief A simple pair of identifier info and location. - typedef std::pair<IdentifierInfo*, SourceLocation> IdentifierLocPair; - - -/// One of these records is kept for each identifier that -/// is lexed. This contains information about whether the token was \#define'd, -/// is a language keyword, or if it is a front-end token of some sort (e.g. a -/// variable or function name). The preprocessor keeps this information in a -/// set, and all tok::identifier tokens have a pointer to one of these. -class IdentifierInfo { - unsigned TokenID : 9; // Front-end token ID or tok::identifier. - // Objective-C keyword ('protocol' in '@protocol') or builtin (__builtin_inf). - // First NUM_OBJC_KEYWORDS values are for Objective-C, the remaining values - // are for builtins. - unsigned ObjCOrBuiltinID :13; - bool HasMacro : 1; // True if there is a #define for this. - bool HadMacro : 1; // True if there was a #define for this. - bool IsExtension : 1; // True if identifier is a lang extension. - bool IsFutureCompatKeyword : 1; // True if identifier is a keyword in a - // newer Standard or proposed Standard. - bool IsPoisoned : 1; // True if identifier is poisoned. - bool IsCPPOperatorKeyword : 1; // True if ident is a C++ operator keyword. - bool NeedsHandleIdentifier : 1; // See "RecomputeNeedsHandleIdentifier". - bool IsFromAST : 1; // True if identifier was loaded (at least - // partially) from an AST file. - bool ChangedAfterLoad : 1; // True if identifier has changed from the - // definition loaded from an AST file. - bool RevertedTokenID : 1; // True if revertTokenIDToIdentifier was - // called. - bool OutOfDate : 1; // True if there may be additional - // information about this identifier - // stored externally. - bool IsModulesImport : 1; // True if this is the 'import' contextual - // keyword. - // 30 bit left in 64-bit word. - - void *FETokenInfo; // Managed by the language front-end. - llvm::StringMapEntry<IdentifierInfo*> *Entry; - - IdentifierInfo(const IdentifierInfo&) = delete; - void operator=(const IdentifierInfo&) = delete; - - friend class IdentifierTable; - -public: - IdentifierInfo(); - - - /// \brief Return true if this is the identifier for the specified string. - /// - /// This is intended to be used for string literals only: II->isStr("foo"). - template <std::size_t StrLen> - bool isStr(const char (&Str)[StrLen]) const { - return getLength() == StrLen-1 && !memcmp(getNameStart(), Str, StrLen-1); - } - - /// \brief Return the beginning of the actual null-terminated string for this - /// identifier. - /// - const char *getNameStart() const { - if (Entry) return Entry->getKeyData(); - // FIXME: This is gross. It would be best not to embed specific details - // of the PTH file format here. - // The 'this' pointer really points to a - // std::pair<IdentifierInfo, const char*>, where internal pointer - // points to the external string data. - typedef std::pair<IdentifierInfo, const char*> actualtype; - return ((const actualtype*) this)->second; - } - - /// \brief Efficiently return the length of this identifier info. - /// - unsigned getLength() const { - if (Entry) return Entry->getKeyLength(); - // FIXME: This is gross. It would be best not to embed specific details - // of the PTH file format here. - // The 'this' pointer really points to a - // std::pair<IdentifierInfo, const char*>, where internal pointer - // points to the external string data. - typedef std::pair<IdentifierInfo, const char*> actualtype; - const char* p = ((const actualtype*) this)->second - 2; - return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1; - } - - /// \brief Return the actual identifier string. - StringRef getName() const { - return StringRef(getNameStart(), getLength()); - } - - /// \brief Return true if this identifier is \#defined to some other value. - /// \note The current definition may be in a module and not currently visible. - bool hasMacroDefinition() const { - return HasMacro; - } - void setHasMacroDefinition(bool Val) { - if (HasMacro == Val) return; - - HasMacro = Val; - if (Val) { - NeedsHandleIdentifier = 1; - HadMacro = true; - } else { - RecomputeNeedsHandleIdentifier(); - } - } - /// \brief Returns true if this identifier was \#defined to some value at any - /// moment. In this case there should be an entry for the identifier in the - /// macro history table in Preprocessor. - bool hadMacroDefinition() const { - return HadMacro; - } - - /// If this is a source-language token (e.g. 'for'), this API - /// can be used to cause the lexer to map identifiers to source-language - /// tokens. - tok::TokenKind getTokenID() const { return (tok::TokenKind)TokenID; } - - /// \brief True if revertTokenIDToIdentifier() was called. - bool hasRevertedTokenIDToIdentifier() const { return RevertedTokenID; } - - /// \brief Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 - /// compatibility. - /// - /// TokenID is normally read-only but there are 2 instances where we revert it - /// to tok::identifier for libstdc++ 4.2. Keep track of when this happens - /// using this method so we can inform serialization about it. - void revertTokenIDToIdentifier() { - assert(TokenID != tok::identifier && "Already at tok::identifier"); - TokenID = tok::identifier; - RevertedTokenID = true; - } - void revertIdentifierToTokenID(tok::TokenKind TK) { - assert(TokenID == tok::identifier && "Should be at tok::identifier"); - TokenID = TK; - RevertedTokenID = false; - } - - /// \brief Return the preprocessor keyword ID for this identifier. - /// - /// For example, "define" will return tok::pp_define. - tok::PPKeywordKind getPPKeywordID() const; - - /// \brief Return the Objective-C keyword ID for the this identifier. - /// - /// For example, 'class' will return tok::objc_class if ObjC is enabled. - tok::ObjCKeywordKind getObjCKeywordID() const { - if (ObjCOrBuiltinID < tok::NUM_OBJC_KEYWORDS) - return tok::ObjCKeywordKind(ObjCOrBuiltinID); - else - return tok::objc_not_keyword; - } - void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCOrBuiltinID = ID; } - - /// \brief True if setNotBuiltin() was called. - bool hasRevertedBuiltin() const { - return ObjCOrBuiltinID == tok::NUM_OBJC_KEYWORDS; - } - - /// \brief Revert the identifier to a non-builtin identifier. We do this if - /// the name of a known builtin library function is used to declare that - /// function, but an unexpected type is specified. - void revertBuiltin() { - setBuiltinID(0); - } - - /// \brief Return a value indicating whether this is a builtin function. - /// - /// 0 is not-built-in. 1 is builtin-for-some-nonprimary-target. - /// 2+ are specific builtin functions. - unsigned getBuiltinID() const { - if (ObjCOrBuiltinID >= tok::NUM_OBJC_KEYWORDS) - return ObjCOrBuiltinID - tok::NUM_OBJC_KEYWORDS; - else - return 0; - } - void setBuiltinID(unsigned ID) { - ObjCOrBuiltinID = ID + tok::NUM_OBJC_KEYWORDS; - assert(ObjCOrBuiltinID - unsigned(tok::NUM_OBJC_KEYWORDS) == ID - && "ID too large for field!"); - } - - unsigned getObjCOrBuiltinID() const { return ObjCOrBuiltinID; } - void setObjCOrBuiltinID(unsigned ID) { ObjCOrBuiltinID = ID; } - - /// get/setExtension - Initialize information about whether or not this - /// language token is an extension. This controls extension warnings, and is - /// only valid if a custom token ID is set. - bool isExtensionToken() const { return IsExtension; } - void setIsExtensionToken(bool Val) { - IsExtension = Val; - if (Val) - NeedsHandleIdentifier = 1; - else - RecomputeNeedsHandleIdentifier(); - } - - /// is/setIsFutureCompatKeyword - Initialize information about whether or not - /// this language token is a keyword in a newer or proposed Standard. This - /// controls compatibility warnings, and is only true when not parsing the - /// corresponding Standard. Once a compatibility problem has been diagnosed - /// with this keyword, the flag will be cleared. - bool isFutureCompatKeyword() const { return IsFutureCompatKeyword; } - void setIsFutureCompatKeyword(bool Val) { - IsFutureCompatKeyword = Val; - if (Val) - NeedsHandleIdentifier = 1; - else - RecomputeNeedsHandleIdentifier(); - } - - /// setIsPoisoned - Mark this identifier as poisoned. After poisoning, the - /// Preprocessor will emit an error every time this token is used. - void setIsPoisoned(bool Value = true) { - IsPoisoned = Value; - if (Value) - NeedsHandleIdentifier = 1; - else - RecomputeNeedsHandleIdentifier(); - } - - /// \brief Return true if this token has been poisoned. - bool isPoisoned() const { return IsPoisoned; } - - /// isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether - /// this identifier is a C++ alternate representation of an operator. - void setIsCPlusPlusOperatorKeyword(bool Val = true) { - IsCPPOperatorKeyword = Val; - if (Val) - NeedsHandleIdentifier = 1; - else - RecomputeNeedsHandleIdentifier(); - } - bool isCPlusPlusOperatorKeyword() const { return IsCPPOperatorKeyword; } - - /// \brief Return true if this token is a keyword in the specified language. - bool isKeyword(const LangOptions &LangOpts); - - /// getFETokenInfo/setFETokenInfo - The language front-end is allowed to - /// associate arbitrary metadata with this token. - template<typename T> - T *getFETokenInfo() const { return static_cast<T*>(FETokenInfo); } - void setFETokenInfo(void *T) { FETokenInfo = T; } - - /// \brief Return true if the Preprocessor::HandleIdentifier must be called - /// on a token of this identifier. - /// - /// If this returns false, we know that HandleIdentifier will not affect - /// the token. - bool isHandleIdentifierCase() const { return NeedsHandleIdentifier; } - - /// \brief Return true if the identifier in its current state was loaded - /// from an AST file. - bool isFromAST() const { return IsFromAST; } - - void setIsFromAST() { IsFromAST = true; } - - /// \brief Determine whether this identifier has changed since it was loaded - /// from an AST file. - bool hasChangedSinceDeserialization() const { - return ChangedAfterLoad; - } - - /// \brief Note that this identifier has changed since it was loaded from - /// an AST file. - void setChangedSinceDeserialization() { - ChangedAfterLoad = true; - } - - /// \brief Determine whether the information for this identifier is out of - /// date with respect to the external source. - bool isOutOfDate() const { return OutOfDate; } - - /// \brief Set whether the information for this identifier is out of - /// date with respect to the external source. - void setOutOfDate(bool OOD) { - OutOfDate = OOD; - if (OOD) - NeedsHandleIdentifier = true; - else - RecomputeNeedsHandleIdentifier(); - } - - /// \brief Determine whether this is the contextual keyword \c import. - bool isModulesImport() const { return IsModulesImport; } - - /// \brief Set whether this identifier is the contextual keyword \c import. - void setModulesImport(bool I) { - IsModulesImport = I; - if (I) - NeedsHandleIdentifier = true; - else - RecomputeNeedsHandleIdentifier(); - } - - /// \brief Provide less than operator for lexicographical sorting. - bool operator<(const IdentifierInfo &RHS) const { - return getName() < RHS.getName(); - } - -private: - /// The Preprocessor::HandleIdentifier does several special (but rare) - /// things to identifiers of various sorts. For example, it changes the - /// \c for keyword token from tok::identifier to tok::for. - /// - /// This method is very tied to the definition of HandleIdentifier. Any - /// change to it should be reflected here. - void RecomputeNeedsHandleIdentifier() { - NeedsHandleIdentifier = - (isPoisoned() | hasMacroDefinition() | isCPlusPlusOperatorKeyword() | - isExtensionToken() | isFutureCompatKeyword() || isOutOfDate() || - isModulesImport()); - } -}; - -/// \brief An RAII object for [un]poisoning an identifier within a scope. -/// -/// \p II is allowed to be null, in which case objects of this type have -/// no effect. -class PoisonIdentifierRAIIObject { - IdentifierInfo *const II; - const bool OldValue; -public: - PoisonIdentifierRAIIObject(IdentifierInfo *II, bool NewValue) - : II(II), OldValue(II ? II->isPoisoned() : false) { - if(II) - II->setIsPoisoned(NewValue); - } - - ~PoisonIdentifierRAIIObject() { - if(II) - II->setIsPoisoned(OldValue); - } -}; - -/// \brief An iterator that walks over all of the known identifiers -/// in the lookup table. -/// -/// Since this iterator uses an abstract interface via virtual -/// functions, it uses an object-oriented interface rather than the -/// more standard C++ STL iterator interface. In this OO-style -/// iteration, the single function \c Next() provides dereference, -/// advance, and end-of-sequence checking in a single -/// operation. Subclasses of this iterator type will provide the -/// actual functionality. -class IdentifierIterator { -private: - IdentifierIterator(const IdentifierIterator &) = delete; - void operator=(const IdentifierIterator &) = delete; - -protected: - IdentifierIterator() { } - -public: - virtual ~IdentifierIterator(); - - /// \brief Retrieve the next string in the identifier table and - /// advances the iterator for the following string. - /// - /// \returns The next string in the identifier table. If there is - /// no such string, returns an empty \c StringRef. - virtual StringRef Next() = 0; -}; - -/// \brief Provides lookups to, and iteration over, IdentiferInfo objects. -class IdentifierInfoLookup { -public: - virtual ~IdentifierInfoLookup(); - - /// \brief Return the IdentifierInfo for the specified named identifier. - /// - /// Unlike the version in IdentifierTable, this returns a pointer instead - /// of a reference. If the pointer is null then the IdentifierInfo cannot - /// be found. - virtual IdentifierInfo* get(StringRef Name) = 0; - - /// \brief Retrieve an iterator into the set of all identifiers - /// known to this identifier lookup source. - /// - /// This routine provides access to all of the identifiers known to - /// the identifier lookup, allowing access to the contents of the - /// identifiers without introducing the overhead of constructing - /// IdentifierInfo objects for each. - /// - /// \returns A new iterator into the set of known identifiers. The - /// caller is responsible for deleting this iterator. - virtual IdentifierIterator *getIdentifiers(); -}; - -/// \brief Implements an efficient mapping from strings to IdentifierInfo nodes. -/// -/// This has no other purpose, but this is an extremely performance-critical -/// piece of the code, as each occurrence of every identifier goes through -/// here when lexed. -class IdentifierTable { - // Shark shows that using MallocAllocator is *much* slower than using this - // BumpPtrAllocator! - typedef llvm::StringMap<IdentifierInfo*, llvm::BumpPtrAllocator> HashTableTy; - HashTableTy HashTable; - - IdentifierInfoLookup* ExternalLookup; - -public: - /// \brief Create the identifier table, populating it with info about the - /// language keywords for the language specified by \p LangOpts. - IdentifierTable(const LangOptions &LangOpts, - IdentifierInfoLookup* externalLookup = nullptr); - - /// \brief Set the external identifier lookup mechanism. - void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup) { - ExternalLookup = IILookup; - } - - /// \brief Retrieve the external identifier lookup object, if any. - IdentifierInfoLookup *getExternalIdentifierLookup() const { - return ExternalLookup; - } - - llvm::BumpPtrAllocator& getAllocator() { - return HashTable.getAllocator(); - } - - /// \brief Return the identifier token info for the specified named - /// identifier. - IdentifierInfo &get(StringRef Name) { - auto &Entry = *HashTable.insert(std::make_pair(Name, nullptr)).first; - - IdentifierInfo *&II = Entry.second; - if (II) return *II; - - // No entry; if we have an external lookup, look there first. - if (ExternalLookup) { - II = ExternalLookup->get(Name); - if (II) - return *II; - } - - // Lookups failed, make a new IdentifierInfo. - void *Mem = getAllocator().Allocate<IdentifierInfo>(); - II = new (Mem) IdentifierInfo(); - - // Make sure getName() knows how to find the IdentifierInfo - // contents. - II->Entry = &Entry; - - return *II; - } - - IdentifierInfo &get(StringRef Name, tok::TokenKind TokenCode) { - IdentifierInfo &II = get(Name); - II.TokenID = TokenCode; - assert(II.TokenID == (unsigned) TokenCode && "TokenCode too large"); - return II; - } - - /// \brief Gets an IdentifierInfo for the given name without consulting - /// external sources. - /// - /// This is a version of get() meant for external sources that want to - /// introduce or modify an identifier. If they called get(), they would - /// likely end up in a recursion. - IdentifierInfo &getOwn(StringRef Name) { - auto &Entry = *HashTable.insert(std::make_pair(Name, nullptr)).first; - - IdentifierInfo *&II = Entry.second; - if (II) - return *II; - - // Lookups failed, make a new IdentifierInfo. - void *Mem = getAllocator().Allocate<IdentifierInfo>(); - II = new (Mem) IdentifierInfo(); - - // Make sure getName() knows how to find the IdentifierInfo - // contents. - II->Entry = &Entry; - - // If this is the 'import' contextual keyword, mark it as such. - if (Name.equals("import")) - II->setModulesImport(true); - - return *II; - } - - typedef HashTableTy::const_iterator iterator; - typedef HashTableTy::const_iterator const_iterator; - - iterator begin() const { return HashTable.begin(); } - iterator end() const { return HashTable.end(); } - unsigned size() const { return HashTable.size(); } - - /// \brief Print some statistics to stderr that indicate how well the - /// hashing is doing. - void PrintStats() const; - - void AddKeywords(const LangOptions &LangOpts); -}; - -/// \brief A family of Objective-C methods. -/// -/// These families have no inherent meaning in the language, but are -/// nonetheless central enough in the existing implementations to -/// merit direct AST support. While, in theory, arbitrary methods can -/// be considered to form families, we focus here on the methods -/// involving allocation and retain-count management, as these are the -/// most "core" and the most likely to be useful to diverse clients -/// without extra information. -/// -/// Both selectors and actual method declarations may be classified -/// into families. Method families may impose additional restrictions -/// beyond their selector name; for example, a method called '_init' -/// that returns void is not considered to be in the 'init' family -/// (but would be if it returned 'id'). It is also possible to -/// explicitly change or remove a method's family. Therefore the -/// method's family should be considered the single source of truth. -enum ObjCMethodFamily { - /// \brief No particular method family. - OMF_None, - - // Selectors in these families may have arbitrary arity, may be - // written with arbitrary leading underscores, and may have - // additional CamelCase "words" in their first selector chunk - // following the family name. - OMF_alloc, - OMF_copy, - OMF_init, - OMF_mutableCopy, - OMF_new, - - // These families are singletons consisting only of the nullary - // selector with the given name. - OMF_autorelease, - OMF_dealloc, - OMF_finalize, - OMF_release, - OMF_retain, - OMF_retainCount, - OMF_self, - OMF_initialize, - - // performSelector families - OMF_performSelector -}; - -/// Enough bits to store any enumerator in ObjCMethodFamily or -/// InvalidObjCMethodFamily. -enum { ObjCMethodFamilyBitWidth = 4 }; - -/// \brief An invalid value of ObjCMethodFamily. -enum { InvalidObjCMethodFamily = (1 << ObjCMethodFamilyBitWidth) - 1 }; - -/// \brief A family of Objective-C methods. -/// -/// These are family of methods whose result type is initially 'id', but -/// but are candidate for the result type to be changed to 'instancetype'. -enum ObjCInstanceTypeFamily { - OIT_None, - OIT_Array, - OIT_Dictionary, - OIT_Singleton, - OIT_Init, - OIT_ReturnsSelf -}; - -enum ObjCStringFormatFamily { - SFF_None, - SFF_NSString, - SFF_CFString -}; - -/// \brief Smart pointer class that efficiently represents Objective-C method -/// names. -/// -/// This class will either point to an IdentifierInfo or a -/// MultiKeywordSelector (which is private). This enables us to optimize -/// selectors that take no arguments and selectors that take 1 argument, which -/// accounts for 78% of all selectors in Cocoa.h. -class Selector { - friend class Diagnostic; - - enum IdentifierInfoFlag { - // Empty selector = 0. - ZeroArg = 0x1, - OneArg = 0x2, - MultiArg = 0x3, - ArgFlags = ZeroArg|OneArg - }; - uintptr_t InfoPtr; // a pointer to the MultiKeywordSelector or IdentifierInfo. - - Selector(IdentifierInfo *II, unsigned nArgs) { - InfoPtr = reinterpret_cast<uintptr_t>(II); - assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); - assert(nArgs < 2 && "nArgs not equal to 0/1"); - InfoPtr |= nArgs+1; - } - Selector(MultiKeywordSelector *SI) { - InfoPtr = reinterpret_cast<uintptr_t>(SI); - assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); - InfoPtr |= MultiArg; - } - - IdentifierInfo *getAsIdentifierInfo() const { - if (getIdentifierInfoFlag() < MultiArg) - return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags); - return nullptr; - } - MultiKeywordSelector *getMultiKeywordSelector() const { - return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags); - } - - unsigned getIdentifierInfoFlag() const { - return InfoPtr & ArgFlags; - } - - static ObjCMethodFamily getMethodFamilyImpl(Selector sel); - - static ObjCStringFormatFamily getStringFormatFamilyImpl(Selector sel); - -public: - friend class SelectorTable; // only the SelectorTable can create these - friend class DeclarationName; // and the AST's DeclarationName. - - /// The default ctor should only be used when creating data structures that - /// will contain selectors. - Selector() : InfoPtr(0) {} - Selector(uintptr_t V) : InfoPtr(V) {} - - /// operator==/!= - Indicate whether the specified selectors are identical. - bool operator==(Selector RHS) const { - return InfoPtr == RHS.InfoPtr; - } - bool operator!=(Selector RHS) const { - return InfoPtr != RHS.InfoPtr; - } - void *getAsOpaquePtr() const { - return reinterpret_cast<void*>(InfoPtr); - } - - /// \brief Determine whether this is the empty selector. - bool isNull() const { return InfoPtr == 0; } - - // Predicates to identify the selector type. - bool isKeywordSelector() const { - return getIdentifierInfoFlag() != ZeroArg; - } - bool isUnarySelector() const { - return getIdentifierInfoFlag() == ZeroArg; - } - unsigned getNumArgs() const; - - - /// \brief Retrieve the identifier at a given position in the selector. - /// - /// Note that the identifier pointer returned may be NULL. Clients that only - /// care about the text of the identifier string, and not the specific, - /// uniqued identifier pointer, should use \c getNameForSlot(), which returns - /// an empty string when the identifier pointer would be NULL. - /// - /// \param argIndex The index for which we want to retrieve the identifier. - /// This index shall be less than \c getNumArgs() unless this is a keyword - /// selector, in which case 0 is the only permissible value. - /// - /// \returns the uniqued identifier for this slot, or NULL if this slot has - /// no corresponding identifier. - IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const; - - /// \brief Retrieve the name at a given position in the selector. - /// - /// \param argIndex The index for which we want to retrieve the name. - /// This index shall be less than \c getNumArgs() unless this is a keyword - /// selector, in which case 0 is the only permissible value. - /// - /// \returns the name for this slot, which may be the empty string if no - /// name was supplied. - StringRef getNameForSlot(unsigned argIndex) const; - - /// \brief Derive the full selector name (e.g. "foo:bar:") and return - /// it as an std::string. - std::string getAsString() const; - - /// \brief Prints the full selector name (e.g. "foo:bar:"). - void print(llvm::raw_ostream &OS) const; - - /// \brief Derive the conventional family of this method. - ObjCMethodFamily getMethodFamily() const { - return getMethodFamilyImpl(*this); - } - - ObjCStringFormatFamily getStringFormatFamily() const { - return getStringFormatFamilyImpl(*this); - } - - static Selector getEmptyMarker() { - return Selector(uintptr_t(-1)); - } - static Selector getTombstoneMarker() { - return Selector(uintptr_t(-2)); - } - - static ObjCInstanceTypeFamily getInstTypeMethodFamily(Selector sel); -}; - -/// \brief This table allows us to fully hide how we implement -/// multi-keyword caching. -class SelectorTable { - void *Impl; // Actually a SelectorTableImpl - SelectorTable(const SelectorTable &) = delete; - void operator=(const SelectorTable &) = delete; -public: - SelectorTable(); - ~SelectorTable(); - - /// \brief Can create any sort of selector. - /// - /// \p NumArgs indicates whether this is a no argument selector "foo", a - /// single argument selector "foo:" or multi-argument "foo:bar:". - Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV); - - Selector getUnarySelector(IdentifierInfo *ID) { - return Selector(ID, 1); - } - Selector getNullarySelector(IdentifierInfo *ID) { - return Selector(ID, 0); - } - - /// \brief Return the total amount of memory allocated for managing selectors. - size_t getTotalMemory() const; - - /// \brief Return the default setter name for the given identifier. - /// - /// This is "set" + \p Name where the initial character of \p Name - /// has been capitalized. - static SmallString<64> constructSetterName(StringRef Name); - - /// \brief Return the default setter selector for the given identifier. - /// - /// This is "set" + \p Name where the initial character of \p Name - /// has been capitalized. - static Selector constructSetterSelector(IdentifierTable &Idents, - SelectorTable &SelTable, - const IdentifierInfo *Name); -}; - -/// DeclarationNameExtra - Common base of the MultiKeywordSelector, -/// CXXSpecialName, and CXXOperatorIdName classes, all of which are -/// private classes that describe different kinds of names. -class DeclarationNameExtra { -public: - /// ExtraKind - The kind of "extra" information stored in the - /// DeclarationName. See @c ExtraKindOrNumArgs for an explanation of - /// how these enumerator values are used. - enum ExtraKind { - CXXConstructor = 0, - CXXDestructor, - CXXConversionFunction, -#define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ - CXXOperator##Name, -#include "clang/Basic/OperatorKinds.def" - CXXLiteralOperator, - CXXUsingDirective, - NUM_EXTRA_KINDS - }; - - /// ExtraKindOrNumArgs - Either the kind of C++ special name or - /// operator-id (if the value is one of the CXX* enumerators of - /// ExtraKind), in which case the DeclarationNameExtra is also a - /// CXXSpecialName, (for CXXConstructor, CXXDestructor, or - /// CXXConversionFunction) CXXOperatorIdName, or CXXLiteralOperatorName, - /// it may be also name common to C++ using-directives (CXXUsingDirective), - /// otherwise it is NUM_EXTRA_KINDS+NumArgs, where NumArgs is the number of - /// arguments in the Objective-C selector, in which case the - /// DeclarationNameExtra is also a MultiKeywordSelector. - unsigned ExtraKindOrNumArgs; -}; - -} // end namespace clang - -namespace llvm { -/// Define DenseMapInfo so that Selectors can be used as keys in DenseMap and -/// DenseSets. -template <> -struct DenseMapInfo<clang::Selector> { - static inline clang::Selector getEmptyKey() { - return clang::Selector::getEmptyMarker(); - } - static inline clang::Selector getTombstoneKey() { - return clang::Selector::getTombstoneMarker(); - } - - static unsigned getHashValue(clang::Selector S); - - static bool isEqual(clang::Selector LHS, clang::Selector RHS) { - return LHS == RHS; - } -}; - -template <> -struct isPodLike<clang::Selector> { static const bool value = true; }; - -template <typename T> class PointerLikeTypeTraits; - -template<> -class PointerLikeTypeTraits<clang::Selector> { -public: - static inline const void *getAsVoidPointer(clang::Selector P) { - return P.getAsOpaquePtr(); - } - static inline clang::Selector getFromVoidPointer(const void *P) { - return clang::Selector(reinterpret_cast<uintptr_t>(P)); - } - enum { NumLowBitsAvailable = 0 }; -}; - -// Provide PointerLikeTypeTraits for IdentifierInfo pointers, which -// are not guaranteed to be 8-byte aligned. -template<> -class PointerLikeTypeTraits<clang::IdentifierInfo*> { -public: - static inline void *getAsVoidPointer(clang::IdentifierInfo* P) { - return P; - } - static inline clang::IdentifierInfo *getFromVoidPointer(void *P) { - return static_cast<clang::IdentifierInfo*>(P); - } - enum { NumLowBitsAvailable = 1 }; -}; - -template<> -class PointerLikeTypeTraits<const clang::IdentifierInfo*> { -public: - static inline const void *getAsVoidPointer(const clang::IdentifierInfo* P) { - return P; - } - static inline const clang::IdentifierInfo *getFromVoidPointer(const void *P) { - return static_cast<const clang::IdentifierInfo*>(P); - } - enum { NumLowBitsAvailable = 1 }; -}; - -} // end namespace llvm -#endif diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h deleted file mode 100644 index 0e6ff92..0000000 --- a/include/clang/Basic/LLVM.h +++ /dev/null @@ -1,83 +0,0 @@ -//===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -/// \file -/// \brief Forward-declares and imports various common LLVM datatypes that -/// clang wants to use unqualified. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_LLVM_H -#define LLVM_CLANG_BASIC_LLVM_H - -// Do not proliferate #includes here, require clients to #include their -// dependencies. -// Casting.h has complex templates that cannot be easily forward declared. -#include "llvm/Support/Casting.h" -// None.h includes an enumerator that is desired & cannot be forward declared -// without a definition of NoneType. -#include "llvm/ADT/None.h" - -namespace llvm { - // ADT's. - class StringRef; - class Twine; - template<typename T> class ArrayRef; - template<typename T> class MutableArrayRef; - template<unsigned InternalLen> class SmallString; - template<typename T, unsigned N> class SmallVector; - template<typename T> class SmallVectorImpl; - template<typename T> class Optional; - - template<typename T> - struct SaveAndRestore; - - // Reference counting. - template <typename T> class IntrusiveRefCntPtr; - template <typename T> struct IntrusiveRefCntPtrInfo; - template <class Derived> class RefCountedBase; - class RefCountedBaseVPTR; - - class raw_ostream; - class raw_pwrite_stream; - // TODO: DenseMap, ... -} - - -namespace clang { - // Casting operators. - using llvm::isa; - using llvm::cast; - using llvm::dyn_cast; - using llvm::dyn_cast_or_null; - using llvm::cast_or_null; - - // ADT's. - using llvm::None; - using llvm::Optional; - using llvm::StringRef; - using llvm::Twine; - using llvm::ArrayRef; - using llvm::MutableArrayRef; - using llvm::SmallString; - using llvm::SmallVector; - using llvm::SmallVectorImpl; - using llvm::SaveAndRestore; - - // Reference counting. - using llvm::IntrusiveRefCntPtr; - using llvm::IntrusiveRefCntPtrInfo; - using llvm::RefCountedBase; - using llvm::RefCountedBaseVPTR; - - using llvm::raw_ostream; - using llvm::raw_pwrite_stream; -} // end namespace clang. - -#endif diff --git a/include/clang/Basic/Lambda.h b/include/clang/Basic/Lambda.h deleted file mode 100644 index e676e72..0000000 --- a/include/clang/Basic/Lambda.h +++ /dev/null @@ -1,43 +0,0 @@ -//===--- Lambda.h - Types for C++ Lambdas -----------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines several types used to describe C++ lambda expressions -/// that are shared between the parser and AST. -/// -//===----------------------------------------------------------------------===// - - -#ifndef LLVM_CLANG_BASIC_LAMBDA_H -#define LLVM_CLANG_BASIC_LAMBDA_H - -namespace clang { - -/// \brief The default, if any, capture method for a lambda expression. -enum LambdaCaptureDefault { - LCD_None, - LCD_ByCopy, - LCD_ByRef -}; - -/// \brief The different capture forms in a lambda introducer -/// -/// C++11 allows capture of \c this, or of local variables by copy or -/// by reference. C++1y also allows "init-capture", where the initializer -/// is an expression. -enum LambdaCaptureKind { - LCK_This, ///< Capturing the \c this pointer - LCK_ByCopy, ///< Capturing by copy (a.k.a., by value) - LCK_ByRef, ///< Capturing by reference - LCK_VLAType ///< Capturing variable-length array type -}; - -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_LAMBDA_H diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def deleted file mode 100644 index cc70d62..0000000 --- a/include/clang/Basic/LangOptions.def +++ /dev/null @@ -1,246 +0,0 @@ -//===--- LangOptions.def - Language option database -------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the language options. Users of this file must -// define the LANGOPT macro to make use of this information. -// -// Optionally, the user may also define: -// -// BENIGN_LANGOPT: for options that don't affect the construction of the AST in -// any way (that is, the value can be different between an implicit module -// and the user of that module). -// -// COMPATIBLE_LANGOPT: for options that affect the construction of the AST in -// a way that doesn't prevent interoperability (that is, the value can be -// different between an explicit module and the user of that module). -// -// ENUM_LANGOPT: for options that have enumeration, rather than unsigned, type. -// -// VALUE_LANGOPT: for options that describe a value rather than a flag. -// -// BENIGN_ENUM_LANGOPT, COMPATIBLE_ENUM_LANGOPT: combinations of the above. -// -// FIXME: Clients should be able to more easily select whether they want -// different levels of compatibility versus how to handle different kinds -// of option. -//===----------------------------------------------------------------------===// - -#ifndef LANGOPT -# error Define the LANGOPT macro to handle language options -#endif - -#ifndef COMPATIBLE_LANGOPT -# define COMPATIBLE_LANGOPT(Name, Bits, Default, Description) \ - LANGOPT(Name, Bits, Default, Description) -#endif - -#ifndef BENIGN_LANGOPT -# define BENIGN_LANGOPT(Name, Bits, Default, Description) \ - COMPATIBLE_LANGOPT(Name, Bits, Default, Description) -#endif - -#ifndef ENUM_LANGOPT -# define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - LANGOPT(Name, Bits, Default, Description) -#endif - -#ifndef COMPATIBLE_ENUM_LANGOPT -# define COMPATIBLE_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - ENUM_LANGOPT(Name, Type, Bits, Default, Description) -#endif - -#ifndef BENIGN_ENUM_LANGOPT -# define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - COMPATIBLE_ENUM_LANGOPT(Name, Type, Bits, Default, Description) -#endif - -#ifndef VALUE_LANGOPT -# define VALUE_LANGOPT(Name, Bits, Default, Description) \ - LANGOPT(Name, Bits, Default, Description) -#endif - -// FIXME: A lot of the BENIGN_ options should be COMPATIBLE_ instead. -LANGOPT(C99 , 1, 0, "C99") -LANGOPT(C11 , 1, 0, "C11") -LANGOPT(MSVCCompat , 1, 0, "Microsoft Visual C++ full compatibility mode") -LANGOPT(MicrosoftExt , 1, 0, "Microsoft C++ extensions") -LANGOPT(AsmBlocks , 1, 0, "Microsoft inline asm blocks") -LANGOPT(Borland , 1, 0, "Borland extensions") -LANGOPT(CPlusPlus , 1, 0, "C++") -LANGOPT(CPlusPlus11 , 1, 0, "C++11") -LANGOPT(CPlusPlus14 , 1, 0, "C++14") -LANGOPT(CPlusPlus1z , 1, 0, "C++1z") -LANGOPT(ObjC1 , 1, 0, "Objective-C 1") -LANGOPT(ObjC2 , 1, 0, "Objective-C 2") -BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0, - "Objective-C auto-synthesized properties") -BENIGN_LANGOPT(EncodeExtendedBlockSig , 1, 0, - "Encoding extended block type signature") -BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1, - "Objective-C related result type inference") -LANGOPT(AppExt , 1, 0, "Objective-C App Extension") -LANGOPT(Trigraphs , 1, 0,"trigraphs") -LANGOPT(LineComment , 1, 0, "'//' comments") -LANGOPT(Bool , 1, 0, "bool, true, and false keywords") -LANGOPT(Half , 1, 0, "half keyword") -LANGOPT(WChar , 1, CPlusPlus, "wchar_t keyword") -LANGOPT(DeclSpecKeyword , 1, 0, "__declspec keyword") -BENIGN_LANGOPT(DollarIdents , 1, 1, "'$' in identifiers") -BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode") -BENIGN_LANGOPT(GNUMode , 1, 1, "GNU extensions") -LANGOPT(GNUKeywords , 1, 1, "GNU keywords") -BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'") -LANGOPT(Digraphs , 1, 0, "digraphs") -BENIGN_LANGOPT(HexFloats , 1, C99, "C99 hexadecimal float constants") -LANGOPT(CXXOperatorNames , 1, 0, "C++ operator name keywords") -LANGOPT(AppleKext , 1, 0, "Apple kext support") -BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support") -LANGOPT(WritableStrings , 1, 0, "writable string support") -LANGOPT(ConstStrings , 1, 0, "const-qualified string support") -LANGOPT(LaxVectorConversions , 1, 1, "lax vector conversions") -LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers") -LANGOPT(ZVector , 1, 0, "System z vector extensions") -LANGOPT(Exceptions , 1, 0, "exception handling") -LANGOPT(ObjCExceptions , 1, 0, "Objective-C exceptions") -LANGOPT(CXXExceptions , 1, 0, "C++ exceptions") -LANGOPT(SjLjExceptions , 1, 0, "setjmp-longjump exception handling") -LANGOPT(TraditionalCPP , 1, 0, "traditional CPP emulation") -LANGOPT(RTTI , 1, 1, "run-time type information") -LANGOPT(RTTIData , 1, 1, "emit run-time type information data") -LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout") -LANGOPT(Freestanding, 1, 0, "freestanding implementation") -LANGOPT(NoBuiltin , 1, 0, "disable builtin functions") -LANGOPT(NoMathBuiltin , 1, 0, "disable math builtin functions") -LANGOPT(GNUAsm , 1, 1, "GNU-style inline assembly") -LANGOPT(Coroutines , 1, 0, "C++ coroutines") - -BENIGN_LANGOPT(ThreadsafeStatics , 1, 1, "thread-safe static initializers") -LANGOPT(POSIXThreads , 1, 0, "POSIX thread support") -LANGOPT(Blocks , 1, 0, "blocks extension to C") -BENIGN_LANGOPT(EmitAllDecls , 1, 0, "support for emitting all declarations") -LANGOPT(MathErrno , 1, 1, "errno support for math functions") -BENIGN_LANGOPT(HeinousExtensions , 1, 0, "Extensions that we really don't like and may be ripped out at any time") -LANGOPT(Modules , 1, 0, "modules extension to C") -COMPATIBLE_LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses") -LANGOPT(ModulesSearchAll , 1, 1, "search even non-imported modules to find unresolved references") -COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "require declaration of module uses and all headers to be in modules") -BENIGN_LANGOPT(ModulesErrorRecovery, 1, 1, "automatically import modules as needed when performing error recovery") -BENIGN_LANGOPT(ImplicitModules, 1, 1, "build modules that are not specified via -fmodule-file") -COMPATIBLE_LANGOPT(ModulesLocalVisibility, 1, 0, "local submodule visibility") -COMPATIBLE_LANGOPT(Optimize , 1, 0, "__OPTIMIZE__ predefined macro") -COMPATIBLE_LANGOPT(OptimizeSize , 1, 0, "__OPTIMIZE_SIZE__ predefined macro") -LANGOPT(Static , 1, 0, "__STATIC__ predefined macro (as opposed to __DYNAMIC__)") -VALUE_LANGOPT(PackStruct , 32, 0, - "default struct packing maximum alignment") -VALUE_LANGOPT(MaxTypeAlign , 32, 0, - "default maximum alignment for types") -VALUE_LANGOPT(PICLevel , 2, 0, "__PIC__ level") -VALUE_LANGOPT(PIELevel , 2, 0, "__PIE__ level") -LANGOPT(GNUInline , 1, 0, "GNU inline semantics") -COMPATIBLE_LANGOPT(NoInlineDefine , 1, 0, "__NO_INLINE__ predefined macro") -COMPATIBLE_LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro") -LANGOPT(FastMath , 1, 0, "__FAST_MATH__ predefined macro") -LANGOPT(FiniteMathOnly , 1, 0, "__FINITE_MATH_ONLY__ predefined macro") -LANGOPT(UnsafeFPMath , 1, 0, "Unsafe Floating Point Math") - -BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars") - -BENIGN_LANGOPT(AccessControl , 1, 1, "C++ access control") -LANGOPT(CharIsSigned , 1, 1, "signed char") -LANGOPT(ShortWChar , 1, 0, "unsigned short wchar_t") -ENUM_LANGOPT(MSPointerToMemberRepresentationMethod, PragmaMSPointersToMembersKind, 2, PPTMK_BestCase, "member-pointer representation method") - -LANGOPT(ShortEnums , 1, 0, "short enum types") - -LANGOPT(OpenCL , 1, 0, "OpenCL") -LANGOPT(OpenCLVersion , 32, 0, "OpenCL version") -LANGOPT(NativeHalfType , 1, 0, "Native half type support") -LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns") -LANGOPT(CUDA , 1, 0, "CUDA") -LANGOPT(OpenMP , 1, 0, "OpenMP support") -LANGOPT(OpenMPUseTLS , 1, 0, "Use TLS for threadprivates or runtime calls") -LANGOPT(OpenMPIsDevice , 1, 0, "Generate code only for OpenMP target device") - -LANGOPT(CUDAIsDevice , 1, 0, "Compiling for CUDA device") -LANGOPT(CUDAAllowHostCallsFromHostDevice, 1, 0, "Allow host device functions to call host functions") -LANGOPT(CUDADisableTargetCallChecks, 1, 0, "Disable checks for call targets (host, device, etc.)") -LANGOPT(CUDATargetOverloads, 1, 0, "Enable function overloads based on CUDA target attributes") - -LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators") -LANGOPT(SizedDeallocation , 1, 0, "enable sized deallocation functions") -LANGOPT(ConceptsTS , 1, 0, "enable C++ Extensions for Concepts") -BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision") -BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records") -BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form") -BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables") -LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings") -BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inline C++ methods") -BENIGN_LANGOPT(ParseUnknownAnytype, 1, 0, "__unknown_anytype") -BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support") -BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type") -BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support") - -BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking") -LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants") -LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math") -LANGOPT(DefaultFPContract , 1, 0, "FP_CONTRACT") -LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment") -LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility") -LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting") -LANGOPT(ObjCWeakRuntime , 1, 0, "__weak support in the ARC runtime") -LANGOPT(ObjCWeak , 1, 0, "Objective-C __weak in ARC and MRC files") -LANGOPT(ObjCSubscriptingLegacyRuntime , 1, 0, "Subscripting support in legacy ObjectiveC runtime") -LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map") -ENUM_LANGOPT(AddressSpaceMapMangling , AddrSpaceMapMangling, 2, ASMM_Target, "OpenCL address space map mangling mode") - -LANGOPT(MRTD , 1, 0, "-mrtd calling convention") -BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing") -LANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime") - -ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode") -ENUM_LANGOPT(ValueVisibilityMode, Visibility, 3, DefaultVisibility, - "value symbol visibility") -ENUM_LANGOPT(TypeVisibilityMode, Visibility, 3, DefaultVisibility, - "type symbol visibility") -ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff, - "stack protector mode") -ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined, - "signed integer overflow handling") - -BENIGN_LANGOPT(ArrowDepth, 32, 256, - "maximum number of operator->s to follow") -BENIGN_LANGOPT(InstantiationDepth, 32, 256, - "maximum template instantiation depth") -BENIGN_LANGOPT(ConstexprCallDepth, 32, 512, - "maximum constexpr call depth") -BENIGN_LANGOPT(ConstexprStepLimit, 32, 1048576, - "maximum constexpr evaluation steps") -BENIGN_LANGOPT(BracketDepth, 32, 256, - "maximum bracket nesting depth") -BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0, - "if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.") -VALUE_LANGOPT(MSCompatibilityVersion, 32, 0, "Microsoft Visual C/C++ Version") -VALUE_LANGOPT(VtorDispMode, 2, 1, "How many vtordisps to insert") - -LANGOPT(ApplePragmaPack, 1, 0, "Apple gcc-compatible #pragma pack handling") - -LANGOPT(RetainCommentsFromSystemHeaders, 1, 0, "retain documentation comments from system headers in the AST") - -LANGOPT(SanitizeAddressFieldPadding, 2, 0, "controls how aggressive is ASan " - "field padding (0: none, 1:least " - "aggressive, 2: more aggressive)") - -#undef LANGOPT -#undef COMPATIBLE_LANGOPT -#undef BENIGN_LANGOPT -#undef ENUM_LANGOPT -#undef COMPATIBLE_ENUM_LANGOPT -#undef BENIGN_ENUM_LANGOPT -#undef VALUE_LANGOPT - diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h deleted file mode 100644 index 736d4e0..0000000 --- a/include/clang/Basic/LangOptions.h +++ /dev/null @@ -1,190 +0,0 @@ -//===--- LangOptions.h - C Language Family Language Options -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::LangOptions interface. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_LANGOPTIONS_H -#define LLVM_CLANG_BASIC_LANGOPTIONS_H - -#include "clang/Basic/CommentOptions.h" -#include "clang/Basic/LLVM.h" -#include "clang/Basic/ObjCRuntime.h" -#include "clang/Basic/Sanitizers.h" -#include "clang/Basic/Visibility.h" -#include <string> -#include <vector> - -namespace clang { - -/// Bitfields of LangOptions, split out from LangOptions in order to ensure that -/// this large collection of bitfields is a trivial class type. -class LangOptionsBase { -public: - // Define simple language options (with no accessors). -#define LANGOPT(Name, Bits, Default, Description) unsigned Name : Bits; -#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) -#include "clang/Basic/LangOptions.def" - -protected: - // Define language options of enumeration type. These are private, and will - // have accessors (below). -#define LANGOPT(Name, Bits, Default, Description) -#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - unsigned Name : Bits; -#include "clang/Basic/LangOptions.def" -}; - -/// \brief Keeps track of the various options that can be -/// enabled, which controls the dialect of C or C++ that is accepted. -class LangOptions : public LangOptionsBase { -public: - typedef clang::Visibility Visibility; - - enum GCMode { NonGC, GCOnly, HybridGC }; - enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq }; - - enum SignedOverflowBehaviorTy { - SOB_Undefined, // Default C standard behavior. - SOB_Defined, // -fwrapv - SOB_Trapping // -ftrapv - }; - - enum PragmaMSPointersToMembersKind { - PPTMK_BestCase, - PPTMK_FullGeneralitySingleInheritance, - PPTMK_FullGeneralityMultipleInheritance, - PPTMK_FullGeneralityVirtualInheritance - }; - - enum AddrSpaceMapMangling { ASMM_Target, ASMM_On, ASMM_Off }; - - enum MSVCMajorVersion { - MSVC2010 = 16, - MSVC2012 = 17, - MSVC2013 = 18, - MSVC2015 = 19 - }; - -public: - /// \brief Set of enabled sanitizers. - SanitizerSet Sanitize; - - /// \brief Paths to blacklist files specifying which objects - /// (files, functions, variables) should not be instrumented. - std::vector<std::string> SanitizerBlacklistFiles; - - clang::ObjCRuntime ObjCRuntime; - - std::string ObjCConstantStringClass; - - /// \brief The name of the handler function to be called when -ftrapv is - /// specified. - /// - /// If none is specified, abort (GCC-compatible behaviour). - std::string OverflowHandler; - - /// \brief The name of the current module. - std::string CurrentModule; - - /// \brief The name of the module that the translation unit is an - /// implementation of. Prevents semantic imports, but does not otherwise - /// treat this as the CurrentModule. - std::string ImplementationOfModule; - - /// \brief The names of any features to enable in module 'requires' decls - /// in addition to the hard-coded list in Module.cpp and the target features. - /// - /// This list is sorted. - std::vector<std::string> ModuleFeatures; - - /// \brief Options for parsing comments. - CommentOptions CommentOpts; - - /// \brief A list of all -fno-builtin-* function names (e.g., memset). - std::vector<std::string> NoBuiltinFuncs; - - /// \brief Triples of the OpenMP targets that the host code codegen should - /// take into account in order to generate accurate offloading descriptors. - std::vector<llvm::Triple> OMPTargetTriples; - - /// \brief Name of the IR file that contains the result of the OpenMP target - /// host code generation. - std::string OMPHostIRFile; - - LangOptions(); - - // Define accessors/mutators for language options of enumeration type. -#define LANGOPT(Name, Bits, Default, Description) -#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ - Type get##Name() const { return static_cast<Type>(Name); } \ - void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } -#include "clang/Basic/LangOptions.def" - - bool isSignedOverflowDefined() const { - return getSignedOverflowBehavior() == SOB_Defined; - } - - bool isSubscriptPointerArithmetic() const { - return ObjCRuntime.isSubscriptPointerArithmetic() && - !ObjCSubscriptingLegacyRuntime; - } - - bool isCompatibleWithMSVC(MSVCMajorVersion MajorVersion) const { - return MSCompatibilityVersion >= MajorVersion * 10000000U; - } - - /// \brief Reset all of the options that are not considered when building a - /// module. - void resetNonModularOptions(); - - /// \brief Is this a libc/libm function that is no longer recognized as a - /// builtin because a -fno-builtin-* option has been specified? - bool isNoBuiltinFunc(const char *Name) const; -}; - -/// \brief Floating point control options -class FPOptions { -public: - unsigned fp_contract : 1; - - FPOptions() : fp_contract(0) {} - - FPOptions(const LangOptions &LangOpts) : - fp_contract(LangOpts.DefaultFPContract) {} -}; - -/// \brief OpenCL volatile options -class OpenCLOptions { -public: -#define OPENCLEXT(nm) unsigned nm : 1; -#include "clang/Basic/OpenCLExtensions.def" - - OpenCLOptions() { -#define OPENCLEXT(nm) nm = 0; -#include "clang/Basic/OpenCLExtensions.def" - } -}; - -/// \brief Describes the kind of translation unit being processed. -enum TranslationUnitKind { - /// \brief The translation unit is a complete translation unit. - TU_Complete, - /// \brief The translation unit is a prefix to a translation unit, and is - /// not complete. - TU_Prefix, - /// \brief The translation unit is a module. - TU_Module -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Linkage.h b/include/clang/Basic/Linkage.h deleted file mode 100644 index 8b15c8e..0000000 --- a/include/clang/Basic/Linkage.h +++ /dev/null @@ -1,110 +0,0 @@ -//===--- Linkage.h - Linkage enumeration and utilities ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the Linkage enumeration and various utility functions. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_LINKAGE_H -#define LLVM_CLANG_BASIC_LINKAGE_H - -#include <assert.h> -#include <stdint.h> -#include <utility> - -namespace clang { - -/// \brief Describes the different kinds of linkage -/// (C++ [basic.link], C99 6.2.2) that an entity may have. -enum Linkage : unsigned char { - /// \brief No linkage, which means that the entity is unique and - /// can only be referred to from within its scope. - NoLinkage = 0, - - /// \brief Internal linkage, which indicates that the entity can - /// be referred to from within the translation unit (but not other - /// translation units). - InternalLinkage, - - /// \brief External linkage within a unique namespace. - /// - /// From the language perspective, these entities have external - /// linkage. However, since they reside in an anonymous namespace, - /// their names are unique to this translation unit, which is - /// equivalent to having internal linkage from the code-generation - /// point of view. - UniqueExternalLinkage, - - /// \brief No linkage according to the standard, but is visible from other - /// translation units because of types defined in a inline function. - VisibleNoLinkage, - - /// \brief External linkage, which indicates that the entity can - /// be referred to from other translation units. - ExternalLinkage -}; - -/// \brief Describes the different kinds of language linkage -/// (C++ [dcl.link]) that an entity may have. -enum LanguageLinkage { - CLanguageLinkage, - CXXLanguageLinkage, - NoLanguageLinkage -}; - -/// \brief A more specific kind of linkage than enum Linkage. -/// -/// This is relevant to CodeGen and AST file reading. -enum GVALinkage { - GVA_Internal, - GVA_AvailableExternally, - GVA_DiscardableODR, - GVA_StrongExternal, - GVA_StrongODR -}; - -inline bool isExternallyVisible(Linkage L) { - return L == ExternalLinkage || L == VisibleNoLinkage; -} - -inline Linkage getFormalLinkage(Linkage L) { - if (L == UniqueExternalLinkage) - return ExternalLinkage; - if (L == VisibleNoLinkage) - return NoLinkage; - return L; -} - -inline bool isExternalFormalLinkage(Linkage L) { - return getFormalLinkage(L) == ExternalLinkage; -} - -/// \brief Compute the minimum linkage given two linkages. -/// -/// The linkage can be interpreted as a pair formed by the formal linkage and -/// a boolean for external visibility. This is just what getFormalLinkage and -/// isExternallyVisible return. We want the minimum of both components. The -/// Linkage enum is defined in an order that makes this simple, we just need -/// special cases for when VisibleNoLinkage would lose the visible bit and -/// become NoLinkage. -inline Linkage minLinkage(Linkage L1, Linkage L2) { - if (L2 == VisibleNoLinkage) - std::swap(L1, L2); - if (L1 == VisibleNoLinkage) { - if (L2 == InternalLinkage) - return NoLinkage; - if (L2 == UniqueExternalLinkage) - return NoLinkage; - } - return L1 < L2 ? L1 : L2; -} - -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_LINKAGE_H diff --git a/include/clang/Basic/MacroBuilder.h b/include/clang/Basic/MacroBuilder.h deleted file mode 100644 index 9a9eaa2..0000000 --- a/include/clang/Basic/MacroBuilder.h +++ /dev/null @@ -1,48 +0,0 @@ -//===--- MacroBuilder.h - CPP Macro building utility ------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::MacroBuilder utility class. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_MACROBUILDER_H -#define LLVM_CLANG_BASIC_MACROBUILDER_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/Twine.h" -#include "llvm/Support/raw_ostream.h" - -namespace clang { - -class MacroBuilder { - raw_ostream &Out; -public: - MacroBuilder(raw_ostream &Output) : Out(Output) {} - - /// Append a \#define line for macro of the form "\#define Name Value\n". - void defineMacro(const Twine &Name, const Twine &Value = "1") { - Out << "#define " << Name << ' ' << Value << '\n'; - } - - /// Append a \#undef line for Name. Name should be of the form XXX - /// and we emit "\#undef XXX". - void undefineMacro(const Twine &Name) { - Out << "#undef " << Name << '\n'; - } - - /// Directly append Str and a newline to the underlying buffer. - void append(const Twine &Str) { - Out << Str << '\n'; - } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Makefile b/include/clang/Basic/Makefile deleted file mode 100644 index 5579a99..0000000 --- a/include/clang/Basic/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -CLANG_LEVEL := ../../.. -BUILT_SOURCES = \ - DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \ - DiagnosticCommentKinds.inc \ - DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \ - DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \ - DiagnosticParseKinds.inc DiagnosticSemaKinds.inc \ - DiagnosticSerializationKinds.inc \ - AttrHasAttributeImpl.inc \ - DiagnosticIndexName.inc DiagnosticGroups.inc AttrList.inc arm_neon.inc \ - Version.inc - -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td) - -# Compute the Clang version from the LLVM version, unless specified explicitly. -ifndef CLANG_VERSION -CLANG_VERSION := $(subst svn,,$(LLVMVersion)) -CLANG_VERSION := $(subst rc,,$(CLANG_VERSION)) -endif - -CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION)) -CLANG_VERSION_MAJOR := $(word 1,$(CLANG_VERSION_COMPONENTS)) -CLANG_VERSION_MINOR := $(word 2,$(CLANG_VERSION_COMPONENTS)) -CLANG_VERSION_PATCHLEVEL := $(word 3,$(CLANG_VERSION_COMPONENTS)) -ifeq ($(CLANG_VERSION_PATCHLEVEL),) -CLANG_HAS_VERSION_PATCHLEVEL := 0 -else -CLANG_HAS_VERSION_PATCHLEVEL := 1 -endif - -$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen" - $(Verb) $(ClangTableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $< - -$(ObjDir)/DiagnosticIndexName.inc.tmp : Diagnostic.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang diagnostic name index with tblgen" - $(Verb) $(ClangTableGen) -gen-clang-diags-index-name -o $(call SYSPATH, $@) $< - -$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(CLANG_TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang diagnostic groups with tblgen" - $(Verb) $(ClangTableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $< - -$(ObjDir)/AttrList.inc.tmp : Attr.td $(CLANG_TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang attribute list with tblgen" - $(Verb) $(ClangTableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../.. $< - -$(ObjDir)/AttrHasAttributeImpl.inc.tmp : Attr.td $(CLANG_TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang __has_attribute implementation with tblgen" - $(Verb) $(ClangTableGen) -gen-clang-attr-has-attribute-impl -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../../ $< - -$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(CLANG_TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang arm_neon.inc with tblgen" - $(Verb) $(ClangTableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../.. $< - -$(ObjDir)/Version.inc.tmp : Version.inc.in Makefile $(LLVM_OBJ_ROOT)/Makefile.config $(ObjDir)/.dir - $(Echo) "Updating Clang version info." - $(Verb)sed -e "s#@CLANG_VERSION@#$(CLANG_VERSION)#g" \ - -e "s#@CLANG_VERSION_MAJOR@#$(CLANG_VERSION_MAJOR)#g" \ - -e "s#@CLANG_VERSION_MINOR@#$(CLANG_VERSION_MINOR)#g" \ - -e "s#@CLANG_VERSION_PATCHLEVEL@#$(CLANG_VERSION_PATCHLEVEL)#g" \ - -e "s#@CLANG_HAS_VERSION_PATCHLEVEL@#$(CLANG_HAS_VERSION_PATCHLEVEL)#g" \ - $< > $@ diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h deleted file mode 100644 index 1702fb1..0000000 --- a/include/clang/Basic/Module.h +++ /dev/null @@ -1,569 +0,0 @@ -//===--- Module.h - Describe a module ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::Module class, which describes a module in the -/// source code. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_MODULE_H -#define LLVM_CLANG_BASIC_MODULE_H - -#include "clang/Basic/FileManager.h" -#include "clang/Basic/SourceLocation.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/PointerIntPair.h" -#include "llvm/ADT/PointerUnion.h" -#include "llvm/ADT/SetVector.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/StringRef.h" -#include <string> -#include <utility> -#include <vector> - -namespace llvm { - class raw_ostream; -} - -namespace clang { - -class LangOptions; -class TargetInfo; -class IdentifierInfo; - -/// \brief Describes the name of a module. -typedef SmallVector<std::pair<std::string, SourceLocation>, 2> ModuleId; - -/// \brief Describes a module or submodule. -class Module { -public: - /// \brief The name of this module. - std::string Name; - - /// \brief The location of the module definition. - SourceLocation DefinitionLoc; - - /// \brief The parent of this module. This will be NULL for the top-level - /// module. - Module *Parent; - - /// \brief The build directory of this module. This is the directory in - /// which the module is notionally built, and relative to which its headers - /// are found. - const DirectoryEntry *Directory; - - /// \brief The umbrella header or directory. - llvm::PointerUnion<const DirectoryEntry *, const FileEntry *> Umbrella; - - /// \brief The module signature. - uint64_t Signature; - - /// \brief The name of the umbrella entry, as written in the module map. - std::string UmbrellaAsWritten; - -private: - /// \brief The submodules of this module, indexed by name. - std::vector<Module *> SubModules; - - /// \brief A mapping from the submodule name to the index into the - /// \c SubModules vector at which that submodule resides. - llvm::StringMap<unsigned> SubModuleIndex; - - /// \brief The AST file if this is a top-level module which has a - /// corresponding serialized AST file, or null otherwise. - const FileEntry *ASTFile; - - /// \brief The top-level headers associated with this module. - llvm::SmallSetVector<const FileEntry *, 2> TopHeaders; - - /// \brief top-level header filenames that aren't resolved to FileEntries yet. - std::vector<std::string> TopHeaderNames; - - /// \brief Cache of modules visible to lookup in this module. - mutable llvm::DenseSet<const Module*> VisibleModulesCache; - - /// The ID used when referencing this module within a VisibleModuleSet. - unsigned VisibilityID; - -public: - enum HeaderKind { - HK_Normal, - HK_Textual, - HK_Private, - HK_PrivateTextual, - HK_Excluded - }; - static const int NumHeaderKinds = HK_Excluded + 1; - - /// \brief Information about a header directive as found in the module map - /// file. - struct Header { - std::string NameAsWritten; - const FileEntry *Entry; - - explicit operator bool() { return Entry; } - }; - - /// \brief Information about a directory name as found in the module map - /// file. - struct DirectoryName { - std::string NameAsWritten; - const DirectoryEntry *Entry; - - explicit operator bool() { return Entry; } - }; - - /// \brief The headers that are part of this module. - SmallVector<Header, 2> Headers[5]; - - /// \brief Stored information about a header directive that was found in the - /// module map file but has not been resolved to a file. - struct UnresolvedHeaderDirective { - SourceLocation FileNameLoc; - std::string FileName; - bool IsUmbrella; - }; - - /// \brief Headers that are mentioned in the module map file but could not be - /// found on the file system. - SmallVector<UnresolvedHeaderDirective, 1> MissingHeaders; - - /// \brief An individual requirement: a feature name and a flag indicating - /// the required state of that feature. - typedef std::pair<std::string, bool> Requirement; - - /// \brief The set of language features required to use this module. - /// - /// If any of these requirements are not available, the \c IsAvailable bit - /// will be false to indicate that this (sub)module is not available. - SmallVector<Requirement, 2> Requirements; - - /// \brief Whether this module is missing a feature from \c Requirements. - unsigned IsMissingRequirement : 1; - - /// \brief Whether we tried and failed to load a module file for this module. - unsigned HasIncompatibleModuleFile : 1; - - /// \brief Whether this module is available in the current translation unit. - /// - /// If the module is missing headers or does not meet all requirements then - /// this bit will be 0. - unsigned IsAvailable : 1; - - /// \brief Whether this module was loaded from a module file. - unsigned IsFromModuleFile : 1; - - /// \brief Whether this is a framework module. - unsigned IsFramework : 1; - - /// \brief Whether this is an explicit submodule. - unsigned IsExplicit : 1; - - /// \brief Whether this is a "system" module (which assumes that all - /// headers in it are system headers). - unsigned IsSystem : 1; - - /// \brief Whether this is an 'extern "C"' module (which implicitly puts all - /// headers in it within an 'extern "C"' block, and allows the module to be - /// imported within such a block). - unsigned IsExternC : 1; - - /// \brief Whether this is an inferred submodule (module * { ... }). - unsigned IsInferred : 1; - - /// \brief Whether we should infer submodules for this module based on - /// the headers. - /// - /// Submodules can only be inferred for modules with an umbrella header. - unsigned InferSubmodules : 1; - - /// \brief Whether, when inferring submodules, the inferred submodules - /// should be explicit. - unsigned InferExplicitSubmodules : 1; - - /// \brief Whether, when inferring submodules, the inferr submodules should - /// export all modules they import (e.g., the equivalent of "export *"). - unsigned InferExportWildcard : 1; - - /// \brief Whether the set of configuration macros is exhaustive. - /// - /// When the set of configuration macros is exhaustive, meaning - /// that no identifier not in this list should affect how the module is - /// built. - unsigned ConfigMacrosExhaustive : 1; - - /// \brief Describes the visibility of the various names within a - /// particular module. - enum NameVisibilityKind { - /// \brief All of the names in this module are hidden. - Hidden, - /// \brief All of the names in this module are visible. - AllVisible - }; - - /// \brief The visibility of names within this particular module. - NameVisibilityKind NameVisibility; - - /// \brief The location of the inferred submodule. - SourceLocation InferredSubmoduleLoc; - - /// \brief The set of modules imported by this module, and on which this - /// module depends. - llvm::SmallSetVector<Module *, 2> Imports; - - /// \brief Describes an exported module. - /// - /// The pointer is the module being re-exported, while the bit will be true - /// to indicate that this is a wildcard export. - typedef llvm::PointerIntPair<Module *, 1, bool> ExportDecl; - - /// \brief The set of export declarations. - SmallVector<ExportDecl, 2> Exports; - - /// \brief Describes an exported module that has not yet been resolved - /// (perhaps because the module it refers to has not yet been loaded). - struct UnresolvedExportDecl { - /// \brief The location of the 'export' keyword in the module map file. - SourceLocation ExportLoc; - - /// \brief The name of the module. - ModuleId Id; - - /// \brief Whether this export declaration ends in a wildcard, indicating - /// that all of its submodules should be exported (rather than the named - /// module itself). - bool Wildcard; - }; - - /// \brief The set of export declarations that have yet to be resolved. - SmallVector<UnresolvedExportDecl, 2> UnresolvedExports; - - /// \brief The directly used modules. - SmallVector<Module *, 2> DirectUses; - - /// \brief The set of use declarations that have yet to be resolved. - SmallVector<ModuleId, 2> UnresolvedDirectUses; - - /// \brief A library or framework to link against when an entity from this - /// module is used. - struct LinkLibrary { - LinkLibrary() : IsFramework(false) { } - LinkLibrary(const std::string &Library, bool IsFramework) - : Library(Library), IsFramework(IsFramework) { } - - /// \brief The library to link against. - /// - /// This will typically be a library or framework name, but can also - /// be an absolute path to the library or framework. - std::string Library; - - /// \brief Whether this is a framework rather than a library. - bool IsFramework; - }; - - /// \brief The set of libraries or frameworks to link against when - /// an entity from this module is used. - llvm::SmallVector<LinkLibrary, 2> LinkLibraries; - - /// \brief The set of "configuration macros", which are macros that - /// (intentionally) change how this module is built. - std::vector<std::string> ConfigMacros; - - /// \brief An unresolved conflict with another module. - struct UnresolvedConflict { - /// \brief The (unresolved) module id. - ModuleId Id; - - /// \brief The message provided to the user when there is a conflict. - std::string Message; - }; - - /// \brief The list of conflicts for which the module-id has not yet been - /// resolved. - std::vector<UnresolvedConflict> UnresolvedConflicts; - - /// \brief A conflict between two modules. - struct Conflict { - /// \brief The module that this module conflicts with. - Module *Other; - - /// \brief The message provided to the user when there is a conflict. - std::string Message; - }; - - /// \brief The list of conflicts. - std::vector<Conflict> Conflicts; - - /// \brief Construct a new module or submodule. - Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, - bool IsFramework, bool IsExplicit, unsigned VisibilityID); - - ~Module(); - - /// \brief Determine whether this module is available for use within the - /// current translation unit. - bool isAvailable() const { return IsAvailable; } - - /// \brief Determine whether this module is available for use within the - /// current translation unit. - /// - /// \param LangOpts The language options used for the current - /// translation unit. - /// - /// \param Target The target options used for the current translation unit. - /// - /// \param Req If this module is unavailable, this parameter - /// will be set to one of the requirements that is not met for use of - /// this module. - bool isAvailable(const LangOptions &LangOpts, - const TargetInfo &Target, - Requirement &Req, - UnresolvedHeaderDirective &MissingHeader) const; - - /// \brief Determine whether this module is a submodule. - bool isSubModule() const { return Parent != nullptr; } - - /// \brief Determine whether this module is a submodule of the given other - /// module. - bool isSubModuleOf(const Module *Other) const; - - /// \brief Determine whether this module is a part of a framework, - /// either because it is a framework module or because it is a submodule - /// of a framework module. - bool isPartOfFramework() const { - for (const Module *Mod = this; Mod; Mod = Mod->Parent) - if (Mod->IsFramework) - return true; - - return false; - } - - /// \brief Determine whether this module is a subframework of another - /// framework. - bool isSubFramework() const { - return IsFramework && Parent && Parent->isPartOfFramework(); - } - - /// \brief Retrieve the full name of this module, including the path from - /// its top-level module. - std::string getFullModuleName() const; - - /// \brief Whether the full name of this module is equal to joining - /// \p nameParts with "."s. - /// - /// This is more efficient than getFullModuleName(). - bool fullModuleNameIs(ArrayRef<StringRef> nameParts) const; - - /// \brief Retrieve the top-level module for this (sub)module, which may - /// be this module. - Module *getTopLevelModule() { - return const_cast<Module *>( - const_cast<const Module *>(this)->getTopLevelModule()); - } - - /// \brief Retrieve the top-level module for this (sub)module, which may - /// be this module. - const Module *getTopLevelModule() const; - - /// \brief Retrieve the name of the top-level module. - /// - StringRef getTopLevelModuleName() const { - return getTopLevelModule()->Name; - } - - /// \brief The serialized AST file for this module, if one was created. - const FileEntry *getASTFile() const { - return getTopLevelModule()->ASTFile; - } - - /// \brief Set the serialized AST file for the top-level module of this module. - void setASTFile(const FileEntry *File) { - assert((File == nullptr || getASTFile() == nullptr || - getASTFile() == File) && "file path changed"); - getTopLevelModule()->ASTFile = File; - } - - /// \brief Retrieve the directory for which this module serves as the - /// umbrella. - DirectoryName getUmbrellaDir() const; - - /// \brief Retrieve the header that serves as the umbrella header for this - /// module. - Header getUmbrellaHeader() const { - if (auto *E = Umbrella.dyn_cast<const FileEntry *>()) - return Header{UmbrellaAsWritten, E}; - return Header{}; - } - - /// \brief Determine whether this module has an umbrella directory that is - /// not based on an umbrella header. - bool hasUmbrellaDir() const { - return Umbrella && Umbrella.is<const DirectoryEntry *>(); - } - - /// \brief Add a top-level header associated with this module. - void addTopHeader(const FileEntry *File) { - assert(File); - TopHeaders.insert(File); - } - - /// \brief Add a top-level header filename associated with this module. - void addTopHeaderFilename(StringRef Filename) { - TopHeaderNames.push_back(Filename); - } - - /// \brief The top-level headers associated with this module. - ArrayRef<const FileEntry *> getTopHeaders(FileManager &FileMgr); - - /// \brief Determine whether this module has declared its intention to - /// directly use another module. - bool directlyUses(const Module *Requested) const; - - /// \brief Add the given feature requirement to the list of features - /// required by this module. - /// - /// \param Feature The feature that is required by this module (and - /// its submodules). - /// - /// \param RequiredState The required state of this feature: \c true - /// if it must be present, \c false if it must be absent. - /// - /// \param LangOpts The set of language options that will be used to - /// evaluate the availability of this feature. - /// - /// \param Target The target options that will be used to evaluate the - /// availability of this feature. - void addRequirement(StringRef Feature, bool RequiredState, - const LangOptions &LangOpts, - const TargetInfo &Target); - - /// \brief Mark this module and all of its submodules as unavailable. - void markUnavailable(bool MissingRequirement = false); - - /// \brief Find the submodule with the given name. - /// - /// \returns The submodule if found, or NULL otherwise. - Module *findSubmodule(StringRef Name) const; - - /// \brief Determine whether the specified module would be visible to - /// a lookup at the end of this module. - /// - /// FIXME: This may return incorrect results for (submodules of) the - /// module currently being built, if it's queried before we see all - /// of its imports. - bool isModuleVisible(const Module *M) const { - if (VisibleModulesCache.empty()) - buildVisibleModulesCache(); - return VisibleModulesCache.count(M); - } - - unsigned getVisibilityID() const { return VisibilityID; } - - typedef std::vector<Module *>::iterator submodule_iterator; - typedef std::vector<Module *>::const_iterator submodule_const_iterator; - - submodule_iterator submodule_begin() { return SubModules.begin(); } - submodule_const_iterator submodule_begin() const {return SubModules.begin();} - submodule_iterator submodule_end() { return SubModules.end(); } - submodule_const_iterator submodule_end() const { return SubModules.end(); } - - llvm::iterator_range<submodule_iterator> submodules() { - return llvm::make_range(submodule_begin(), submodule_end()); - } - llvm::iterator_range<submodule_const_iterator> submodules() const { - return llvm::make_range(submodule_begin(), submodule_end()); - } - - /// \brief Appends this module's list of exported modules to \p Exported. - /// - /// This provides a subset of immediately imported modules (the ones that are - /// directly exported), not the complete set of exported modules. - void getExportedModules(SmallVectorImpl<Module *> &Exported) const; - - static StringRef getModuleInputBufferName() { - return "<module-includes>"; - } - - /// \brief Print the module map for this module to the given stream. - /// - void print(raw_ostream &OS, unsigned Indent = 0) const; - - /// \brief Dump the contents of this module to the given output stream. - void dump() const; - -private: - void buildVisibleModulesCache() const; -}; - -/// \brief A set of visible modules. -class VisibleModuleSet { -public: - VisibleModuleSet() : Generation(0) {} - VisibleModuleSet(VisibleModuleSet &&O) - : ImportLocs(std::move(O.ImportLocs)), Generation(O.Generation ? 1 : 0) { - O.ImportLocs.clear(); - ++O.Generation; - } - - /// Move from another visible modules set. Guaranteed to leave the source - /// empty and bump the generation on both. - VisibleModuleSet &operator=(VisibleModuleSet &&O) { - ImportLocs = std::move(O.ImportLocs); - O.ImportLocs.clear(); - ++O.Generation; - ++Generation; - return *this; - } - - /// \brief Get the current visibility generation. Incremented each time the - /// set of visible modules changes in any way. - unsigned getGeneration() const { return Generation; } - - /// \brief Determine whether a module is visible. - bool isVisible(const Module *M) const { - return getImportLoc(M).isValid(); - } - - /// \brief Get the location at which the import of a module was triggered. - SourceLocation getImportLoc(const Module *M) const { - return M->getVisibilityID() < ImportLocs.size() - ? ImportLocs[M->getVisibilityID()] - : SourceLocation(); - } - - /// \brief A callback to call when a module is made visible (directly or - /// indirectly) by a call to \ref setVisible. - typedef llvm::function_ref<void(Module *M)> VisibleCallback; - /// \brief A callback to call when a module conflict is found. \p Path - /// consists of a sequence of modules from the conflicting module to the one - /// made visible, where each was exported by the next. - typedef llvm::function_ref<void(ArrayRef<Module *> Path, - Module *Conflict, StringRef Message)> - ConflictCallback; - /// \brief Make a specific module visible. - void setVisible(Module *M, SourceLocation Loc, - VisibleCallback Vis = [](Module *) {}, - ConflictCallback Cb = [](ArrayRef<Module *>, Module *, - StringRef) {}); - -private: - /// Import locations for each visible module. Indexed by the module's - /// VisibilityID. - std::vector<SourceLocation> ImportLocs; - /// Visibility generation, bumped every time the visibility state changes. - unsigned Generation; -}; - -} // end namespace clang - - -#endif // LLVM_CLANG_BASIC_MODULE_H diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h deleted file mode 100644 index cf51b14..0000000 --- a/include/clang/Basic/ObjCRuntime.h +++ /dev/null @@ -1,333 +0,0 @@ -//===--- ObjCRuntime.h - Objective-C Runtime Configuration ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines types useful for describing an Objective-C runtime. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H -#define LLVM_CLANG_BASIC_OBJCRUNTIME_H - -#include "clang/Basic/VersionTuple.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/ErrorHandling.h" - -namespace clang { - -/// \brief The basic abstraction for the target Objective-C runtime. -class ObjCRuntime { -public: - /// \brief The basic Objective-C runtimes that we know about. - enum Kind { - /// 'macosx' is the Apple-provided NeXT-derived runtime on Mac OS - /// X platforms that use the non-fragile ABI; the version is a - /// release of that OS. - MacOSX, - - /// 'macosx-fragile' is the Apple-provided NeXT-derived runtime on - /// Mac OS X platforms that use the fragile ABI; the version is a - /// release of that OS. - FragileMacOSX, - - /// 'ios' is the Apple-provided NeXT-derived runtime on iOS or the iOS - /// simulator; it is always non-fragile. The version is a release - /// version of iOS. - iOS, - - /// 'watchos' is a variant of iOS for Apple's watchOS. The version - /// is a release version of watchOS. - WatchOS, - - /// 'gcc' is the Objective-C runtime shipped with GCC, implementing a - /// fragile Objective-C ABI - GCC, - - /// 'gnustep' is the modern non-fragile GNUstep runtime. - GNUstep, - - /// 'objfw' is the Objective-C runtime included in ObjFW - ObjFW - }; - -private: - Kind TheKind; - VersionTuple Version; - -public: - /// A bogus initialization of the runtime. - ObjCRuntime() : TheKind(MacOSX) {} - - ObjCRuntime(Kind kind, const VersionTuple &version) - : TheKind(kind), Version(version) {} - - void set(Kind kind, VersionTuple version) { - TheKind = kind; - Version = version; - } - - Kind getKind() const { return TheKind; } - const VersionTuple &getVersion() const { return Version; } - - /// \brief Does this runtime follow the set of implied behaviors for a - /// "non-fragile" ABI? - bool isNonFragile() const { - switch (getKind()) { - case FragileMacOSX: return false; - case GCC: return false; - case MacOSX: return true; - case GNUstep: return true; - case ObjFW: return true; - case iOS: return true; - case WatchOS: return true; - } - llvm_unreachable("bad kind"); - } - - /// The inverse of isNonFragile(): does this runtime follow the set of - /// implied behaviors for a "fragile" ABI? - bool isFragile() const { return !isNonFragile(); } - - /// The default dispatch mechanism to use for the specified architecture - bool isLegacyDispatchDefaultForArch(llvm::Triple::ArchType Arch) { - // The GNUstep runtime uses a newer dispatch method by default from - // version 1.6 onwards - if (getKind() == GNUstep && getVersion() >= VersionTuple(1, 6)) { - if (Arch == llvm::Triple::arm || - Arch == llvm::Triple::x86 || - Arch == llvm::Triple::x86_64) - return false; - } - else if ((getKind() == MacOSX) && isNonFragile() && - (getVersion() >= VersionTuple(10, 0)) && - (getVersion() < VersionTuple(10, 6))) - return Arch != llvm::Triple::x86_64; - // Except for deployment target of 10.5 or less, - // Mac runtimes use legacy dispatch everywhere now. - return true; - } - - /// \brief Is this runtime basically of the GNU family of runtimes? - bool isGNUFamily() const { - switch (getKind()) { - case FragileMacOSX: - case MacOSX: - case iOS: - case WatchOS: - return false; - case GCC: - case GNUstep: - case ObjFW: - return true; - } - llvm_unreachable("bad kind"); - } - - /// \brief Is this runtime basically of the NeXT family of runtimes? - bool isNeXTFamily() const { - // For now, this is just the inverse of isGNUFamily(), but that's - // not inherently true. - return !isGNUFamily(); - } - - /// \brief Does this runtime allow ARC at all? - bool allowsARC() const { - switch (getKind()) { - case FragileMacOSX: - // No stub library for the fragile runtime. - return getVersion() >= VersionTuple(10, 7); - case MacOSX: return true; - case iOS: return true; - case WatchOS: return true; - case GCC: return false; - case GNUstep: return true; - case ObjFW: return true; - } - llvm_unreachable("bad kind"); - } - - /// \brief Does this runtime natively provide the ARC entrypoints? - /// - /// ARC cannot be directly supported on a platform that does not provide - /// these entrypoints, although it may be supportable via a stub - /// library. - bool hasNativeARC() const { - switch (getKind()) { - case FragileMacOSX: return getVersion() >= VersionTuple(10, 7); - case MacOSX: return getVersion() >= VersionTuple(10, 7); - case iOS: return getVersion() >= VersionTuple(5); - case WatchOS: return true; - - case GCC: return false; - case GNUstep: return getVersion() >= VersionTuple(1, 6); - case ObjFW: return true; - } - llvm_unreachable("bad kind"); - } - - /// \brief Does this runtime supports optimized setter entrypoints? - bool hasOptimizedSetter() const { - switch (getKind()) { - case MacOSX: - return getVersion() >= VersionTuple(10, 8); - case iOS: - return (getVersion() >= VersionTuple(6)); - case WatchOS: - return true; - case GNUstep: - return getVersion() >= VersionTuple(1, 7); - - default: - return false; - } - } - - /// Does this runtime allow the use of __weak? - bool allowsWeak() const { - return hasNativeWeak(); - } - - /// \brief Does this runtime natively provide ARC-compliant 'weak' - /// entrypoints? - bool hasNativeWeak() const { - // Right now, this is always equivalent to whether the runtime - // natively supports ARC decision. - return hasNativeARC(); - } - - /// \brief Does this runtime directly support the subscripting methods? - /// - /// This is really a property of the library, not the runtime. - bool hasSubscripting() const { - switch (getKind()) { - case FragileMacOSX: return false; - case MacOSX: return getVersion() >= VersionTuple(10, 8); - case iOS: return getVersion() >= VersionTuple(6); - case WatchOS: return true; - - // This is really a lie, because some implementations and versions - // of the runtime do not support ARC. Probably -fgnu-runtime - // should imply a "maximal" runtime or something? - case GCC: return true; - case GNUstep: return true; - case ObjFW: return true; - } - llvm_unreachable("bad kind"); - } - - /// \brief Does this runtime allow sizeof or alignof on object types? - bool allowsSizeofAlignof() const { - return isFragile(); - } - - /// \brief Does this runtime allow pointer arithmetic on objects? - /// - /// This covers +, -, ++, --, and (if isSubscriptPointerArithmetic() - /// yields true) []. - bool allowsPointerArithmetic() const { - switch (getKind()) { - case FragileMacOSX: - case GCC: - return true; - case MacOSX: - case iOS: - case WatchOS: - case GNUstep: - case ObjFW: - return false; - } - llvm_unreachable("bad kind"); - } - - /// \brief Is subscripting pointer arithmetic? - bool isSubscriptPointerArithmetic() const { - return allowsPointerArithmetic(); - } - - /// \brief Does this runtime provide an objc_terminate function? - /// - /// This is used in handlers for exceptions during the unwind process; - /// without it, abort() must be used in pure ObjC files. - bool hasTerminate() const { - switch (getKind()) { - case FragileMacOSX: return getVersion() >= VersionTuple(10, 8); - case MacOSX: return getVersion() >= VersionTuple(10, 8); - case iOS: return getVersion() >= VersionTuple(5); - case WatchOS: return true; - case GCC: return false; - case GNUstep: return false; - case ObjFW: return false; - } - llvm_unreachable("bad kind"); - } - - /// \brief Does this runtime support weakly importing classes? - bool hasWeakClassImport() const { - switch (getKind()) { - case MacOSX: return true; - case iOS: return true; - case WatchOS: return true; - case FragileMacOSX: return false; - case GCC: return true; - case GNUstep: return true; - case ObjFW: return true; - } - llvm_unreachable("bad kind"); - } - - /// \brief Does this runtime use zero-cost exceptions? - bool hasUnwindExceptions() const { - switch (getKind()) { - case MacOSX: return true; - case iOS: return true; - case WatchOS: return true; - case FragileMacOSX: return false; - case GCC: return true; - case GNUstep: return true; - case ObjFW: return true; - } - llvm_unreachable("bad kind"); - } - - bool hasAtomicCopyHelper() const { - switch (getKind()) { - case FragileMacOSX: - case MacOSX: - case iOS: - case WatchOS: - return true; - case GNUstep: - return getVersion() >= VersionTuple(1, 7); - default: return false; - } - } - - /// \brief Try to parse an Objective-C runtime specification from the given - /// string. - /// - /// \return true on error. - bool tryParse(StringRef input); - - std::string getAsString() const; - - friend bool operator==(const ObjCRuntime &left, const ObjCRuntime &right) { - return left.getKind() == right.getKind() && - left.getVersion() == right.getVersion(); - } - - friend bool operator!=(const ObjCRuntime &left, const ObjCRuntime &right) { - return !(left == right); - } -}; - -raw_ostream &operator<<(raw_ostream &out, const ObjCRuntime &value); - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/OpenCLExtensions.def b/include/clang/Basic/OpenCLExtensions.def deleted file mode 100644 index 91fd919..0000000 --- a/include/clang/Basic/OpenCLExtensions.def +++ /dev/null @@ -1,35 +0,0 @@ -//===--- OpenCLExtensions.def - OpenCL extension list -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the list of supported OpenCL extensions. -// -//===----------------------------------------------------------------------===// - -// OpenCL 1.1. -OPENCLEXT(cl_khr_fp64) -OPENCLEXT(cl_khr_int64_base_atomics) -OPENCLEXT(cl_khr_int64_extended_atomics) -OPENCLEXT(cl_khr_fp16) -OPENCLEXT(cl_khr_gl_sharing) -OPENCLEXT(cl_khr_gl_event) -OPENCLEXT(cl_khr_d3d10_sharing) -OPENCLEXT(cl_khr_global_int32_base_atomics) -OPENCLEXT(cl_khr_global_int32_extended_atomics) -OPENCLEXT(cl_khr_local_int32_base_atomics) -OPENCLEXT(cl_khr_local_int32_extended_atomics) -OPENCLEXT(cl_khr_byte_addressable_store) -OPENCLEXT(cl_khr_3d_image_writes) - -// OpenCL 2.0 -OPENCLEXT(cl_khr_gl_msaa_sharing) - -// Clang Extensions. -OPENCLEXT(cl_clang_storage_class_specifiers) - -#undef OPENCLEXT diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def deleted file mode 100644 index 44f77ad..0000000 --- a/include/clang/Basic/OpenMPKinds.def +++ /dev/null @@ -1,451 +0,0 @@ -//===--- OpenMPKinds.def - OpenMP directives and clauses list ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// \file -/// \brief This file defines the list of supported OpenMP directives and -/// clauses. -/// -//===----------------------------------------------------------------------===// - -#ifndef OPENMP_DIRECTIVE -# define OPENMP_DIRECTIVE(Name) -#endif -#ifndef OPENMP_DIRECTIVE_EXT -#define OPENMP_DIRECTIVE_EXT(Name, Str) -#endif -#ifndef OPENMP_CLAUSE -# define OPENMP_CLAUSE(Name, Class) -#endif -#ifndef OPENMP_PARALLEL_CLAUSE -# define OPENMP_PARALLEL_CLAUSE(Name) -#endif -#ifndef OPENMP_SIMD_CLAUSE -# define OPENMP_SIMD_CLAUSE(Name) -#endif -#ifndef OPENMP_FOR_CLAUSE -# define OPENMP_FOR_CLAUSE(Name) -#endif -#ifndef OPENMP_FOR_SIMD_CLAUSE -# define OPENMP_FOR_SIMD_CLAUSE(Name) -#endif -#ifndef OPENMP_SECTIONS_CLAUSE -# define OPENMP_SECTIONS_CLAUSE(Name) -#endif -#ifndef OPENMP_SINGLE_CLAUSE -# define OPENMP_SINGLE_CLAUSE(Name) -#endif -#ifndef OPENMP_PARALLEL_FOR_CLAUSE -# define OPENMP_PARALLEL_FOR_CLAUSE(Name) -#endif -#ifndef OPENMP_PARALLEL_FOR_SIMD_CLAUSE -# define OPENMP_PARALLEL_FOR_SIMD_CLAUSE(Name) -#endif -#ifndef OPENMP_PARALLEL_SECTIONS_CLAUSE -# define OPENMP_PARALLEL_SECTIONS_CLAUSE(Name) -#endif -#ifndef OPENMP_TASK_CLAUSE -# define OPENMP_TASK_CLAUSE(Name) -#endif -#ifndef OPENMP_ATOMIC_CLAUSE -# define OPENMP_ATOMIC_CLAUSE(Name) -#endif -#ifndef OPENMP_TARGET_CLAUSE -# define OPENMP_TARGET_CLAUSE(Name) -#endif -#ifndef OPENMP_TARGET_DATA_CLAUSE -# define OPENMP_TARGET_DATA_CLAUSE(Name) -#endif -#ifndef OPENMP_TEAMS_CLAUSE -# define OPENMP_TEAMS_CLAUSE(Name) -#endif -#ifndef OPENMP_CANCEL_CLAUSE -# define OPENMP_CANCEL_CLAUSE(Name) -#endif -#ifndef OPENMP_ORDERED_CLAUSE -# define OPENMP_ORDERED_CLAUSE(Name) -#endif -#ifndef OPENMP_TASKLOOP_CLAUSE -# define OPENMP_TASKLOOP_CLAUSE(Name) -#endif -#ifndef OPENMP_TASKLOOP_SIMD_CLAUSE -# define OPENMP_TASKLOOP_SIMD_CLAUSE(Name) -#endif -#ifndef OPENMP_CRITICAL_CLAUSE -# define OPENMP_CRITICAL_CLAUSE(Name) -#endif -#ifndef OPENMP_DISTRIBUTE_CLAUSE -#define OPENMP_DISTRIBUTE_CLAUSE(Name) -#endif -#ifndef OPENMP_DEFAULT_KIND -# define OPENMP_DEFAULT_KIND(Name) -#endif -#ifndef OPENMP_PROC_BIND_KIND -# define OPENMP_PROC_BIND_KIND(Name) -#endif -#ifndef OPENMP_SCHEDULE_KIND -#define OPENMP_SCHEDULE_KIND(Name) -#endif -#ifndef OPENMP_SCHEDULE_MODIFIER -#define OPENMP_SCHEDULE_MODIFIER(Name) -#endif -#ifndef OPENMP_DEPEND_KIND -#define OPENMP_DEPEND_KIND(Name) -#endif -#ifndef OPENMP_LINEAR_KIND -#define OPENMP_LINEAR_KIND(Name) -#endif -#ifndef OPENMP_MAP_KIND -#define OPENMP_MAP_KIND(Name) -#endif - -// OpenMP directives. -OPENMP_DIRECTIVE(threadprivate) -OPENMP_DIRECTIVE(parallel) -OPENMP_DIRECTIVE(task) -OPENMP_DIRECTIVE(simd) -OPENMP_DIRECTIVE(for) -OPENMP_DIRECTIVE(sections) -OPENMP_DIRECTIVE(section) -OPENMP_DIRECTIVE(single) -OPENMP_DIRECTIVE(master) -OPENMP_DIRECTIVE(critical) -OPENMP_DIRECTIVE(taskyield) -OPENMP_DIRECTIVE(barrier) -OPENMP_DIRECTIVE(taskwait) -OPENMP_DIRECTIVE(taskgroup) -OPENMP_DIRECTIVE(flush) -OPENMP_DIRECTIVE(ordered) -OPENMP_DIRECTIVE(atomic) -OPENMP_DIRECTIVE(target) -OPENMP_DIRECTIVE(teams) -OPENMP_DIRECTIVE(cancel) -OPENMP_DIRECTIVE_EXT(target_data, "target data") -OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for") -OPENMP_DIRECTIVE_EXT(parallel_for_simd, "parallel for simd") -OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel sections") -OPENMP_DIRECTIVE_EXT(for_simd, "for simd") -OPENMP_DIRECTIVE_EXT(cancellation_point, "cancellation point") -OPENMP_DIRECTIVE(taskloop) -OPENMP_DIRECTIVE_EXT(taskloop_simd, "taskloop simd") -OPENMP_DIRECTIVE(distribute) - -// OpenMP clauses. -OPENMP_CLAUSE(if, OMPIfClause) -OPENMP_CLAUSE(final, OMPFinalClause) -OPENMP_CLAUSE(num_threads, OMPNumThreadsClause) -OPENMP_CLAUSE(safelen, OMPSafelenClause) -OPENMP_CLAUSE(simdlen, OMPSimdlenClause) -OPENMP_CLAUSE(collapse, OMPCollapseClause) -OPENMP_CLAUSE(default, OMPDefaultClause) -OPENMP_CLAUSE(private, OMPPrivateClause) -OPENMP_CLAUSE(firstprivate, OMPFirstprivateClause) -OPENMP_CLAUSE(lastprivate, OMPLastprivateClause) -OPENMP_CLAUSE(shared, OMPSharedClause) -OPENMP_CLAUSE(reduction, OMPReductionClause) -OPENMP_CLAUSE(linear, OMPLinearClause) -OPENMP_CLAUSE(aligned, OMPAlignedClause) -OPENMP_CLAUSE(copyin, OMPCopyinClause) -OPENMP_CLAUSE(copyprivate, OMPCopyprivateClause) -OPENMP_CLAUSE(proc_bind, OMPProcBindClause) -OPENMP_CLAUSE(schedule, OMPScheduleClause) -OPENMP_CLAUSE(ordered, OMPOrderedClause) -OPENMP_CLAUSE(nowait, OMPNowaitClause) -OPENMP_CLAUSE(untied, OMPUntiedClause) -OPENMP_CLAUSE(mergeable, OMPMergeableClause) -OPENMP_CLAUSE(flush, OMPFlushClause) -OPENMP_CLAUSE(read, OMPReadClause) -OPENMP_CLAUSE(write, OMPWriteClause) -OPENMP_CLAUSE(update, OMPUpdateClause) -OPENMP_CLAUSE(capture, OMPCaptureClause) -OPENMP_CLAUSE(seq_cst, OMPSeqCstClause) -OPENMP_CLAUSE(depend, OMPDependClause) -OPENMP_CLAUSE(device, OMPDeviceClause) -OPENMP_CLAUSE(threads, OMPThreadsClause) -OPENMP_CLAUSE(simd, OMPSIMDClause) -OPENMP_CLAUSE(map, OMPMapClause) -OPENMP_CLAUSE(num_teams, OMPNumTeamsClause) -OPENMP_CLAUSE(thread_limit, OMPThreadLimitClause) -OPENMP_CLAUSE(priority, OMPPriorityClause) -OPENMP_CLAUSE(grainsize, OMPGrainsizeClause) -OPENMP_CLAUSE(nogroup, OMPNogroupClause) -OPENMP_CLAUSE(num_tasks, OMPNumTasksClause) -OPENMP_CLAUSE(hint, OMPHintClause) - -// Clauses allowed for OpenMP directive 'parallel'. -OPENMP_PARALLEL_CLAUSE(if) -OPENMP_PARALLEL_CLAUSE(num_threads) -OPENMP_PARALLEL_CLAUSE(default) -OPENMP_PARALLEL_CLAUSE(proc_bind) -OPENMP_PARALLEL_CLAUSE(private) -OPENMP_PARALLEL_CLAUSE(firstprivate) -OPENMP_PARALLEL_CLAUSE(shared) -OPENMP_PARALLEL_CLAUSE(reduction) -OPENMP_PARALLEL_CLAUSE(copyin) - -// Clauses allowed for directive 'omp simd'. -OPENMP_SIMD_CLAUSE(private) -OPENMP_SIMD_CLAUSE(lastprivate) -OPENMP_SIMD_CLAUSE(linear) -OPENMP_SIMD_CLAUSE(aligned) -OPENMP_SIMD_CLAUSE(safelen) -OPENMP_SIMD_CLAUSE(simdlen) -OPENMP_SIMD_CLAUSE(collapse) -OPENMP_SIMD_CLAUSE(reduction) - -// Clauses allowed for directive 'omp for'. -OPENMP_FOR_CLAUSE(private) -OPENMP_FOR_CLAUSE(lastprivate) -OPENMP_FOR_CLAUSE(firstprivate) -OPENMP_FOR_CLAUSE(reduction) -OPENMP_FOR_CLAUSE(collapse) -OPENMP_FOR_CLAUSE(schedule) -OPENMP_FOR_CLAUSE(ordered) -OPENMP_FOR_CLAUSE(nowait) -OPENMP_FOR_CLAUSE(linear) - -// Clauses allowed for directive 'omp for simd'. -OPENMP_FOR_SIMD_CLAUSE(private) -OPENMP_FOR_SIMD_CLAUSE(firstprivate) -OPENMP_FOR_SIMD_CLAUSE(lastprivate) -OPENMP_FOR_SIMD_CLAUSE(reduction) -OPENMP_FOR_SIMD_CLAUSE(schedule) -OPENMP_FOR_SIMD_CLAUSE(collapse) -OPENMP_FOR_SIMD_CLAUSE(nowait) -OPENMP_FOR_SIMD_CLAUSE(safelen) -OPENMP_FOR_SIMD_CLAUSE(simdlen) -OPENMP_FOR_SIMD_CLAUSE(linear) -OPENMP_FOR_SIMD_CLAUSE(aligned) -OPENMP_FOR_SIMD_CLAUSE(ordered) - -// Clauses allowed for OpenMP directive 'omp sections'. -OPENMP_SECTIONS_CLAUSE(private) -OPENMP_SECTIONS_CLAUSE(lastprivate) -OPENMP_SECTIONS_CLAUSE(firstprivate) -OPENMP_SECTIONS_CLAUSE(reduction) -OPENMP_SECTIONS_CLAUSE(nowait) - -// Clauses allowed for directive 'omp single'. -OPENMP_SINGLE_CLAUSE(private) -OPENMP_SINGLE_CLAUSE(firstprivate) -OPENMP_SINGLE_CLAUSE(copyprivate) -OPENMP_SINGLE_CLAUSE(nowait) - -// Clauses allowed for OpenMP directive 'cancel'. -OPENMP_CANCEL_CLAUSE(if) - -// Static attributes for 'default' clause. -OPENMP_DEFAULT_KIND(none) -OPENMP_DEFAULT_KIND(shared) - -// Static attributes for 'proc_bind' clause. -OPENMP_PROC_BIND_KIND(master) -OPENMP_PROC_BIND_KIND(close) -OPENMP_PROC_BIND_KIND(spread) - -// Static attributes for 'schedule' clause. -OPENMP_SCHEDULE_KIND(static) -OPENMP_SCHEDULE_KIND(dynamic) -OPENMP_SCHEDULE_KIND(guided) -OPENMP_SCHEDULE_KIND(auto) -OPENMP_SCHEDULE_KIND(runtime) - -// Modifiers for 'schedule' clause. -OPENMP_SCHEDULE_MODIFIER(monotonic) -OPENMP_SCHEDULE_MODIFIER(nonmonotonic) -OPENMP_SCHEDULE_MODIFIER(simd) - -// Static attributes for 'depend' clause. -OPENMP_DEPEND_KIND(in) -OPENMP_DEPEND_KIND(out) -OPENMP_DEPEND_KIND(inout) -OPENMP_DEPEND_KIND(source) -OPENMP_DEPEND_KIND(sink) - -// Modifiers for 'linear' clause. -OPENMP_LINEAR_KIND(val) -OPENMP_LINEAR_KIND(ref) -OPENMP_LINEAR_KIND(uval) - -// Clauses allowed for OpenMP directive 'parallel for'. -OPENMP_PARALLEL_FOR_CLAUSE(if) -OPENMP_PARALLEL_FOR_CLAUSE(num_threads) -OPENMP_PARALLEL_FOR_CLAUSE(default) -OPENMP_PARALLEL_FOR_CLAUSE(proc_bind) -OPENMP_PARALLEL_FOR_CLAUSE(private) -OPENMP_PARALLEL_FOR_CLAUSE(firstprivate) -OPENMP_PARALLEL_FOR_CLAUSE(shared) -OPENMP_PARALLEL_FOR_CLAUSE(reduction) -OPENMP_PARALLEL_FOR_CLAUSE(copyin) -OPENMP_PARALLEL_FOR_CLAUSE(lastprivate) -OPENMP_PARALLEL_FOR_CLAUSE(collapse) -OPENMP_PARALLEL_FOR_CLAUSE(schedule) -OPENMP_PARALLEL_FOR_CLAUSE(ordered) -OPENMP_PARALLEL_FOR_CLAUSE(linear) - -// Clauses allowed for OpenMP directive 'parallel for simd'. -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(if) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(num_threads) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(default) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(proc_bind) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(private) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(firstprivate) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(shared) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(reduction) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(copyin) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(lastprivate) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(collapse) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(schedule) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(safelen) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(simdlen) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(linear) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(aligned) -OPENMP_PARALLEL_FOR_SIMD_CLAUSE(ordered) - -// Clauses allowed for OpenMP directive 'parallel sections'. -OPENMP_PARALLEL_SECTIONS_CLAUSE(if) -OPENMP_PARALLEL_SECTIONS_CLAUSE(num_threads) -OPENMP_PARALLEL_SECTIONS_CLAUSE(default) -OPENMP_PARALLEL_SECTIONS_CLAUSE(proc_bind) -OPENMP_PARALLEL_SECTIONS_CLAUSE(private) -OPENMP_PARALLEL_SECTIONS_CLAUSE(firstprivate) -OPENMP_PARALLEL_SECTIONS_CLAUSE(shared) -OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction) -OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin) -OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate) - -// Clauses allowed for OpenMP directive 'task'. -OPENMP_TASK_CLAUSE(if) -OPENMP_TASK_CLAUSE(final) -OPENMP_TASK_CLAUSE(default) -OPENMP_TASK_CLAUSE(private) -OPENMP_TASK_CLAUSE(firstprivate) -OPENMP_TASK_CLAUSE(shared) -OPENMP_TASK_CLAUSE(untied) -OPENMP_TASK_CLAUSE(mergeable) -OPENMP_TASK_CLAUSE(depend) -OPENMP_TASK_CLAUSE(priority) - -// Clauses allowed for OpenMP directive 'atomic'. -OPENMP_ATOMIC_CLAUSE(read) -OPENMP_ATOMIC_CLAUSE(write) -OPENMP_ATOMIC_CLAUSE(update) -OPENMP_ATOMIC_CLAUSE(capture) -OPENMP_ATOMIC_CLAUSE(seq_cst) - -// Clauses allowed for OpenMP directive 'target'. -// TODO More clauses for 'target' directive. -OPENMP_TARGET_CLAUSE(if) -OPENMP_TARGET_CLAUSE(device) -OPENMP_TARGET_CLAUSE(map) - -// Clauses allowed for OpenMP directive 'target data'. -// TODO More clauses for 'target data' directive. -OPENMP_TARGET_DATA_CLAUSE(if) -OPENMP_TARGET_DATA_CLAUSE(device) -OPENMP_TARGET_DATA_CLAUSE(map) - -// Clauses allowed for OpenMP directive 'teams'. -// TODO More clauses for 'teams' directive. -OPENMP_TEAMS_CLAUSE(default) -OPENMP_TEAMS_CLAUSE(private) -OPENMP_TEAMS_CLAUSE(firstprivate) -OPENMP_TEAMS_CLAUSE(shared) -OPENMP_TEAMS_CLAUSE(reduction) -OPENMP_TEAMS_CLAUSE(num_teams) -OPENMP_TEAMS_CLAUSE(thread_limit) - -// Clauses allowed for OpenMP directive 'ordered'. -// TODO More clauses for 'ordered' directive. -OPENMP_ORDERED_CLAUSE(threads) -OPENMP_ORDERED_CLAUSE(simd) -OPENMP_ORDERED_CLAUSE(depend) - -// Map types and map type modifier for 'map' clause. -OPENMP_MAP_KIND(alloc) -OPENMP_MAP_KIND(to) -OPENMP_MAP_KIND(from) -OPENMP_MAP_KIND(tofrom) -OPENMP_MAP_KIND(delete) -OPENMP_MAP_KIND(release) -OPENMP_MAP_KIND(always) - -// Clauses allowed for OpenMP directive 'taskloop'. -OPENMP_TASKLOOP_CLAUSE(if) -OPENMP_TASKLOOP_CLAUSE(shared) -OPENMP_TASKLOOP_CLAUSE(private) -OPENMP_TASKLOOP_CLAUSE(firstprivate) -OPENMP_TASKLOOP_CLAUSE(lastprivate) -OPENMP_TASKLOOP_CLAUSE(default) -OPENMP_TASKLOOP_CLAUSE(collapse) -OPENMP_TASKLOOP_CLAUSE(final) -OPENMP_TASKLOOP_CLAUSE(untied) -OPENMP_TASKLOOP_CLAUSE(mergeable) -OPENMP_TASKLOOP_CLAUSE(priority) -OPENMP_TASKLOOP_CLAUSE(grainsize) -OPENMP_TASKLOOP_CLAUSE(nogroup) -OPENMP_TASKLOOP_CLAUSE(num_tasks) - -// Clauses allowed for OpenMP directive 'taskloop simd'. -OPENMP_TASKLOOP_SIMD_CLAUSE(if) -OPENMP_TASKLOOP_SIMD_CLAUSE(shared) -OPENMP_TASKLOOP_SIMD_CLAUSE(private) -OPENMP_TASKLOOP_SIMD_CLAUSE(firstprivate) -OPENMP_TASKLOOP_SIMD_CLAUSE(lastprivate) -OPENMP_TASKLOOP_SIMD_CLAUSE(default) -OPENMP_TASKLOOP_SIMD_CLAUSE(collapse) -OPENMP_TASKLOOP_SIMD_CLAUSE(final) -OPENMP_TASKLOOP_SIMD_CLAUSE(untied) -OPENMP_TASKLOOP_SIMD_CLAUSE(mergeable) -OPENMP_TASKLOOP_SIMD_CLAUSE(priority) -OPENMP_TASKLOOP_SIMD_CLAUSE(linear) -OPENMP_TASKLOOP_SIMD_CLAUSE(aligned) -OPENMP_TASKLOOP_SIMD_CLAUSE(safelen) -OPENMP_TASKLOOP_SIMD_CLAUSE(simdlen) -OPENMP_TASKLOOP_SIMD_CLAUSE(grainsize) -OPENMP_TASKLOOP_SIMD_CLAUSE(nogroup) -OPENMP_TASKLOOP_SIMD_CLAUSE(num_tasks) - -// Clauses allowed for OpenMP directive 'critical'. -OPENMP_CRITICAL_CLAUSE(hint) - -// Clauses allowed for OpenMP directive 'distribute' -OPENMP_DISTRIBUTE_CLAUSE(private) -OPENMP_DISTRIBUTE_CLAUSE(firstprivate) -OPENMP_DISTRIBUTE_CLAUSE(lastprivate) -OPENMP_DISTRIBUTE_CLAUSE(collapse) - -#undef OPENMP_TASKLOOP_SIMD_CLAUSE -#undef OPENMP_TASKLOOP_CLAUSE -#undef OPENMP_LINEAR_KIND -#undef OPENMP_DEPEND_KIND -#undef OPENMP_SCHEDULE_MODIFIER -#undef OPENMP_SCHEDULE_KIND -#undef OPENMP_PROC_BIND_KIND -#undef OPENMP_DEFAULT_KIND -#undef OPENMP_DIRECTIVE -#undef OPENMP_DIRECTIVE_EXT -#undef OPENMP_CLAUSE -#undef OPENMP_CRITICAL_CLAUSE -#undef OPENMP_ORDERED_CLAUSE -#undef OPENMP_CANCEL_CLAUSE -#undef OPENMP_SINGLE_CLAUSE -#undef OPENMP_SECTIONS_CLAUSE -#undef OPENMP_PARALLEL_CLAUSE -#undef OPENMP_PARALLEL_FOR_CLAUSE -#undef OPENMP_PARALLEL_FOR_SIMD_CLAUSE -#undef OPENMP_PARALLEL_SECTIONS_CLAUSE -#undef OPENMP_TASK_CLAUSE -#undef OPENMP_ATOMIC_CLAUSE -#undef OPENMP_TARGET_CLAUSE -#undef OPENMP_TARGET_DATA_CLAUSE -#undef OPENMP_TEAMS_CLAUSE -#undef OPENMP_SIMD_CLAUSE -#undef OPENMP_FOR_CLAUSE -#undef OPENMP_FOR_SIMD_CLAUSE -#undef OPENMP_MAP_KIND -#undef OPENMP_DISTRIBUTE_CLAUSE diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h deleted file mode 100644 index d4d3db8..0000000 --- a/include/clang/Basic/OpenMPKinds.h +++ /dev/null @@ -1,175 +0,0 @@ -//===--- OpenMPKinds.h - OpenMP enums ---------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines some OpenMP-specific enums and functions. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_OPENMPKINDS_H -#define LLVM_CLANG_BASIC_OPENMPKINDS_H - -#include "llvm/ADT/StringRef.h" - -namespace clang { - -/// \brief OpenMP directives. -enum OpenMPDirectiveKind { -#define OPENMP_DIRECTIVE(Name) \ - OMPD_##Name, -#define OPENMP_DIRECTIVE_EXT(Name, Str) \ - OMPD_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPD_unknown -}; - -/// \brief OpenMP clauses. -enum OpenMPClauseKind { -#define OPENMP_CLAUSE(Name, Class) \ - OMPC_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_threadprivate, - OMPC_unknown -}; - -/// \brief OpenMP attributes for 'default' clause. -enum OpenMPDefaultClauseKind { -#define OPENMP_DEFAULT_KIND(Name) \ - OMPC_DEFAULT_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_DEFAULT_unknown -}; - -/// \brief OpenMP attributes for 'proc_bind' clause. -enum OpenMPProcBindClauseKind { -#define OPENMP_PROC_BIND_KIND(Name) \ - OMPC_PROC_BIND_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_PROC_BIND_unknown -}; - -/// \brief OpenMP attributes for 'schedule' clause. -enum OpenMPScheduleClauseKind { -#define OPENMP_SCHEDULE_KIND(Name) \ - OMPC_SCHEDULE_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_SCHEDULE_unknown -}; - -/// \brief OpenMP modifiers for 'schedule' clause. -enum OpenMPScheduleClauseModifier { - OMPC_SCHEDULE_MODIFIER_unknown = OMPC_SCHEDULE_unknown, -#define OPENMP_SCHEDULE_MODIFIER(Name) \ - OMPC_SCHEDULE_MODIFIER_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_SCHEDULE_MODIFIER_last -}; - -/// \brief OpenMP attributes for 'depend' clause. -enum OpenMPDependClauseKind { -#define OPENMP_DEPEND_KIND(Name) \ - OMPC_DEPEND_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_DEPEND_unknown -}; - -/// \brief OpenMP attributes for 'linear' clause. -enum OpenMPLinearClauseKind { -#define OPENMP_LINEAR_KIND(Name) \ - OMPC_LINEAR_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_LINEAR_unknown -}; - -/// \brief OpenMP mapping kind for 'map' clause. -enum OpenMPMapClauseKind { -#define OPENMP_MAP_KIND(Name) \ - OMPC_MAP_##Name, -#include "clang/Basic/OpenMPKinds.def" - OMPC_MAP_unknown -}; - -OpenMPDirectiveKind getOpenMPDirectiveKind(llvm::StringRef Str); -const char *getOpenMPDirectiveName(OpenMPDirectiveKind Kind); - -OpenMPClauseKind getOpenMPClauseKind(llvm::StringRef Str); -const char *getOpenMPClauseName(OpenMPClauseKind Kind); - -unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str); -const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type); - -bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, - OpenMPClauseKind CKind); - -/// \brief Checks if the specified directive is a directive with an associated -/// loop construct. -/// \param DKind Specified directive. -/// \return true - the directive is a loop-associated directive like 'omp simd' -/// or 'omp for' directive, otherwise - false. -bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a worksharing directive. -/// \param DKind Specified directive. -/// \return true - the directive is a worksharing directive like 'omp for', -/// otherwise - false. -bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a taskloop directive. -/// \param DKind Specified directive. -/// \return true - the directive is a worksharing directive like 'omp taskloop', -/// otherwise - false. -bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a parallel-kind directive. -/// \param DKind Specified directive. -/// \return true - the directive is a parallel-like directive like 'omp -/// parallel', otherwise - false. -bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a target-kind directive. -/// \param DKind Specified directive. -/// \return true - the directive is a target-like directive like 'omp target', -/// otherwise - false. -bool isOpenMPTargetDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a teams-kind directive. -/// \param DKind Specified directive. -/// \return true - the directive is a teams-like directive like 'omp teams', -/// otherwise - false. -bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a simd directive. -/// \param DKind Specified directive. -/// \return true - the directive is a simd directive like 'omp simd', -/// otherwise - false. -bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified directive is a distribute directive. -/// \param DKind Specified directive. -/// \return true - the directive is a distribute-directive like 'omp -/// distribute', -/// otherwise - false. -bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind); - -/// \brief Checks if the specified clause is one of private clauses like -/// 'private', 'firstprivate', 'reduction' etc.. -/// \param Kind Clause kind. -/// \return true - the clause is a private clause, otherwise - false. -bool isOpenMPPrivate(OpenMPClauseKind Kind); - -/// \brief Checks if the specified clause is one of threadprivate clauses like -/// 'threadprivate', 'copyin' or 'copyprivate'. -/// \param Kind Clause kind. -/// \return true - the clause is a threadprivate clause, otherwise - false. -bool isOpenMPThreadPrivate(OpenMPClauseKind Kind); - -} - -#endif - diff --git a/include/clang/Basic/OperatorKinds.def b/include/clang/Basic/OperatorKinds.def deleted file mode 100644 index 34ad764..0000000 --- a/include/clang/Basic/OperatorKinds.def +++ /dev/null @@ -1,107 +0,0 @@ -//===--- OperatorKinds.def - C++ Overloaded Operator Database ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the OverloadedOperator database, which includes -// all of the overloadable C++ operators. -// -//===----------------------------------------------------------------------===// -// -/// @file OperatorKinds.def -/// -/// In this file, each of the overloadable C++ operators is enumerated -/// with either the OVERLOADED_OPERATOR or OVERLOADED_OPERATOR_MULTI -/// macro, each of which can be specified by the code including this -/// file. OVERLOADED_OPERATOR is used for single-token operators -/// (e.g., "+"), and has six arguments: -/// -/// Name: The name of the token. OO_Name will be the name of the -/// corresponding enumerator in OverloadedOperatorKind in -/// OperatorKinds.h. -/// -/// Spelling: A string that provides a canonical spelling for the -/// operator, e.g., "operator+". -/// -/// Token: The name of the token that specifies the operator, e.g., -/// "plus" for operator+ or "greatergreaterequal" for -/// "operator>>=". With a "kw_" prefix, the token name can be used as -/// an enumerator into the TokenKind enumeration. -/// -/// Unary: True if the operator can be declared as a unary operator. -/// -/// Binary: True if the operator can be declared as a binary -/// operator. Note that some operators (e.g., "operator+" and -/// "operator*") can be both unary and binary. -/// -/// MemberOnly: True if this operator can only be declared as a -/// non-static member function. False if the operator can be both a -/// non-member function and a non-static member function. -/// -/// OVERLOADED_OPERATOR_MULTI is used to enumerate the multi-token -/// overloaded operator names, e.g., "operator delete []". The macro -/// has all of the parameters of OVERLOADED_OPERATOR except Token, -/// which is omitted. - -#ifndef OVERLOADED_OPERATOR -# define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) -#endif - -#ifndef OVERLOADED_OPERATOR_MULTI -# define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) \ - OVERLOADED_OPERATOR(Name,Spelling,unknown,Unary,Binary,MemberOnly) -#endif - -OVERLOADED_OPERATOR_MULTI(New , "new" , true , true , false) -OVERLOADED_OPERATOR_MULTI(Delete , "delete" , true , true , false) -OVERLOADED_OPERATOR_MULTI(Array_New , "new[]" , true , true , false) -OVERLOADED_OPERATOR_MULTI(Array_Delete , "delete[]" , true , true , false) -OVERLOADED_OPERATOR(Plus , "+" , plus , true , true , false) -OVERLOADED_OPERATOR(Minus , "-" , minus , true , true , false) -OVERLOADED_OPERATOR(Star , "*" , star , true , true , false) -OVERLOADED_OPERATOR(Slash , "/" , slash , false, true , false) -OVERLOADED_OPERATOR(Percent , "%" , percent , false, true , false) -OVERLOADED_OPERATOR(Caret , "^" , caret , false, true , false) -OVERLOADED_OPERATOR(Amp , "&" , amp , true , true , false) -OVERLOADED_OPERATOR(Pipe , "|" , pipe , false, true , false) -OVERLOADED_OPERATOR(Tilde , "~" , tilde , true , false, false) -OVERLOADED_OPERATOR(Exclaim , "!" , exclaim , true , false, false) -OVERLOADED_OPERATOR(Equal , "=" , equal , false, true , true) -OVERLOADED_OPERATOR(Less , "<" , less , false, true , false) -OVERLOADED_OPERATOR(Greater , ">" , greater , false, true , false) -OVERLOADED_OPERATOR(PlusEqual , "+=" , plusequal , false, true , false) -OVERLOADED_OPERATOR(MinusEqual , "-=" , minusequal , false, true , false) -OVERLOADED_OPERATOR(StarEqual , "*=" , starequal , false, true , false) -OVERLOADED_OPERATOR(SlashEqual , "/=" , slashequal , false, true , false) -OVERLOADED_OPERATOR(PercentEqual , "%=" , percentequal , false, true , false) -OVERLOADED_OPERATOR(CaretEqual , "^=" , caretequal , false, true , false) -OVERLOADED_OPERATOR(AmpEqual , "&=" , ampequal , false, true , false) -OVERLOADED_OPERATOR(PipeEqual , "|=" , pipeequal , false, true , false) -OVERLOADED_OPERATOR(LessLess , "<<" , lessless , false, true , false) -OVERLOADED_OPERATOR(GreaterGreater , ">>" , greatergreater , false, true , false) -OVERLOADED_OPERATOR(LessLessEqual , "<<=" , lesslessequal , false, true , false) -OVERLOADED_OPERATOR(GreaterGreaterEqual , ">>=" , greatergreaterequal, false, true , false) -OVERLOADED_OPERATOR(EqualEqual , "==" , equalequal , false, true , false) -OVERLOADED_OPERATOR(ExclaimEqual , "!=" , exclaimequal , false, true , false) -OVERLOADED_OPERATOR(LessEqual , "<=" , lessequal , false, true , false) -OVERLOADED_OPERATOR(GreaterEqual , ">=" , greaterequal , false, true , false) -OVERLOADED_OPERATOR(AmpAmp , "&&" , ampamp , false, true , false) -OVERLOADED_OPERATOR(PipePipe , "||" , pipepipe , false, true , false) -OVERLOADED_OPERATOR(PlusPlus , "++" , plusplus , true , true , false) -OVERLOADED_OPERATOR(MinusMinus , "--" , minusminus , true , true , false) -OVERLOADED_OPERATOR(Comma , "," , comma , false, true , false) -OVERLOADED_OPERATOR(ArrowStar , "->*" , arrowstar , false, true , false) -OVERLOADED_OPERATOR(Arrow , "->" , arrow , true , false, true) -OVERLOADED_OPERATOR_MULTI(Call , "()" , true , true , true) -OVERLOADED_OPERATOR_MULTI(Subscript , "[]" , false, true , true) -// ?: can *not* be overloaded, but we need the overload -// resolution machinery for it. -OVERLOADED_OPERATOR_MULTI(Conditional , "?" , false, true , false) -OVERLOADED_OPERATOR(Coawait , "co_await", kw_co_await , true , false, false) - -#undef OVERLOADED_OPERATOR_MULTI -#undef OVERLOADED_OPERATOR diff --git a/include/clang/Basic/OperatorKinds.h b/include/clang/Basic/OperatorKinds.h deleted file mode 100644 index 7120bae..0000000 --- a/include/clang/Basic/OperatorKinds.h +++ /dev/null @@ -1,36 +0,0 @@ -//===--- OperatorKinds.h - C++ Overloaded Operators -------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines an enumeration for C++ overloaded operators. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_OPERATORKINDS_H -#define LLVM_CLANG_BASIC_OPERATORKINDS_H - -namespace clang { - -/// \brief Enumeration specifying the different kinds of C++ overloaded -/// operators. -enum OverloadedOperatorKind : int { - OO_None, ///< Not an overloaded operator -#define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ - OO_##Name, -#include "clang/Basic/OperatorKinds.def" - NUM_OVERLOADED_OPERATORS -}; - -/// \brief Retrieve the spelling of the given overloaded operator, without -/// the preceding "operator" keyword. -const char *getOperatorSpelling(OverloadedOperatorKind Operator); - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/OperatorPrecedence.h b/include/clang/Basic/OperatorPrecedence.h deleted file mode 100644 index 640749f..0000000 --- a/include/clang/Basic/OperatorPrecedence.h +++ /dev/null @@ -1,52 +0,0 @@ -//===--- OperatorPrecedence.h - Operator precedence levels ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines and computes precedence levels for binary/ternary operators. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_OPERATORPRECEDENCE_H -#define LLVM_CLANG_BASIC_OPERATORPRECEDENCE_H - -#include "clang/Basic/TokenKinds.h" - -namespace clang { - -/// PrecedenceLevels - These are precedences for the binary/ternary -/// operators in the C99 grammar. These have been named to relate -/// with the C99 grammar productions. Low precedences numbers bind -/// more weakly than high numbers. -namespace prec { - enum Level { - Unknown = 0, // Not binary operator. - Comma = 1, // , - Assignment = 2, // =, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |= - Conditional = 3, // ? - LogicalOr = 4, // || - LogicalAnd = 5, // && - InclusiveOr = 6, // | - ExclusiveOr = 7, // ^ - And = 8, // & - Equality = 9, // ==, != - Relational = 10, // >=, <=, >, < - Shift = 11, // <<, >> - Additive = 12, // -, + - Multiplicative = 13, // *, /, % - PointerToMember = 14 // .*, ->* - }; -} - -/// \brief Return the precedence of the specified binary operator token. -prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, - bool CPlusPlus11); - -} // end namespace clang - -#endif // LLVM_CLANG_OPERATOR_PRECEDENCE_H diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h deleted file mode 100644 index 53ce95c..0000000 --- a/include/clang/Basic/PartialDiagnostic.h +++ /dev/null @@ -1,410 +0,0 @@ -//===--- PartialDiagnostic.h - Diagnostic "closures" ------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Implements a partial diagnostic that can be emitted anwyhere -/// in a DiagnosticBuilder stream. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_PARTIALDIAGNOSTIC_H -#define LLVM_CLANG_BASIC_PARTIALDIAGNOSTIC_H - -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/SourceLocation.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" -#include <cassert> - -namespace clang { - -class PartialDiagnostic { -public: - enum { - // The MaxArguments and MaxFixItHints member enum values from - // DiagnosticsEngine are private but DiagnosticsEngine declares - // PartialDiagnostic a friend. These enum values are redeclared - // here so that the nested Storage class below can access them. - MaxArguments = DiagnosticsEngine::MaxArguments - }; - - struct Storage { - Storage() : NumDiagArgs(0) { } - - enum { - /// \brief The maximum number of arguments we can hold. We - /// currently only support up to 10 arguments (%0-%9). - /// - /// A single diagnostic with more than that almost certainly has to - /// be simplified anyway. - MaxArguments = PartialDiagnostic::MaxArguments - }; - - /// \brief The number of entries in Arguments. - unsigned char NumDiagArgs; - - /// \brief Specifies for each argument whether it is in DiagArgumentsStr - /// or in DiagArguments. - unsigned char DiagArgumentsKind[MaxArguments]; - - /// \brief The values for the various substitution positions. - /// - /// This is used when the argument is not an std::string. The specific value - /// is mangled into an intptr_t and the interpretation depends on exactly - /// what sort of argument kind it is. - intptr_t DiagArgumentsVal[MaxArguments]; - - /// \brief The values for the various substitution positions that have - /// string arguments. - std::string DiagArgumentsStr[MaxArguments]; - - /// \brief The list of ranges added to this diagnostic. - SmallVector<CharSourceRange, 8> DiagRanges; - - /// \brief If valid, provides a hint with some code to insert, remove, or - /// modify at a particular position. - SmallVector<FixItHint, 6> FixItHints; - }; - - /// \brief An allocator for Storage objects, which uses a small cache to - /// objects, used to reduce malloc()/free() traffic for partial diagnostics. - class StorageAllocator { - static const unsigned NumCached = 16; - Storage Cached[NumCached]; - Storage *FreeList[NumCached]; - unsigned NumFreeListEntries; - - public: - StorageAllocator(); - ~StorageAllocator(); - - /// \brief Allocate new storage. - Storage *Allocate() { - if (NumFreeListEntries == 0) - return new Storage; - - Storage *Result = FreeList[--NumFreeListEntries]; - Result->NumDiagArgs = 0; - Result->DiagRanges.clear(); - Result->FixItHints.clear(); - return Result; - } - - /// \brief Free the given storage object. - void Deallocate(Storage *S) { - if (S >= Cached && S <= Cached + NumCached) { - FreeList[NumFreeListEntries++] = S; - return; - } - - delete S; - } - }; - -private: - // NOTE: Sema assumes that PartialDiagnostic is location-invariant - // in the sense that its bits can be safely memcpy'ed and destructed - // in the new location. - - /// \brief The diagnostic ID. - mutable unsigned DiagID; - - /// \brief Storage for args and ranges. - mutable Storage *DiagStorage; - - /// \brief Allocator used to allocate storage for this diagnostic. - StorageAllocator *Allocator; - - /// \brief Retrieve storage for this particular diagnostic. - Storage *getStorage() const { - if (DiagStorage) - return DiagStorage; - - if (Allocator) - DiagStorage = Allocator->Allocate(); - else { - assert(Allocator != reinterpret_cast<StorageAllocator *>(~uintptr_t(0))); - DiagStorage = new Storage; - } - return DiagStorage; - } - - void freeStorage() { - if (!DiagStorage) - return; - - // The hot path for PartialDiagnostic is when we just used it to wrap an ID - // (typically so we have the flexibility of passing a more complex - // diagnostic into the callee, but that does not commonly occur). - // - // Split this out into a slow function for silly compilers (*cough*) which - // can't do decent partial inlining. - freeStorageSlow(); - } - - void freeStorageSlow() { - if (Allocator) - Allocator->Deallocate(DiagStorage); - else if (Allocator != reinterpret_cast<StorageAllocator *>(~uintptr_t(0))) - delete DiagStorage; - DiagStorage = nullptr; - } - - void AddSourceRange(const CharSourceRange &R) const { - if (!DiagStorage) - DiagStorage = getStorage(); - - DiagStorage->DiagRanges.push_back(R); - } - - void AddFixItHint(const FixItHint &Hint) const { - if (Hint.isNull()) - return; - - if (!DiagStorage) - DiagStorage = getStorage(); - - DiagStorage->FixItHints.push_back(Hint); - } - -public: - struct NullDiagnostic {}; - /// \brief Create a null partial diagnostic, which cannot carry a payload, - /// and only exists to be swapped with a real partial diagnostic. - PartialDiagnostic(NullDiagnostic) - : DiagID(0), DiagStorage(nullptr), Allocator(nullptr) { } - - PartialDiagnostic(unsigned DiagID, StorageAllocator &Allocator) - : DiagID(DiagID), DiagStorage(nullptr), Allocator(&Allocator) { } - - PartialDiagnostic(const PartialDiagnostic &Other) - : DiagID(Other.DiagID), DiagStorage(nullptr), Allocator(Other.Allocator) - { - if (Other.DiagStorage) { - DiagStorage = getStorage(); - *DiagStorage = *Other.DiagStorage; - } - } - - PartialDiagnostic(PartialDiagnostic &&Other) - : DiagID(Other.DiagID), DiagStorage(Other.DiagStorage), - Allocator(Other.Allocator) { - Other.DiagStorage = nullptr; - } - - PartialDiagnostic(const PartialDiagnostic &Other, Storage *DiagStorage) - : DiagID(Other.DiagID), DiagStorage(DiagStorage), - Allocator(reinterpret_cast<StorageAllocator *>(~uintptr_t(0))) - { - if (Other.DiagStorage) - *this->DiagStorage = *Other.DiagStorage; - } - - PartialDiagnostic(const Diagnostic &Other, StorageAllocator &Allocator) - : DiagID(Other.getID()), DiagStorage(nullptr), Allocator(&Allocator) - { - // Copy arguments. - for (unsigned I = 0, N = Other.getNumArgs(); I != N; ++I) { - if (Other.getArgKind(I) == DiagnosticsEngine::ak_std_string) - AddString(Other.getArgStdStr(I)); - else - AddTaggedVal(Other.getRawArg(I), Other.getArgKind(I)); - } - - // Copy source ranges. - for (unsigned I = 0, N = Other.getNumRanges(); I != N; ++I) - AddSourceRange(Other.getRange(I)); - - // Copy fix-its. - for (unsigned I = 0, N = Other.getNumFixItHints(); I != N; ++I) - AddFixItHint(Other.getFixItHint(I)); - } - - PartialDiagnostic &operator=(const PartialDiagnostic &Other) { - DiagID = Other.DiagID; - if (Other.DiagStorage) { - if (!DiagStorage) - DiagStorage = getStorage(); - - *DiagStorage = *Other.DiagStorage; - } else { - freeStorage(); - } - - return *this; - } - - PartialDiagnostic &operator=(PartialDiagnostic &&Other) { - freeStorage(); - - DiagID = Other.DiagID; - DiagStorage = Other.DiagStorage; - Allocator = Other.Allocator; - - Other.DiagStorage = nullptr; - return *this; - } - - ~PartialDiagnostic() { - freeStorage(); - } - - void swap(PartialDiagnostic &PD) { - std::swap(DiagID, PD.DiagID); - std::swap(DiagStorage, PD.DiagStorage); - std::swap(Allocator, PD.Allocator); - } - - unsigned getDiagID() const { return DiagID; } - - void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const { - if (!DiagStorage) - DiagStorage = getStorage(); - - assert(DiagStorage->NumDiagArgs < Storage::MaxArguments && - "Too many arguments to diagnostic!"); - DiagStorage->DiagArgumentsKind[DiagStorage->NumDiagArgs] = Kind; - DiagStorage->DiagArgumentsVal[DiagStorage->NumDiagArgs++] = V; - } - - void AddString(StringRef V) const { - if (!DiagStorage) - DiagStorage = getStorage(); - - assert(DiagStorage->NumDiagArgs < Storage::MaxArguments && - "Too many arguments to diagnostic!"); - DiagStorage->DiagArgumentsKind[DiagStorage->NumDiagArgs] - = DiagnosticsEngine::ak_std_string; - DiagStorage->DiagArgumentsStr[DiagStorage->NumDiagArgs++] = V; - } - - void Emit(const DiagnosticBuilder &DB) const { - if (!DiagStorage) - return; - - // Add all arguments. - for (unsigned i = 0, e = DiagStorage->NumDiagArgs; i != e; ++i) { - if ((DiagnosticsEngine::ArgumentKind)DiagStorage->DiagArgumentsKind[i] - == DiagnosticsEngine::ak_std_string) - DB.AddString(DiagStorage->DiagArgumentsStr[i]); - else - DB.AddTaggedVal(DiagStorage->DiagArgumentsVal[i], - (DiagnosticsEngine::ArgumentKind)DiagStorage->DiagArgumentsKind[i]); - } - - // Add all ranges. - for (const CharSourceRange &Range : DiagStorage->DiagRanges) - DB.AddSourceRange(Range); - - // Add all fix-its. - for (const FixItHint &Fix : DiagStorage->FixItHints) - DB.AddFixItHint(Fix); - } - - void EmitToString(DiagnosticsEngine &Diags, - SmallVectorImpl<char> &Buf) const { - // FIXME: It should be possible to render a diagnostic to a string without - // messing with the state of the diagnostics engine. - DiagnosticBuilder DB(Diags.Report(getDiagID())); - Emit(DB); - DB.FlushCounts(); - Diagnostic(&Diags).FormatDiagnostic(Buf); - DB.Clear(); - Diags.Clear(); - } - - /// \brief Clear out this partial diagnostic, giving it a new diagnostic ID - /// and removing all of its arguments, ranges, and fix-it hints. - void Reset(unsigned DiagID = 0) { - this->DiagID = DiagID; - freeStorage(); - } - - bool hasStorage() const { return DiagStorage != nullptr; } - - friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - unsigned I) { - PD.AddTaggedVal(I, DiagnosticsEngine::ak_uint); - return PD; - } - - friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - int I) { - PD.AddTaggedVal(I, DiagnosticsEngine::ak_sint); - return PD; - } - - friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - const char *S) { - PD.AddTaggedVal(reinterpret_cast<intptr_t>(S), - DiagnosticsEngine::ak_c_string); - return PD; - } - - friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - StringRef S) { - - PD.AddString(S); - return PD; - } - - friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - const IdentifierInfo *II) { - PD.AddTaggedVal(reinterpret_cast<intptr_t>(II), - DiagnosticsEngine::ak_identifierinfo); - return PD; - } - - // Adds a DeclContext to the diagnostic. The enable_if template magic is here - // so that we only match those arguments that are (statically) DeclContexts; - // other arguments that derive from DeclContext (e.g., RecordDecls) will not - // match. - template<typename T> - friend inline - typename std::enable_if<std::is_same<T, DeclContext>::value, - const PartialDiagnostic &>::type - operator<<(const PartialDiagnostic &PD, T *DC) { - PD.AddTaggedVal(reinterpret_cast<intptr_t>(DC), - DiagnosticsEngine::ak_declcontext); - return PD; - } - - friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - SourceRange R) { - PD.AddSourceRange(CharSourceRange::getTokenRange(R)); - return PD; - } - - friend inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - const CharSourceRange &R) { - PD.AddSourceRange(R); - return PD; - } - - friend const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, - const FixItHint &Hint) { - PD.AddFixItHint(Hint); - return PD; - } - -}; - -inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const PartialDiagnostic &PD) { - PD.Emit(DB); - return DB; -} - -/// \brief A partial diagnostic along with the source location where this -/// diagnostic occurs. -typedef std::pair<SourceLocation, PartialDiagnostic> PartialDiagnosticAt; - -} // end namespace clang -#endif diff --git a/include/clang/Basic/PlistSupport.h b/include/clang/Basic/PlistSupport.h deleted file mode 100644 index 84dd291..0000000 --- a/include/clang/Basic/PlistSupport.h +++ /dev/null @@ -1,119 +0,0 @@ -//===---------- PlistSupport.h - Plist Output Utilities ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_PLISTSUPPORT_H -#define LLVM_CLANG_BASIC_PLISTSUPPORT_H - -#include "clang/Basic/FileManager.h" -#include "clang/Basic/SourceManager.h" -#include "llvm/Support/raw_ostream.h" - -namespace clang { -namespace markup { -typedef llvm::DenseMap<FileID, unsigned> FIDMap; - -inline void AddFID(FIDMap &FIDs, SmallVectorImpl<FileID> &V, - const SourceManager &SM, SourceLocation L) { - FileID FID = SM.getFileID(SM.getExpansionLoc(L)); - FIDMap::iterator I = FIDs.find(FID); - if (I != FIDs.end()) - return; - FIDs[FID] = V.size(); - V.push_back(FID); -} - -inline unsigned GetFID(const FIDMap &FIDs, const SourceManager &SM, - SourceLocation L) { - FileID FID = SM.getFileID(SM.getExpansionLoc(L)); - FIDMap::const_iterator I = FIDs.find(FID); - assert(I != FIDs.end()); - return I->second; -} - -inline raw_ostream &Indent(raw_ostream &o, const unsigned indent) { - for (unsigned i = 0; i < indent; ++i) - o << ' '; - return o; -} - -inline raw_ostream &EmitPlistHeader(raw_ostream &o) { - static const char *PlistHeader = - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" " - "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" - "<plist version=\"1.0\">\n"; - return o << PlistHeader; -} - -inline raw_ostream &EmitInteger(raw_ostream &o, int64_t value) { - o << "<integer>"; - o << value; - o << "</integer>"; - return o; -} - -inline raw_ostream &EmitString(raw_ostream &o, StringRef s) { - o << "<string>"; - for (StringRef::const_iterator I = s.begin(), E = s.end(); I != E; ++I) { - char c = *I; - switch (c) { - default: - o << c; - break; - case '&': - o << "&"; - break; - case '<': - o << "<"; - break; - case '>': - o << ">"; - break; - case '\'': - o << "'"; - break; - case '\"': - o << """; - break; - } - } - o << "</string>"; - return o; -} - -inline void EmitLocation(raw_ostream &o, const SourceManager &SM, - SourceLocation L, const FIDMap &FM, unsigned indent) { - if (L.isInvalid()) return; - - FullSourceLoc Loc(SM.getExpansionLoc(L), const_cast<SourceManager &>(SM)); - - Indent(o, indent) << "<dict>\n"; - Indent(o, indent) << " <key>line</key>"; - EmitInteger(o, Loc.getExpansionLineNumber()) << '\n'; - Indent(o, indent) << " <key>col</key>"; - EmitInteger(o, Loc.getExpansionColumnNumber()) << '\n'; - Indent(o, indent) << " <key>file</key>"; - EmitInteger(o, GetFID(FM, SM, Loc)) << '\n'; - Indent(o, indent) << "</dict>\n"; -} - -inline void EmitRange(raw_ostream &o, const SourceManager &SM, - CharSourceRange R, const FIDMap &FM, unsigned indent) { - if (R.isInvalid()) return; - - assert(R.isCharRange() && "cannot handle a token range"); - Indent(o, indent) << "<array>\n"; - EmitLocation(o, SM, R.getBegin(), FM, indent + 1); - EmitLocation(o, SM, R.getEnd(), FM, indent + 1); - Indent(o, indent) << "</array>\n"; -} -} -} - -#endif diff --git a/include/clang/Basic/PrettyStackTrace.h b/include/clang/Basic/PrettyStackTrace.h deleted file mode 100644 index 6badae5..0000000 --- a/include/clang/Basic/PrettyStackTrace.h +++ /dev/null @@ -1,38 +0,0 @@ -//===- clang/Basic/PrettyStackTrace.h - Pretty Crash Handling --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the PrettyStackTraceEntry class, which is used to make -/// crashes give more contextual information about what the program was doing -/// when it crashed. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H -#define LLVM_CLANG_BASIC_PRETTYSTACKTRACE_H - -#include "clang/Basic/SourceLocation.h" -#include "llvm/Support/PrettyStackTrace.h" - -namespace clang { - - /// If a crash happens while one of these objects are live, the message - /// is printed out along with the specified source location. - class PrettyStackTraceLoc : public llvm::PrettyStackTraceEntry { - SourceManager &SM; - SourceLocation Loc; - const char *Message; - public: - PrettyStackTraceLoc(SourceManager &sm, SourceLocation L, const char *Msg) - : SM(sm), Loc(L), Message(Msg) {} - void print(raw_ostream &OS) const override; - }; -} - -#endif diff --git a/include/clang/Basic/SanitizerBlacklist.h b/include/clang/Basic/SanitizerBlacklist.h deleted file mode 100644 index e651e18..0000000 --- a/include/clang/Basic/SanitizerBlacklist.h +++ /dev/null @@ -1,46 +0,0 @@ -//===--- SanitizerBlacklist.h - Blacklist for sanitizers --------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// User-provided blacklist used to disable/alter instrumentation done in -// sanitizers. -// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H -#define LLVM_CLANG_BASIC_SANITIZERBLACKLIST_H - -#include "clang/Basic/LLVM.h" -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/SourceManager.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/SpecialCaseList.h" -#include <memory> - -namespace clang { - -class SanitizerBlacklist { - std::unique_ptr<llvm::SpecialCaseList> SCL; - SourceManager &SM; - -public: - SanitizerBlacklist(const std::vector<std::string> &BlacklistPaths, - SourceManager &SM); - bool isBlacklistedGlobal(StringRef GlobalName, - StringRef Category = StringRef()) const; - bool isBlacklistedType(StringRef MangledTypeName, - StringRef Category = StringRef()) const; - bool isBlacklistedFunction(StringRef FunctionName) const; - bool isBlacklistedFile(StringRef FileName, - StringRef Category = StringRef()) const; - bool isBlacklistedLocation(SourceLocation Loc, - StringRef Category = StringRef()) const; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def deleted file mode 100644 index 4b68593..0000000 --- a/include/clang/Basic/Sanitizers.def +++ /dev/null @@ -1,122 +0,0 @@ -//===--- Sanitizers.def - Runtime sanitizer options -------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the options for specifying which runtime sanitizers to -// enable. Users of this file must define the SANITIZER macro to make use of -// this information. Users of this file can also define the SANITIZER_GROUP -// macro to get information on options which refer to sets of sanitizers. -// -//===----------------------------------------------------------------------===// - -#ifndef SANITIZER -#error "Define SANITIZER prior to including this file!" -#endif - -// SANITIZER(NAME, ID) - -// The first value is the name of the sanitizer as a string. The sanitizer can -// be enabled by specifying -fsanitize=NAME. - -// The second value is an identifier which can be used to refer to the -// sanitizer. - - -// SANITIZER_GROUP(NAME, ID, ALIAS) - -// The first two values have the same semantics as the corresponding SANITIZER -// values. The third value is an expression ORing together the IDs of individual -// sanitizers in this group. - -#ifndef SANITIZER_GROUP -#define SANITIZER_GROUP(NAME, ID, ALIAS) -#endif - - -// AddressSanitizer -SANITIZER("address", Address) - -// Kernel AddressSanitizer (KASan) -SANITIZER("kernel-address", KernelAddress) - -// MemorySanitizer -SANITIZER("memory", Memory) - -// ThreadSanitizer -SANITIZER("thread", Thread) - -// LeakSanitizer -SANITIZER("leak", Leak) - -// UndefinedBehaviorSanitizer -SANITIZER("alignment", Alignment) -SANITIZER("array-bounds", ArrayBounds) -SANITIZER("bool", Bool) -SANITIZER("enum", Enum) -SANITIZER("float-cast-overflow", FloatCastOverflow) -SANITIZER("float-divide-by-zero", FloatDivideByZero) -SANITIZER("function", Function) -SANITIZER("integer-divide-by-zero", IntegerDivideByZero) -SANITIZER("nonnull-attribute", NonnullAttribute) -SANITIZER("null", Null) -SANITIZER("object-size", ObjectSize) -SANITIZER("return", Return) -SANITIZER("returns-nonnull-attribute", ReturnsNonnullAttribute) -SANITIZER("shift-base", ShiftBase) -SANITIZER("shift-exponent", ShiftExponent) -SANITIZER_GROUP("shift", Shift, ShiftBase | ShiftExponent) -SANITIZER("signed-integer-overflow", SignedIntegerOverflow) -SANITIZER("unreachable", Unreachable) -SANITIZER("vla-bound", VLABound) -SANITIZER("vptr", Vptr) - -// IntegerSanitizer -SANITIZER("unsigned-integer-overflow", UnsignedIntegerOverflow) - -// DataFlowSanitizer -SANITIZER("dataflow", DataFlow) - -// Control Flow Integrity -SANITIZER("cfi-cast-strict", CFICastStrict) -SANITIZER("cfi-derived-cast", CFIDerivedCast) -SANITIZER("cfi-icall", CFIICall) -SANITIZER("cfi-unrelated-cast", CFIUnrelatedCast) -SANITIZER("cfi-nvcall", CFINVCall) -SANITIZER("cfi-vcall", CFIVCall) -SANITIZER_GROUP("cfi", CFI, - CFIDerivedCast | CFIICall | CFIUnrelatedCast | CFINVCall | - CFIVCall) - -// Safe Stack -SANITIZER("safe-stack", SafeStack) - -// -fsanitize=undefined includes all the sanitizers which have low overhead, no -// ABI or address space layout implications, and only catch undefined behavior. -SANITIZER_GROUP("undefined", Undefined, - Alignment | Bool | ArrayBounds | Enum | FloatCastOverflow | - FloatDivideByZero | IntegerDivideByZero | NonnullAttribute | - Null | ObjectSize | Return | ReturnsNonnullAttribute | - Shift | SignedIntegerOverflow | Unreachable | VLABound | - Function | Vptr) - -// -fsanitize=undefined-trap is an alias for -fsanitize=undefined. -SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined) - -SANITIZER_GROUP("integer", Integer, - SignedIntegerOverflow | UnsignedIntegerOverflow | Shift | - IntegerDivideByZero) - -SANITIZER("local-bounds", LocalBounds) -SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds) - -// Magic group, containing all sanitizers. For example, "-fno-sanitize=all" -// can be used to disable all the sanitizers. -SANITIZER_GROUP("all", All, ~0ULL) - -#undef SANITIZER -#undef SANITIZER_GROUP diff --git a/include/clang/Basic/Sanitizers.h b/include/clang/Basic/Sanitizers.h deleted file mode 100644 index 98e70de..0000000 --- a/include/clang/Basic/Sanitizers.h +++ /dev/null @@ -1,86 +0,0 @@ -//===--- Sanitizers.h - C Language Family Language Options ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::SanitizerKind enum. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_SANITIZERS_H -#define LLVM_CLANG_BASIC_SANITIZERS_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/MathExtras.h" - -namespace clang { - -typedef uint64_t SanitizerMask; - -namespace SanitizerKind { - -// Assign ordinals to possible values of -fsanitize= flag, which we will use as -// bit positions. -enum SanitizerOrdinal : uint64_t { -#define SANITIZER(NAME, ID) SO_##ID, -#define SANITIZER_GROUP(NAME, ID, ALIAS) SO_##ID##Group, -#include "clang/Basic/Sanitizers.def" - SO_Count -}; - -// Define the set of sanitizer kinds, as well as the set of sanitizers each -// sanitizer group expands into. -#define SANITIZER(NAME, ID) \ - const SanitizerMask ID = 1ULL << SO_##ID; -#define SANITIZER_GROUP(NAME, ID, ALIAS) \ - const SanitizerMask ID = ALIAS; \ - const SanitizerMask ID##Group = 1ULL << SO_##ID##Group; -#include "clang/Basic/Sanitizers.def" - -} - -struct SanitizerSet { - SanitizerSet() : Mask(0) {} - - /// \brief Check if a certain (single) sanitizer is enabled. - bool has(SanitizerMask K) const { - assert(llvm::isPowerOf2_64(K)); - return Mask & K; - } - - /// \brief Check if one or more sanitizers are enabled. - bool hasOneOf(SanitizerMask K) const { return Mask & K; } - - /// \brief Enable or disable a certain (single) sanitizer. - void set(SanitizerMask K, bool Value) { - assert(llvm::isPowerOf2_64(K)); - Mask = Value ? (Mask | K) : (Mask & ~K); - } - - /// \brief Disable all sanitizers. - void clear() { Mask = 0; } - - /// \brief Returns true if at least one sanitizer is enabled. - bool empty() const { return Mask == 0; } - - /// \brief Bitmask of enabled sanitizers. - SanitizerMask Mask; -}; - -/// Parse a single value from a -fsanitize= or -fno-sanitize= value list. -/// Returns a non-zero SanitizerMask, or \c 0 if \p Value is not known. -SanitizerMask parseSanitizerValue(StringRef Value, bool AllowGroups); - -/// For each sanitizer group bit set in \p Kinds, set the bits for sanitizers -/// this group enables. -SanitizerMask expandSanitizerGroups(SanitizerMask Kinds); - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h deleted file mode 100644 index 0aeba5e..0000000 --- a/include/clang/Basic/SourceLocation.h +++ /dev/null @@ -1,438 +0,0 @@ -//===--- SourceLocation.h - Compact identifier for Source Files -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::SourceLocation class and associated facilities. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_SOURCELOCATION_H -#define LLVM_CLANG_BASIC_SOURCELOCATION_H - -#include "clang/Basic/LLVM.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/PointerLikeTypeTraits.h" -#include <cassert> -#include <functional> -#include <string> -#include <utility> - -namespace llvm { - class MemoryBuffer; - template <typename T> struct DenseMapInfo; - template <typename T> struct isPodLike; -} - -namespace clang { - -class SourceManager; - -/// \brief An opaque identifier used by SourceManager which refers to a -/// source file (MemoryBuffer) along with its \#include path and \#line data. -/// -class FileID { - /// \brief A mostly-opaque identifier, where 0 is "invalid", >0 is - /// this module, and <-1 is something loaded from another module. - int ID; -public: - FileID() : ID(0) {} - - bool isValid() const { return ID != 0; } - bool isInvalid() const { return ID == 0; } - - bool operator==(const FileID &RHS) const { return ID == RHS.ID; } - bool operator<(const FileID &RHS) const { return ID < RHS.ID; } - bool operator<=(const FileID &RHS) const { return ID <= RHS.ID; } - bool operator!=(const FileID &RHS) const { return !(*this == RHS); } - bool operator>(const FileID &RHS) const { return RHS < *this; } - bool operator>=(const FileID &RHS) const { return RHS <= *this; } - - static FileID getSentinel() { return get(-1); } - unsigned getHashValue() const { return static_cast<unsigned>(ID); } - -private: - friend class SourceManager; - friend class ASTWriter; - friend class ASTReader; - - static FileID get(int V) { - FileID F; - F.ID = V; - return F; - } - int getOpaqueValue() const { return ID; } -}; - - -/// \brief Encodes a location in the source. The SourceManager can decode this -/// to get at the full include stack, line and column information. -/// -/// Technically, a source location is simply an offset into the manager's view -/// of the input source, which is all input buffers (including macro -/// expansions) concatenated in an effectively arbitrary order. The manager -/// actually maintains two blocks of input buffers. One, starting at offset -/// 0 and growing upwards, contains all buffers from this module. The other, -/// starting at the highest possible offset and growing downwards, contains -/// buffers of loaded modules. -/// -/// In addition, one bit of SourceLocation is used for quick access to the -/// information whether the location is in a file or a macro expansion. -/// -/// It is important that this type remains small. It is currently 32 bits wide. -class SourceLocation { - unsigned ID; - friend class SourceManager; - friend class ASTReader; - friend class ASTWriter; - enum : unsigned { - MacroIDBit = 1U << 31 - }; -public: - - SourceLocation() : ID(0) {} - - bool isFileID() const { return (ID & MacroIDBit) == 0; } - bool isMacroID() const { return (ID & MacroIDBit) != 0; } - - /// \brief Return true if this is a valid SourceLocation object. - /// - /// Invalid SourceLocations are often used when events have no corresponding - /// location in the source (e.g. a diagnostic is required for a command line - /// option). - bool isValid() const { return ID != 0; } - bool isInvalid() const { return ID == 0; } - -private: - /// \brief Return the offset into the manager's global input view. - unsigned getOffset() const { - return ID & ~MacroIDBit; - } - - static SourceLocation getFileLoc(unsigned ID) { - assert((ID & MacroIDBit) == 0 && "Ran out of source locations!"); - SourceLocation L; - L.ID = ID; - return L; - } - - static SourceLocation getMacroLoc(unsigned ID) { - assert((ID & MacroIDBit) == 0 && "Ran out of source locations!"); - SourceLocation L; - L.ID = MacroIDBit | ID; - return L; - } -public: - - /// \brief Return a source location with the specified offset from this - /// SourceLocation. - SourceLocation getLocWithOffset(int Offset) const { - assert(((getOffset()+Offset) & MacroIDBit) == 0 && "offset overflow"); - SourceLocation L; - L.ID = ID+Offset; - return L; - } - - /// \brief When a SourceLocation itself cannot be used, this returns - /// an (opaque) 32-bit integer encoding for it. - /// - /// This should only be passed to SourceLocation::getFromRawEncoding, it - /// should not be inspected directly. - unsigned getRawEncoding() const { return ID; } - - /// \brief Turn a raw encoding of a SourceLocation object into - /// a real SourceLocation. - /// - /// \see getRawEncoding. - static SourceLocation getFromRawEncoding(unsigned Encoding) { - SourceLocation X; - X.ID = Encoding; - return X; - } - - /// \brief When a SourceLocation itself cannot be used, this returns - /// an (opaque) pointer encoding for it. - /// - /// This should only be passed to SourceLocation::getFromPtrEncoding, it - /// should not be inspected directly. - void* getPtrEncoding() const { - // Double cast to avoid a warning "cast to pointer from integer of different - // size". - return (void*)(uintptr_t)getRawEncoding(); - } - - /// \brief Turn a pointer encoding of a SourceLocation object back - /// into a real SourceLocation. - static SourceLocation getFromPtrEncoding(const void *Encoding) { - return getFromRawEncoding((unsigned)(uintptr_t)Encoding); - } - - void print(raw_ostream &OS, const SourceManager &SM) const; - std::string printToString(const SourceManager &SM) const; - void dump(const SourceManager &SM) const; -}; - -inline bool operator==(const SourceLocation &LHS, const SourceLocation &RHS) { - return LHS.getRawEncoding() == RHS.getRawEncoding(); -} - -inline bool operator!=(const SourceLocation &LHS, const SourceLocation &RHS) { - return !(LHS == RHS); -} - -inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) { - return LHS.getRawEncoding() < RHS.getRawEncoding(); -} - -/// \brief A trivial tuple used to represent a source range. -class SourceRange { - SourceLocation B; - SourceLocation E; -public: - SourceRange(): B(SourceLocation()), E(SourceLocation()) {} - SourceRange(SourceLocation loc) : B(loc), E(loc) {} - SourceRange(SourceLocation begin, SourceLocation end) : B(begin), E(end) {} - - SourceLocation getBegin() const { return B; } - SourceLocation getEnd() const { return E; } - - void setBegin(SourceLocation b) { B = b; } - void setEnd(SourceLocation e) { E = e; } - - bool isValid() const { return B.isValid() && E.isValid(); } - bool isInvalid() const { return !isValid(); } - - bool operator==(const SourceRange &X) const { - return B == X.B && E == X.E; - } - - bool operator!=(const SourceRange &X) const { - return B != X.B || E != X.E; - } -}; - -/// \brief Represents a character-granular source range. -/// -/// The underlying SourceRange can either specify the starting/ending character -/// of the range, or it can specify the start of the range and the start of the -/// last token of the range (a "token range"). In the token range case, the -/// size of the last token must be measured to determine the actual end of the -/// range. -class CharSourceRange { - SourceRange Range; - bool IsTokenRange; -public: - CharSourceRange() : IsTokenRange(false) {} - CharSourceRange(SourceRange R, bool ITR) : Range(R), IsTokenRange(ITR) {} - - static CharSourceRange getTokenRange(SourceRange R) { - return CharSourceRange(R, true); - } - - static CharSourceRange getCharRange(SourceRange R) { - return CharSourceRange(R, false); - } - - static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) { - return getTokenRange(SourceRange(B, E)); - } - static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) { - return getCharRange(SourceRange(B, E)); - } - - /// \brief Return true if the end of this range specifies the start of - /// the last token. Return false if the end of this range specifies the last - /// character in the range. - bool isTokenRange() const { return IsTokenRange; } - bool isCharRange() const { return !IsTokenRange; } - - SourceLocation getBegin() const { return Range.getBegin(); } - SourceLocation getEnd() const { return Range.getEnd(); } - SourceRange getAsRange() const { return Range; } - - void setBegin(SourceLocation b) { Range.setBegin(b); } - void setEnd(SourceLocation e) { Range.setEnd(e); } - - bool isValid() const { return Range.isValid(); } - bool isInvalid() const { return !isValid(); } -}; - -/// \brief A SourceLocation and its associated SourceManager. -/// -/// This is useful for argument passing to functions that expect both objects. -class FullSourceLoc : public SourceLocation { - const SourceManager *SrcMgr; -public: - /// \brief Creates a FullSourceLoc where isValid() returns \c false. - explicit FullSourceLoc() : SrcMgr(nullptr) {} - - explicit FullSourceLoc(SourceLocation Loc, const SourceManager &SM) - : SourceLocation(Loc), SrcMgr(&SM) {} - - /// \pre This FullSourceLoc has an associated SourceManager. - const SourceManager &getManager() const { - assert(SrcMgr && "SourceManager is NULL."); - return *SrcMgr; - } - - FileID getFileID() const; - - FullSourceLoc getExpansionLoc() const; - FullSourceLoc getSpellingLoc() const; - - unsigned getExpansionLineNumber(bool *Invalid = nullptr) const; - unsigned getExpansionColumnNumber(bool *Invalid = nullptr) const; - - unsigned getSpellingLineNumber(bool *Invalid = nullptr) const; - unsigned getSpellingColumnNumber(bool *Invalid = nullptr) const; - - const char *getCharacterData(bool *Invalid = nullptr) const; - - - /// \brief Return a StringRef to the source buffer data for the - /// specified FileID. - StringRef getBufferData(bool *Invalid = nullptr) const; - - /// \brief Decompose the specified location into a raw FileID + Offset pair. - /// - /// The first element is the FileID, the second is the offset from the - /// start of the buffer of the location. - std::pair<FileID, unsigned> getDecomposedLoc() const; - - bool isInSystemHeader() const; - - /// \brief Determines the order of 2 source locations in the translation unit. - /// - /// \returns true if this source location comes before 'Loc', false otherwise. - bool isBeforeInTranslationUnitThan(SourceLocation Loc) const; - - /// \brief Determines the order of 2 source locations in the translation unit. - /// - /// \returns true if this source location comes before 'Loc', false otherwise. - bool isBeforeInTranslationUnitThan(FullSourceLoc Loc) const { - assert(Loc.isValid()); - assert(SrcMgr == Loc.SrcMgr && "Loc comes from another SourceManager!"); - return isBeforeInTranslationUnitThan((SourceLocation)Loc); - } - - /// \brief Comparison function class, useful for sorting FullSourceLocs. - struct BeforeThanCompare : public std::binary_function<FullSourceLoc, - FullSourceLoc, bool> { - bool operator()(const FullSourceLoc& lhs, const FullSourceLoc& rhs) const { - return lhs.isBeforeInTranslationUnitThan(rhs); - } - }; - - /// \brief Prints information about this FullSourceLoc to stderr. - /// - /// This is useful for debugging. - void dump() const; - - friend inline bool - operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) { - return LHS.getRawEncoding() == RHS.getRawEncoding() && - LHS.SrcMgr == RHS.SrcMgr; - } - - friend inline bool - operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) { - return !(LHS == RHS); - } - -}; - -/// \brief Represents an unpacked "presumed" location which can be presented -/// to the user. -/// -/// A 'presumed' location can be modified by \#line and GNU line marker -/// directives and is always the expansion point of a normal location. -/// -/// You can get a PresumedLoc from a SourceLocation with SourceManager. -class PresumedLoc { - const char *Filename; - unsigned Line, Col; - SourceLocation IncludeLoc; -public: - PresumedLoc() : Filename(nullptr) {} - PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL) - : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) { - } - - /// \brief Return true if this object is invalid or uninitialized. - /// - /// This occurs when created with invalid source locations or when walking - /// off the top of a \#include stack. - bool isInvalid() const { return Filename == nullptr; } - bool isValid() const { return Filename != nullptr; } - - /// \brief Return the presumed filename of this location. - /// - /// This can be affected by \#line etc. - const char *getFilename() const { return Filename; } - - /// \brief Return the presumed line number of this location. - /// - /// This can be affected by \#line etc. - unsigned getLine() const { return Line; } - - /// \brief Return the presumed column number of this location. - /// - /// This cannot be affected by \#line, but is packaged here for convenience. - unsigned getColumn() const { return Col; } - - /// \brief Return the presumed include location of this location. - /// - /// This can be affected by GNU linemarker directives. - SourceLocation getIncludeLoc() const { return IncludeLoc; } -}; - - -} // end namespace clang - -namespace llvm { - /// Define DenseMapInfo so that FileID's can be used as keys in DenseMap and - /// DenseSets. - template <> - struct DenseMapInfo<clang::FileID> { - static inline clang::FileID getEmptyKey() { - return clang::FileID(); - } - static inline clang::FileID getTombstoneKey() { - return clang::FileID::getSentinel(); - } - - static unsigned getHashValue(clang::FileID S) { - return S.getHashValue(); - } - - static bool isEqual(clang::FileID LHS, clang::FileID RHS) { - return LHS == RHS; - } - }; - - template <> - struct isPodLike<clang::SourceLocation> { static const bool value = true; }; - template <> - struct isPodLike<clang::FileID> { static const bool value = true; }; - - // Teach SmallPtrSet how to handle SourceLocation. - template<> - class PointerLikeTypeTraits<clang::SourceLocation> { - public: - static inline void *getAsVoidPointer(clang::SourceLocation L) { - return L.getPtrEncoding(); - } - static inline clang::SourceLocation getFromVoidPointer(void *P) { - return clang::SourceLocation::getFromRawEncoding((unsigned)(uintptr_t)P); - } - enum { NumLowBitsAvailable = 0 }; - }; - -} // end namespace llvm - -#endif diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h deleted file mode 100644 index 99392a0..0000000 --- a/include/clang/Basic/SourceManager.h +++ /dev/null @@ -1,1711 +0,0 @@ -//===--- SourceManager.h - Track and cache source files ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the SourceManager interface. -/// -/// There are three different types of locations in a %file: a spelling -/// location, an expansion location, and a presumed location. -/// -/// Given an example of: -/// \code -/// #define min(x, y) x < y ? x : y -/// \endcode -/// -/// and then later on a use of min: -/// \code -/// #line 17 -/// return min(a, b); -/// \endcode -/// -/// The expansion location is the line in the source code where the macro -/// was expanded (the return statement), the spelling location is the -/// location in the source where the macro was originally defined, -/// and the presumed location is where the line directive states that -/// the line is 17, or any other line. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_SOURCEMANAGER_H -#define LLVM_CLANG_BASIC_SOURCEMANAGER_H - -#include "clang/Basic/FileManager.h" -#include "clang/Basic/LLVM.h" -#include "clang/Basic/SourceLocation.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/PointerIntPair.h" -#include "llvm/ADT/PointerUnion.h" -#include "llvm/Support/AlignOf.h" -#include "llvm/Support/Allocator.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/MemoryBuffer.h" -#include <cassert> -#include <map> -#include <memory> -#include <vector> - -namespace clang { - -class DiagnosticsEngine; -class SourceManager; -class FileManager; -class FileEntry; -class LineTableInfo; -class LangOptions; -class ASTWriter; -class ASTReader; - -/// \brief Public enums and private classes that are part of the -/// SourceManager implementation. -/// -namespace SrcMgr { - /// \brief Indicates whether a file or directory holds normal user code, - /// system code, or system code which is implicitly 'extern "C"' in C++ mode. - /// - /// Entire directories can be tagged with this (this is maintained by - /// DirectoryLookup and friends) as can specific FileInfos when a \#pragma - /// system_header is seen or in various other cases. - /// - enum CharacteristicKind { - C_User, C_System, C_ExternCSystem - }; - - /// \brief One instance of this struct is kept for every file loaded or used. - /// - /// This object owns the MemoryBuffer object. - class LLVM_ALIGNAS(8) ContentCache { - enum CCFlags { - /// \brief Whether the buffer is invalid. - InvalidFlag = 0x01, - /// \brief Whether the buffer should not be freed on destruction. - DoNotFreeFlag = 0x02 - }; - - /// \brief The actual buffer containing the characters from the input - /// file. - /// - /// This is owned by the ContentCache object. The bits indicate - /// whether the buffer is invalid. - mutable llvm::PointerIntPair<llvm::MemoryBuffer *, 2> Buffer; - - public: - /// \brief Reference to the file entry representing this ContentCache. - /// - /// This reference does not own the FileEntry object. - /// - /// It is possible for this to be NULL if the ContentCache encapsulates - /// an imaginary text buffer. - const FileEntry *OrigEntry; - - /// \brief References the file which the contents were actually loaded from. - /// - /// Can be different from 'Entry' if we overridden the contents of one file - /// with the contents of another file. - const FileEntry *ContentsEntry; - - /// \brief A bump pointer allocated array of offsets for each source line. - /// - /// This is lazily computed. This is owned by the SourceManager - /// BumpPointerAllocator object. - unsigned *SourceLineCache; - - /// \brief The number of lines in this ContentCache. - /// - /// This is only valid if SourceLineCache is non-null. - unsigned NumLines; - - /// \brief Indicates whether the buffer itself was provided to override - /// the actual file contents. - /// - /// When true, the original entry may be a virtual file that does not - /// exist. - unsigned BufferOverridden : 1; - - /// \brief True if this content cache was initially created for a source - /// file considered as a system one. - unsigned IsSystemFile : 1; - - /// \brief True if this file may be transient, that is, if it might not - /// exist at some later point in time when this content entry is used, - /// after serialization and deserialization. - unsigned IsTransient : 1; - - ContentCache(const FileEntry *Ent = nullptr) : ContentCache(Ent, Ent) {} - - ContentCache(const FileEntry *Ent, const FileEntry *contentEnt) - : Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt), - SourceLineCache(nullptr), NumLines(0), BufferOverridden(false), - IsSystemFile(false), IsTransient(false) {} - - ~ContentCache(); - - /// The copy ctor does not allow copies where source object has either - /// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory - /// is not transferred, so this is a logical error. - ContentCache(const ContentCache &RHS) - : Buffer(nullptr, false), SourceLineCache(nullptr), - BufferOverridden(false), IsSystemFile(false), IsTransient(false) { - OrigEntry = RHS.OrigEntry; - ContentsEntry = RHS.ContentsEntry; - - assert(RHS.Buffer.getPointer() == nullptr && - RHS.SourceLineCache == nullptr && - "Passed ContentCache object cannot own a buffer."); - - NumLines = RHS.NumLines; - } - - /// \brief Returns the memory buffer for the associated content. - /// - /// \param Diag Object through which diagnostics will be emitted if the - /// buffer cannot be retrieved. - /// - /// \param Loc If specified, is the location that invalid file diagnostics - /// will be emitted at. - /// - /// \param Invalid If non-NULL, will be set \c true if an error occurred. - llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag, - const SourceManager &SM, - SourceLocation Loc = SourceLocation(), - bool *Invalid = nullptr) const; - - /// \brief Returns the size of the content encapsulated by this - /// ContentCache. - /// - /// This can be the size of the source file or the size of an - /// arbitrary scratch buffer. If the ContentCache encapsulates a source - /// file this size is retrieved from the file's FileEntry. - unsigned getSize() const; - - /// \brief Returns the number of bytes actually mapped for this - /// ContentCache. - /// - /// This can be 0 if the MemBuffer was not actually expanded. - unsigned getSizeBytesMapped() const; - - /// Returns the kind of memory used to back the memory buffer for - /// this content cache. This is used for performance analysis. - llvm::MemoryBuffer::BufferKind getMemoryBufferKind() const; - - void setBuffer(std::unique_ptr<llvm::MemoryBuffer> B) { - assert(!Buffer.getPointer() && "MemoryBuffer already set."); - Buffer.setPointer(B.release()); - Buffer.setInt(0); - } - - /// \brief Get the underlying buffer, returning NULL if the buffer is not - /// yet available. - llvm::MemoryBuffer *getRawBuffer() const { return Buffer.getPointer(); } - - /// \brief Replace the existing buffer (which will be deleted) - /// with the given buffer. - void replaceBuffer(llvm::MemoryBuffer *B, bool DoNotFree = false); - - /// \brief Determine whether the buffer itself is invalid. - bool isBufferInvalid() const { - return Buffer.getInt() & InvalidFlag; - } - - /// \brief Determine whether the buffer should be freed. - bool shouldFreeBuffer() const { - return (Buffer.getInt() & DoNotFreeFlag) == 0; - } - - private: - // Disable assignments. - ContentCache &operator=(const ContentCache& RHS) = delete; - }; - - // Assert that the \c ContentCache objects will always be 8-byte aligned so - // that we can pack 3 bits of integer into pointers to such objects. - static_assert(llvm::AlignOf<ContentCache>::Alignment >= 8, - "ContentCache must be 8-byte aligned."); - - /// \brief Information about a FileID, basically just the logical file - /// that it represents and include stack information. - /// - /// Each FileInfo has include stack information, indicating where it came - /// from. This information encodes the \#include chain that a token was - /// expanded from. The main include file has an invalid IncludeLoc. - /// - /// FileInfos contain a "ContentCache *", with the contents of the file. - /// - class FileInfo { - /// \brief The location of the \#include that brought in this file. - /// - /// This is an invalid SLOC for the main file (top of the \#include chain). - unsigned IncludeLoc; // Really a SourceLocation - - /// \brief Number of FileIDs (files and macros) that were created during - /// preprocessing of this \#include, including this SLocEntry. - /// - /// Zero means the preprocessor didn't provide such info for this SLocEntry. - unsigned NumCreatedFIDs; - - /// \brief Contains the ContentCache* and the bits indicating the - /// characteristic of the file and whether it has \#line info, all - /// bitmangled together. - uintptr_t Data; - - friend class clang::SourceManager; - friend class clang::ASTWriter; - friend class clang::ASTReader; - public: - /// \brief Return a FileInfo object. - static FileInfo get(SourceLocation IL, const ContentCache *Con, - CharacteristicKind FileCharacter) { - FileInfo X; - X.IncludeLoc = IL.getRawEncoding(); - X.NumCreatedFIDs = 0; - X.Data = (uintptr_t)Con; - assert((X.Data & 7) == 0 &&"ContentCache pointer insufficiently aligned"); - assert((unsigned)FileCharacter < 4 && "invalid file character"); - X.Data |= (unsigned)FileCharacter; - return X; - } - - SourceLocation getIncludeLoc() const { - return SourceLocation::getFromRawEncoding(IncludeLoc); - } - const ContentCache* getContentCache() const { - return reinterpret_cast<const ContentCache*>(Data & ~uintptr_t(7)); - } - - /// \brief Return whether this is a system header or not. - CharacteristicKind getFileCharacteristic() const { - return (CharacteristicKind)(Data & 3); - } - - /// \brief Return true if this FileID has \#line directives in it. - bool hasLineDirectives() const { return (Data & 4) != 0; } - - /// \brief Set the flag that indicates that this FileID has - /// line table entries associated with it. - void setHasLineDirectives() { - Data |= 4; - } - }; - - /// \brief Each ExpansionInfo encodes the expansion location - where - /// the token was ultimately expanded, and the SpellingLoc - where the actual - /// character data for the token came from. - class ExpansionInfo { - // Really these are all SourceLocations. - - /// \brief Where the spelling for the token can be found. - unsigned SpellingLoc; - - /// In a macro expansion, ExpansionLocStart and ExpansionLocEnd - /// indicate the start and end of the expansion. In object-like macros, - /// they will be the same. In a function-like macro expansion, the start - /// will be the identifier and the end will be the ')'. Finally, in - /// macro-argument instantiations, the end will be 'SourceLocation()', an - /// invalid location. - unsigned ExpansionLocStart, ExpansionLocEnd; - - public: - SourceLocation getSpellingLoc() const { - return SourceLocation::getFromRawEncoding(SpellingLoc); - } - SourceLocation getExpansionLocStart() const { - return SourceLocation::getFromRawEncoding(ExpansionLocStart); - } - SourceLocation getExpansionLocEnd() const { - SourceLocation EndLoc = - SourceLocation::getFromRawEncoding(ExpansionLocEnd); - return EndLoc.isInvalid() ? getExpansionLocStart() : EndLoc; - } - - std::pair<SourceLocation,SourceLocation> getExpansionLocRange() const { - return std::make_pair(getExpansionLocStart(), getExpansionLocEnd()); - } - - bool isMacroArgExpansion() const { - // Note that this needs to return false for default constructed objects. - return getExpansionLocStart().isValid() && - SourceLocation::getFromRawEncoding(ExpansionLocEnd).isInvalid(); - } - - bool isMacroBodyExpansion() const { - return getExpansionLocStart().isValid() && - SourceLocation::getFromRawEncoding(ExpansionLocEnd).isValid(); - } - - bool isFunctionMacroExpansion() const { - return getExpansionLocStart().isValid() && - getExpansionLocStart() != getExpansionLocEnd(); - } - - /// \brief Return a ExpansionInfo for an expansion. - /// - /// Start and End specify the expansion range (where the macro is - /// expanded), and SpellingLoc specifies the spelling location (where - /// the characters from the token come from). All three can refer to - /// normal File SLocs or expansion locations. - static ExpansionInfo create(SourceLocation SpellingLoc, - SourceLocation Start, SourceLocation End) { - ExpansionInfo X; - X.SpellingLoc = SpellingLoc.getRawEncoding(); - X.ExpansionLocStart = Start.getRawEncoding(); - X.ExpansionLocEnd = End.getRawEncoding(); - return X; - } - - /// \brief Return a special ExpansionInfo for the expansion of - /// a macro argument into a function-like macro's body. - /// - /// ExpansionLoc specifies the expansion location (where the macro is - /// expanded). This doesn't need to be a range because a macro is always - /// expanded at a macro parameter reference, and macro parameters are - /// always exactly one token. SpellingLoc specifies the spelling location - /// (where the characters from the token come from). ExpansionLoc and - /// SpellingLoc can both refer to normal File SLocs or expansion locations. - /// - /// Given the code: - /// \code - /// #define F(x) f(x) - /// F(42); - /// \endcode - /// - /// When expanding '\c F(42)', the '\c x' would call this with an - /// SpellingLoc pointing at '\c 42' and an ExpansionLoc pointing at its - /// location in the definition of '\c F'. - static ExpansionInfo createForMacroArg(SourceLocation SpellingLoc, - SourceLocation ExpansionLoc) { - // We store an intentionally invalid source location for the end of the - // expansion range to mark that this is a macro argument ion rather than - // a normal one. - return create(SpellingLoc, ExpansionLoc, SourceLocation()); - } - }; - - /// \brief This is a discriminated union of FileInfo and ExpansionInfo. - /// - /// SourceManager keeps an array of these objects, and they are uniquely - /// identified by the FileID datatype. - class SLocEntry { - unsigned Offset : 31; - unsigned IsExpansion : 1; - union { - FileInfo File; - ExpansionInfo Expansion; - }; - public: - unsigned getOffset() const { return Offset; } - - bool isExpansion() const { return IsExpansion; } - bool isFile() const { return !isExpansion(); } - - const FileInfo &getFile() const { - assert(isFile() && "Not a file SLocEntry!"); - return File; - } - - const ExpansionInfo &getExpansion() const { - assert(isExpansion() && "Not a macro expansion SLocEntry!"); - return Expansion; - } - - static SLocEntry get(unsigned Offset, const FileInfo &FI) { - assert(!(Offset & (1 << 31)) && "Offset is too large"); - SLocEntry E; - E.Offset = Offset; - E.IsExpansion = false; - E.File = FI; - return E; - } - - static SLocEntry get(unsigned Offset, const ExpansionInfo &Expansion) { - assert(!(Offset & (1 << 31)) && "Offset is too large"); - SLocEntry E; - E.Offset = Offset; - E.IsExpansion = true; - E.Expansion = Expansion; - return E; - } - }; -} // end SrcMgr namespace. - -/// \brief External source of source location entries. -class ExternalSLocEntrySource { -public: - virtual ~ExternalSLocEntrySource(); - - /// \brief Read the source location entry with index ID, which will always be - /// less than -1. - /// - /// \returns true if an error occurred that prevented the source-location - /// entry from being loaded. - virtual bool ReadSLocEntry(int ID) = 0; - - /// \brief Retrieve the module import location and name for the given ID, if - /// in fact it was loaded from a module (rather than, say, a precompiled - /// header). - virtual std::pair<SourceLocation, StringRef> getModuleImportLoc(int ID) = 0; -}; - - -/// \brief Holds the cache used by isBeforeInTranslationUnit. -/// -/// The cache structure is complex enough to be worth breaking out of -/// SourceManager. -class InBeforeInTUCacheEntry { - /// \brief The FileID's of the cached query. - /// - /// If these match up with a subsequent query, the result can be reused. - FileID LQueryFID, RQueryFID; - - /// \brief True if LQueryFID was created before RQueryFID. - /// - /// This is used to compare macro expansion locations. - bool IsLQFIDBeforeRQFID; - - /// \brief The file found in common between the two \#include traces, i.e., - /// the nearest common ancestor of the \#include tree. - FileID CommonFID; - - /// \brief The offset of the previous query in CommonFID. - /// - /// Usually, this represents the location of the \#include for QueryFID, but - /// if LQueryFID is a parent of RQueryFID (or vice versa) then these can be a - /// random token in the parent. - unsigned LCommonOffset, RCommonOffset; -public: - /// \brief Return true if the currently cached values match up with - /// the specified LHS/RHS query. - /// - /// If not, we can't use the cache. - bool isCacheValid(FileID LHS, FileID RHS) const { - return LQueryFID == LHS && RQueryFID == RHS; - } - - /// \brief If the cache is valid, compute the result given the - /// specified offsets in the LHS/RHS FileID's. - bool getCachedResult(unsigned LOffset, unsigned ROffset) const { - // If one of the query files is the common file, use the offset. Otherwise, - // use the #include loc in the common file. - if (LQueryFID != CommonFID) LOffset = LCommonOffset; - if (RQueryFID != CommonFID) ROffset = RCommonOffset; - - // It is common for multiple macro expansions to be "included" from the same - // location (expansion location), in which case use the order of the FileIDs - // to determine which came first. This will also take care the case where - // one of the locations points at the inclusion/expansion point of the other - // in which case its FileID will come before the other. - if (LOffset == ROffset) - return IsLQFIDBeforeRQFID; - - return LOffset < ROffset; - } - - /// \brief Set up a new query. - void setQueryFIDs(FileID LHS, FileID RHS, bool isLFIDBeforeRFID) { - assert(LHS != RHS); - LQueryFID = LHS; - RQueryFID = RHS; - IsLQFIDBeforeRQFID = isLFIDBeforeRFID; - } - - void clear() { - LQueryFID = RQueryFID = FileID(); - IsLQFIDBeforeRQFID = false; - } - - void setCommonLoc(FileID commonFID, unsigned lCommonOffset, - unsigned rCommonOffset) { - CommonFID = commonFID; - LCommonOffset = lCommonOffset; - RCommonOffset = rCommonOffset; - } - -}; - -/// \brief The stack used when building modules on demand, which is used -/// to provide a link between the source managers of the different compiler -/// instances. -typedef ArrayRef<std::pair<std::string, FullSourceLoc> > ModuleBuildStack; - -/// \brief This class handles loading and caching of source files into memory. -/// -/// This object owns the MemoryBuffer objects for all of the loaded -/// files and assigns unique FileID's for each unique \#include chain. -/// -/// The SourceManager can be queried for information about SourceLocation -/// objects, turning them into either spelling or expansion locations. Spelling -/// locations represent where the bytes corresponding to a token came from and -/// expansion locations represent where the location is in the user's view. In -/// the case of a macro expansion, for example, the spelling location indicates -/// where the expanded token came from and the expansion location specifies -/// where it was expanded. -class SourceManager : public RefCountedBase<SourceManager> { - /// \brief DiagnosticsEngine object. - DiagnosticsEngine &Diag; - - FileManager &FileMgr; - - mutable llvm::BumpPtrAllocator ContentCacheAlloc; - - /// \brief Memoized information about all of the files tracked by this - /// SourceManager. - /// - /// This map allows us to merge ContentCache entries based - /// on their FileEntry*. All ContentCache objects will thus have unique, - /// non-null, FileEntry pointers. - llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> FileInfos; - - /// \brief True if the ContentCache for files that are overridden by other - /// files, should report the original file name. Defaults to true. - bool OverridenFilesKeepOriginalName; - - /// \brief True if non-system source files should be treated as volatile - /// (likely to change while trying to use them). Defaults to false. - bool UserFilesAreVolatile; - - /// \brief True if all files read during this compilation should be treated - /// as transient (may not be present in later compilations using a module - /// file created from this compilation). Defaults to false. - bool FilesAreTransient; - - struct OverriddenFilesInfoTy { - /// \brief Files that have been overridden with the contents from another - /// file. - llvm::DenseMap<const FileEntry *, const FileEntry *> OverriddenFiles; - /// \brief Files that were overridden with a memory buffer. - llvm::DenseSet<const FileEntry *> OverriddenFilesWithBuffer; - }; - - /// \brief Lazily create the object keeping overridden files info, since - /// it is uncommonly used. - std::unique_ptr<OverriddenFilesInfoTy> OverriddenFilesInfo; - - OverriddenFilesInfoTy &getOverriddenFilesInfo() { - if (!OverriddenFilesInfo) - OverriddenFilesInfo.reset(new OverriddenFilesInfoTy); - return *OverriddenFilesInfo; - } - - /// \brief Information about various memory buffers that we have read in. - /// - /// All FileEntry* within the stored ContentCache objects are NULL, - /// as they do not refer to a file. - std::vector<SrcMgr::ContentCache*> MemBufferInfos; - - /// \brief The table of SLocEntries that are local to this module. - /// - /// Positive FileIDs are indexes into this table. Entry 0 indicates an invalid - /// expansion. - SmallVector<SrcMgr::SLocEntry, 0> LocalSLocEntryTable; - - /// \brief The table of SLocEntries that are loaded from other modules. - /// - /// Negative FileIDs are indexes into this table. To get from ID to an index, - /// use (-ID - 2). - mutable SmallVector<SrcMgr::SLocEntry, 0> LoadedSLocEntryTable; - - /// \brief The starting offset of the next local SLocEntry. - /// - /// This is LocalSLocEntryTable.back().Offset + the size of that entry. - unsigned NextLocalOffset; - - /// \brief The starting offset of the latest batch of loaded SLocEntries. - /// - /// This is LoadedSLocEntryTable.back().Offset, except that that entry might - /// not have been loaded, so that value would be unknown. - unsigned CurrentLoadedOffset; - - /// \brief The highest possible offset is 2^31-1, so CurrentLoadedOffset - /// starts at 2^31. - static const unsigned MaxLoadedOffset = 1U << 31U; - - /// \brief A bitmap that indicates whether the entries of LoadedSLocEntryTable - /// have already been loaded from the external source. - /// - /// Same indexing as LoadedSLocEntryTable. - llvm::BitVector SLocEntryLoaded; - - /// \brief An external source for source location entries. - ExternalSLocEntrySource *ExternalSLocEntries; - - /// \brief A one-entry cache to speed up getFileID. - /// - /// LastFileIDLookup records the last FileID looked up or created, because it - /// is very common to look up many tokens from the same file. - mutable FileID LastFileIDLookup; - - /// \brief Holds information for \#line directives. - /// - /// This is referenced by indices from SLocEntryTable. - LineTableInfo *LineTable; - - /// \brief These ivars serve as a cache used in the getLineNumber - /// method which is used to speedup getLineNumber calls to nearby locations. - mutable FileID LastLineNoFileIDQuery; - mutable SrcMgr::ContentCache *LastLineNoContentCache; - mutable unsigned LastLineNoFilePos; - mutable unsigned LastLineNoResult; - - /// \brief The file ID for the main source file of the translation unit. - FileID MainFileID; - - /// \brief The file ID for the precompiled preamble there is one. - FileID PreambleFileID; - - // Statistics for -print-stats. - mutable unsigned NumLinearScans, NumBinaryProbes; - - /// \brief Associates a FileID with its "included/expanded in" decomposed - /// location. - /// - /// Used to cache results from and speed-up \c getDecomposedIncludedLoc - /// function. - mutable llvm::DenseMap<FileID, std::pair<FileID, unsigned> > IncludedLocMap; - - /// The key value into the IsBeforeInTUCache table. - typedef std::pair<FileID, FileID> IsBeforeInTUCacheKey; - - /// The IsBeforeInTranslationUnitCache is a mapping from FileID pairs - /// to cache results. - typedef llvm::DenseMap<IsBeforeInTUCacheKey, InBeforeInTUCacheEntry> - InBeforeInTUCache; - - /// Cache results for the isBeforeInTranslationUnit method. - mutable InBeforeInTUCache IBTUCache; - mutable InBeforeInTUCacheEntry IBTUCacheOverflow; - - /// Return the cache entry for comparing the given file IDs - /// for isBeforeInTranslationUnit. - InBeforeInTUCacheEntry &getInBeforeInTUCache(FileID LFID, FileID RFID) const; - - // Cache for the "fake" buffer used for error-recovery purposes. - mutable std::unique_ptr<llvm::MemoryBuffer> FakeBufferForRecovery; - - mutable std::unique_ptr<SrcMgr::ContentCache> FakeContentCacheForRecovery; - - /// \brief Lazily computed map of macro argument chunks to their expanded - /// source location. - typedef std::map<unsigned, SourceLocation> MacroArgsMap; - - mutable llvm::DenseMap<FileID, MacroArgsMap *> MacroArgsCacheMap; - - /// \brief The stack of modules being built, which is used to detect - /// cycles in the module dependency graph as modules are being built, as - /// well as to describe why we're rebuilding a particular module. - /// - /// There is no way to set this value from the command line. If we ever need - /// to do so (e.g., if on-demand module construction moves out-of-process), - /// we can add a cc1-level option to do so. - SmallVector<std::pair<std::string, FullSourceLoc>, 2> StoredModuleBuildStack; - - // SourceManager doesn't support copy construction. - explicit SourceManager(const SourceManager&) = delete; - void operator=(const SourceManager&) = delete; -public: - SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr, - bool UserFilesAreVolatile = false); - ~SourceManager(); - - void clearIDTables(); - - DiagnosticsEngine &getDiagnostics() const { return Diag; } - - FileManager &getFileManager() const { return FileMgr; } - - /// \brief Set true if the SourceManager should report the original file name - /// for contents of files that were overridden by other files. Defaults to - /// true. - void setOverridenFilesKeepOriginalName(bool value) { - OverridenFilesKeepOriginalName = value; - } - - /// \brief True if non-system source files should be treated as volatile - /// (likely to change while trying to use them). - bool userFilesAreVolatile() const { return UserFilesAreVolatile; } - - /// \brief Retrieve the module build stack. - ModuleBuildStack getModuleBuildStack() const { - return StoredModuleBuildStack; - } - - /// \brief Set the module build stack. - void setModuleBuildStack(ModuleBuildStack stack) { - StoredModuleBuildStack.clear(); - StoredModuleBuildStack.append(stack.begin(), stack.end()); - } - - /// \brief Push an entry to the module build stack. - void pushModuleBuildStack(StringRef moduleName, FullSourceLoc importLoc) { - StoredModuleBuildStack.push_back(std::make_pair(moduleName.str(),importLoc)); - } - - //===--------------------------------------------------------------------===// - // MainFileID creation and querying methods. - //===--------------------------------------------------------------------===// - - /// \brief Returns the FileID of the main source file. - FileID getMainFileID() const { return MainFileID; } - - /// \brief Set the file ID for the main source file. - void setMainFileID(FileID FID) { - MainFileID = FID; - } - - /// \brief Set the file ID for the precompiled preamble. - void setPreambleFileID(FileID Preamble) { - assert(PreambleFileID.isInvalid() && "PreambleFileID already set!"); - PreambleFileID = Preamble; - } - - /// \brief Get the file ID for the precompiled preamble if there is one. - FileID getPreambleFileID() const { return PreambleFileID; } - - //===--------------------------------------------------------------------===// - // Methods to create new FileID's and macro expansions. - //===--------------------------------------------------------------------===// - - /// \brief Create a new FileID that represents the specified file - /// being \#included from the specified IncludePosition. - /// - /// This translates NULL into standard input. - FileID createFileID(const FileEntry *SourceFile, SourceLocation IncludePos, - SrcMgr::CharacteristicKind FileCharacter, - int LoadedID = 0, unsigned LoadedOffset = 0) { - const SrcMgr::ContentCache * - IR = getOrCreateContentCache(SourceFile, - /*isSystemFile=*/FileCharacter != SrcMgr::C_User); - assert(IR && "getOrCreateContentCache() cannot return NULL"); - return createFileID(IR, IncludePos, FileCharacter, LoadedID, LoadedOffset); - } - - /// \brief Create a new FileID that represents the specified memory buffer. - /// - /// This does no caching of the buffer and takes ownership of the - /// MemoryBuffer, so only pass a MemoryBuffer to this once. - FileID createFileID(std::unique_ptr<llvm::MemoryBuffer> Buffer, - SrcMgr::CharacteristicKind FileCharacter = SrcMgr::C_User, - int LoadedID = 0, unsigned LoadedOffset = 0, - SourceLocation IncludeLoc = SourceLocation()) { - return createFileID(createMemBufferContentCache(std::move(Buffer)), - IncludeLoc, FileCharacter, LoadedID, LoadedOffset); - } - - /// \brief Return a new SourceLocation that encodes the - /// fact that a token from SpellingLoc should actually be referenced from - /// ExpansionLoc, and that it represents the expansion of a macro argument - /// into the function-like macro body. - SourceLocation createMacroArgExpansionLoc(SourceLocation Loc, - SourceLocation ExpansionLoc, - unsigned TokLength); - - /// \brief Return a new SourceLocation that encodes the fact - /// that a token from SpellingLoc should actually be referenced from - /// ExpansionLoc. - SourceLocation createExpansionLoc(SourceLocation Loc, - SourceLocation ExpansionLocStart, - SourceLocation ExpansionLocEnd, - unsigned TokLength, - int LoadedID = 0, - unsigned LoadedOffset = 0); - - /// \brief Retrieve the memory buffer associated with the given file. - /// - /// \param Invalid If non-NULL, will be set \c true if an error - /// occurs while retrieving the memory buffer. - llvm::MemoryBuffer *getMemoryBufferForFile(const FileEntry *File, - bool *Invalid = nullptr); - - /// \brief Override the contents of the given source file by providing an - /// already-allocated buffer. - /// - /// \param SourceFile the source file whose contents will be overridden. - /// - /// \param Buffer the memory buffer whose contents will be used as the - /// data in the given source file. - /// - /// \param DoNotFree If true, then the buffer will not be freed when the - /// source manager is destroyed. - void overrideFileContents(const FileEntry *SourceFile, - llvm::MemoryBuffer *Buffer, bool DoNotFree); - void overrideFileContents(const FileEntry *SourceFile, - std::unique_ptr<llvm::MemoryBuffer> Buffer) { - overrideFileContents(SourceFile, Buffer.release(), /*DoNotFree*/ false); - } - - /// \brief Override the given source file with another one. - /// - /// \param SourceFile the source file which will be overridden. - /// - /// \param NewFile the file whose contents will be used as the - /// data instead of the contents of the given source file. - void overrideFileContents(const FileEntry *SourceFile, - const FileEntry *NewFile); - - /// \brief Returns true if the file contents have been overridden. - bool isFileOverridden(const FileEntry *File) { - if (OverriddenFilesInfo) { - if (OverriddenFilesInfo->OverriddenFilesWithBuffer.count(File)) - return true; - if (OverriddenFilesInfo->OverriddenFiles.find(File) != - OverriddenFilesInfo->OverriddenFiles.end()) - return true; - } - return false; - } - - /// \brief Disable overridding the contents of a file, previously enabled - /// with #overrideFileContents. - /// - /// This should be called before parsing has begun. - void disableFileContentsOverride(const FileEntry *File); - - /// \brief Specify that a file is transient. - void setFileIsTransient(const FileEntry *SourceFile); - - /// \brief Specify that all files that are read during this compilation are - /// transient. - void setAllFilesAreTransient(bool Transient) { - FilesAreTransient = Transient; - } - - //===--------------------------------------------------------------------===// - // FileID manipulation methods. - //===--------------------------------------------------------------------===// - - /// \brief Return the buffer for the specified FileID. - /// - /// If there is an error opening this buffer the first time, this - /// manufactures a temporary buffer and returns a non-empty error string. - llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc, - bool *Invalid = nullptr) const { - bool MyInvalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid); - if (MyInvalid || !Entry.isFile()) { - if (Invalid) - *Invalid = true; - - return getFakeBufferForRecovery(); - } - - return Entry.getFile().getContentCache()->getBuffer(Diag, *this, Loc, - Invalid); - } - - llvm::MemoryBuffer *getBuffer(FileID FID, bool *Invalid = nullptr) const { - bool MyInvalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid); - if (MyInvalid || !Entry.isFile()) { - if (Invalid) - *Invalid = true; - - return getFakeBufferForRecovery(); - } - - return Entry.getFile().getContentCache()->getBuffer(Diag, *this, - SourceLocation(), - Invalid); - } - - /// \brief Returns the FileEntry record for the provided FileID. - const FileEntry *getFileEntryForID(FileID FID) const { - bool MyInvalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid); - if (MyInvalid || !Entry.isFile()) - return nullptr; - - const SrcMgr::ContentCache *Content = Entry.getFile().getContentCache(); - if (!Content) - return nullptr; - return Content->OrigEntry; - } - - /// \brief Returns the FileEntry record for the provided SLocEntry. - const FileEntry *getFileEntryForSLocEntry(const SrcMgr::SLocEntry &sloc) const - { - const SrcMgr::ContentCache *Content = sloc.getFile().getContentCache(); - if (!Content) - return nullptr; - return Content->OrigEntry; - } - - /// \brief Return a StringRef to the source buffer data for the - /// specified FileID. - /// - /// \param FID The file ID whose contents will be returned. - /// \param Invalid If non-NULL, will be set true if an error occurred. - StringRef getBufferData(FileID FID, bool *Invalid = nullptr) const; - - /// \brief Get the number of FileIDs (files and macros) that were created - /// during preprocessing of \p FID, including it. - unsigned getNumCreatedFIDsForFileID(FileID FID) const { - bool Invalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); - if (Invalid || !Entry.isFile()) - return 0; - - return Entry.getFile().NumCreatedFIDs; - } - - /// \brief Set the number of FileIDs (files and macros) that were created - /// during preprocessing of \p FID, including it. - void setNumCreatedFIDsForFileID(FileID FID, unsigned NumFIDs) const { - bool Invalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); - if (Invalid || !Entry.isFile()) - return; - - assert(Entry.getFile().NumCreatedFIDs == 0 && "Already set!"); - const_cast<SrcMgr::FileInfo &>(Entry.getFile()).NumCreatedFIDs = NumFIDs; - } - - //===--------------------------------------------------------------------===// - // SourceLocation manipulation methods. - //===--------------------------------------------------------------------===// - - /// \brief Return the FileID for a SourceLocation. - /// - /// This is a very hot method that is used for all SourceManager queries - /// that start with a SourceLocation object. It is responsible for finding - /// the entry in SLocEntryTable which contains the specified location. - /// - FileID getFileID(SourceLocation SpellingLoc) const { - unsigned SLocOffset = SpellingLoc.getOffset(); - - // If our one-entry cache covers this offset, just return it. - if (isOffsetInFileID(LastFileIDLookup, SLocOffset)) - return LastFileIDLookup; - - return getFileIDSlow(SLocOffset); - } - - /// \brief Return the filename of the file containing a SourceLocation. - StringRef getFilename(SourceLocation SpellingLoc) const { - if (const FileEntry *F = getFileEntryForID(getFileID(SpellingLoc))) - return F->getName(); - return StringRef(); - } - - /// \brief Return the source location corresponding to the first byte of - /// the specified file. - SourceLocation getLocForStartOfFile(FileID FID) const { - bool Invalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); - if (Invalid || !Entry.isFile()) - return SourceLocation(); - - unsigned FileOffset = Entry.getOffset(); - return SourceLocation::getFileLoc(FileOffset); - } - - /// \brief Return the source location corresponding to the last byte of the - /// specified file. - SourceLocation getLocForEndOfFile(FileID FID) const { - bool Invalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); - if (Invalid || !Entry.isFile()) - return SourceLocation(); - - unsigned FileOffset = Entry.getOffset(); - return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID)); - } - - /// \brief Returns the include location if \p FID is a \#include'd file - /// otherwise it returns an invalid location. - SourceLocation getIncludeLoc(FileID FID) const { - bool Invalid = false; - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); - if (Invalid || !Entry.isFile()) - return SourceLocation(); - - return Entry.getFile().getIncludeLoc(); - } - - // \brief Returns the import location if the given source location is - // located within a module, or an invalid location if the source location - // is within the current translation unit. - std::pair<SourceLocation, StringRef> - getModuleImportLoc(SourceLocation Loc) const { - FileID FID = getFileID(Loc); - - // Positive file IDs are in the current translation unit, and -1 is a - // placeholder. - if (FID.ID >= -1) - return std::make_pair(SourceLocation(), ""); - - return ExternalSLocEntries->getModuleImportLoc(FID.ID); - } - - /// \brief Given a SourceLocation object \p Loc, return the expansion - /// location referenced by the ID. - SourceLocation getExpansionLoc(SourceLocation Loc) const { - // Handle the non-mapped case inline, defer to out of line code to handle - // expansions. - if (Loc.isFileID()) return Loc; - return getExpansionLocSlowCase(Loc); - } - - /// \brief Given \p Loc, if it is a macro location return the expansion - /// location or the spelling location, depending on if it comes from a - /// macro argument or not. - SourceLocation getFileLoc(SourceLocation Loc) const { - if (Loc.isFileID()) return Loc; - return getFileLocSlowCase(Loc); - } - - /// \brief Return the start/end of the expansion information for an - /// expansion location. - /// - /// \pre \p Loc is required to be an expansion location. - std::pair<SourceLocation,SourceLocation> - getImmediateExpansionRange(SourceLocation Loc) const; - - /// \brief Given a SourceLocation object, return the range of - /// tokens covered by the expansion in the ultimate file. - std::pair<SourceLocation,SourceLocation> - getExpansionRange(SourceLocation Loc) const; - - /// \brief Given a SourceRange object, return the range of - /// tokens covered by the expansion in the ultimate file. - SourceRange getExpansionRange(SourceRange Range) const { - return SourceRange(getExpansionRange(Range.getBegin()).first, - getExpansionRange(Range.getEnd()).second); - } - - /// \brief Given a SourceLocation object, return the spelling - /// location referenced by the ID. - /// - /// This is the place where the characters that make up the lexed token - /// can be found. - SourceLocation getSpellingLoc(SourceLocation Loc) const { - // Handle the non-mapped case inline, defer to out of line code to handle - // expansions. - if (Loc.isFileID()) return Loc; - return getSpellingLocSlowCase(Loc); - } - - /// \brief Given a SourceLocation object, return the spelling location - /// referenced by the ID. - /// - /// This is the first level down towards the place where the characters - /// that make up the lexed token can be found. This should not generally - /// be used by clients. - SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const; - - /// \brief Decompose the specified location into a raw FileID + Offset pair. - /// - /// The first element is the FileID, the second is the offset from the - /// start of the buffer of the location. - std::pair<FileID, unsigned> getDecomposedLoc(SourceLocation Loc) const { - FileID FID = getFileID(Loc); - bool Invalid = false; - const SrcMgr::SLocEntry &E = getSLocEntry(FID, &Invalid); - if (Invalid) - return std::make_pair(FileID(), 0); - return std::make_pair(FID, Loc.getOffset()-E.getOffset()); - } - - /// \brief Decompose the specified location into a raw FileID + Offset pair. - /// - /// If the location is an expansion record, walk through it until we find - /// the final location expanded. - std::pair<FileID, unsigned> - getDecomposedExpansionLoc(SourceLocation Loc) const { - FileID FID = getFileID(Loc); - bool Invalid = false; - const SrcMgr::SLocEntry *E = &getSLocEntry(FID, &Invalid); - if (Invalid) - return std::make_pair(FileID(), 0); - - unsigned Offset = Loc.getOffset()-E->getOffset(); - if (Loc.isFileID()) - return std::make_pair(FID, Offset); - - return getDecomposedExpansionLocSlowCase(E); - } - - /// \brief Decompose the specified location into a raw FileID + Offset pair. - /// - /// If the location is an expansion record, walk through it until we find - /// its spelling record. - std::pair<FileID, unsigned> - getDecomposedSpellingLoc(SourceLocation Loc) const { - FileID FID = getFileID(Loc); - bool Invalid = false; - const SrcMgr::SLocEntry *E = &getSLocEntry(FID, &Invalid); - if (Invalid) - return std::make_pair(FileID(), 0); - - unsigned Offset = Loc.getOffset()-E->getOffset(); - if (Loc.isFileID()) - return std::make_pair(FID, Offset); - return getDecomposedSpellingLocSlowCase(E, Offset); - } - - /// \brief Returns the "included/expanded in" decomposed location of the given - /// FileID. - std::pair<FileID, unsigned> getDecomposedIncludedLoc(FileID FID) const; - - /// \brief Returns the offset from the start of the file that the - /// specified SourceLocation represents. - /// - /// This is not very meaningful for a macro ID. - unsigned getFileOffset(SourceLocation SpellingLoc) const { - return getDecomposedLoc(SpellingLoc).second; - } - - /// \brief Tests whether the given source location represents a macro - /// argument's expansion into the function-like macro definition. - /// - /// \param StartLoc If non-null and function returns true, it is set to the - /// start location of the macro argument expansion. - /// - /// Such source locations only appear inside of the expansion - /// locations representing where a particular function-like macro was - /// expanded. - bool isMacroArgExpansion(SourceLocation Loc, - SourceLocation *StartLoc = nullptr) const; - - /// \brief Tests whether the given source location represents the expansion of - /// a macro body. - /// - /// This is equivalent to testing whether the location is part of a macro - /// expansion but not the expansion of an argument to a function-like macro. - bool isMacroBodyExpansion(SourceLocation Loc) const; - - /// \brief Returns true if the given MacroID location points at the beginning - /// of the immediate macro expansion. - /// - /// \param MacroBegin If non-null and function returns true, it is set to the - /// begin location of the immediate macro expansion. - bool isAtStartOfImmediateMacroExpansion(SourceLocation Loc, - SourceLocation *MacroBegin = nullptr) const; - - /// \brief Returns true if the given MacroID location points at the character - /// end of the immediate macro expansion. - /// - /// \param MacroEnd If non-null and function returns true, it is set to the - /// character end location of the immediate macro expansion. - bool - isAtEndOfImmediateMacroExpansion(SourceLocation Loc, - SourceLocation *MacroEnd = nullptr) const; - - /// \brief Returns true if \p Loc is inside the [\p Start, +\p Length) - /// chunk of the source location address space. - /// - /// If it's true and \p RelativeOffset is non-null, it will be set to the - /// relative offset of \p Loc inside the chunk. - bool isInSLocAddrSpace(SourceLocation Loc, - SourceLocation Start, unsigned Length, - unsigned *RelativeOffset = nullptr) const { - assert(((Start.getOffset() < NextLocalOffset && - Start.getOffset()+Length <= NextLocalOffset) || - (Start.getOffset() >= CurrentLoadedOffset && - Start.getOffset()+Length < MaxLoadedOffset)) && - "Chunk is not valid SLoc address space"); - unsigned LocOffs = Loc.getOffset(); - unsigned BeginOffs = Start.getOffset(); - unsigned EndOffs = BeginOffs + Length; - if (LocOffs >= BeginOffs && LocOffs < EndOffs) { - if (RelativeOffset) - *RelativeOffset = LocOffs - BeginOffs; - return true; - } - - return false; - } - - /// \brief Return true if both \p LHS and \p RHS are in the local source - /// location address space or the loaded one. - /// - /// If it's true and \p RelativeOffset is non-null, it will be set to the - /// offset of \p RHS relative to \p LHS. - bool isInSameSLocAddrSpace(SourceLocation LHS, SourceLocation RHS, - int *RelativeOffset) const { - unsigned LHSOffs = LHS.getOffset(), RHSOffs = RHS.getOffset(); - bool LHSLoaded = LHSOffs >= CurrentLoadedOffset; - bool RHSLoaded = RHSOffs >= CurrentLoadedOffset; - - if (LHSLoaded == RHSLoaded) { - if (RelativeOffset) - *RelativeOffset = RHSOffs - LHSOffs; - return true; - } - - return false; - } - - //===--------------------------------------------------------------------===// - // Queries about the code at a SourceLocation. - //===--------------------------------------------------------------------===// - - /// \brief Return a pointer to the start of the specified location - /// in the appropriate spelling MemoryBuffer. - /// - /// \param Invalid If non-NULL, will be set \c true if an error occurs. - const char *getCharacterData(SourceLocation SL, - bool *Invalid = nullptr) const; - - /// \brief Return the column # for the specified file position. - /// - /// This is significantly cheaper to compute than the line number. This - /// returns zero if the column number isn't known. This may only be called - /// on a file sloc, so you must choose a spelling or expansion location - /// before calling this method. - unsigned getColumnNumber(FileID FID, unsigned FilePos, - bool *Invalid = nullptr) const; - unsigned getSpellingColumnNumber(SourceLocation Loc, - bool *Invalid = nullptr) const; - unsigned getExpansionColumnNumber(SourceLocation Loc, - bool *Invalid = nullptr) const; - unsigned getPresumedColumnNumber(SourceLocation Loc, - bool *Invalid = nullptr) const; - - /// \brief Given a SourceLocation, return the spelling line number - /// for the position indicated. - /// - /// This requires building and caching a table of line offsets for the - /// MemoryBuffer, so this is not cheap: use only when about to emit a - /// diagnostic. - unsigned getLineNumber(FileID FID, unsigned FilePos, bool *Invalid = nullptr) const; - unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const; - unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const; - unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const; - - /// \brief Return the filename or buffer identifier of the buffer the - /// location is in. - /// - /// Note that this name does not respect \#line directives. Use - /// getPresumedLoc for normal clients. - const char *getBufferName(SourceLocation Loc, bool *Invalid = nullptr) const; - - /// \brief Return the file characteristic of the specified source - /// location, indicating whether this is a normal file, a system - /// header, or an "implicit extern C" system header. - /// - /// This state can be modified with flags on GNU linemarker directives like: - /// \code - /// # 4 "foo.h" 3 - /// \endcode - /// which changes all source locations in the current file after that to be - /// considered to be from a system header. - SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const; - - /// \brief Returns the "presumed" location of a SourceLocation specifies. - /// - /// A "presumed location" can be modified by \#line or GNU line marker - /// directives. This provides a view on the data that a user should see - /// in diagnostics, for example. - /// - /// Note that a presumed location is always given as the expansion point of - /// an expansion location, not at the spelling location. - /// - /// \returns The presumed location of the specified SourceLocation. If the - /// presumed location cannot be calculated (e.g., because \p Loc is invalid - /// or the file containing \p Loc has changed on disk), returns an invalid - /// presumed location. - PresumedLoc getPresumedLoc(SourceLocation Loc, - bool UseLineDirectives = true) const; - - /// \brief Returns whether the PresumedLoc for a given SourceLocation is - /// in the main file. - /// - /// This computes the "presumed" location for a SourceLocation, then checks - /// whether it came from a file other than the main file. This is different - /// from isWrittenInMainFile() because it takes line marker directives into - /// account. - bool isInMainFile(SourceLocation Loc) const; - - /// \brief Returns true if the spelling locations for both SourceLocations - /// are part of the same file buffer. - /// - /// This check ignores line marker directives. - bool isWrittenInSameFile(SourceLocation Loc1, SourceLocation Loc2) const { - return getFileID(Loc1) == getFileID(Loc2); - } - - /// \brief Returns true if the spelling location for the given location - /// is in the main file buffer. - /// - /// This check ignores line marker directives. - bool isWrittenInMainFile(SourceLocation Loc) const { - return getFileID(Loc) == getMainFileID(); - } - - /// \brief Returns if a SourceLocation is in a system header. - bool isInSystemHeader(SourceLocation Loc) const { - return getFileCharacteristic(Loc) != SrcMgr::C_User; - } - - /// \brief Returns if a SourceLocation is in an "extern C" system header. - bool isInExternCSystemHeader(SourceLocation Loc) const { - return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem; - } - - /// \brief Returns whether \p Loc is expanded from a macro in a system header. - bool isInSystemMacro(SourceLocation loc) { - return loc.isMacroID() && isInSystemHeader(getSpellingLoc(loc)); - } - - /// \brief The size of the SLocEntry that \p FID represents. - unsigned getFileIDSize(FileID FID) const; - - /// \brief Given a specific FileID, returns true if \p Loc is inside that - /// FileID chunk and sets relative offset (offset of \p Loc from beginning - /// of FileID) to \p relativeOffset. - bool isInFileID(SourceLocation Loc, FileID FID, - unsigned *RelativeOffset = nullptr) const { - unsigned Offs = Loc.getOffset(); - if (isOffsetInFileID(FID, Offs)) { - if (RelativeOffset) - *RelativeOffset = Offs - getSLocEntry(FID).getOffset(); - return true; - } - - return false; - } - - //===--------------------------------------------------------------------===// - // Line Table Manipulation Routines - //===--------------------------------------------------------------------===// - - /// \brief Return the uniqued ID for the specified filename. - /// - unsigned getLineTableFilenameID(StringRef Str); - - /// \brief Add a line note to the line table for the FileID and offset - /// specified by Loc. - /// - /// If FilenameID is -1, it is considered to be unspecified. - void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID); - void AddLineNote(SourceLocation Loc, unsigned LineNo, int FilenameID, - bool IsFileEntry, bool IsFileExit, - bool IsSystemHeader, bool IsExternCHeader); - - /// \brief Determine if the source manager has a line table. - bool hasLineTable() const { return LineTable != nullptr; } - - /// \brief Retrieve the stored line table. - LineTableInfo &getLineTable(); - - //===--------------------------------------------------------------------===// - // Queries for performance analysis. - //===--------------------------------------------------------------------===// - - /// \brief Return the total amount of physical memory allocated by the - /// ContentCache allocator. - size_t getContentCacheSize() const { - return ContentCacheAlloc.getTotalMemory(); - } - - struct MemoryBufferSizes { - const size_t malloc_bytes; - const size_t mmap_bytes; - - MemoryBufferSizes(size_t malloc_bytes, size_t mmap_bytes) - : malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {} - }; - - /// \brief Return the amount of memory used by memory buffers, breaking down - /// by heap-backed versus mmap'ed memory. - MemoryBufferSizes getMemoryBufferSizes() const; - - /// \brief Return the amount of memory used for various side tables and - /// data structures in the SourceManager. - size_t getDataStructureSizes() const; - - //===--------------------------------------------------------------------===// - // Other miscellaneous methods. - //===--------------------------------------------------------------------===// - - /// \brief Get the source location for the given file:line:col triplet. - /// - /// If the source file is included multiple times, the source location will - /// be based upon the first inclusion. - SourceLocation translateFileLineCol(const FileEntry *SourceFile, - unsigned Line, unsigned Col) const; - - /// \brief Get the FileID for the given file. - /// - /// If the source file is included multiple times, the FileID will be the - /// first inclusion. - FileID translateFile(const FileEntry *SourceFile) const; - - /// \brief Get the source location in \p FID for the given line:col. - /// Returns null location if \p FID is not a file SLocEntry. - SourceLocation translateLineCol(FileID FID, - unsigned Line, unsigned Col) const; - - /// \brief If \p Loc points inside a function macro argument, the returned - /// location will be the macro location in which the argument was expanded. - /// If a macro argument is used multiple times, the expanded location will - /// be at the first expansion of the argument. - /// e.g. - /// MY_MACRO(foo); - /// ^ - /// Passing a file location pointing at 'foo', will yield a macro location - /// where 'foo' was expanded into. - SourceLocation getMacroArgExpandedLocation(SourceLocation Loc) const; - - /// \brief Determines the order of 2 source locations in the translation unit. - /// - /// \returns true if LHS source location comes before RHS, false otherwise. - bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; - - /// \brief Determines the order of 2 source locations in the "source location - /// address space". - bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { - return isBeforeInSLocAddrSpace(LHS, RHS.getOffset()); - } - - /// \brief Determines the order of a source location and a source location - /// offset in the "source location address space". - /// - /// Note that we always consider source locations loaded from - bool isBeforeInSLocAddrSpace(SourceLocation LHS, unsigned RHS) const { - unsigned LHSOffset = LHS.getOffset(); - bool LHSLoaded = LHSOffset >= CurrentLoadedOffset; - bool RHSLoaded = RHS >= CurrentLoadedOffset; - if (LHSLoaded == RHSLoaded) - return LHSOffset < RHS; - - return LHSLoaded; - } - - // Iterators over FileInfos. - typedef llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> - ::const_iterator fileinfo_iterator; - fileinfo_iterator fileinfo_begin() const { return FileInfos.begin(); } - fileinfo_iterator fileinfo_end() const { return FileInfos.end(); } - bool hasFileInfo(const FileEntry *File) const { - return FileInfos.find(File) != FileInfos.end(); - } - - /// \brief Print statistics to stderr. - /// - void PrintStats() const; - - void dump() const; - - /// \brief Get the number of local SLocEntries we have. - unsigned local_sloc_entry_size() const { return LocalSLocEntryTable.size(); } - - /// \brief Get a local SLocEntry. This is exposed for indexing. - const SrcMgr::SLocEntry &getLocalSLocEntry(unsigned Index, - bool *Invalid = nullptr) const { - assert(Index < LocalSLocEntryTable.size() && "Invalid index"); - return LocalSLocEntryTable[Index]; - } - - /// \brief Get the number of loaded SLocEntries we have. - unsigned loaded_sloc_entry_size() const { return LoadedSLocEntryTable.size();} - - /// \brief Get a loaded SLocEntry. This is exposed for indexing. - const SrcMgr::SLocEntry &getLoadedSLocEntry(unsigned Index, - bool *Invalid = nullptr) const { - assert(Index < LoadedSLocEntryTable.size() && "Invalid index"); - if (SLocEntryLoaded[Index]) - return LoadedSLocEntryTable[Index]; - return loadSLocEntry(Index, Invalid); - } - - const SrcMgr::SLocEntry &getSLocEntry(FileID FID, - bool *Invalid = nullptr) const { - if (FID.ID == 0 || FID.ID == -1) { - if (Invalid) *Invalid = true; - return LocalSLocEntryTable[0]; - } - return getSLocEntryByID(FID.ID, Invalid); - } - - unsigned getNextLocalOffset() const { return NextLocalOffset; } - - void setExternalSLocEntrySource(ExternalSLocEntrySource *Source) { - assert(LoadedSLocEntryTable.empty() && - "Invalidating existing loaded entries"); - ExternalSLocEntries = Source; - } - - /// \brief Allocate a number of loaded SLocEntries, which will be actually - /// loaded on demand from the external source. - /// - /// NumSLocEntries will be allocated, which occupy a total of TotalSize space - /// in the global source view. The lowest ID and the base offset of the - /// entries will be returned. - std::pair<int, unsigned> - AllocateLoadedSLocEntries(unsigned NumSLocEntries, unsigned TotalSize); - - /// \brief Returns true if \p Loc came from a PCH/Module. - bool isLoadedSourceLocation(SourceLocation Loc) const { - return Loc.getOffset() >= CurrentLoadedOffset; - } - - /// \brief Returns true if \p Loc did not come from a PCH/Module. - bool isLocalSourceLocation(SourceLocation Loc) const { - return Loc.getOffset() < NextLocalOffset; - } - - /// \brief Returns true if \p FID came from a PCH/Module. - bool isLoadedFileID(FileID FID) const { - assert(FID.ID != -1 && "Using FileID sentinel value"); - return FID.ID < 0; - } - - /// \brief Returns true if \p FID did not come from a PCH/Module. - bool isLocalFileID(FileID FID) const { - return !isLoadedFileID(FID); - } - - /// Gets the location of the immediate macro caller, one level up the stack - /// toward the initial macro typed into the source. - SourceLocation getImmediateMacroCallerLoc(SourceLocation Loc) const { - if (!Loc.isMacroID()) return Loc; - - // When we have the location of (part of) an expanded parameter, its - // spelling location points to the argument as expanded in the macro call, - // and therefore is used to locate the macro caller. - if (isMacroArgExpansion(Loc)) - return getImmediateSpellingLoc(Loc); - - // Otherwise, the caller of the macro is located where this macro is - // expanded (while the spelling is part of the macro definition). - return getImmediateExpansionRange(Loc).first; - } - -private: - llvm::MemoryBuffer *getFakeBufferForRecovery() const; - const SrcMgr::ContentCache *getFakeContentCacheForRecovery() const; - - const SrcMgr::SLocEntry &loadSLocEntry(unsigned Index, bool *Invalid) const; - - /// \brief Get the entry with the given unwrapped FileID. - const SrcMgr::SLocEntry &getSLocEntryByID(int ID, - bool *Invalid = nullptr) const { - assert(ID != -1 && "Using FileID sentinel value"); - if (ID < 0) - return getLoadedSLocEntryByID(ID, Invalid); - return getLocalSLocEntry(static_cast<unsigned>(ID), Invalid); - } - - const SrcMgr::SLocEntry & - getLoadedSLocEntryByID(int ID, bool *Invalid = nullptr) const { - return getLoadedSLocEntry(static_cast<unsigned>(-ID - 2), Invalid); - } - - /// Implements the common elements of storing an expansion info struct into - /// the SLocEntry table and producing a source location that refers to it. - SourceLocation createExpansionLocImpl(const SrcMgr::ExpansionInfo &Expansion, - unsigned TokLength, - int LoadedID = 0, - unsigned LoadedOffset = 0); - - /// \brief Return true if the specified FileID contains the - /// specified SourceLocation offset. This is a very hot method. - inline bool isOffsetInFileID(FileID FID, unsigned SLocOffset) const { - const SrcMgr::SLocEntry &Entry = getSLocEntry(FID); - // If the entry is after the offset, it can't contain it. - if (SLocOffset < Entry.getOffset()) return false; - - // If this is the very last entry then it does. - if (FID.ID == -2) - return true; - - // If it is the last local entry, then it does if the location is local. - if (FID.ID+1 == static_cast<int>(LocalSLocEntryTable.size())) - return SLocOffset < NextLocalOffset; - - // Otherwise, the entry after it has to not include it. This works for both - // local and loaded entries. - return SLocOffset < getSLocEntryByID(FID.ID+1).getOffset(); - } - - /// \brief Returns the previous in-order FileID or an invalid FileID if there - /// is no previous one. - FileID getPreviousFileID(FileID FID) const; - - /// \brief Returns the next in-order FileID or an invalid FileID if there is - /// no next one. - FileID getNextFileID(FileID FID) const; - - /// \brief Create a new fileID for the specified ContentCache and - /// include position. - /// - /// This works regardless of whether the ContentCache corresponds to a - /// file or some other input source. - FileID createFileID(const SrcMgr::ContentCache* File, - SourceLocation IncludePos, - SrcMgr::CharacteristicKind DirCharacter, - int LoadedID, unsigned LoadedOffset); - - const SrcMgr::ContentCache * - getOrCreateContentCache(const FileEntry *SourceFile, - bool isSystemFile = false); - - /// \brief Create a new ContentCache for the specified memory buffer. - const SrcMgr::ContentCache * - createMemBufferContentCache(std::unique_ptr<llvm::MemoryBuffer> Buf); - - FileID getFileIDSlow(unsigned SLocOffset) const; - FileID getFileIDLocal(unsigned SLocOffset) const; - FileID getFileIDLoaded(unsigned SLocOffset) const; - - SourceLocation getExpansionLocSlowCase(SourceLocation Loc) const; - SourceLocation getSpellingLocSlowCase(SourceLocation Loc) const; - SourceLocation getFileLocSlowCase(SourceLocation Loc) const; - - std::pair<FileID, unsigned> - getDecomposedExpansionLocSlowCase(const SrcMgr::SLocEntry *E) const; - std::pair<FileID, unsigned> - getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E, - unsigned Offset) const; - void computeMacroArgsCache(MacroArgsMap *&MacroArgsCache, FileID FID) const; - void associateFileChunkWithMacroArgExp(MacroArgsMap &MacroArgsCache, - FileID FID, - SourceLocation SpellLoc, - SourceLocation ExpansionLoc, - unsigned ExpansionLength) const; - friend class ASTReader; - friend class ASTWriter; -}; - -/// \brief Comparison function object. -template<typename T> -class BeforeThanCompare; - -/// \brief Compare two source locations. -template<> -class BeforeThanCompare<SourceLocation> { - SourceManager &SM; - -public: - explicit BeforeThanCompare(SourceManager &SM) : SM(SM) { } - - bool operator()(SourceLocation LHS, SourceLocation RHS) const { - return SM.isBeforeInTranslationUnit(LHS, RHS); - } -}; - -/// \brief Compare two non-overlapping source ranges. -template<> -class BeforeThanCompare<SourceRange> { - SourceManager &SM; - -public: - explicit BeforeThanCompare(SourceManager &SM) : SM(SM) { } - - bool operator()(SourceRange LHS, SourceRange RHS) const { - return SM.isBeforeInTranslationUnit(LHS.getBegin(), RHS.getBegin()); - } -}; - -} // end namespace clang - - -#endif diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h deleted file mode 100644 index 27dea9f..0000000 --- a/include/clang/Basic/SourceManagerInternals.h +++ /dev/null @@ -1,128 +0,0 @@ -//===--- SourceManagerInternals.h - SourceManager Internals -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines implementation details of the clang::SourceManager class. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H -#define LLVM_CLANG_BASIC_SOURCEMANAGERINTERNALS_H - -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/SourceManager.h" -#include "llvm/ADT/StringMap.h" -#include <map> - -namespace clang { - -//===----------------------------------------------------------------------===// -// Line Table Implementation -//===----------------------------------------------------------------------===// - -struct LineEntry { - /// \brief The offset in this file that the line entry occurs at. - unsigned FileOffset; - - /// \brief The presumed line number of this line entry: \#line 4. - unsigned LineNo; - - /// \brief The ID of the filename identified by this line entry: - /// \#line 4 "foo.c". This is -1 if not specified. - int FilenameID; - - /// \brief Set the 0 if no flags, 1 if a system header, - SrcMgr::CharacteristicKind FileKind; - - /// \brief The offset of the virtual include stack location, - /// which is manipulated by GNU linemarker directives. - /// - /// If this is 0 then there is no virtual \#includer. - unsigned IncludeOffset; - - static LineEntry get(unsigned Offs, unsigned Line, int Filename, - SrcMgr::CharacteristicKind FileKind, - unsigned IncludeOffset) { - LineEntry E; - E.FileOffset = Offs; - E.LineNo = Line; - E.FilenameID = Filename; - E.FileKind = FileKind; - E.IncludeOffset = IncludeOffset; - return E; - } -}; - -// needed for FindNearestLineEntry (upper_bound of LineEntry) -inline bool operator<(const LineEntry &lhs, const LineEntry &rhs) { - // FIXME: should check the other field? - return lhs.FileOffset < rhs.FileOffset; -} - -inline bool operator<(const LineEntry &E, unsigned Offset) { - return E.FileOffset < Offset; -} - -inline bool operator<(unsigned Offset, const LineEntry &E) { - return Offset < E.FileOffset; -} - -/// \brief Used to hold and unique data used to represent \#line information. -class LineTableInfo { - /// \brief Map used to assign unique IDs to filenames in \#line directives. - /// - /// This allows us to unique the filenames that - /// frequently reoccur and reference them with indices. FilenameIDs holds - /// the mapping from string -> ID, and FilenamesByID holds the mapping of ID - /// to string. - llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs; - std::vector<llvm::StringMapEntry<unsigned>*> FilenamesByID; - - /// \brief Map from FileIDs to a list of line entries (sorted by the offset - /// at which they occur in the file). - std::map<FileID, std::vector<LineEntry> > LineEntries; -public: - void clear() { - FilenameIDs.clear(); - FilenamesByID.clear(); - LineEntries.clear(); - } - - unsigned getLineTableFilenameID(StringRef Str); - const char *getFilename(unsigned ID) const { - assert(ID < FilenamesByID.size() && "Invalid FilenameID"); - return FilenamesByID[ID]->getKeyData(); - } - unsigned getNumFilenames() const { return FilenamesByID.size(); } - - void AddLineNote(FileID FID, unsigned Offset, - unsigned LineNo, int FilenameID); - void AddLineNote(FileID FID, unsigned Offset, - unsigned LineNo, int FilenameID, - unsigned EntryExit, SrcMgr::CharacteristicKind FileKind); - - - /// \brief Find the line entry nearest to FID that is before it. - /// - /// If there is no line entry before \p Offset in \p FID, returns null. - const LineEntry *FindNearestLineEntry(FileID FID, unsigned Offset); - - // Low-level access - typedef std::map<FileID, std::vector<LineEntry> >::iterator iterator; - iterator begin() { return LineEntries.begin(); } - iterator end() { return LineEntries.end(); } - - /// \brief Add a new line entry that has already been encoded into - /// the internal representation of the line table. - void AddEntry(FileID FID, const std::vector<LineEntry> &Entries); -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h deleted file mode 100644 index 1d59d64..0000000 --- a/include/clang/Basic/Specifiers.h +++ /dev/null @@ -1,283 +0,0 @@ -//===--- Specifiers.h - Declaration and Type Specifiers ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines various enumerations that describe declaration and -/// type specifiers. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_SPECIFIERS_H -#define LLVM_CLANG_BASIC_SPECIFIERS_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/ErrorHandling.h" - -namespace clang { - /// \brief Specifies the width of a type, e.g., short, long, or long long. - enum TypeSpecifierWidth { - TSW_unspecified, - TSW_short, - TSW_long, - TSW_longlong - }; - - /// \brief Specifies the signedness of a type, e.g., signed or unsigned. - enum TypeSpecifierSign { - TSS_unspecified, - TSS_signed, - TSS_unsigned - }; - - /// \brief Specifies the kind of type. - enum TypeSpecifierType { - TST_unspecified, - TST_void, - TST_char, - TST_wchar, // C++ wchar_t - TST_char16, // C++11 char16_t - TST_char32, // C++11 char32_t - TST_int, - TST_int128, - TST_half, // OpenCL half, ARM NEON __fp16 - TST_float, - TST_double, - TST_bool, // _Bool - TST_decimal32, // _Decimal32 - TST_decimal64, // _Decimal64 - TST_decimal128, // _Decimal128 - TST_enum, - TST_union, - TST_struct, - TST_class, // C++ class type - TST_interface, // C++ (Microsoft-specific) __interface type - TST_typename, // Typedef, C++ class-name or enum name, etc. - TST_typeofType, - TST_typeofExpr, - TST_decltype, // C++11 decltype - TST_underlyingType, // __underlying_type for C++11 - TST_auto, // C++11 auto - TST_decltype_auto, // C++1y decltype(auto) - TST_auto_type, // __auto_type extension - TST_unknown_anytype, // __unknown_anytype extension - TST_atomic, // C11 _Atomic - TST_error // erroneous type - }; - - /// \brief Structure that packs information about the type specifiers that - /// were written in a particular type specifier sequence. - struct WrittenBuiltinSpecs { - /*DeclSpec::TST*/ unsigned Type : 5; - /*DeclSpec::TSS*/ unsigned Sign : 2; - /*DeclSpec::TSW*/ unsigned Width : 2; - bool ModeAttr : 1; - }; - - /// \brief A C++ access specifier (public, private, protected), plus the - /// special value "none" which means different things in different contexts. - enum AccessSpecifier { - AS_public, - AS_protected, - AS_private, - AS_none - }; - - /// \brief The categorization of expression values, currently following the - /// C++11 scheme. - enum ExprValueKind { - /// \brief An r-value expression (a pr-value in the C++11 taxonomy) - /// produces a temporary value. - VK_RValue, - - /// \brief An l-value expression is a reference to an object with - /// independent storage. - VK_LValue, - - /// \brief An x-value expression is a reference to an object with - /// independent storage but which can be "moved", i.e. - /// efficiently cannibalized for its resources. - VK_XValue - }; - - /// \brief A further classification of the kind of object referenced by an - /// l-value or x-value. - enum ExprObjectKind { - /// An ordinary object is located at an address in memory. - OK_Ordinary, - - /// A bitfield object is a bitfield on a C or C++ record. - OK_BitField, - - /// A vector component is an element or range of elements on a vector. - OK_VectorComponent, - - /// An Objective-C property is a logical field of an Objective-C - /// object which is read and written via Objective-C method calls. - OK_ObjCProperty, - - /// An Objective-C array/dictionary subscripting which reads an - /// object or writes at the subscripted array/dictionary element via - /// Objective-C method calls. - OK_ObjCSubscript - }; - - /// \brief Describes the kind of template specialization that a - /// particular template specialization declaration represents. - enum TemplateSpecializationKind { - /// This template specialization was formed from a template-id but - /// has not yet been declared, defined, or instantiated. - TSK_Undeclared = 0, - /// This template specialization was implicitly instantiated from a - /// template. (C++ [temp.inst]). - TSK_ImplicitInstantiation, - /// This template specialization was declared or defined by an - /// explicit specialization (C++ [temp.expl.spec]) or partial - /// specialization (C++ [temp.class.spec]). - TSK_ExplicitSpecialization, - /// This template specialization was instantiated from a template - /// due to an explicit instantiation declaration request - /// (C++11 [temp.explicit]). - TSK_ExplicitInstantiationDeclaration, - /// This template specialization was instantiated from a template - /// due to an explicit instantiation definition request - /// (C++ [temp.explicit]). - TSK_ExplicitInstantiationDefinition - }; - - /// \brief Determine whether this template specialization kind refers - /// to an instantiation of an entity (as opposed to a non-template or - /// an explicit specialization). - inline bool isTemplateInstantiation(TemplateSpecializationKind Kind) { - return Kind != TSK_Undeclared && Kind != TSK_ExplicitSpecialization; - } - - /// \brief True if this template specialization kind is an explicit - /// specialization, explicit instantiation declaration, or explicit - /// instantiation definition. - inline bool isTemplateExplicitInstantiationOrSpecialization( - TemplateSpecializationKind Kind) { - switch (Kind) { - case TSK_ExplicitSpecialization: - case TSK_ExplicitInstantiationDeclaration: - case TSK_ExplicitInstantiationDefinition: - return true; - - case TSK_Undeclared: - case TSK_ImplicitInstantiation: - return false; - } - llvm_unreachable("bad template specialization kind"); - } - - /// \brief Thread storage-class-specifier. - enum ThreadStorageClassSpecifier { - TSCS_unspecified, - /// GNU __thread. - TSCS___thread, - /// C++11 thread_local. Implies 'static' at block scope, but not at - /// class scope. - TSCS_thread_local, - /// C11 _Thread_local. Must be combined with either 'static' or 'extern' - /// if used at block scope. - TSCS__Thread_local - }; - - /// \brief Storage classes. - enum StorageClass { - // These are legal on both functions and variables. - SC_None, - SC_Extern, - SC_Static, - SC_PrivateExtern, - - // These are only legal on variables. - SC_Auto, - SC_Register - }; - - /// \brief Checks whether the given storage class is legal for functions. - inline bool isLegalForFunction(StorageClass SC) { - return SC <= SC_PrivateExtern; - } - - /// \brief Checks whether the given storage class is legal for variables. - inline bool isLegalForVariable(StorageClass SC) { - return true; - } - - /// \brief In-class initialization styles for non-static data members. - enum InClassInitStyle { - ICIS_NoInit, ///< No in-class initializer. - ICIS_CopyInit, ///< Copy initialization. - ICIS_ListInit ///< Direct list-initialization. - }; - - /// \brief CallingConv - Specifies the calling convention that a function uses. - enum CallingConv { - CC_C, // __attribute__((cdecl)) - CC_X86StdCall, // __attribute__((stdcall)) - CC_X86FastCall, // __attribute__((fastcall)) - CC_X86ThisCall, // __attribute__((thiscall)) - CC_X86VectorCall, // __attribute__((vectorcall)) - CC_X86Pascal, // __attribute__((pascal)) - CC_X86_64Win64, // __attribute__((ms_abi)) - CC_X86_64SysV, // __attribute__((sysv_abi)) - CC_AAPCS, // __attribute__((pcs("aapcs"))) - CC_AAPCS_VFP, // __attribute__((pcs("aapcs-vfp"))) - CC_IntelOclBicc, // __attribute__((intel_ocl_bicc)) - CC_SpirFunction, // default for OpenCL functions on SPIR target - CC_SpirKernel // inferred for OpenCL kernels on SPIR target - }; - - /// \brief Checks whether the given calling convention supports variadic - /// calls. Unprototyped calls also use the variadic call rules. - inline bool supportsVariadicCall(CallingConv CC) { - switch (CC) { - case CC_X86StdCall: - case CC_X86FastCall: - case CC_X86ThisCall: - case CC_X86Pascal: - case CC_X86VectorCall: - case CC_SpirFunction: - case CC_SpirKernel: - return false; - default: - return true; - } - } - - /// \brief The storage duration for an object (per C++ [basic.stc]). - enum StorageDuration { - SD_FullExpression, ///< Full-expression storage duration (for temporaries). - SD_Automatic, ///< Automatic storage duration (most local variables). - SD_Thread, ///< Thread storage duration. - SD_Static, ///< Static storage duration. - SD_Dynamic ///< Dynamic storage duration. - }; - - /// Describes the nullability of a particular type. - enum class NullabilityKind : uint8_t { - /// Values of this type can never be null. - NonNull = 0, - /// Values of this type can be null. - Nullable, - /// Whether values of this type can be null is (explicitly) - /// unspecified. This captures a (fairly rare) case where we - /// can't conclude anything about the nullability of the type even - /// though it has been considered. - Unspecified - }; - - /// Retrieve the spelling of the given nullability kind. - llvm::StringRef getNullabilitySpelling(NullabilityKind kind, - bool isContextSensitive = false); -} // end namespace clang - -#endif // LLVM_CLANG_BASIC_SPECIFIERS_H diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td deleted file mode 100644 index 36519ea..0000000 --- a/include/clang/Basic/StmtNodes.td +++ /dev/null @@ -1,224 +0,0 @@ -class AttrSubject; - -class Stmt<bit abstract = 0> : AttrSubject { - bit Abstract = abstract; -} - -class DStmt<Stmt base, bit abstract = 0> : Stmt<abstract> { - Stmt Base = base; -} - -// Statements -def NullStmt : Stmt; -def CompoundStmt : Stmt; -def LabelStmt : Stmt; -def AttributedStmt : Stmt; -def IfStmt : Stmt; -def SwitchStmt : Stmt; -def WhileStmt : Stmt; -def DoStmt : Stmt; -def ForStmt : Stmt; -def GotoStmt : Stmt; -def IndirectGotoStmt : Stmt; -def ContinueStmt : Stmt; -def BreakStmt : Stmt; -def ReturnStmt : Stmt; -def DeclStmt : Stmt; -def SwitchCase : Stmt<1>; -def CaseStmt : DStmt<SwitchCase>; -def DefaultStmt : DStmt<SwitchCase>; -def CapturedStmt : Stmt; - -// Asm statements -def AsmStmt : Stmt<1>; -def GCCAsmStmt : DStmt<AsmStmt>; -def MSAsmStmt : DStmt<AsmStmt>; - -// Obj-C statements -def ObjCAtTryStmt : Stmt; -def ObjCAtCatchStmt : Stmt; -def ObjCAtFinallyStmt : Stmt; -def ObjCAtThrowStmt : Stmt; -def ObjCAtSynchronizedStmt : Stmt; -def ObjCForCollectionStmt : Stmt; -def ObjCAutoreleasePoolStmt : Stmt; - -// C++ statments -def CXXCatchStmt : Stmt; -def CXXTryStmt : Stmt; -def CXXForRangeStmt : Stmt; - -// C++ Coroutines TS statements -def CoroutineBodyStmt : Stmt; -def CoreturnStmt : Stmt; - -// Expressions -def Expr : Stmt<1>; -def PredefinedExpr : DStmt<Expr>; -def DeclRefExpr : DStmt<Expr>; -def IntegerLiteral : DStmt<Expr>; -def FloatingLiteral : DStmt<Expr>; -def ImaginaryLiteral : DStmt<Expr>; -def StringLiteral : DStmt<Expr>; -def CharacterLiteral : DStmt<Expr>; -def ParenExpr : DStmt<Expr>; -def UnaryOperator : DStmt<Expr>; -def OffsetOfExpr : DStmt<Expr>; -def UnaryExprOrTypeTraitExpr : DStmt<Expr>; -def ArraySubscriptExpr : DStmt<Expr>; -def OMPArraySectionExpr : DStmt<Expr>; -def CallExpr : DStmt<Expr>; -def MemberExpr : DStmt<Expr>; -def CastExpr : DStmt<Expr, 1>; -def BinaryOperator : DStmt<Expr>; -def CompoundAssignOperator : DStmt<BinaryOperator>; -def AbstractConditionalOperator : DStmt<Expr, 1>; -def ConditionalOperator : DStmt<AbstractConditionalOperator>; -def BinaryConditionalOperator : DStmt<AbstractConditionalOperator>; -def ImplicitCastExpr : DStmt<CastExpr>; -def ExplicitCastExpr : DStmt<CastExpr, 1>; -def CStyleCastExpr : DStmt<ExplicitCastExpr>; -def CompoundLiteralExpr : DStmt<Expr>; -def ExtVectorElementExpr : DStmt<Expr>; -def InitListExpr : DStmt<Expr>; -def DesignatedInitExpr : DStmt<Expr>; -def DesignatedInitUpdateExpr : DStmt<Expr>; -def ImplicitValueInitExpr : DStmt<Expr>; -def NoInitExpr : DStmt<Expr>; -def ParenListExpr : DStmt<Expr>; -def VAArgExpr : DStmt<Expr>; -def GenericSelectionExpr : DStmt<Expr>; -def PseudoObjectExpr : DStmt<Expr>; - -// Atomic expressions -def AtomicExpr : DStmt<Expr>; - -// GNU Extensions. -def AddrLabelExpr : DStmt<Expr>; -def StmtExpr : DStmt<Expr>; -def ChooseExpr : DStmt<Expr>; -def GNUNullExpr : DStmt<Expr>; - -// C++ Expressions. -def CXXOperatorCallExpr : DStmt<CallExpr>; -def CXXMemberCallExpr : DStmt<CallExpr>; -def CXXNamedCastExpr : DStmt<ExplicitCastExpr, 1>; -def CXXStaticCastExpr : DStmt<CXXNamedCastExpr>; -def CXXDynamicCastExpr : DStmt<CXXNamedCastExpr>; -def CXXReinterpretCastExpr : DStmt<CXXNamedCastExpr>; -def CXXConstCastExpr : DStmt<CXXNamedCastExpr>; -def CXXFunctionalCastExpr : DStmt<ExplicitCastExpr>; -def CXXTypeidExpr : DStmt<Expr>; -def UserDefinedLiteral : DStmt<CallExpr>; -def CXXBoolLiteralExpr : DStmt<Expr>; -def CXXNullPtrLiteralExpr : DStmt<Expr>; -def CXXThisExpr : DStmt<Expr>; -def CXXThrowExpr : DStmt<Expr>; -def CXXDefaultArgExpr : DStmt<Expr>; -def CXXDefaultInitExpr : DStmt<Expr>; -def CXXScalarValueInitExpr : DStmt<Expr>; -def CXXStdInitializerListExpr : DStmt<Expr>; -def CXXNewExpr : DStmt<Expr>; -def CXXDeleteExpr : DStmt<Expr>; -def CXXPseudoDestructorExpr : DStmt<Expr>; -def TypeTraitExpr : DStmt<Expr>; -def ArrayTypeTraitExpr : DStmt<Expr>; -def ExpressionTraitExpr : DStmt<Expr>; -def DependentScopeDeclRefExpr : DStmt<Expr>; -def CXXConstructExpr : DStmt<Expr>; -def CXXBindTemporaryExpr : DStmt<Expr>; -def ExprWithCleanups : DStmt<Expr>; -def CXXTemporaryObjectExpr : DStmt<CXXConstructExpr>; -def CXXUnresolvedConstructExpr : DStmt<Expr>; -def CXXDependentScopeMemberExpr : DStmt<Expr>; -def OverloadExpr : DStmt<Expr, 1>; -def UnresolvedLookupExpr : DStmt<OverloadExpr>; -def UnresolvedMemberExpr : DStmt<OverloadExpr>; -def CXXNoexceptExpr : DStmt<Expr>; -def PackExpansionExpr : DStmt<Expr>; -def SizeOfPackExpr : DStmt<Expr>; -def SubstNonTypeTemplateParmExpr : DStmt<Expr>; -def SubstNonTypeTemplateParmPackExpr : DStmt<Expr>; -def FunctionParmPackExpr : DStmt<Expr>; -def MaterializeTemporaryExpr : DStmt<Expr>; -def LambdaExpr : DStmt<Expr>; -def CXXFoldExpr : DStmt<Expr>; - -// C++ Coroutines TS expressions -def CoroutineSuspendExpr : DStmt<Expr, 1>; -def CoawaitExpr : DStmt<CoroutineSuspendExpr>; -def CoyieldExpr : DStmt<CoroutineSuspendExpr>; - -// Obj-C Expressions. -def ObjCStringLiteral : DStmt<Expr>; -def ObjCBoxedExpr : DStmt<Expr>; -def ObjCArrayLiteral : DStmt<Expr>; -def ObjCDictionaryLiteral : DStmt<Expr>; -def ObjCEncodeExpr : DStmt<Expr>; -def ObjCMessageExpr : DStmt<Expr>; -def ObjCSelectorExpr : DStmt<Expr>; -def ObjCProtocolExpr : DStmt<Expr>; -def ObjCIvarRefExpr : DStmt<Expr>; -def ObjCPropertyRefExpr : DStmt<Expr>; -def ObjCIsaExpr : DStmt<Expr>; -def ObjCIndirectCopyRestoreExpr : DStmt<Expr>; -def ObjCBoolLiteralExpr : DStmt<Expr>; -def ObjCSubscriptRefExpr : DStmt<Expr>; - -// Obj-C ARC Expressions. -def ObjCBridgedCastExpr : DStmt<ExplicitCastExpr>; - -// CUDA Expressions. -def CUDAKernelCallExpr : DStmt<CallExpr>; - -// Clang Extensions. -def ShuffleVectorExpr : DStmt<Expr>; -def ConvertVectorExpr : DStmt<Expr>; -def BlockExpr : DStmt<Expr>; -def OpaqueValueExpr : DStmt<Expr>; -def TypoExpr : DStmt<Expr>; - -// Microsoft Extensions. -def MSPropertyRefExpr : DStmt<Expr>; -def MSPropertySubscriptExpr : DStmt<Expr>; -def CXXUuidofExpr : DStmt<Expr>; -def SEHTryStmt : Stmt; -def SEHExceptStmt : Stmt; -def SEHFinallyStmt : Stmt; -def SEHLeaveStmt : Stmt; -def MSDependentExistsStmt : Stmt; - -// OpenCL Extensions. -def AsTypeExpr : DStmt<Expr>; - -// OpenMP Directives. -def OMPExecutableDirective : Stmt<1>; -def OMPLoopDirective : DStmt<OMPExecutableDirective, 1>; -def OMPParallelDirective : DStmt<OMPExecutableDirective>; -def OMPSimdDirective : DStmt<OMPLoopDirective>; -def OMPForDirective : DStmt<OMPLoopDirective>; -def OMPForSimdDirective : DStmt<OMPLoopDirective>; -def OMPSectionsDirective : DStmt<OMPExecutableDirective>; -def OMPSectionDirective : DStmt<OMPExecutableDirective>; -def OMPSingleDirective : DStmt<OMPExecutableDirective>; -def OMPMasterDirective : DStmt<OMPExecutableDirective>; -def OMPCriticalDirective : DStmt<OMPExecutableDirective>; -def OMPParallelForDirective : DStmt<OMPLoopDirective>; -def OMPParallelForSimdDirective : DStmt<OMPLoopDirective>; -def OMPParallelSectionsDirective : DStmt<OMPExecutableDirective>; -def OMPTaskDirective : DStmt<OMPExecutableDirective>; -def OMPTaskyieldDirective : DStmt<OMPExecutableDirective>; -def OMPBarrierDirective : DStmt<OMPExecutableDirective>; -def OMPTaskwaitDirective : DStmt<OMPExecutableDirective>; -def OMPTaskgroupDirective : DStmt<OMPExecutableDirective>; -def OMPFlushDirective : DStmt<OMPExecutableDirective>; -def OMPOrderedDirective : DStmt<OMPExecutableDirective>; -def OMPAtomicDirective : DStmt<OMPExecutableDirective>; -def OMPTargetDirective : DStmt<OMPExecutableDirective>; -def OMPTargetDataDirective : DStmt<OMPExecutableDirective>; -def OMPTeamsDirective : DStmt<OMPExecutableDirective>; -def OMPCancellationPointDirective : DStmt<OMPExecutableDirective>; -def OMPCancelDirective : DStmt<OMPExecutableDirective>; -def OMPTaskLoopDirective : DStmt<OMPLoopDirective>; -def OMPTaskLoopSimdDirective : DStmt<OMPLoopDirective>; -def OMPDistributeDirective : DStmt<OMPLoopDirective>; diff --git a/include/clang/Basic/TargetBuiltins.h b/include/clang/Basic/TargetBuiltins.h deleted file mode 100644 index 623c0b6..0000000 --- a/include/clang/Basic/TargetBuiltins.h +++ /dev/null @@ -1,201 +0,0 @@ -//===--- TargetBuiltins.h - Target specific builtin IDs ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Enumerates target-specific builtins in their own namespaces within -/// namespace ::clang. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TARGETBUILTINS_H -#define LLVM_CLANG_BASIC_TARGETBUILTINS_H - -#include <stdint.h> -#include "clang/Basic/Builtins.h" -#undef PPC - -namespace clang { - - namespace NEON { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsNEON.def" - FirstTSBuiltin - }; - } - - /// \brief ARM builtins - namespace ARM { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, - LastNEONBuiltin = NEON::FirstTSBuiltin - 1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsARM.def" - LastTSBuiltin - }; - } - - /// \brief AArch64 builtins - namespace AArch64 { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, - LastNEONBuiltin = NEON::FirstTSBuiltin - 1, - #define BUILTIN(ID, TYPE, ATTRS) BI##ID, - #include "clang/Basic/BuiltinsAArch64.def" - LastTSBuiltin - }; - } - - /// \brief PPC builtins - namespace PPC { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsPPC.def" - LastTSBuiltin - }; - } - - /// \brief NVPTX builtins - namespace NVPTX { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsNVPTX.def" - LastTSBuiltin - }; - } - - /// \brief AMDGPU builtins - namespace AMDGPU { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, - #define BUILTIN(ID, TYPE, ATTRS) BI##ID, - #include "clang/Basic/BuiltinsAMDGPU.def" - LastTSBuiltin - }; - } - - /// \brief X86 builtins - namespace X86 { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsX86.def" - LastTSBuiltin - }; - } - - /// \brief Flags to identify the types for overloaded Neon builtins. - /// - /// These must be kept in sync with the flags in utils/TableGen/NeonEmitter.h. - class NeonTypeFlags { - enum { - EltTypeMask = 0xf, - UnsignedFlag = 0x10, - QuadFlag = 0x20 - }; - uint32_t Flags; - - public: - enum EltType { - Int8, - Int16, - Int32, - Int64, - Poly8, - Poly16, - Poly64, - Poly128, - Float16, - Float32, - Float64 - }; - - NeonTypeFlags(unsigned F) : Flags(F) {} - NeonTypeFlags(EltType ET, bool IsUnsigned, bool IsQuad) : Flags(ET) { - if (IsUnsigned) - Flags |= UnsignedFlag; - if (IsQuad) - Flags |= QuadFlag; - } - - EltType getEltType() const { return (EltType)(Flags & EltTypeMask); } - bool isPoly() const { - EltType ET = getEltType(); - return ET == Poly8 || ET == Poly16; - } - bool isUnsigned() const { return (Flags & UnsignedFlag) != 0; } - bool isQuad() const { return (Flags & QuadFlag) != 0; } - }; - - /// \brief Hexagon builtins - namespace Hexagon { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsHexagon.def" - LastTSBuiltin - }; - } - - /// \brief MIPS builtins - namespace Mips { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsMips.def" - LastTSBuiltin - }; - } - - /// \brief XCore builtins - namespace XCore { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsXCore.def" - LastTSBuiltin - }; - } - - /// \brief Le64 builtins - namespace Le64 { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, - #define BUILTIN(ID, TYPE, ATTRS) BI##ID, - #include "clang/Basic/BuiltinsLe64.def" - LastTSBuiltin - }; - } - - /// \brief SystemZ builtins - namespace SystemZ { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsSystemZ.def" - LastTSBuiltin - }; - } - - /// \brief WebAssembly builtins - namespace WebAssembly { - enum { - LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, -#define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsWebAssembly.def" - LastTSBuiltin - }; - } - -} // end namespace clang. - -#endif diff --git a/include/clang/Basic/TargetCXXABI.h b/include/clang/Basic/TargetCXXABI.h deleted file mode 100644 index 67247ea..0000000 --- a/include/clang/Basic/TargetCXXABI.h +++ /dev/null @@ -1,354 +0,0 @@ -//===--- TargetCXXABI.h - C++ ABI Target Configuration ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the TargetCXXABI class, which abstracts details of the -/// C++ ABI that we're targeting. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TARGETCXXABI_H -#define LLVM_CLANG_BASIC_TARGETCXXABI_H - -#include "llvm/ADT/Triple.h" -#include "llvm/Support/ErrorHandling.h" - -namespace clang { - -/// \brief The basic abstraction for the target C++ ABI. -class TargetCXXABI { -public: - /// \brief The basic C++ ABI kind. - enum Kind { - /// The generic Itanium ABI is the standard ABI of most open-source - /// and Unix-like platforms. It is the primary ABI targeted by - /// many compilers, including Clang and GCC. - /// - /// It is documented here: - /// http://www.codesourcery.com/public/cxx-abi/ - GenericItanium, - - /// The generic ARM ABI is a modified version of the Itanium ABI - /// proposed by ARM for use on ARM-based platforms. - /// - /// These changes include: - /// - the representation of member function pointers is adjusted - /// to not conflict with the 'thumb' bit of ARM function pointers; - /// - constructors and destructors return 'this'; - /// - guard variables are smaller; - /// - inline functions are never key functions; - /// - array cookies have a slightly different layout; - /// - additional convenience functions are specified; - /// - and more! - /// - /// It is documented here: - /// http://infocenter.arm.com - /// /help/topic/com.arm.doc.ihi0041c/IHI0041C_cppabi.pdf - GenericARM, - - /// The iOS ABI is a partial implementation of the ARM ABI. - /// Several of the features of the ARM ABI were not fully implemented - /// in the compilers that iOS was launched with. - /// - /// Essentially, the iOS ABI includes the ARM changes to: - /// - member function pointers, - /// - guard variables, - /// - array cookies, and - /// - constructor/destructor signatures. - iOS, - - /// The iOS 64-bit ABI is follows ARM's published 64-bit ABI more - /// closely, but we don't guarantee to follow it perfectly. - /// - /// It is documented here: - /// http://infocenter.arm.com - /// /help/topic/com.arm.doc.ihi0059a/IHI0059A_cppabi64.pdf - iOS64, - - /// WatchOS is a modernisation of the iOS ABI, which roughly means it's - /// the iOS64 ABI ported to 32-bits. The primary difference from iOS64 is - /// that RTTI objects must still be unique at the moment. - WatchOS, - - /// The generic AArch64 ABI is also a modified version of the Itanium ABI, - /// but it has fewer divergences than the 32-bit ARM ABI. - /// - /// The relevant changes from the generic ABI in this case are: - /// - representation of member function pointers adjusted as in ARM. - /// - guard variables are smaller. - GenericAArch64, - - /// The generic Mips ABI is a modified version of the Itanium ABI. - /// - /// At the moment, only change from the generic ABI in this case is: - /// - representation of member function pointers adjusted as in ARM. - GenericMIPS, - - /// The WebAssembly ABI is a modified version of the Itanium ABI. - /// - /// The changes from the Itanium ABI are: - /// - representation of member function pointers is adjusted, as in ARM; - /// - member functions are not specially aligned; - /// - constructors and destructors return 'this', as in ARM; - /// - guard variables are 32-bit on wasm32, as in ARM; - /// - unused bits of guard variables are reserved, as in ARM; - /// - inline functions are never key functions, as in ARM; - /// - C++11 POD rules are used for tail padding, as in iOS64. - /// - /// TODO: At present the WebAssembly ABI is not considered stable, so none - /// of these details is necessarily final yet. - WebAssembly, - - /// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and - /// compatible compilers). - /// - /// FIXME: should this be split into Win32 and Win64 variants? - /// - /// Only scattered and incomplete official documentation exists. - Microsoft - }; - -private: - // Right now, this class is passed around as a cheap value type. - // If you add more members, especially non-POD members, please - // audit the users to pass it by reference instead. - Kind TheKind; - -public: - /// A bogus initialization of the platform ABI. - TargetCXXABI() : TheKind(GenericItanium) {} - - TargetCXXABI(Kind kind) : TheKind(kind) {} - - void set(Kind kind) { - TheKind = kind; - } - - Kind getKind() const { return TheKind; } - - /// \brief Does this ABI generally fall into the Itanium family of ABIs? - bool isItaniumFamily() const { - switch (getKind()) { - case GenericAArch64: - case GenericItanium: - case GenericARM: - case iOS: - case iOS64: - case WatchOS: - case GenericMIPS: - case WebAssembly: - return true; - - case Microsoft: - return false; - } - llvm_unreachable("bad ABI kind"); - } - - /// \brief Is this ABI an MSVC-compatible ABI? - bool isMicrosoft() const { - switch (getKind()) { - case GenericAArch64: - case GenericItanium: - case GenericARM: - case iOS: - case iOS64: - case WatchOS: - case GenericMIPS: - case WebAssembly: - return false; - - case Microsoft: - return true; - } - llvm_unreachable("bad ABI kind"); - } - - /// \brief Are member functions differently aligned? - /// - /// Many Itanium-style C++ ABIs require member functions to be aligned, so - /// that a pointer to such a function is guaranteed to have a zero in the - /// least significant bit, so that pointers to member functions can use that - /// bit to distinguish between virtual and non-virtual functions. However, - /// some Itanium-style C++ ABIs differentiate between virtual and non-virtual - /// functions via other means, and consequently don't require that member - /// functions be aligned. - bool areMemberFunctionsAligned() const { - switch (getKind()) { - case WebAssembly: - // WebAssembly doesn't require any special alignment for member functions. - return false; - case GenericARM: - case GenericAArch64: - case GenericMIPS: - // TODO: ARM-style pointers to member functions put the discriminator in - // the this adjustment, so they don't require functions to have any - // special alignment and could therefore also return false. - case GenericItanium: - case iOS: - case iOS64: - case WatchOS: - case Microsoft: - return true; - } - llvm_unreachable("bad ABI kind"); - } - - /// \brief Is the default C++ member function calling convention - /// the same as the default calling convention? - bool isMemberFunctionCCDefault() const { - // Right now, this is always false for Microsoft. - return !isMicrosoft(); - } - - /// Are arguments to a call destroyed left to right in the callee? - /// This is a fundamental language change, since it implies that objects - /// passed by value do *not* live to the end of the full expression. - /// Temporaries passed to a function taking a const reference live to the end - /// of the full expression as usual. Both the caller and the callee must - /// have access to the destructor, while only the caller needs the - /// destructor if this is false. - bool areArgsDestroyedLeftToRightInCallee() const { - return isMicrosoft(); - } - - /// \brief Does this ABI have different entrypoints for complete-object - /// and base-subobject constructors? - bool hasConstructorVariants() const { - return isItaniumFamily(); - } - - /// \brief Does this ABI allow virtual bases to be primary base classes? - bool hasPrimaryVBases() const { - return isItaniumFamily(); - } - - /// \brief Does this ABI use key functions? If so, class data such as the - /// vtable is emitted with strong linkage by the TU containing the key - /// function. - bool hasKeyFunctions() const { - return isItaniumFamily(); - } - - /// \brief Can an out-of-line inline function serve as a key function? - /// - /// This flag is only useful in ABIs where type data (for example, - /// v-tables and type_info objects) are emitted only after processing - /// the definition of a special "key" virtual function. (This is safe - /// because the ODR requires that every virtual function be defined - /// somewhere in a program.) This usually permits such data to be - /// emitted in only a single object file, as opposed to redundantly - /// in every object file that requires it. - /// - /// One simple and common definition of "key function" is the first - /// virtual function in the class definition which is not defined there. - /// This rule works very well when that function has a non-inline - /// definition in some non-header file. Unfortunately, when that - /// function is defined inline, this rule requires the type data - /// to be emitted weakly, as if there were no key function. - /// - /// The ARM ABI observes that the ODR provides an additional guarantee: - /// a virtual function is always ODR-used, so if it is defined inline, - /// that definition must appear in every translation unit that defines - /// the class. Therefore, there is no reason to allow such functions - /// to serve as key functions. - /// - /// Because this changes the rules for emitting type data, - /// it can cause type data to be emitted with both weak and strong - /// linkage, which is not allowed on all platforms. Therefore, - /// exploiting this observation requires an ABI break and cannot be - /// done on a generic Itanium platform. - bool canKeyFunctionBeInline() const { - switch (getKind()) { - case GenericARM: - case iOS64: - case WebAssembly: - case WatchOS: - return false; - - case GenericAArch64: - case GenericItanium: - case iOS: // old iOS compilers did not follow this rule - case Microsoft: - case GenericMIPS: - return true; - } - llvm_unreachable("bad ABI kind"); - } - - /// When is record layout allowed to allocate objects in the tail - /// padding of a base class? - /// - /// This decision cannot be changed without breaking platform ABI - /// compatibility, and yet it is tied to language guarantees which - /// the committee has so far seen fit to strengthen no less than - /// three separate times: - /// - originally, there were no restrictions at all; - /// - C++98 declared that objects could not be allocated in the - /// tail padding of a POD type; - /// - C++03 extended the definition of POD to include classes - /// containing member pointers; and - /// - C++11 greatly broadened the definition of POD to include - /// all trivial standard-layout classes. - /// Each of these changes technically took several existing - /// platforms and made them permanently non-conformant. - enum TailPaddingUseRules { - /// The tail-padding of a base class is always theoretically - /// available, even if it's POD. This is not strictly conforming - /// in any language mode. - AlwaysUseTailPadding, - - /// Only allocate objects in the tail padding of a base class if - /// the base class is not POD according to the rules of C++ TR1. - /// This is non-strictly conforming in C++11 mode. - UseTailPaddingUnlessPOD03, - - /// Only allocate objects in the tail padding of a base class if - /// the base class is not POD according to the rules of C++11. - UseTailPaddingUnlessPOD11 - }; - TailPaddingUseRules getTailPaddingUseRules() const { - switch (getKind()) { - // To preserve binary compatibility, the generic Itanium ABI has - // permanently locked the definition of POD to the rules of C++ TR1, - // and that trickles down to derived ABIs. - case GenericItanium: - case GenericAArch64: - case GenericARM: - case iOS: - case GenericMIPS: - return UseTailPaddingUnlessPOD03; - - // iOS on ARM64 and WebAssembly use the C++11 POD rules. They do not honor - // the Itanium exception about classes with over-large bitfields. - case iOS64: - case WebAssembly: - case WatchOS: - return UseTailPaddingUnlessPOD11; - - // MSVC always allocates fields in the tail-padding of a base class - // subobject, even if they're POD. - case Microsoft: - return AlwaysUseTailPadding; - } - llvm_unreachable("bad ABI kind"); - } - - friend bool operator==(const TargetCXXABI &left, const TargetCXXABI &right) { - return left.getKind() == right.getKind(); - } - - friend bool operator!=(const TargetCXXABI &left, const TargetCXXABI &right) { - return !(left == right); - } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h deleted file mode 100644 index f1d8338..0000000 --- a/include/clang/Basic/TargetInfo.h +++ /dev/null @@ -1,953 +0,0 @@ -//===--- TargetInfo.h - Expose information about the target -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::TargetInfo interface. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TARGETINFO_H -#define LLVM_CLANG_BASIC_TARGETINFO_H - -#include "clang/Basic/AddressSpaces.h" -#include "clang/Basic/LLVM.h" -#include "clang/Basic/Specifiers.h" -#include "clang/Basic/TargetCXXABI.h" -#include "clang/Basic/TargetOptions.h" -#include "clang/Basic/VersionTuple.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/APInt.h" -#include "llvm/ADT/SmallSet.h" -#include "llvm/ADT/StringMap.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/DataTypes.h" -#include <cassert> -#include <string> -#include <vector> - -namespace llvm { -struct fltSemantics; -} - -namespace clang { -class DiagnosticsEngine; -class LangOptions; -class MacroBuilder; -class SourceLocation; -class SourceManager; - -namespace Builtin { struct Info; } - -/// \brief Exposes information about the current target. -/// -class TargetInfo : public RefCountedBase<TargetInfo> { - std::shared_ptr<TargetOptions> TargetOpts; - llvm::Triple Triple; -protected: - // Target values set by the ctor of the actual target implementation. Default - // values are specified by the TargetInfo constructor. - bool BigEndian; - bool TLSSupported; - bool NoAsmVariants; // True if {|} are normal characters. - unsigned char PointerWidth, PointerAlign; - unsigned char BoolWidth, BoolAlign; - unsigned char IntWidth, IntAlign; - unsigned char HalfWidth, HalfAlign; - unsigned char FloatWidth, FloatAlign; - unsigned char DoubleWidth, DoubleAlign; - unsigned char LongDoubleWidth, LongDoubleAlign; - unsigned char LargeArrayMinWidth, LargeArrayAlign; - unsigned char LongWidth, LongAlign; - unsigned char LongLongWidth, LongLongAlign; - unsigned char SuitableAlign; - unsigned char DefaultAlignForAttributeAligned; - unsigned char MinGlobalAlign; - unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth; - unsigned short MaxVectorAlign; - unsigned short MaxTLSAlign; - unsigned short SimdDefaultAlign; - const char *DataLayoutString; - const char *UserLabelPrefix; - const char *MCountName; - const llvm::fltSemantics *HalfFormat, *FloatFormat, *DoubleFormat, - *LongDoubleFormat; - unsigned char RegParmMax, SSERegParmMax; - TargetCXXABI TheCXXABI; - const LangAS::Map *AddrSpaceMap; - - mutable StringRef PlatformName; - mutable VersionTuple PlatformMinVersion; - - unsigned HasAlignMac68kSupport : 1; - unsigned RealTypeUsesObjCFPRet : 3; - unsigned ComplexLongDoubleUsesFP2Ret : 1; - - unsigned HasBuiltinMSVaList : 1; - - // TargetInfo Constructor. Default initializes all fields. - TargetInfo(const llvm::Triple &T); - -public: - /// \brief Construct a target for the given options. - /// - /// \param Opts - The options to use to initialize the target. The target may - /// modify the options to canonicalize the target feature information to match - /// what the backend expects. - static TargetInfo * - CreateTargetInfo(DiagnosticsEngine &Diags, - const std::shared_ptr<TargetOptions> &Opts); - - virtual ~TargetInfo(); - - /// \brief Retrieve the target options. - TargetOptions &getTargetOpts() const { - assert(TargetOpts && "Missing target options"); - return *TargetOpts; - } - - ///===---- Target Data Type Query Methods -------------------------------===// - enum IntType { - NoInt = 0, - SignedChar, - UnsignedChar, - SignedShort, - UnsignedShort, - SignedInt, - UnsignedInt, - SignedLong, - UnsignedLong, - SignedLongLong, - UnsignedLongLong - }; - - enum RealType { - NoFloat = 255, - Float = 0, - Double, - LongDouble - }; - - /// \brief The different kinds of __builtin_va_list types defined by - /// the target implementation. - enum BuiltinVaListKind { - /// typedef char* __builtin_va_list; - CharPtrBuiltinVaList = 0, - - /// typedef void* __builtin_va_list; - VoidPtrBuiltinVaList, - - /// __builtin_va_list as defind by the AArch64 ABI - /// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf - AArch64ABIBuiltinVaList, - - /// __builtin_va_list as defined by the PNaCl ABI: - /// http://www.chromium.org/nativeclient/pnacl/bitcode-abi#TOC-Machine-Types - PNaClABIBuiltinVaList, - - /// __builtin_va_list as defined by the Power ABI: - /// https://www.power.org - /// /resources/downloads/Power-Arch-32-bit-ABI-supp-1.0-Embedded.pdf - PowerABIBuiltinVaList, - - /// __builtin_va_list as defined by the x86-64 ABI: - /// http://www.x86-64.org/documentation/abi.pdf - X86_64ABIBuiltinVaList, - - /// __builtin_va_list as defined by ARM AAPCS ABI - /// http://infocenter.arm.com - // /help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf - AAPCSABIBuiltinVaList, - - // typedef struct __va_list_tag - // { - // long __gpr; - // long __fpr; - // void *__overflow_arg_area; - // void *__reg_save_area; - // } va_list[1]; - SystemZBuiltinVaList - }; - -protected: - IntType SizeType, IntMaxType, PtrDiffType, IntPtrType, WCharType, - WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType, - ProcessIDType; - - /// \brief Whether Objective-C's built-in boolean type should be signed char. - /// - /// Otherwise, when this flag is not set, the normal built-in boolean type is - /// used. - unsigned UseSignedCharForObjCBool : 1; - - /// Control whether the alignment of bit-field types is respected when laying - /// out structures. If true, then the alignment of the bit-field type will be - /// used to (a) impact the alignment of the containing structure, and (b) - /// ensure that the individual bit-field will not straddle an alignment - /// boundary. - unsigned UseBitFieldTypeAlignment : 1; - - /// \brief Whether zero length bitfields (e.g., int : 0;) force alignment of - /// the next bitfield. - /// - /// If the alignment of the zero length bitfield is greater than the member - /// that follows it, `bar', `bar' will be aligned as the type of the - /// zero-length bitfield. - unsigned UseZeroLengthBitfieldAlignment : 1; - - /// If non-zero, specifies a fixed alignment value for bitfields that follow - /// zero length bitfield, regardless of the zero length bitfield type. - unsigned ZeroLengthBitfieldBoundary; - - /// \brief Specify if mangling based on address space map should be used or - /// not for language specific address spaces - bool UseAddrSpaceMapMangling; - -public: - IntType getSizeType() const { return SizeType; } - IntType getIntMaxType() const { return IntMaxType; } - IntType getUIntMaxType() const { - return getCorrespondingUnsignedType(IntMaxType); - } - IntType getPtrDiffType(unsigned AddrSpace) const { - return AddrSpace == 0 ? PtrDiffType : getPtrDiffTypeV(AddrSpace); - } - IntType getIntPtrType() const { return IntPtrType; } - IntType getUIntPtrType() const { - return getCorrespondingUnsignedType(IntPtrType); - } - IntType getWCharType() const { return WCharType; } - IntType getWIntType() const { return WIntType; } - IntType getChar16Type() const { return Char16Type; } - IntType getChar32Type() const { return Char32Type; } - IntType getInt64Type() const { return Int64Type; } - IntType getUInt64Type() const { - return getCorrespondingUnsignedType(Int64Type); - } - IntType getSigAtomicType() const { return SigAtomicType; } - IntType getProcessIDType() const { return ProcessIDType; } - - static IntType getCorrespondingUnsignedType(IntType T) { - switch (T) { - case SignedChar: - return UnsignedChar; - case SignedShort: - return UnsignedShort; - case SignedInt: - return UnsignedInt; - case SignedLong: - return UnsignedLong; - case SignedLongLong: - return UnsignedLongLong; - default: - llvm_unreachable("Unexpected signed integer type"); - } - } - - /// \brief Return the width (in bits) of the specified integer type enum. - /// - /// For example, SignedInt -> getIntWidth(). - unsigned getTypeWidth(IntType T) const; - - /// \brief Return integer type with specified width. - virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const; - - /// \brief Return the smallest integer type with at least the specified width. - virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, - bool IsSigned) const; - - /// \brief Return floating point type with specified width. - RealType getRealTypeByWidth(unsigned BitWidth) const; - - /// \brief Return the alignment (in bits) of the specified integer type enum. - /// - /// For example, SignedInt -> getIntAlign(). - unsigned getTypeAlign(IntType T) const; - - /// \brief Returns true if the type is signed; false otherwise. - static bool isTypeSigned(IntType T); - - /// \brief Return the width of pointers on this target, for the - /// specified address space. - uint64_t getPointerWidth(unsigned AddrSpace) const { - return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace); - } - uint64_t getPointerAlign(unsigned AddrSpace) const { - return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace); - } - - /// \brief Return the size of '_Bool' and C++ 'bool' for this target, in bits. - unsigned getBoolWidth() const { return BoolWidth; } - - /// \brief Return the alignment of '_Bool' and C++ 'bool' for this target. - unsigned getBoolAlign() const { return BoolAlign; } - - unsigned getCharWidth() const { return 8; } // FIXME - unsigned getCharAlign() const { return 8; } // FIXME - - /// \brief Return the size of 'signed short' and 'unsigned short' for this - /// target, in bits. - unsigned getShortWidth() const { return 16; } // FIXME - - /// \brief Return the alignment of 'signed short' and 'unsigned short' for - /// this target. - unsigned getShortAlign() const { return 16; } // FIXME - - /// getIntWidth/Align - Return the size of 'signed int' and 'unsigned int' for - /// this target, in bits. - unsigned getIntWidth() const { return IntWidth; } - unsigned getIntAlign() const { return IntAlign; } - - /// getLongWidth/Align - Return the size of 'signed long' and 'unsigned long' - /// for this target, in bits. - unsigned getLongWidth() const { return LongWidth; } - unsigned getLongAlign() const { return LongAlign; } - - /// getLongLongWidth/Align - Return the size of 'signed long long' and - /// 'unsigned long long' for this target, in bits. - unsigned getLongLongWidth() const { return LongLongWidth; } - unsigned getLongLongAlign() const { return LongLongAlign; } - - /// \brief Determine whether the __int128 type is supported on this target. - virtual bool hasInt128Type() const { - return getPointerWidth(0) >= 64; - } // FIXME - - /// \brief Return the alignment that is suitable for storing any - /// object with a fundamental alignment requirement. - unsigned getSuitableAlign() const { return SuitableAlign; } - - /// \brief Return the default alignment for __attribute__((aligned)) on - /// this target, to be used if no alignment value is specified. - unsigned getDefaultAlignForAttributeAligned() const { - return DefaultAlignForAttributeAligned; - } - - /// getMinGlobalAlign - Return the minimum alignment of a global variable, - /// unless its alignment is explicitly reduced via attributes. - unsigned getMinGlobalAlign() const { return MinGlobalAlign; } - - /// getWCharWidth/Align - Return the size of 'wchar_t' for this target, in - /// bits. - unsigned getWCharWidth() const { return getTypeWidth(WCharType); } - unsigned getWCharAlign() const { return getTypeAlign(WCharType); } - - /// getChar16Width/Align - Return the size of 'char16_t' for this target, in - /// bits. - unsigned getChar16Width() const { return getTypeWidth(Char16Type); } - unsigned getChar16Align() const { return getTypeAlign(Char16Type); } - - /// getChar32Width/Align - Return the size of 'char32_t' for this target, in - /// bits. - unsigned getChar32Width() const { return getTypeWidth(Char32Type); } - unsigned getChar32Align() const { return getTypeAlign(Char32Type); } - - /// getHalfWidth/Align/Format - Return the size/align/format of 'half'. - unsigned getHalfWidth() const { return HalfWidth; } - unsigned getHalfAlign() const { return HalfAlign; } - const llvm::fltSemantics &getHalfFormat() const { return *HalfFormat; } - - /// getFloatWidth/Align/Format - Return the size/align/format of 'float'. - unsigned getFloatWidth() const { return FloatWidth; } - unsigned getFloatAlign() const { return FloatAlign; } - const llvm::fltSemantics &getFloatFormat() const { return *FloatFormat; } - - /// getDoubleWidth/Align/Format - Return the size/align/format of 'double'. - unsigned getDoubleWidth() const { return DoubleWidth; } - unsigned getDoubleAlign() const { return DoubleAlign; } - const llvm::fltSemantics &getDoubleFormat() const { return *DoubleFormat; } - - /// getLongDoubleWidth/Align/Format - Return the size/align/format of 'long - /// double'. - unsigned getLongDoubleWidth() const { return LongDoubleWidth; } - unsigned getLongDoubleAlign() const { return LongDoubleAlign; } - const llvm::fltSemantics &getLongDoubleFormat() const { - return *LongDoubleFormat; - } - - /// \brief Return true if the 'long double' type should be mangled like - /// __float128. - virtual bool useFloat128ManglingForLongDouble() const { return false; } - - /// \brief Return the value for the C99 FLT_EVAL_METHOD macro. - virtual unsigned getFloatEvalMethod() const { return 0; } - - // getLargeArrayMinWidth/Align - Return the minimum array size that is - // 'large' and its alignment. - unsigned getLargeArrayMinWidth() const { return LargeArrayMinWidth; } - unsigned getLargeArrayAlign() const { return LargeArrayAlign; } - - /// \brief Return the maximum width lock-free atomic operation which will - /// ever be supported for the given target - unsigned getMaxAtomicPromoteWidth() const { return MaxAtomicPromoteWidth; } - /// \brief Return the maximum width lock-free atomic operation which can be - /// inlined given the supported features of the given target. - unsigned getMaxAtomicInlineWidth() const { return MaxAtomicInlineWidth; } - /// \brief Returns true if the given target supports lock-free atomic - /// operations at the specified width and alignment. - virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits, - uint64_t AlignmentInBits) const { - return AtomicSizeInBits <= AlignmentInBits && - AtomicSizeInBits <= getMaxAtomicInlineWidth() && - (AtomicSizeInBits <= getCharWidth() || - llvm::isPowerOf2_64(AtomicSizeInBits / getCharWidth())); - } - - /// \brief Return the maximum vector alignment supported for the given target. - unsigned getMaxVectorAlign() const { return MaxVectorAlign; } - /// \brief Return default simd alignment for the given target. Generally, this - /// value is type-specific, but this alignment can be used for most of the - /// types for the given target. - unsigned getSimdDefaultAlign() const { return SimdDefaultAlign; } - - /// \brief Return the size of intmax_t and uintmax_t for this target, in bits. - unsigned getIntMaxTWidth() const { - return getTypeWidth(IntMaxType); - } - - // Return the size of unwind_word for this target. - unsigned getUnwindWordWidth() const { return getPointerWidth(0); } - - /// \brief Return the "preferred" register width on this target. - unsigned getRegisterWidth() const { - // Currently we assume the register width on the target matches the pointer - // width, we can introduce a new variable for this if/when some target wants - // it. - return PointerWidth; - } - - /// \brief Returns the default value of the __USER_LABEL_PREFIX__ macro, - /// which is the prefix given to user symbols by default. - /// - /// On most platforms this is "_", but it is "" on some, and "." on others. - const char *getUserLabelPrefix() const { - return UserLabelPrefix; - } - - /// \brief Returns the name of the mcount instrumentation function. - const char *getMCountName() const { - return MCountName; - } - - /// \brief Check if the Objective-C built-in boolean type should be signed - /// char. - /// - /// Otherwise, if this returns false, the normal built-in boolean type - /// should also be used for Objective-C. - bool useSignedCharForObjCBool() const { - return UseSignedCharForObjCBool; - } - void noSignedCharForObjCBool() { - UseSignedCharForObjCBool = false; - } - - /// \brief Check whether the alignment of bit-field types is respected - /// when laying out structures. - bool useBitFieldTypeAlignment() const { - return UseBitFieldTypeAlignment; - } - - /// \brief Check whether zero length bitfields should force alignment of - /// the next member. - bool useZeroLengthBitfieldAlignment() const { - return UseZeroLengthBitfieldAlignment; - } - - /// \brief Get the fixed alignment value in bits for a member that follows - /// a zero length bitfield. - unsigned getZeroLengthBitfieldBoundary() const { - return ZeroLengthBitfieldBoundary; - } - - /// \brief Check whether this target support '\#pragma options align=mac68k'. - bool hasAlignMac68kSupport() const { - return HasAlignMac68kSupport; - } - - /// \brief Return the user string for the specified integer type enum. - /// - /// For example, SignedShort -> "short". - static const char *getTypeName(IntType T); - - /// \brief Return the constant suffix for the specified integer type enum. - /// - /// For example, SignedLong -> "L". - const char *getTypeConstantSuffix(IntType T) const; - - /// \brief Return the printf format modifier for the specified - /// integer type enum. - /// - /// For example, SignedLong -> "l". - static const char *getTypeFormatModifier(IntType T); - - /// \brief Check whether the given real type should use the "fpret" flavor of - /// Objective-C message passing on this target. - bool useObjCFPRetForRealType(RealType T) const { - return RealTypeUsesObjCFPRet & (1 << T); - } - - /// \brief Check whether _Complex long double should use the "fp2ret" flavor - /// of Objective-C message passing on this target. - bool useObjCFP2RetForComplexLongDouble() const { - return ComplexLongDoubleUsesFP2Ret; - } - - /// \brief Specify if mangling based on address space map should be used or - /// not for language specific address spaces - bool useAddressSpaceMapMangling() const { - return UseAddrSpaceMapMangling; - } - - ///===---- Other target property query methods --------------------------===// - - /// \brief Appends the target-specific \#define values for this - /// target set to the specified buffer. - virtual void getTargetDefines(const LangOptions &Opts, - MacroBuilder &Builder) const = 0; - - - /// Return information about target-specific builtins for - /// the current primary target, and info about which builtins are non-portable - /// across the current set of primary and secondary targets. - virtual ArrayRef<Builtin::Info> getTargetBuiltins() const = 0; - - /// The __builtin_clz* and __builtin_ctz* built-in - /// functions are specified to have undefined results for zero inputs, but - /// on targets that support these operations in a way that provides - /// well-defined results for zero without loss of performance, it is a good - /// idea to avoid optimizing based on that undef behavior. - virtual bool isCLZForZeroUndef() const { return true; } - - /// \brief Returns the kind of __builtin_va_list type that should be used - /// with this target. - virtual BuiltinVaListKind getBuiltinVaListKind() const = 0; - - /// Returns whether or not type \c __builtin_ms_va_list type is - /// available on this target. - bool hasBuiltinMSVaList() const { return HasBuiltinMSVaList; } - - /// \brief Returns whether the passed in string is a valid clobber in an - /// inline asm statement. - /// - /// This is used by Sema. - bool isValidClobber(StringRef Name) const; - - /// \brief Returns whether the passed in string is a valid register name - /// according to GCC. - /// - /// This is used by Sema for inline asm statements. - bool isValidGCCRegisterName(StringRef Name) const; - - /// \brief Returns the "normalized" GCC register name. - /// - /// For example, on x86 it will return "ax" when "eax" is passed in. - StringRef getNormalizedGCCRegisterName(StringRef Name) const; - - struct ConstraintInfo { - enum { - CI_None = 0x00, - CI_AllowsMemory = 0x01, - CI_AllowsRegister = 0x02, - CI_ReadWrite = 0x04, // "+r" output constraint (read and write). - CI_HasMatchingInput = 0x08, // This output operand has a matching input. - CI_ImmediateConstant = 0x10, // This operand must be an immediate constant - CI_EarlyClobber = 0x20, // "&" output constraint (early clobber). - }; - unsigned Flags; - int TiedOperand; - struct { - int Min; - int Max; - } ImmRange; - llvm::SmallSet<int, 4> ImmSet; - - std::string ConstraintStr; // constraint: "=rm" - std::string Name; // Operand name: [foo] with no []'s. - public: - ConstraintInfo(StringRef ConstraintStr, StringRef Name) - : Flags(0), TiedOperand(-1), ConstraintStr(ConstraintStr.str()), - Name(Name.str()) { - ImmRange.Min = ImmRange.Max = 0; - } - - const std::string &getConstraintStr() const { return ConstraintStr; } - const std::string &getName() const { return Name; } - bool isReadWrite() const { return (Flags & CI_ReadWrite) != 0; } - bool earlyClobber() { return (Flags & CI_EarlyClobber) != 0; } - bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; } - bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; } - - /// \brief Return true if this output operand has a matching - /// (tied) input operand. - bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; } - - /// \brief Return true if this input operand is a matching - /// constraint that ties it to an output operand. - /// - /// If this returns true then getTiedOperand will indicate which output - /// operand this is tied to. - bool hasTiedOperand() const { return TiedOperand != -1; } - unsigned getTiedOperand() const { - assert(hasTiedOperand() && "Has no tied operand!"); - return (unsigned)TiedOperand; - } - - bool requiresImmediateConstant() const { - return (Flags & CI_ImmediateConstant) != 0; - } - bool isValidAsmImmediate(const llvm::APInt &Value) const { - return (Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max)) || - ImmSet.count(Value.getZExtValue()) != 0; - } - - void setIsReadWrite() { Flags |= CI_ReadWrite; } - void setEarlyClobber() { Flags |= CI_EarlyClobber; } - void setAllowsMemory() { Flags |= CI_AllowsMemory; } - void setAllowsRegister() { Flags |= CI_AllowsRegister; } - void setHasMatchingInput() { Flags |= CI_HasMatchingInput; } - void setRequiresImmediate(int Min, int Max) { - Flags |= CI_ImmediateConstant; - ImmRange.Min = Min; - ImmRange.Max = Max; - } - void setRequiresImmediate(llvm::ArrayRef<int> Exacts) { - Flags |= CI_ImmediateConstant; - for (int Exact : Exacts) - ImmSet.insert(Exact); - } - void setRequiresImmediate(int Exact) { - Flags |= CI_ImmediateConstant; - ImmSet.insert(Exact); - } - void setRequiresImmediate() { - Flags |= CI_ImmediateConstant; - ImmRange.Min = INT_MIN; - ImmRange.Max = INT_MAX; - } - - /// \brief Indicate that this is an input operand that is tied to - /// the specified output operand. - /// - /// Copy over the various constraint information from the output. - void setTiedOperand(unsigned N, ConstraintInfo &Output) { - Output.setHasMatchingInput(); - Flags = Output.Flags; - TiedOperand = N; - // Don't copy Name or constraint string. - } - }; - - /// \brief Validate register name used for global register variables. - /// - /// This function returns true if the register passed in RegName can be used - /// for global register variables on this target. In addition, it returns - /// true in HasSizeMismatch if the size of the register doesn't match the - /// variable size passed in RegSize. - virtual bool validateGlobalRegisterVariable(StringRef RegName, - unsigned RegSize, - bool &HasSizeMismatch) const { - HasSizeMismatch = false; - return true; - } - - // validateOutputConstraint, validateInputConstraint - Checks that - // a constraint is valid and provides information about it. - // FIXME: These should return a real error instead of just true/false. - bool validateOutputConstraint(ConstraintInfo &Info) const; - bool validateInputConstraint(MutableArrayRef<ConstraintInfo> OutputConstraints, - ConstraintInfo &info) const; - - virtual bool validateOutputSize(StringRef /*Constraint*/, - unsigned /*Size*/) const { - return true; - } - - virtual bool validateInputSize(StringRef /*Constraint*/, - unsigned /*Size*/) const { - return true; - } - virtual bool - validateConstraintModifier(StringRef /*Constraint*/, - char /*Modifier*/, - unsigned /*Size*/, - std::string &/*SuggestedModifier*/) const { - return true; - } - virtual bool - validateAsmConstraint(const char *&Name, - TargetInfo::ConstraintInfo &info) const = 0; - - bool resolveSymbolicName(const char *&Name, - ArrayRef<ConstraintInfo> OutputConstraints, - unsigned &Index) const; - - // Constraint parm will be left pointing at the last character of - // the constraint. In practice, it won't be changed unless the - // constraint is longer than one character. - virtual std::string convertConstraint(const char *&Constraint) const { - // 'p' defaults to 'r', but can be overridden by targets. - if (*Constraint == 'p') - return std::string("r"); - return std::string(1, *Constraint); - } - - /// \brief Returns a string of target-specific clobbers, in LLVM format. - virtual const char *getClobbers() const = 0; - - /// \brief Returns true if NaN encoding is IEEE 754-2008. - /// Only MIPS allows a different encoding. - virtual bool isNan2008() const { - return true; - } - - /// \brief Returns the target triple of the primary target. - const llvm::Triple &getTriple() const { - return Triple; - } - - const char *getDataLayoutString() const { - assert(DataLayoutString && "Uninitialized DataLayoutString!"); - return DataLayoutString; - } - - struct GCCRegAlias { - const char * const Aliases[5]; - const char * const Register; - }; - - struct AddlRegName { - const char * const Names[5]; - const unsigned RegNum; - }; - - /// \brief Does this target support "protected" visibility? - /// - /// Any target which dynamic libraries will naturally support - /// something like "default" (meaning that the symbol is visible - /// outside this shared object) and "hidden" (meaning that it isn't) - /// visibilities, but "protected" is really an ELF-specific concept - /// with weird semantics designed around the convenience of dynamic - /// linker implementations. Which is not to suggest that there's - /// consistent target-independent semantics for "default" visibility - /// either; the entire thing is pretty badly mangled. - virtual bool hasProtectedVisibility() const { return true; } - - /// \brief An optional hook that targets can implement to perform semantic - /// checking on attribute((section("foo"))) specifiers. - /// - /// In this case, "foo" is passed in to be checked. If the section - /// specifier is invalid, the backend should return a non-empty string - /// that indicates the problem. - /// - /// This hook is a simple quality of implementation feature to catch errors - /// and give good diagnostics in cases when the assembler or code generator - /// would otherwise reject the section specifier. - /// - virtual std::string isValidSectionSpecifier(StringRef SR) const { - return ""; - } - - /// \brief Set forced language options. - /// - /// Apply changes to the target information with respect to certain - /// language options which change the target configuration. - virtual void adjust(const LangOptions &Opts); - - /// \brief Initialize the map with the default set of target features for the - /// CPU this should include all legal feature strings on the target. - /// - /// \return False on error (invalid features). - virtual bool initFeatureMap(llvm::StringMap<bool> &Features, - DiagnosticsEngine &Diags, StringRef CPU, - const std::vector<std::string> &FeatureVec) const; - - /// \brief Get the ABI currently in use. - virtual StringRef getABI() const { return StringRef(); } - - /// \brief Get the C++ ABI currently in use. - TargetCXXABI getCXXABI() const { - return TheCXXABI; - } - - /// \brief Target the specified CPU. - /// - /// \return False on error (invalid CPU name). - virtual bool setCPU(const std::string &Name) { - return false; - } - - /// \brief Use the specified ABI. - /// - /// \return False on error (invalid ABI name). - virtual bool setABI(const std::string &Name) { - return false; - } - - /// \brief Use the specified unit for FP math. - /// - /// \return False on error (invalid unit name). - virtual bool setFPMath(StringRef Name) { - return false; - } - - /// \brief Enable or disable a specific target feature; - /// the feature name must be valid. - virtual void setFeatureEnabled(llvm::StringMap<bool> &Features, - StringRef Name, - bool Enabled) const { - Features[Name] = Enabled; - } - - /// \brief Perform initialization based on the user configured - /// set of features (e.g., +sse4). - /// - /// The list is guaranteed to have at most one entry per feature. - /// - /// The target may modify the features list, to change which options are - /// passed onwards to the backend. - /// FIXME: This part should be fixed so that we can change handleTargetFeatures - /// to merely a TargetInfo initialization routine. - /// - /// \return False on error. - virtual bool handleTargetFeatures(std::vector<std::string> &Features, - DiagnosticsEngine &Diags) { - return true; - } - - /// \brief Determine whether the given target has the given feature. - virtual bool hasFeature(StringRef Feature) const { - return false; - } - - // \brief Validate the contents of the __builtin_cpu_supports(const char*) - // argument. - virtual bool validateCpuSupports(StringRef Name) const { return false; } - - // \brief Returns maximal number of args passed in registers. - unsigned getRegParmMax() const { - assert(RegParmMax < 7 && "RegParmMax value is larger than AST can handle"); - return RegParmMax; - } - - /// \brief Whether the target supports thread-local storage. - bool isTLSSupported() const { - return TLSSupported; - } - - /// \brief Return the maximum alignment (in bits) of a TLS variable - /// - /// Gets the maximum alignment (in bits) of a TLS variable on this target. - /// Returns zero if there is no such constraint. - unsigned short getMaxTLSAlign() const { - return MaxTLSAlign; - } - - /// \brief Whether the target supports SEH __try. - bool isSEHTrySupported() const { - return getTriple().isOSWindows() && - (getTriple().getArch() == llvm::Triple::x86 || - getTriple().getArch() == llvm::Triple::x86_64); - } - - /// \brief Return true if {|} are normal characters in the asm string. - /// - /// If this returns false (the default), then {abc|xyz} is syntax - /// that says that when compiling for asm variant #0, "abc" should be - /// generated, but when compiling for asm variant #1, "xyz" should be - /// generated. - bool hasNoAsmVariants() const { - return NoAsmVariants; - } - - /// \brief Return the register number that __builtin_eh_return_regno would - /// return with the specified argument. - virtual int getEHDataRegisterNumber(unsigned RegNo) const { - return -1; - } - - /// \brief Return the section to use for C++ static initialization functions. - virtual const char *getStaticInitSectionSpecifier() const { - return nullptr; - } - - const LangAS::Map &getAddressSpaceMap() const { - return *AddrSpaceMap; - } - - /// \brief Retrieve the name of the platform as it is used in the - /// availability attribute. - StringRef getPlatformName() const { return PlatformName; } - - /// \brief Retrieve the minimum desired version of the platform, to - /// which the program should be compiled. - VersionTuple getPlatformMinVersion() const { return PlatformMinVersion; } - - bool isBigEndian() const { return BigEndian; } - - enum CallingConvMethodType { - CCMT_Unknown, - CCMT_Member, - CCMT_NonMember - }; - - /// \brief Gets the default calling convention for the given target and - /// declaration context. - virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const { - // Not all targets will specify an explicit calling convention that we can - // express. This will always do the right thing, even though it's not - // an explicit calling convention. - return CC_C; - } - - enum CallingConvCheckResult { - CCCR_OK, - CCCR_Warning, - CCCR_Ignore, - }; - - /// \brief Determines whether a given calling convention is valid for the - /// target. A calling convention can either be accepted, produce a warning - /// and be substituted with the default calling convention, or (someday) - /// produce an error (such as using thiscall on a non-instance function). - virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const { - switch (CC) { - default: - return CCCR_Warning; - case CC_C: - return CCCR_OK; - } - } - - /// Controls if __builtin_longjmp / __builtin_setjmp can be lowered to - /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp. - virtual bool hasSjLjLowering() const { - return false; - } - -protected: - virtual uint64_t getPointerWidthV(unsigned AddrSpace) const { - return PointerWidth; - } - virtual uint64_t getPointerAlignV(unsigned AddrSpace) const { - return PointerAlign; - } - virtual enum IntType getPtrDiffTypeV(unsigned AddrSpace) const { - return PtrDiffType; - } - virtual ArrayRef<const char *> getGCCRegNames() const = 0; - virtual ArrayRef<GCCRegAlias> getGCCRegAliases() const = 0; - virtual ArrayRef<AddlRegName> getGCCAddlRegNames() const { - return None; - } -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h deleted file mode 100644 index ca0cca7..0000000 --- a/include/clang/Basic/TargetOptions.h +++ /dev/null @@ -1,54 +0,0 @@ -//===--- TargetOptions.h ----------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::TargetOptions class. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TARGETOPTIONS_H -#define LLVM_CLANG_BASIC_TARGETOPTIONS_H - -#include <string> -#include <vector> - -namespace clang { - -/// \brief Options for controlling the target. -class TargetOptions { -public: - /// If given, the name of the target triple to compile for. If not given the - /// target will be selected to match the host. - std::string Triple; - - /// If given, the name of the target CPU to generate code for. - std::string CPU; - - /// If given, the unit to use for floating point math. - std::string FPMath; - - /// If given, the name of the target ABI to use. - std::string ABI; - - /// If given, the version string of the linker in use. - std::string LinkerVersion; - - /// \brief The list of target specific features to enable or disable, as written on the command line. - std::vector<std::string> FeaturesAsWritten; - - /// The list of target specific features to enable or disable -- this should - /// be a list of strings starting with by '+' or '-'. - std::vector<std::string> Features; - - std::vector<std::string> Reciprocals; -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Basic/TemplateKinds.h b/include/clang/Basic/TemplateKinds.h deleted file mode 100644 index aed287b..0000000 --- a/include/clang/Basic/TemplateKinds.h +++ /dev/null @@ -1,44 +0,0 @@ -//===--- TemplateKinds.h - Enum values for C++ Template Kinds ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::TemplateNameKind enum. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_TEMPLATEKINDS_H -#define LLVM_CLANG_BASIC_TEMPLATEKINDS_H - -namespace clang { - -/// \brief Specifies the kind of template name that an identifier refers to. -/// Be careful when changing this: this enumeration is used in diagnostics. -enum TemplateNameKind { - /// The name does not refer to a template. - TNK_Non_template = 0, - /// The name refers to a function template or a set of overloaded - /// functions that includes at least one function template. - TNK_Function_template, - /// The name refers to a template whose specialization produces a - /// type. The template itself could be a class template, template - /// template parameter, or C++0x template alias. - TNK_Type_template, - /// The name refers to a variable template whose specialization produces a - /// variable. - TNK_Var_template, - /// The name refers to a dependent template name. Whether the - /// template name is assumed to refer to a type template or a - /// function template depends on the context in which the template - /// name occurs. - TNK_Dependent_template_name -}; - -} -#endif - - diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def deleted file mode 100644 index 9252d99..0000000 --- a/include/clang/Basic/TokenKinds.def +++ /dev/null @@ -1,781 +0,0 @@ -//===--- TokenKinds.def - C Family Token Kind Database ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the TokenKind database. This includes normal tokens like -// tok::ampamp (corresponding to the && token) as well as keywords for various -// languages. Users of this file must optionally #define the TOK, KEYWORD, -// CXX11_KEYWORD, CONCEPTS_KEYWORD, ALIAS, or PPKEYWORD macros to make use of -// this file. -// -//===----------------------------------------------------------------------===// - -#ifndef TOK -#define TOK(X) -#endif -#ifndef PUNCTUATOR -#define PUNCTUATOR(X,Y) TOK(X) -#endif -#ifndef KEYWORD -#define KEYWORD(X,Y) TOK(kw_ ## X) -#endif -#ifndef CXX11_KEYWORD -#define CXX11_KEYWORD(X,Y) KEYWORD(X,KEYCXX11|(Y)) -#endif -#ifndef CONCEPTS_KEYWORD -#define CONCEPTS_KEYWORD(X) KEYWORD(X,KEYCONCEPTS) -#endif -#ifndef TYPE_TRAIT -#define TYPE_TRAIT(N,I,K) KEYWORD(I,K) -#endif -#ifndef TYPE_TRAIT_1 -#define TYPE_TRAIT_1(I,E,K) TYPE_TRAIT(1,I,K) -#endif -#ifndef TYPE_TRAIT_2 -#define TYPE_TRAIT_2(I,E,K) TYPE_TRAIT(2,I,K) -#endif -#ifndef TYPE_TRAIT_N -#define TYPE_TRAIT_N(I,E,K) TYPE_TRAIT(0,I,K) -#endif -#ifndef ALIAS -#define ALIAS(X,Y,Z) -#endif -#ifndef PPKEYWORD -#define PPKEYWORD(X) -#endif -#ifndef CXX_KEYWORD_OPERATOR -#define CXX_KEYWORD_OPERATOR(X,Y) -#endif -#ifndef OBJC1_AT_KEYWORD -#define OBJC1_AT_KEYWORD(X) -#endif -#ifndef OBJC2_AT_KEYWORD -#define OBJC2_AT_KEYWORD(X) -#endif -#ifndef TESTING_KEYWORD -#define TESTING_KEYWORD(X, L) KEYWORD(X, L) -#endif -#ifndef ANNOTATION -#define ANNOTATION(X) TOK(annot_ ## X) -#endif - -//===----------------------------------------------------------------------===// -// Preprocessor keywords. -//===----------------------------------------------------------------------===// - -// These have meaning after a '#' at the start of a line. These define enums in -// the tok::pp_* namespace. Note that IdentifierInfo::getPPKeywordID must be -// manually updated if something is added here. -PPKEYWORD(not_keyword) - -// C99 6.10.1 - Conditional Inclusion. -PPKEYWORD(if) -PPKEYWORD(ifdef) -PPKEYWORD(ifndef) -PPKEYWORD(elif) -PPKEYWORD(else) -PPKEYWORD(endif) -PPKEYWORD(defined) - -// C99 6.10.2 - Source File Inclusion. -PPKEYWORD(include) -PPKEYWORD(__include_macros) - -// C99 6.10.3 - Macro Replacement. -PPKEYWORD(define) -PPKEYWORD(undef) - -// C99 6.10.4 - Line Control. -PPKEYWORD(line) - -// C99 6.10.5 - Error Directive. -PPKEYWORD(error) - -// C99 6.10.6 - Pragma Directive. -PPKEYWORD(pragma) - -// GNU Extensions. -PPKEYWORD(import) -PPKEYWORD(include_next) -PPKEYWORD(warning) -PPKEYWORD(ident) -PPKEYWORD(sccs) -PPKEYWORD(assert) -PPKEYWORD(unassert) - -// Clang extensions -PPKEYWORD(__public_macro) -PPKEYWORD(__private_macro) - -//===----------------------------------------------------------------------===// -// Language keywords. -//===----------------------------------------------------------------------===// - -// These define members of the tok::* namespace. - -TOK(unknown) // Not a token. -TOK(eof) // End of file. -TOK(eod) // End of preprocessing directive (end of line inside a - // directive). -TOK(code_completion) // Code completion marker - -// C99 6.4.9: Comments. -TOK(comment) // Comment (only in -E -C[C] mode) - -// C99 6.4.2: Identifiers. -TOK(identifier) // abcde123 -TOK(raw_identifier) // Used only in raw lexing mode. - -// C99 6.4.4.1: Integer Constants -// C99 6.4.4.2: Floating Constants -TOK(numeric_constant) // 0x123 - -// C99 6.4.4: Character Constants -TOK(char_constant) // 'a' -TOK(wide_char_constant) // L'b' - -// C++1z Character Constants -TOK(utf8_char_constant) // u8'a' - -// C++11 Character Constants -TOK(utf16_char_constant) // u'a' -TOK(utf32_char_constant) // U'a' - -// C99 6.4.5: String Literals. -TOK(string_literal) // "foo" -TOK(wide_string_literal) // L"foo" -TOK(angle_string_literal)// <foo> - -// C++11 String Literals. -TOK(utf8_string_literal) // u8"foo" -TOK(utf16_string_literal)// u"foo" -TOK(utf32_string_literal)// U"foo" - -// C99 6.4.6: Punctuators. -PUNCTUATOR(l_square, "[") -PUNCTUATOR(r_square, "]") -PUNCTUATOR(l_paren, "(") -PUNCTUATOR(r_paren, ")") -PUNCTUATOR(l_brace, "{") -PUNCTUATOR(r_brace, "}") -PUNCTUATOR(period, ".") -PUNCTUATOR(ellipsis, "...") -PUNCTUATOR(amp, "&") -PUNCTUATOR(ampamp, "&&") -PUNCTUATOR(ampequal, "&=") -PUNCTUATOR(star, "*") -PUNCTUATOR(starequal, "*=") -PUNCTUATOR(plus, "+") -PUNCTUATOR(plusplus, "++") -PUNCTUATOR(plusequal, "+=") -PUNCTUATOR(minus, "-") -PUNCTUATOR(arrow, "->") -PUNCTUATOR(minusminus, "--") -PUNCTUATOR(minusequal, "-=") -PUNCTUATOR(tilde, "~") -PUNCTUATOR(exclaim, "!") -PUNCTUATOR(exclaimequal, "!=") -PUNCTUATOR(slash, "/") -PUNCTUATOR(slashequal, "/=") -PUNCTUATOR(percent, "%") -PUNCTUATOR(percentequal, "%=") -PUNCTUATOR(less, "<") -PUNCTUATOR(lessless, "<<") -PUNCTUATOR(lessequal, "<=") -PUNCTUATOR(lesslessequal, "<<=") -PUNCTUATOR(greater, ">") -PUNCTUATOR(greatergreater, ">>") -PUNCTUATOR(greaterequal, ">=") -PUNCTUATOR(greatergreaterequal, ">>=") -PUNCTUATOR(caret, "^") -PUNCTUATOR(caretequal, "^=") -PUNCTUATOR(pipe, "|") -PUNCTUATOR(pipepipe, "||") -PUNCTUATOR(pipeequal, "|=") -PUNCTUATOR(question, "?") -PUNCTUATOR(colon, ":") -PUNCTUATOR(semi, ";") -PUNCTUATOR(equal, "=") -PUNCTUATOR(equalequal, "==") -PUNCTUATOR(comma, ",") -PUNCTUATOR(hash, "#") -PUNCTUATOR(hashhash, "##") -PUNCTUATOR(hashat, "#@") - -// C++ Support -PUNCTUATOR(periodstar, ".*") -PUNCTUATOR(arrowstar, "->*") -PUNCTUATOR(coloncolon, "::") - -// Objective C support. -PUNCTUATOR(at, "@") - -// CUDA support. -PUNCTUATOR(lesslessless, "<<<") -PUNCTUATOR(greatergreatergreater, ">>>") - -// C99 6.4.1: Keywords. These turn into kw_* tokens. -// Flags allowed: -// KEYALL - This is a keyword in all variants of C and C++, or it -// is a keyword in the implementation namespace that should -// always be treated as a keyword -// KEYC99 - This is a keyword introduced to C in C99 -// KEYC11 - This is a keyword introduced to C in C11 -// KEYCXX - This is a C++ keyword, or a C++-specific keyword in the -// implementation namespace -// KEYNOCXX - This is a keyword in every non-C++ dialect. -// KEYCXX11 - This is a C++ keyword introduced to C++ in C++11 -// KEYCONCEPTS - This is a keyword if the C++ extensions for concepts -// are enabled. -// KEYGNU - This is a keyword if GNU extensions are enabled -// KEYMS - This is a keyword if Microsoft extensions are enabled -// KEYNOMS18 - This is a keyword that must never be enabled under -// MSVC <= v18. -// KEYOPENCL - This is a keyword in OpenCL -// KEYNOOPENCL - This is a keyword that is not supported in OpenCL -// KEYALTIVEC - This is a keyword in AltiVec -// KEYZVECTOR - This is a keyword for the System z vector extensions, -// which are heavily based on AltiVec -// KEYBORLAND - This is a keyword if Borland extensions are enabled -// KEYCOROUTINES - This is a keyword if support for the C++ coroutines -// TS is enabled -// BOOLSUPPORT - This is a keyword if 'bool' is a built-in type -// HALFSUPPORT - This is a keyword if 'half' is a built-in type -// WCHARSUPPORT - This is a keyword if 'wchar_t' is a built-in type -// -KEYWORD(auto , KEYALL) -KEYWORD(break , KEYALL) -KEYWORD(case , KEYALL) -KEYWORD(char , KEYALL) -KEYWORD(const , KEYALL) -KEYWORD(continue , KEYALL) -KEYWORD(default , KEYALL) -KEYWORD(do , KEYALL) -KEYWORD(double , KEYALL) -KEYWORD(else , KEYALL) -KEYWORD(enum , KEYALL) -KEYWORD(extern , KEYALL) -KEYWORD(float , KEYALL) -KEYWORD(for , KEYALL) -KEYWORD(goto , KEYALL) -KEYWORD(if , KEYALL) -KEYWORD(inline , KEYC99|KEYCXX|KEYGNU) -KEYWORD(int , KEYALL) -KEYWORD(long , KEYALL) -KEYWORD(register , KEYALL) -KEYWORD(restrict , KEYC99) -KEYWORD(return , KEYALL) -KEYWORD(short , KEYALL) -KEYWORD(signed , KEYALL) -KEYWORD(sizeof , KEYALL) -KEYWORD(static , KEYALL) -KEYWORD(struct , KEYALL) -KEYWORD(switch , KEYALL) -KEYWORD(typedef , KEYALL) -KEYWORD(union , KEYALL) -KEYWORD(unsigned , KEYALL) -KEYWORD(void , KEYALL) -KEYWORD(volatile , KEYALL) -KEYWORD(while , KEYALL) -KEYWORD(_Alignas , KEYALL) -KEYWORD(_Alignof , KEYALL) -KEYWORD(_Atomic , KEYALL|KEYNOOPENCL) -KEYWORD(_Bool , KEYNOCXX) -KEYWORD(_Complex , KEYALL) -KEYWORD(_Generic , KEYALL) -KEYWORD(_Imaginary , KEYALL) -KEYWORD(_Noreturn , KEYALL) -KEYWORD(_Static_assert , KEYALL) -KEYWORD(_Thread_local , KEYALL) -KEYWORD(__func__ , KEYALL) -KEYWORD(__objc_yes , KEYALL) -KEYWORD(__objc_no , KEYALL) - - -// C++ 2.11p1: Keywords. -KEYWORD(asm , KEYCXX|KEYGNU) -KEYWORD(bool , BOOLSUPPORT) -KEYWORD(catch , KEYCXX) -KEYWORD(class , KEYCXX) -KEYWORD(const_cast , KEYCXX) -KEYWORD(delete , KEYCXX) -KEYWORD(dynamic_cast , KEYCXX) -KEYWORD(explicit , KEYCXX) -KEYWORD(export , KEYCXX) -KEYWORD(false , BOOLSUPPORT) -KEYWORD(friend , KEYCXX) -KEYWORD(mutable , KEYCXX) -KEYWORD(namespace , KEYCXX) -KEYWORD(new , KEYCXX) -KEYWORD(operator , KEYCXX) -KEYWORD(private , KEYCXX) -KEYWORD(protected , KEYCXX) -KEYWORD(public , KEYCXX) -KEYWORD(reinterpret_cast , KEYCXX) -KEYWORD(static_cast , KEYCXX) -KEYWORD(template , KEYCXX) -KEYWORD(this , KEYCXX) -KEYWORD(throw , KEYCXX) -KEYWORD(true , BOOLSUPPORT) -KEYWORD(try , KEYCXX) -KEYWORD(typename , KEYCXX) -KEYWORD(typeid , KEYCXX) -KEYWORD(using , KEYCXX) -KEYWORD(virtual , KEYCXX) -KEYWORD(wchar_t , WCHARSUPPORT) - -// C++ 2.5p2: Alternative Representations. -CXX_KEYWORD_OPERATOR(and , ampamp) -CXX_KEYWORD_OPERATOR(and_eq , ampequal) -CXX_KEYWORD_OPERATOR(bitand , amp) -CXX_KEYWORD_OPERATOR(bitor , pipe) -CXX_KEYWORD_OPERATOR(compl , tilde) -CXX_KEYWORD_OPERATOR(not , exclaim) -CXX_KEYWORD_OPERATOR(not_eq , exclaimequal) -CXX_KEYWORD_OPERATOR(or , pipepipe) -CXX_KEYWORD_OPERATOR(or_eq , pipeequal) -CXX_KEYWORD_OPERATOR(xor , caret) -CXX_KEYWORD_OPERATOR(xor_eq , caretequal) - -// C++11 keywords -CXX11_KEYWORD(alignas , 0) -CXX11_KEYWORD(alignof , 0) -CXX11_KEYWORD(char16_t , KEYNOMS18) -CXX11_KEYWORD(char32_t , KEYNOMS18) -CXX11_KEYWORD(constexpr , 0) -CXX11_KEYWORD(decltype , 0) -CXX11_KEYWORD(noexcept , 0) -CXX11_KEYWORD(nullptr , 0) -CXX11_KEYWORD(static_assert , 0) -CXX11_KEYWORD(thread_local , 0) - -// C++ concepts TS keywords -CONCEPTS_KEYWORD(concept) -CONCEPTS_KEYWORD(requires) - -// C++ coroutines TS keywords -KEYWORD(co_await , KEYCOROUTINES) -KEYWORD(co_return , KEYCOROUTINES) -KEYWORD(co_yield , KEYCOROUTINES) - -// GNU Extensions (in impl-reserved namespace) -KEYWORD(_Decimal32 , KEYALL) -KEYWORD(_Decimal64 , KEYALL) -KEYWORD(_Decimal128 , KEYALL) -KEYWORD(__null , KEYCXX) -KEYWORD(__alignof , KEYALL) -KEYWORD(__attribute , KEYALL) -KEYWORD(__builtin_choose_expr , KEYALL) -KEYWORD(__builtin_offsetof , KEYALL) -// __builtin_types_compatible_p is a GNU C extension that we handle like a C++ -// type trait. -TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompatible, KEYNOCXX) -KEYWORD(__builtin_va_arg , KEYALL) -KEYWORD(__extension__ , KEYALL) -KEYWORD(__imag , KEYALL) -KEYWORD(__int128 , KEYALL) -KEYWORD(__label__ , KEYALL) -KEYWORD(__real , KEYALL) -KEYWORD(__thread , KEYALL) -KEYWORD(__FUNCTION__ , KEYALL) -KEYWORD(__PRETTY_FUNCTION__ , KEYALL) -KEYWORD(__auto_type , KEYALL) - -// GNU Extensions (outside impl-reserved namespace) -KEYWORD(typeof , KEYGNU) - -// MS Extensions -KEYWORD(__FUNCDNAME__ , KEYMS) -KEYWORD(__FUNCSIG__ , KEYMS) -KEYWORD(L__FUNCTION__ , KEYMS) -TYPE_TRAIT_1(__is_interface_class, IsInterfaceClass, KEYMS) -TYPE_TRAIT_1(__is_sealed, IsSealed, KEYMS) - -// MSVC12.0 / VS2013 Type Traits -TYPE_TRAIT_1(__is_destructible, IsDestructible, KEYMS) -TYPE_TRAIT_1(__is_nothrow_destructible, IsNothrowDestructible, KEYMS) -TYPE_TRAIT_2(__is_nothrow_assignable, IsNothrowAssignable, KEYCXX) -TYPE_TRAIT_N(__is_constructible, IsConstructible, KEYCXX) -TYPE_TRAIT_N(__is_nothrow_constructible, IsNothrowConstructible, KEYCXX) - -// GNU and MS Type Traits -TYPE_TRAIT_1(__has_nothrow_assign, HasNothrowAssign, KEYCXX) -TYPE_TRAIT_1(__has_nothrow_move_assign, HasNothrowMoveAssign, KEYCXX) -TYPE_TRAIT_1(__has_nothrow_copy, HasNothrowCopy, KEYCXX) -TYPE_TRAIT_1(__has_nothrow_constructor, HasNothrowConstructor, KEYCXX) -TYPE_TRAIT_1(__has_trivial_assign, HasTrivialAssign, KEYCXX) -TYPE_TRAIT_1(__has_trivial_move_assign, HasTrivialMoveAssign, KEYCXX) -TYPE_TRAIT_1(__has_trivial_copy, HasTrivialCopy, KEYCXX) -TYPE_TRAIT_1(__has_trivial_constructor, HasTrivialDefaultConstructor, KEYCXX) -TYPE_TRAIT_1(__has_trivial_move_constructor, HasTrivialMoveConstructor, KEYCXX) -TYPE_TRAIT_1(__has_trivial_destructor, HasTrivialDestructor, KEYCXX) -TYPE_TRAIT_1(__has_virtual_destructor, HasVirtualDestructor, KEYCXX) -TYPE_TRAIT_1(__is_abstract, IsAbstract, KEYCXX) -TYPE_TRAIT_2(__is_base_of, IsBaseOf, KEYCXX) -TYPE_TRAIT_1(__is_class, IsClass, KEYCXX) -TYPE_TRAIT_2(__is_convertible_to, IsConvertibleTo, KEYCXX) -TYPE_TRAIT_1(__is_empty, IsEmpty, KEYCXX) -TYPE_TRAIT_1(__is_enum, IsEnum, KEYCXX) -TYPE_TRAIT_1(__is_final, IsFinal, KEYCXX) -// Tentative name - there's no implementation of std::is_literal_type yet. -TYPE_TRAIT_1(__is_literal, IsLiteral, KEYCXX) -// Name for GCC 4.6 compatibility - people have already written libraries using -// this name unfortunately. -ALIAS("__is_literal_type", __is_literal, KEYCXX) -TYPE_TRAIT_1(__is_pod, IsPOD, KEYCXX) -TYPE_TRAIT_1(__is_polymorphic, IsPolymorphic, KEYCXX) -TYPE_TRAIT_1(__is_trivial, IsTrivial, KEYCXX) -TYPE_TRAIT_1(__is_union, IsUnion, KEYCXX) - -// Clang-only C++ Type Traits -TYPE_TRAIT_N(__is_trivially_constructible, IsTriviallyConstructible, KEYCXX) -TYPE_TRAIT_1(__is_trivially_copyable, IsTriviallyCopyable, KEYCXX) -TYPE_TRAIT_2(__is_trivially_assignable, IsTriviallyAssignable, KEYCXX) -KEYWORD(__underlying_type , KEYCXX) - -// Embarcadero Expression Traits -KEYWORD(__is_lvalue_expr , KEYCXX) -KEYWORD(__is_rvalue_expr , KEYCXX) - -// Embarcadero Unary Type Traits -TYPE_TRAIT_1(__is_arithmetic, IsArithmetic, KEYCXX) -TYPE_TRAIT_1(__is_floating_point, IsFloatingPoint, KEYCXX) -TYPE_TRAIT_1(__is_integral, IsIntegral, KEYCXX) -TYPE_TRAIT_1(__is_complete_type, IsCompleteType, KEYCXX) -TYPE_TRAIT_1(__is_void, IsVoid, KEYCXX) -TYPE_TRAIT_1(__is_array, IsArray, KEYCXX) -TYPE_TRAIT_1(__is_function, IsFunction, KEYCXX) -TYPE_TRAIT_1(__is_reference, IsReference, KEYCXX) -TYPE_TRAIT_1(__is_lvalue_reference, IsLvalueReference, KEYCXX) -TYPE_TRAIT_1(__is_rvalue_reference, IsRvalueReference, KEYCXX) -TYPE_TRAIT_1(__is_fundamental, IsFundamental, KEYCXX) -TYPE_TRAIT_1(__is_object, IsObject, KEYCXX) -TYPE_TRAIT_1(__is_scalar, IsScalar, KEYCXX) -TYPE_TRAIT_1(__is_compound, IsCompound, KEYCXX) -TYPE_TRAIT_1(__is_pointer, IsPointer, KEYCXX) -TYPE_TRAIT_1(__is_member_object_pointer, IsMemberObjectPointer, KEYCXX) -TYPE_TRAIT_1(__is_member_function_pointer, IsMemberFunctionPointer, KEYCXX) -TYPE_TRAIT_1(__is_member_pointer, IsMemberPointer, KEYCXX) -TYPE_TRAIT_1(__is_const, IsConst, KEYCXX) -TYPE_TRAIT_1(__is_volatile, IsVolatile, KEYCXX) -TYPE_TRAIT_1(__is_standard_layout, IsStandardLayout, KEYCXX) -TYPE_TRAIT_1(__is_signed, IsSigned, KEYCXX) -TYPE_TRAIT_1(__is_unsigned, IsUnsigned, KEYCXX) - -// Embarcadero Binary Type Traits -TYPE_TRAIT_2(__is_same, IsSame, KEYCXX) -TYPE_TRAIT_2(__is_convertible, IsConvertible, KEYCXX) -KEYWORD(__array_rank , KEYCXX) -KEYWORD(__array_extent , KEYCXX) - -// Apple Extension. -KEYWORD(__private_extern__ , KEYALL) -KEYWORD(__module_private__ , KEYALL) - -// Extension that will be enabled for Microsoft, Borland and PS4, but can be -// disabled via '-fno-declspec'. -KEYWORD(__declspec , 0) - -// Microsoft Extension. -KEYWORD(__cdecl , KEYALL) -KEYWORD(__stdcall , KEYALL) -KEYWORD(__fastcall , KEYALL) -KEYWORD(__thiscall , KEYALL) -KEYWORD(__vectorcall , KEYALL) -KEYWORD(__forceinline , KEYMS) -KEYWORD(__unaligned , KEYMS) -KEYWORD(__super , KEYMS) - -// OpenCL address space qualifiers -KEYWORD(__global , KEYOPENCL) -KEYWORD(__local , KEYOPENCL) -KEYWORD(__constant , KEYOPENCL) -KEYWORD(__private , KEYOPENCL) -KEYWORD(__generic , KEYOPENCL) -ALIAS("global", __global , KEYOPENCL) -ALIAS("local", __local , KEYOPENCL) -ALIAS("constant", __constant , KEYOPENCL) -ALIAS("private", __private , KEYOPENCL) -ALIAS("generic", __generic , KEYOPENCL) -// OpenCL function qualifiers -KEYWORD(__kernel , KEYOPENCL) -ALIAS("kernel", __kernel , KEYOPENCL) -// OpenCL access qualifiers -KEYWORD(__read_only , KEYOPENCL) -KEYWORD(__write_only , KEYOPENCL) -KEYWORD(__read_write , KEYOPENCL) -ALIAS("read_only", __read_only , KEYOPENCL) -ALIAS("write_only", __write_only , KEYOPENCL) -ALIAS("read_write", __read_write , KEYOPENCL) -// OpenCL builtins -KEYWORD(__builtin_astype , KEYOPENCL) -KEYWORD(vec_step , KEYOPENCL|KEYALTIVEC|KEYZVECTOR) - -// OpenMP Type Traits -KEYWORD(__builtin_omp_required_simd_align, KEYALL) - -// Borland Extensions. -KEYWORD(__pascal , KEYALL) - -// Altivec Extension. -KEYWORD(__vector , KEYALTIVEC|KEYZVECTOR) -KEYWORD(__pixel , KEYALTIVEC) -KEYWORD(__bool , KEYALTIVEC|KEYZVECTOR) - -// ARM NEON extensions. -ALIAS("__fp16", half , KEYALL) - -// OpenCL Extension. -KEYWORD(half , HALFSUPPORT) - -// Objective-C ARC keywords. -KEYWORD(__bridge , KEYARC) -KEYWORD(__bridge_transfer , KEYARC) -KEYWORD(__bridge_retained , KEYARC) -KEYWORD(__bridge_retain , KEYARC) - -// Objective-C keywords. -KEYWORD(__covariant , KEYOBJC2) -KEYWORD(__contravariant , KEYOBJC2) -KEYWORD(__kindof , KEYOBJC2) - -// Alternate spelling for various tokens. There are GCC extensions in all -// languages, but should not be disabled in strict conformance mode. -ALIAS("__alignof__" , __alignof , KEYALL) -ALIAS("__asm" , asm , KEYALL) -ALIAS("__asm__" , asm , KEYALL) -ALIAS("__attribute__", __attribute, KEYALL) -ALIAS("__complex" , _Complex , KEYALL) -ALIAS("__complex__" , _Complex , KEYALL) -ALIAS("__const" , const , KEYALL) -ALIAS("__const__" , const , KEYALL) -ALIAS("__decltype" , decltype , KEYCXX) -ALIAS("__imag__" , __imag , KEYALL) -ALIAS("__inline" , inline , KEYALL) -ALIAS("__inline__" , inline , KEYALL) -ALIAS("__nullptr" , nullptr , KEYCXX) -ALIAS("__real__" , __real , KEYALL) -ALIAS("__restrict" , restrict , KEYALL) -ALIAS("__restrict__" , restrict , KEYALL) -ALIAS("__signed" , signed , KEYALL) -ALIAS("__signed__" , signed , KEYALL) -ALIAS("__typeof" , typeof , KEYALL) -ALIAS("__typeof__" , typeof , KEYALL) -ALIAS("__volatile" , volatile , KEYALL) -ALIAS("__volatile__" , volatile , KEYALL) - -// Type nullability. -KEYWORD(_Nonnull , KEYALL) -KEYWORD(_Nullable , KEYALL) -KEYWORD(_Null_unspecified , KEYALL) - -// Microsoft extensions which should be disabled in strict conformance mode -KEYWORD(__ptr64 , KEYMS) -KEYWORD(__ptr32 , KEYMS) -KEYWORD(__sptr , KEYMS) -KEYWORD(__uptr , KEYMS) -KEYWORD(__w64 , KEYMS) -KEYWORD(__uuidof , KEYMS | KEYBORLAND) -KEYWORD(__try , KEYMS | KEYBORLAND) -KEYWORD(__finally , KEYMS | KEYBORLAND) -KEYWORD(__leave , KEYMS | KEYBORLAND) -KEYWORD(__int64 , KEYMS) -KEYWORD(__if_exists , KEYMS) -KEYWORD(__if_not_exists , KEYMS) -KEYWORD(__single_inheritance , KEYMS) -KEYWORD(__multiple_inheritance , KEYMS) -KEYWORD(__virtual_inheritance , KEYMS) -KEYWORD(__interface , KEYMS) -ALIAS("__int8" , char , KEYMS) -ALIAS("_int8" , char , KEYMS) -ALIAS("__int16" , short , KEYMS) -ALIAS("_int16" , short , KEYMS) -ALIAS("__int32" , int , KEYMS) -ALIAS("_int32" , int , KEYMS) -ALIAS("_int64" , __int64 , KEYMS) -ALIAS("__wchar_t" , wchar_t , KEYMS) -ALIAS("_asm" , asm , KEYMS) -ALIAS("_alignof" , __alignof , KEYMS) -ALIAS("__builtin_alignof", __alignof , KEYMS) -ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) -ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) -ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) -ALIAS("_thiscall" , __thiscall , KEYMS) -ALIAS("_vectorcall" , __vectorcall, KEYMS) -ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) -ALIAS("_inline" , inline , KEYMS) -ALIAS("_declspec" , __declspec , KEYMS) - -// Borland Extensions which should be disabled in strict conformance mode. -ALIAS("_pascal" , __pascal , KEYBORLAND) - -// Clang Extensions. -KEYWORD(__builtin_convertvector , KEYALL) -ALIAS("__char16_t" , char16_t , KEYCXX) -ALIAS("__char32_t" , char32_t , KEYCXX) - -// Clang-specific keywords enabled only in testing. -TESTING_KEYWORD(__unknown_anytype , KEYALL) - - -//===----------------------------------------------------------------------===// -// Objective-C @-preceded keywords. -//===----------------------------------------------------------------------===// - -// These have meaning after an '@' in Objective-C mode. These define enums in -// the tok::objc_* namespace. - -OBJC1_AT_KEYWORD(not_keyword) -OBJC1_AT_KEYWORD(class) -OBJC1_AT_KEYWORD(compatibility_alias) -OBJC1_AT_KEYWORD(defs) -OBJC1_AT_KEYWORD(encode) -OBJC1_AT_KEYWORD(end) -OBJC1_AT_KEYWORD(implementation) -OBJC1_AT_KEYWORD(interface) -OBJC1_AT_KEYWORD(private) -OBJC1_AT_KEYWORD(protected) -OBJC1_AT_KEYWORD(protocol) -OBJC1_AT_KEYWORD(public) -OBJC1_AT_KEYWORD(selector) -OBJC1_AT_KEYWORD(throw) -OBJC1_AT_KEYWORD(try) -OBJC1_AT_KEYWORD(catch) -OBJC1_AT_KEYWORD(finally) -OBJC1_AT_KEYWORD(synchronized) -OBJC1_AT_KEYWORD(autoreleasepool) - -OBJC2_AT_KEYWORD(property) -OBJC2_AT_KEYWORD(package) -OBJC2_AT_KEYWORD(required) -OBJC2_AT_KEYWORD(optional) -OBJC2_AT_KEYWORD(synthesize) -OBJC2_AT_KEYWORD(dynamic) -OBJC2_AT_KEYWORD(import) - -// TODO: What to do about context-sensitive keywords like: -// bycopy/byref/in/inout/oneway/out? - -ANNOTATION(cxxscope) // annotation for a C++ scope spec, e.g. "::foo::bar::" -ANNOTATION(typename) // annotation for a C typedef name, a C++ (possibly - // qualified) typename, e.g. "foo::MyClass", or - // template-id that names a type ("std::vector<int>") -ANNOTATION(template_id) // annotation for a C++ template-id that names a - // function template specialization (not a type), - // e.g., "std::swap<int>" -ANNOTATION(primary_expr) // annotation for a primary expression -ANNOTATION(decltype) // annotation for a decltype expression, - // e.g., "decltype(foo.bar())" - -// Annotation for #pragma unused(...) -// For each argument inside the parentheses the pragma handler will produce -// one 'pragma_unused' annotation token followed by the argument token. -ANNOTATION(pragma_unused) - -// Annotation for #pragma GCC visibility... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_vis) - -// Annotation for #pragma pack... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_pack) - -// Annotation for #pragma clang __debug parser_crash... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_parser_crash) - -// Annotation for #pragma clang __debug captured... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_captured) - -// Annotation for #pragma ms_struct... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_msstruct) - -// Annotation for #pragma align... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_align) - -// Annotation for #pragma weak id -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_weak) - -// Annotation for #pragma weak id = id -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_weakalias) - -// Annotation for #pragma redefine_extname... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_redefine_extname) - -// Annotation for #pragma STDC FP_CONTRACT... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_fp_contract) - -// Annotation for #pragma pointers_to_members... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_ms_pointers_to_members) - -// Annotation for #pragma vtordisp... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_ms_vtordisp) - -// Annotation for all microsoft #pragmas... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_ms_pragma) - -// Annotation for #pragma OPENCL EXTENSION... -// The lexer produces these so that they only take effect when the parser -// handles them. -ANNOTATION(pragma_opencl_extension) - -// Annotations for OpenMP pragma directives - #pragma omp ... -// The lexer produces these so that they only take effect when the parser -// handles #pragma omp ... directives. -ANNOTATION(pragma_openmp) -ANNOTATION(pragma_openmp_end) - -// Annotations for loop pragma directives #pragma clang loop ... -// The lexer produces these so that they only take effect when the parser -// handles #pragma loop ... directives. -ANNOTATION(pragma_loop_hint) - -// Annotations for module import translated from #include etc. -ANNOTATION(module_include) -ANNOTATION(module_begin) -ANNOTATION(module_end) - -#undef ANNOTATION -#undef TESTING_KEYWORD -#undef OBJC2_AT_KEYWORD -#undef OBJC1_AT_KEYWORD -#undef CXX_KEYWORD_OPERATOR -#undef PPKEYWORD -#undef ALIAS -#undef TYPE_TRAIT_N -#undef TYPE_TRAIT_2 -#undef TYPE_TRAIT_1 -#undef TYPE_TRAIT -#undef CONCEPTS_KEYWORD -#undef CXX11_KEYWORD -#undef KEYWORD -#undef PUNCTUATOR -#undef TOK diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h deleted file mode 100644 index f4ecb3e..0000000 --- a/include/clang/Basic/TokenKinds.h +++ /dev/null @@ -1,106 +0,0 @@ -//===--- TokenKinds.h - Enum values for C Token Kinds -----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::TokenKind enum and support functions. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TOKENKINDS_H -#define LLVM_CLANG_BASIC_TOKENKINDS_H - -#include "llvm/Support/Compiler.h" - -namespace clang { - -namespace tok { - -/// \brief Provides a simple uniform namespace for tokens from all C languages. -enum TokenKind : unsigned short { -#define TOK(X) X, -#include "clang/Basic/TokenKinds.def" - NUM_TOKENS -}; - -/// \brief Provides a namespace for preprocessor keywords which start with a -/// '#' at the beginning of the line. -enum PPKeywordKind { -#define PPKEYWORD(X) pp_##X, -#include "clang/Basic/TokenKinds.def" - NUM_PP_KEYWORDS -}; - -/// \brief Provides a namespace for Objective-C keywords which start with -/// an '@'. -enum ObjCKeywordKind { -#define OBJC1_AT_KEYWORD(X) objc_##X, -#define OBJC2_AT_KEYWORD(X) objc_##X, -#include "clang/Basic/TokenKinds.def" - NUM_OBJC_KEYWORDS -}; - -/// \brief Defines the possible values of an on-off-switch (C99 6.10.6p2). -enum OnOffSwitch { - OOS_ON, OOS_OFF, OOS_DEFAULT -}; - -/// \brief Determines the name of a token as used within the front end. -/// -/// The name of a token will be an internal name (such as "l_square") -/// and should not be used as part of diagnostic messages. -const char *getTokenName(TokenKind Kind) LLVM_READNONE; - -/// \brief Determines the spelling of simple punctuation tokens like -/// '!' or '%', and returns NULL for literal and annotation tokens. -/// -/// This routine only retrieves the "simple" spelling of the token, -/// and will not produce any alternative spellings (e.g., a -/// digraph). For the actual spelling of a given Token, use -/// Preprocessor::getSpelling(). -const char *getPunctuatorSpelling(TokenKind Kind) LLVM_READNONE; - -/// \brief Determines the spelling of simple keyword and contextual keyword -/// tokens like 'int' and 'dynamic_cast'. Returns NULL for other token kinds. -const char *getKeywordSpelling(TokenKind Kind) LLVM_READNONE; - -/// \brief Return true if this is a raw identifier or an identifier kind. -inline bool isAnyIdentifier(TokenKind K) { - return (K == tok::identifier) || (K == tok::raw_identifier); -} - -/// \brief Return true if this is a C or C++ string-literal (or -/// C++11 user-defined-string-literal) token. -inline bool isStringLiteral(TokenKind K) { - return K == tok::string_literal || K == tok::wide_string_literal || - K == tok::utf8_string_literal || K == tok::utf16_string_literal || - K == tok::utf32_string_literal; -} - -/// \brief Return true if this is a "literal" kind, like a numeric -/// constant, string, etc. -inline bool isLiteral(TokenKind K) { - return K == tok::numeric_constant || K == tok::char_constant || - K == tok::wide_char_constant || K == tok::utf8_char_constant || - K == tok::utf16_char_constant || K == tok::utf32_char_constant || - isStringLiteral(K) || K == tok::angle_string_literal; -} - -/// \brief Return true if this is any of tok::annot_* kinds. -inline bool isAnnotation(TokenKind K) { -#define ANNOTATION(NAME) \ - if (K == tok::annot_##NAME) \ - return true; -#include "clang/Basic/TokenKinds.def" - return false; -} - -} // end namespace tok -} // end namespace clang - -#endif diff --git a/include/clang/Basic/TypeTraits.h b/include/clang/Basic/TypeTraits.h deleted file mode 100644 index 765246b..0000000 --- a/include/clang/Basic/TypeTraits.h +++ /dev/null @@ -1,100 +0,0 @@ -//===--- TypeTraits.h - C++ Type Traits Support Enumerations ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines enumerations for the type traits support. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_TYPETRAITS_H -#define LLVM_CLANG_BASIC_TYPETRAITS_H - -namespace clang { - - /// \brief Names for traits that operate specifically on types. - enum TypeTrait { - UTT_HasNothrowAssign, - UTT_HasNothrowMoveAssign, - UTT_HasNothrowCopy, - UTT_HasNothrowConstructor, - UTT_HasTrivialAssign, - UTT_HasTrivialMoveAssign, - UTT_HasTrivialCopy, - UTT_HasTrivialDefaultConstructor, - UTT_HasTrivialMoveConstructor, - UTT_HasTrivialDestructor, - UTT_HasVirtualDestructor, - UTT_IsAbstract, - UTT_IsArithmetic, - UTT_IsArray, - UTT_IsClass, - UTT_IsCompleteType, - UTT_IsCompound, - UTT_IsConst, - UTT_IsDestructible, - UTT_IsEmpty, - UTT_IsEnum, - UTT_IsFinal, - UTT_IsFloatingPoint, - UTT_IsFunction, - UTT_IsFundamental, - UTT_IsIntegral, - UTT_IsInterfaceClass, - UTT_IsLiteral, - UTT_IsLvalueReference, - UTT_IsMemberFunctionPointer, - UTT_IsMemberObjectPointer, - UTT_IsMemberPointer, - UTT_IsNothrowDestructible, - UTT_IsObject, - UTT_IsPOD, - UTT_IsPointer, - UTT_IsPolymorphic, - UTT_IsReference, - UTT_IsRvalueReference, - UTT_IsScalar, - UTT_IsSealed, - UTT_IsSigned, - UTT_IsStandardLayout, - UTT_IsTrivial, - UTT_IsTriviallyCopyable, - UTT_IsUnion, - UTT_IsUnsigned, - UTT_IsVoid, - UTT_IsVolatile, - UTT_Last = UTT_IsVolatile, - BTT_IsBaseOf, - BTT_IsConvertible, - BTT_IsConvertibleTo, - BTT_IsSame, - BTT_TypeCompatible, - BTT_IsNothrowAssignable, - BTT_IsTriviallyAssignable, - BTT_Last = BTT_IsTriviallyAssignable, - TT_IsConstructible, - TT_IsNothrowConstructible, - TT_IsTriviallyConstructible - }; - - /// \brief Names for the array type traits. - enum ArrayTypeTrait { - ATT_ArrayRank, - ATT_ArrayExtent - }; - - /// \brief Names for the "expression or type" traits. - enum UnaryExprOrTypeTrait { - UETT_SizeOf, - UETT_AlignOf, - UETT_VecStep, - UETT_OpenMPRequiredSimdAlign, - }; -} - -#endif diff --git a/include/clang/Basic/Version.h b/include/clang/Basic/Version.h deleted file mode 100644 index 02da432..0000000 --- a/include/clang/Basic/Version.h +++ /dev/null @@ -1,82 +0,0 @@ -//===- Version.h - Clang Version Number -------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines version macros and version-related utility functions -/// for Clang. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_VERSION_H -#define LLVM_CLANG_BASIC_VERSION_H - -#include "clang/Basic/Version.inc" -#include "llvm/ADT/StringRef.h" - -/// \brief Helper macro for CLANG_VERSION_STRING. -#define CLANG_MAKE_VERSION_STRING2(X) #X - -#ifdef CLANG_VERSION_PATCHLEVEL -/// \brief Helper macro for CLANG_VERSION_STRING. -#define CLANG_MAKE_VERSION_STRING(X,Y,Z) CLANG_MAKE_VERSION_STRING2(X.Y.Z) - -/// \brief A string that describes the Clang version number, e.g., "1.0". -#define CLANG_VERSION_STRING \ - CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR, \ - CLANG_VERSION_PATCHLEVEL) -#else -/// \brief Helper macro for CLANG_VERSION_STRING. -#define CLANG_MAKE_VERSION_STRING(X,Y) CLANG_MAKE_VERSION_STRING2(X.Y) - -/// \brief A string that describes the Clang version number, e.g., "1.0". -#define CLANG_VERSION_STRING \ - CLANG_MAKE_VERSION_STRING(CLANG_VERSION_MAJOR,CLANG_VERSION_MINOR) -#endif - -namespace clang { - /// \brief Retrieves the repository path (e.g., Subversion path) that - /// identifies the particular Clang branch, tag, or trunk from which this - /// Clang was built. - std::string getClangRepositoryPath(); - - /// \brief Retrieves the repository path from which LLVM was built. - /// - /// This supports LLVM residing in a separate repository from clang. - std::string getLLVMRepositoryPath(); - - /// \brief Retrieves the repository revision number (or identifer) from which - /// this Clang was built. - std::string getClangRevision(); - - /// \brief Retrieves the repository revision number (or identifer) from which - /// LLVM was built. - /// - /// If Clang and LLVM are in the same repository, this returns the same - /// string as getClangRevision. - std::string getLLVMRevision(); - - /// \brief Retrieves the full repository version that is an amalgamation of - /// the information in getClangRepositoryPath() and getClangRevision(). - std::string getClangFullRepositoryVersion(); - - /// \brief Retrieves a string representing the complete clang version, - /// which includes the clang version number, the repository version, - /// and the vendor tag. - std::string getClangFullVersion(); - - /// \brief Like getClangFullVersion(), but with a custom tool name. - std::string getClangToolFullVersion(llvm::StringRef ToolName); - - /// \brief Retrieves a string representing the complete clang version suitable - /// for use in the CPP __VERSION__ macro, which includes the clang version - /// number, the repository version, and the vendor tag. - std::string getClangFullCPPVersion(); -} - -#endif // LLVM_CLANG_BASIC_VERSION_H diff --git a/include/clang/Basic/Version.inc.in b/include/clang/Basic/Version.inc.in deleted file mode 100644 index ccf8430..0000000 --- a/include/clang/Basic/Version.inc.in +++ /dev/null @@ -1,6 +0,0 @@ -#define CLANG_VERSION @CLANG_VERSION@ -#define CLANG_VERSION_MAJOR @CLANG_VERSION_MAJOR@ -#define CLANG_VERSION_MINOR @CLANG_VERSION_MINOR@ -#if @CLANG_HAS_VERSION_PATCHLEVEL@ -#define CLANG_VERSION_PATCHLEVEL @CLANG_VERSION_PATCHLEVEL@ -#endif diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h deleted file mode 100644 index 784f3f3..0000000 --- a/include/clang/Basic/VersionTuple.h +++ /dev/null @@ -1,163 +0,0 @@ -//===- VersionTuple.h - Version Number Handling -----------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::VersionTuple class, which represents a version in -/// the form major[.minor[.subminor]]. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_VERSIONTUPLE_H -#define LLVM_CLANG_BASIC_VERSIONTUPLE_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/Optional.h" -#include <string> -#include <tuple> - -namespace clang { - -/// \brief Represents a version number in the form major[.minor[.subminor[.build]]]. -class VersionTuple { - unsigned Major : 31; - unsigned Minor : 31; - unsigned Subminor : 31; - unsigned Build : 31; - unsigned HasMinor : 1; - unsigned HasSubminor : 1; - unsigned HasBuild : 1; - unsigned UsesUnderscores : 1; - -public: - VersionTuple() - : Major(0), Minor(0), Subminor(0), Build(0), HasMinor(false), - HasSubminor(false), HasBuild(false), UsesUnderscores(false) {} - - explicit VersionTuple(unsigned Major) - : Major(Major), Minor(0), Subminor(0), Build(0), HasMinor(false), - HasSubminor(false), HasBuild(false), UsesUnderscores(false) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, - bool UsesUnderscores = false) - : Major(Major), Minor(Minor), Subminor(0), Build(0), HasMinor(true), - HasSubminor(false), HasBuild(false), UsesUnderscores(UsesUnderscores) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, - bool UsesUnderscores = false) - : Major(Major), Minor(Minor), Subminor(Subminor), Build(0), - HasMinor(true), HasSubminor(true), HasBuild(false), - UsesUnderscores(UsesUnderscores) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, - unsigned Build, bool UsesUnderscores = false) - : Major(Major), Minor(Minor), Subminor(Subminor), Build(Build), - HasMinor(true), HasSubminor(true), HasBuild(true), - UsesUnderscores(UsesUnderscores) {} - - /// \brief Determine whether this version information is empty - /// (e.g., all version components are zero). - bool empty() const { - return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0; - } - - /// \brief Retrieve the major version number. - unsigned getMajor() const { return Major; } - - /// \brief Retrieve the minor version number, if provided. - Optional<unsigned> getMinor() const { - if (!HasMinor) - return None; - return Minor; - } - - /// \brief Retrieve the subminor version number, if provided. - Optional<unsigned> getSubminor() const { - if (!HasSubminor) - return None; - return Subminor; - } - - /// \brief Retrieve the build version number, if provided. - Optional<unsigned> getBuild() const { - if (!HasBuild) - return None; - return Build; - } - - bool usesUnderscores() const { - return UsesUnderscores; - } - - void UseDotAsSeparator() { - UsesUnderscores = false; - } - - /// \brief Determine if two version numbers are equivalent. If not - /// provided, minor and subminor version numbers are considered to be zero. - friend bool operator==(const VersionTuple& X, const VersionTuple &Y) { - return X.Major == Y.Major && X.Minor == Y.Minor && - X.Subminor == Y.Subminor && X.Build == Y.Build; - } - - /// \brief Determine if two version numbers are not equivalent. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator!=(const VersionTuple &X, const VersionTuple &Y) { - return !(X == Y); - } - - /// \brief Determine whether one version number precedes another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator<(const VersionTuple &X, const VersionTuple &Y) { - return std::tie(X.Major, X.Minor, X.Subminor, X.Build) < - std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build); - } - - /// \brief Determine whether one version number follows another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator>(const VersionTuple &X, const VersionTuple &Y) { - return Y < X; - } - - /// \brief Determine whether one version number precedes or is - /// equivalent to another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator<=(const VersionTuple &X, const VersionTuple &Y) { - return !(Y < X); - } - - /// \brief Determine whether one version number follows or is - /// equivalent to another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator>=(const VersionTuple &X, const VersionTuple &Y) { - return !(X < Y); - } - - /// \brief Retrieve a string representation of the version number. - std::string getAsString() const; - - /// \brief Try to parse the given string as a version number. - /// \returns \c true if the string does not match the regular expression - /// [0-9]+(\.[0-9]+){0,3} - bool tryParse(StringRef string); -}; - -/// \brief Print a version number. -raw_ostream& operator<<(raw_ostream &Out, const VersionTuple &V); - -} // end namespace clang -#endif // LLVM_CLANG_BASIC_VERSIONTUPLE_H diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h deleted file mode 100644 index 1df4947..0000000 --- a/include/clang/Basic/VirtualFileSystem.h +++ /dev/null @@ -1,341 +0,0 @@ -//===- VirtualFileSystem.h - Virtual File System Layer ----------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// \file -/// \brief Defines the virtual file system interface vfs::FileSystem. -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_BASIC_VIRTUALFILESYSTEM_H -#define LLVM_CLANG_BASIC_VIRTUALFILESYSTEM_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/Optional.h" -#include "llvm/Support/ErrorOr.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/SourceMgr.h" -#include "llvm/Support/raw_ostream.h" - -namespace llvm { -class MemoryBuffer; -} - -namespace clang { -namespace vfs { - -/// \brief The result of a \p status operation. -class Status { - std::string Name; - llvm::sys::fs::UniqueID UID; - llvm::sys::TimeValue MTime; - uint32_t User; - uint32_t Group; - uint64_t Size; - llvm::sys::fs::file_type Type; - llvm::sys::fs::perms Perms; - -public: - bool IsVFSMapped; // FIXME: remove when files support multiple names - -public: - Status() : Type(llvm::sys::fs::file_type::status_error) {} - Status(const llvm::sys::fs::file_status &Status); - Status(StringRef Name, llvm::sys::fs::UniqueID UID, - llvm::sys::TimeValue MTime, uint32_t User, uint32_t Group, - uint64_t Size, llvm::sys::fs::file_type Type, - llvm::sys::fs::perms Perms); - - /// Get a copy of a Status with a different name. - static Status copyWithNewName(const Status &In, StringRef NewName); - static Status copyWithNewName(const llvm::sys::fs::file_status &In, - StringRef NewName); - - /// \brief Returns the name that should be used for this file or directory. - StringRef getName() const { return Name; } - - /// @name Status interface from llvm::sys::fs - /// @{ - llvm::sys::fs::file_type getType() const { return Type; } - llvm::sys::fs::perms getPermissions() const { return Perms; } - llvm::sys::TimeValue getLastModificationTime() const { return MTime; } - llvm::sys::fs::UniqueID getUniqueID() const { return UID; } - uint32_t getUser() const { return User; } - uint32_t getGroup() const { return Group; } - uint64_t getSize() const { return Size; } - /// @} - /// @name Status queries - /// These are static queries in llvm::sys::fs. - /// @{ - bool equivalent(const Status &Other) const; - bool isDirectory() const; - bool isRegularFile() const; - bool isOther() const; - bool isSymlink() const; - bool isStatusKnown() const; - bool exists() const; - /// @} -}; - -/// \brief Represents an open file. -class File { -public: - /// \brief Destroy the file after closing it (if open). - /// Sub-classes should generally call close() inside their destructors. We - /// cannot do that from the base class, since close is virtual. - virtual ~File(); - /// \brief Get the status of the file. - virtual llvm::ErrorOr<Status> status() = 0; - /// \brief Get the contents of the file as a \p MemoryBuffer. - virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBuffer(const Twine &Name, int64_t FileSize = -1, - bool RequiresNullTerminator = true, bool IsVolatile = false) = 0; - /// \brief Closes the file. - virtual std::error_code close() = 0; -}; - -namespace detail { -/// \brief An interface for virtual file systems to provide an iterator over the -/// (non-recursive) contents of a directory. -struct DirIterImpl { - virtual ~DirIterImpl(); - /// \brief Sets \c CurrentEntry to the next entry in the directory on success, - /// or returns a system-defined \c error_code. - virtual std::error_code increment() = 0; - Status CurrentEntry; -}; -} // end namespace detail - -/// \brief An input iterator over the entries in a virtual path, similar to -/// llvm::sys::fs::directory_iterator. -class directory_iterator { - std::shared_ptr<detail::DirIterImpl> Impl; // Input iterator semantics on copy - -public: - directory_iterator(std::shared_ptr<detail::DirIterImpl> I) : Impl(I) { - assert(Impl.get() != nullptr && "requires non-null implementation"); - if (!Impl->CurrentEntry.isStatusKnown()) - Impl.reset(); // Normalize the end iterator to Impl == nullptr. - } - - /// \brief Construct an 'end' iterator. - directory_iterator() { } - - /// \brief Equivalent to operator++, with an error code. - directory_iterator &increment(std::error_code &EC) { - assert(Impl && "attempting to increment past end"); - EC = Impl->increment(); - if (EC || !Impl->CurrentEntry.isStatusKnown()) - Impl.reset(); // Normalize the end iterator to Impl == nullptr. - return *this; - } - - const Status &operator*() const { return Impl->CurrentEntry; } - const Status *operator->() const { return &Impl->CurrentEntry; } - - bool operator==(const directory_iterator &RHS) const { - if (Impl && RHS.Impl) - return Impl->CurrentEntry.equivalent(RHS.Impl->CurrentEntry); - return !Impl && !RHS.Impl; - } - bool operator!=(const directory_iterator &RHS) const { - return !(*this == RHS); - } -}; - -class FileSystem; - -/// \brief An input iterator over the recursive contents of a virtual path, -/// similar to llvm::sys::fs::recursive_directory_iterator. -class recursive_directory_iterator { - typedef std::stack<directory_iterator, std::vector<directory_iterator>> - IterState; - - FileSystem *FS; - std::shared_ptr<IterState> State; // Input iterator semantics on copy. - -public: - recursive_directory_iterator(FileSystem &FS, const Twine &Path, - std::error_code &EC); - /// \brief Construct an 'end' iterator. - recursive_directory_iterator() { } - - /// \brief Equivalent to operator++, with an error code. - recursive_directory_iterator &increment(std::error_code &EC); - - const Status &operator*() const { return *State->top(); } - const Status *operator->() const { return &*State->top(); } - - bool operator==(const recursive_directory_iterator &Other) const { - return State == Other.State; // identity - } - bool operator!=(const recursive_directory_iterator &RHS) const { - return !(*this == RHS); - } -}; - -/// \brief The virtual file system interface. -class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> { -public: - virtual ~FileSystem(); - - /// \brief Get the status of the entry at \p Path, if one exists. - virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0; - /// \brief Get a \p File object for the file at \p Path, if one exists. - virtual llvm::ErrorOr<std::unique_ptr<File>> - openFileForRead(const Twine &Path) = 0; - - /// This is a convenience method that opens a file, gets its content and then - /// closes the file. - llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBufferForFile(const Twine &Name, int64_t FileSize = -1, - bool RequiresNullTerminator = true, bool IsVolatile = false); - - /// \brief Get a directory_iterator for \p Dir. - /// \note The 'end' iterator is directory_iterator(). - virtual directory_iterator dir_begin(const Twine &Dir, - std::error_code &EC) = 0; - - /// Set the working directory. This will affect all following operations on - /// this file system and may propagate down for nested file systems. - virtual std::error_code setCurrentWorkingDirectory(const Twine &Path) = 0; - /// Get the working directory of this file system. - virtual llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const = 0; - - /// Check whether a file exists. Provided for convenience. - bool exists(const Twine &Path); - - /// Make \a Path an absolute path. - /// - /// Makes \a Path absolute using the current directory if it is not already. - /// An empty \a Path will result in the current directory. - /// - /// /absolute/path => /absolute/path - /// relative/../path => <current-directory>/relative/../path - /// - /// \param Path A path that is modified to be an absolute path. - /// \returns success if \a path has been made absolute, otherwise a - /// platform-specific error_code. - std::error_code makeAbsolute(SmallVectorImpl<char> &Path) const; -}; - -/// \brief Gets an \p vfs::FileSystem for the 'real' file system, as seen by -/// the operating system. -IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); - -/// \brief A file system that allows overlaying one \p AbstractFileSystem on top -/// of another. -/// -/// Consists of a stack of >=1 \p FileSystem objects, which are treated as being -/// one merged file system. When there is a directory that exists in more than -/// one file system, the \p OverlayFileSystem contains a directory containing -/// the union of their contents. The attributes (permissions, etc.) of the -/// top-most (most recently added) directory are used. When there is a file -/// that exists in more than one file system, the file in the top-most file -/// system overrides the other(s). -class OverlayFileSystem : public FileSystem { - typedef SmallVector<IntrusiveRefCntPtr<FileSystem>, 1> FileSystemList; - /// \brief The stack of file systems, implemented as a list in order of - /// their addition. - FileSystemList FSList; - -public: - OverlayFileSystem(IntrusiveRefCntPtr<FileSystem> Base); - /// \brief Pushes a file system on top of the stack. - void pushOverlay(IntrusiveRefCntPtr<FileSystem> FS); - - llvm::ErrorOr<Status> status(const Twine &Path) override; - llvm::ErrorOr<std::unique_ptr<File>> - openFileForRead(const Twine &Path) override; - directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override; - llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override; - std::error_code setCurrentWorkingDirectory(const Twine &Path) override; - - typedef FileSystemList::reverse_iterator iterator; - - /// \brief Get an iterator pointing to the most recently added file system. - iterator overlays_begin() { return FSList.rbegin(); } - - /// \brief Get an iterator pointing one-past the least recently added file - /// system. - iterator overlays_end() { return FSList.rend(); } -}; - -namespace detail { -class InMemoryDirectory; -} // end namespace detail - -/// An in-memory file system. -class InMemoryFileSystem : public FileSystem { - std::unique_ptr<detail::InMemoryDirectory> Root; - std::string WorkingDirectory; - bool UseNormalizedPaths = true; - -public: - explicit InMemoryFileSystem(bool UseNormalizedPaths = true); - ~InMemoryFileSystem() override; - /// Add a buffer to the VFS with a path. The VFS owns the buffer. - /// \return true if the file was successfully added, false if the file already - /// exists in the file system with different contents. - bool addFile(const Twine &Path, time_t ModificationTime, - std::unique_ptr<llvm::MemoryBuffer> Buffer); - /// Add a buffer to the VFS with a path. The VFS does not own the buffer. - /// \return true if the file was successfully added, false if the file already - /// exists in the file system with different contents. - bool addFileNoOwn(const Twine &Path, time_t ModificationTime, - llvm::MemoryBuffer *Buffer); - std::string toString() const; - /// Return true if this file system normalizes . and .. in paths. - bool useNormalizedPaths() const { return UseNormalizedPaths; } - - llvm::ErrorOr<Status> status(const Twine &Path) override; - llvm::ErrorOr<std::unique_ptr<File>> - openFileForRead(const Twine &Path) override; - directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override; - llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override { - return WorkingDirectory; - } - std::error_code setCurrentWorkingDirectory(const Twine &Path) override { - WorkingDirectory = Path.str(); - return std::error_code(); - } -}; - -/// \brief Get a globally unique ID for a virtual file or directory. -llvm::sys::fs::UniqueID getNextVirtualUniqueID(); - -/// \brief Gets a \p FileSystem for a virtual file system described in YAML -/// format. -IntrusiveRefCntPtr<FileSystem> -getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer, - llvm::SourceMgr::DiagHandlerTy DiagHandler, - void *DiagContext = nullptr, - IntrusiveRefCntPtr<FileSystem> ExternalFS = getRealFileSystem()); - -struct YAMLVFSEntry { - template <typename T1, typename T2> YAMLVFSEntry(T1 &&VPath, T2 &&RPath) - : VPath(std::forward<T1>(VPath)), RPath(std::forward<T2>(RPath)) {} - std::string VPath; - std::string RPath; -}; - -class YAMLVFSWriter { - std::vector<YAMLVFSEntry> Mappings; - Optional<bool> IsCaseSensitive; - -public: - YAMLVFSWriter() {} - void addFileMapping(StringRef VirtualPath, StringRef RealPath); - void setCaseSensitivity(bool CaseSensitive) { - IsCaseSensitive = CaseSensitive; - } - void write(llvm::raw_ostream &OS); -}; - -} // end namespace vfs -} // end namespace clang -#endif diff --git a/include/clang/Basic/Visibility.h b/include/clang/Basic/Visibility.h deleted file mode 100644 index 6ac52ed..0000000 --- a/include/clang/Basic/Visibility.h +++ /dev/null @@ -1,141 +0,0 @@ -//===--- Visibility.h - Visibility enumeration and utilities ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::Visibility enumeration and various utility -/// functions. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_VISIBILITY_H -#define LLVM_CLANG_BASIC_VISIBILITY_H - -#include "clang/Basic/Linkage.h" - -namespace clang { - -/// \brief Describes the different kinds of visibility that a declaration -/// may have. -/// -/// Visibility determines how a declaration interacts with the dynamic -/// linker. It may also affect whether the symbol can be found by runtime -/// symbol lookup APIs. -/// -/// Visibility is not described in any language standard and -/// (nonetheless) sometimes has odd behavior. Not all platforms -/// support all visibility kinds. -enum Visibility { - /// Objects with "hidden" visibility are not seen by the dynamic - /// linker. - HiddenVisibility, - - /// Objects with "protected" visibility are seen by the dynamic - /// linker but always dynamically resolve to an object within this - /// shared object. - ProtectedVisibility, - - /// Objects with "default" visibility are seen by the dynamic linker - /// and act like normal objects. - DefaultVisibility -}; - -inline Visibility minVisibility(Visibility L, Visibility R) { - return L < R ? L : R; -} - -class LinkageInfo { - uint8_t linkage_ : 3; - uint8_t visibility_ : 2; - uint8_t explicit_ : 1; - - void setVisibility(Visibility V, bool E) { visibility_ = V; explicit_ = E; } -public: - LinkageInfo() : linkage_(ExternalLinkage), visibility_(DefaultVisibility), - explicit_(false) {} - LinkageInfo(Linkage L, Visibility V, bool E) - : linkage_(L), visibility_(V), explicit_(E) { - assert(getLinkage() == L && getVisibility() == V && - isVisibilityExplicit() == E && "Enum truncated!"); - } - - static LinkageInfo external() { - return LinkageInfo(); - } - static LinkageInfo internal() { - return LinkageInfo(InternalLinkage, DefaultVisibility, false); - } - static LinkageInfo uniqueExternal() { - return LinkageInfo(UniqueExternalLinkage, DefaultVisibility, false); - } - static LinkageInfo none() { - return LinkageInfo(NoLinkage, DefaultVisibility, false); - } - - Linkage getLinkage() const { return (Linkage)linkage_; } - Visibility getVisibility() const { return (Visibility)visibility_; } - bool isVisibilityExplicit() const { return explicit_; } - - void setLinkage(Linkage L) { linkage_ = L; } - - void mergeLinkage(Linkage L) { - setLinkage(minLinkage(getLinkage(), L)); - } - void mergeLinkage(LinkageInfo other) { - mergeLinkage(other.getLinkage()); - } - - void mergeExternalVisibility(Linkage L) { - Linkage ThisL = getLinkage(); - if (!isExternallyVisible(L)) { - if (ThisL == VisibleNoLinkage) - ThisL = NoLinkage; - else if (ThisL == ExternalLinkage) - ThisL = UniqueExternalLinkage; - } - setLinkage(ThisL); - } - void mergeExternalVisibility(LinkageInfo Other) { - mergeExternalVisibility(Other.getLinkage()); - } - - /// Merge in the visibility 'newVis'. - void mergeVisibility(Visibility newVis, bool newExplicit) { - Visibility oldVis = getVisibility(); - - // Never increase visibility. - if (oldVis < newVis) - return; - - // If the new visibility is the same as the old and the new - // visibility isn't explicit, we have nothing to add. - if (oldVis == newVis && !newExplicit) - return; - - // Otherwise, we're either decreasing visibility or making our - // existing visibility explicit. - setVisibility(newVis, newExplicit); - } - void mergeVisibility(LinkageInfo other) { - mergeVisibility(other.getVisibility(), other.isVisibilityExplicit()); - } - - /// Merge both linkage and visibility. - void merge(LinkageInfo other) { - mergeLinkage(other); - mergeVisibility(other); - } - - /// Merge linkage and conditionally merge visibility. - void mergeMaybeWithVisibility(LinkageInfo other, bool withVis) { - mergeLinkage(other); - if (withVis) mergeVisibility(other); - } -}; -} - -#endif // LLVM_CLANG_BASIC_VISIBILITY_H diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td deleted file mode 100644 index 6d95c1e..0000000 --- a/include/clang/Basic/arm_neon.td +++ /dev/null @@ -1,1657 +0,0 @@ -//===--- arm_neon.td - ARM NEON compiler interface ------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the TableGen definitions from which the ARM NEON header -// file will be generated. See ARM document DUI0348B. -// -//===----------------------------------------------------------------------===// -// -// Each intrinsic is a subclass of the Inst class. An intrinsic can either -// generate a __builtin_* call or it can expand to a set of generic operations. -// -// The operations are subclasses of Operation providing a list of DAGs, the -// last of which is the return value. The available DAG nodes are documented -// below. -// -//===----------------------------------------------------------------------===// - -// The base Operation class. All operations must subclass this. -class Operation<list<dag> ops=[]> { - list<dag> Ops = ops; - bit Unavailable = 0; -} -// An operation that only contains a single DAG. -class Op<dag op> : Operation<[op]>; -// A shorter version of Operation - takes a list of DAGs. The last of these will -// be the return value. -class LOp<list<dag> ops> : Operation<ops>; - -// These defs and classes are used internally to implement the SetTheory -// expansion and should be ignored. -foreach Index = 0-63 in - def sv##Index; -class MaskExpand; - -//===----------------------------------------------------------------------===// -// Available operations -//===----------------------------------------------------------------------===// - -// DAG arguments can either be operations (documented below) or variables. -// Variables are prefixed with '$'. There are variables for each input argument, -// with the name $pN, where N starts at zero. So the zero'th argument will be -// $p0, the first $p1 etc. - -// op - Binary or unary operator, depending on the number of arguments. The -// operator itself is just treated as a raw string and is not checked. -// example: (op "+", $p0, $p1) -> "__p0 + __p1". -// (op "-", $p0) -> "-__p0" -def op; -// call - Invoke another intrinsic. The input types are type checked and -// disambiguated. If there is no intrinsic defined that takes -// the given types (or if there is a type ambiguity) an error is -// generated at tblgen time. The name of the intrinsic is the raw -// name as given to the Inst class (not mangled). -// example: (call "vget_high", $p0) -> "vgetq_high_s16(__p0)" -// (assuming $p0 has type int16x8_t). -def call; -// cast - Perform a cast to a different type. This gets emitted as a static -// C-style cast. For a pure reinterpret cast (T x = *(T*)&y), use -// "bitcast". -// -// The syntax is (cast MOD* VAL). The last argument is the value to -// cast, preceded by a sequence of type modifiers. The target type -// starts off as the type of VAL, and is modified by MOD in sequence. -// The available modifiers are: -// - $X - Take the type of parameter/variable X. For example: -// (cast $p0, $p1) would cast $p1 to the type of $p0. -// - "R" - The type of the return type. -// - A typedef string - A NEON or stdint.h type that is then parsed. -// for example: (cast "uint32x4_t", $p0). -// - "U" - Make the type unsigned. -// - "S" - Make the type signed. -// - "H" - Halve the number of lanes in the type. -// - "D" - Double the number of lanes in the type. -// - "8" - Convert type to an equivalent vector of 8-bit signed -// integers. -// example: (cast "R", "U", $p0) -> "(uint32x4_t)__p0" (assuming the return -// value is of type "int32x4_t". -// (cast $p0, "D", "8", $p1) -> "(int8x16_t)__p1" (assuming __p0 -// has type float64x1_t or any other vector type of 64 bits). -// (cast "int32_t", $p2) -> "(int32_t)__p2" -def cast; -// bitcast - Same as "cast", except a reinterpret-cast is produced: -// (bitcast "T", $p0) -> "*(T*)&__p0". -// The VAL argument is saved to a temporary so it can be used -// as an l-value. -def bitcast; -// dup - Take a scalar argument and create a vector by duplicating it into -// all lanes. The type of the vector is the base type of the intrinsic. -// example: (dup $p1) -> "(uint32x2_t) {__p1, __p1}" (assuming the base type -// is uint32x2_t). -def dup; -// splat - Take a vector and a lane index, and return a vector of the same type -// containing repeated instances of the source vector at the lane index. -// example: (splat $p0, $p1) -> -// "__builtin_shufflevector(__p0, __p0, __p1, __p1, __p1, __p1)" -// (assuming __p0 has four elements). -def splat; -// save_temp - Create a temporary (local) variable. The variable takes a name -// based on the zero'th parameter and can be referenced using -// using that name in subsequent DAGs in the same -// operation. The scope of a temp is the operation. If a variable -// with the given name already exists, an error will be given at -// tblgen time. -// example: [(save_temp $var, (call "foo", $p0)), -// (op "+", $var, $p1)] -> -// "int32x2_t __var = foo(__p0); return __var + __p1;" -def save_temp; -// name_replace - Return the name of the current intrinsic with the first -// argument replaced by the second argument. Raises an error if -// the first argument does not exist in the intrinsic name. -// example: (call (name_replace "_high_", "_"), $p0) (to call the non-high -// version of this intrinsic). -def name_replace; -// literal - Create a literal piece of code. The code is treated as a raw -// string, and must be given a type. The type is a stdint.h or -// NEON intrinsic type as given to (cast). -// example: (literal "int32_t", "0") -def literal; -// shuffle - Create a vector shuffle. The syntax is (shuffle ARG0, ARG1, MASK). -// The MASK argument is a set of elements. The elements are generated -// from the two special defs "mask0" and "mask1". "mask0" expands to -// the lane indices in sequence for ARG0, and "mask1" expands to -// the lane indices in sequence for ARG1. They can be used as-is, e.g. -// -// (shuffle $p0, $p1, mask0) -> $p0 -// (shuffle $p0, $p1, mask1) -> $p1 -// -// or, more usefully, they can be manipulated using the SetTheory -// operators plus some extra operators defined in the NEON emitter. -// The operators are described below. -// example: (shuffle $p0, $p1, (add (highhalf mask0), (highhalf mask1))) -> -// A concatenation of the high halves of the input vectors. -def shuffle; - -// add, interleave, decimate: These set operators are vanilla SetTheory -// operators and take their normal definition. -def add; -def interleave; -def decimate; -// rotl - Rotate set left by a number of elements. -// example: (rotl mask0, 3) -> [3, 4, 5, 6, 0, 1, 2] -def rotl; -// rotl - Rotate set right by a number of elements. -// example: (rotr mask0, 3) -> [4, 5, 6, 0, 1, 2, 3] -def rotr; -// highhalf - Take only the high half of the input. -// example: (highhalf mask0) -> [4, 5, 6, 7] (assuming mask0 had 8 elements) -def highhalf; -// highhalf - Take only the low half of the input. -// example: (lowhalf mask0) -> [0, 1, 2, 3] (assuming mask0 had 8 elements) -def lowhalf; -// rev - Perform a variable-width reversal of the elements. The zero'th argument -// is a width in bits to reverse. The lanes this maps to is determined -// based on the element width of the underlying type. -// example: (rev 32, mask0) -> [3, 2, 1, 0, 7, 6, 5, 4] (if 8-bit elements) -// example: (rev 32, mask0) -> [1, 0, 3, 2] (if 16-bit elements) -def rev; -// mask0 - The initial sequence of lanes for shuffle ARG0 -def mask0 : MaskExpand; -// mask0 - The initial sequence of lanes for shuffle ARG1 -def mask1 : MaskExpand; - -def OP_NONE : Operation; -def OP_UNAVAILABLE : Operation { - let Unavailable = 1; -} - -//===----------------------------------------------------------------------===// -// Instruction definitions -//===----------------------------------------------------------------------===// - -// Every intrinsic subclasses "Inst". An intrinsic has a name, a prototype and -// a sequence of typespecs. -// -// The name is the base name of the intrinsic, for example "vget_lane". This is -// then mangled by the tblgen backend to add type information ("vget_lane_s16"). -// -// A typespec is a sequence of uppercase characters (modifiers) followed by one -// lowercase character. A typespec encodes a particular "base type" of the -// intrinsic. -// -// An example typespec is "Qs" - quad-size short - uint16x8_t. The available -// typespec codes are given below. -// -// The string given to an Inst class is a sequence of typespecs. The intrinsic -// is instantiated for every typespec in the sequence. For example "sdQsQd". -// -// The prototype is a string that defines the return type of the intrinsic -// and the type of each argument. The return type and every argument gets a -// "modifier" that can change in some way the "base type" of the intrinsic. -// -// The modifier 'd' means "default" and does not modify the base type in any -// way. The available modifiers are given below. -// -// Typespecs -// --------- -// c: char -// s: short -// i: int -// l: long -// k: 128-bit long -// f: float -// h: half-float -// d: double -// -// Typespec modifiers -// ------------------ -// S: scalar, only used for function mangling. -// U: unsigned -// Q: 128b -// H: 128b without mangling 'q' -// P: polynomial -// -// Prototype modifiers -// ------------------- -// prototype: return (arg, arg, ...) -// -// v: void -// t: best-fit integer (int/poly args) -// x: signed integer (int/float args) -// u: unsigned integer (int/float args) -// f: float (int args) -// F: double (int args) -// d: default -// g: default, ignore 'Q' size modifier. -// j: default, force 'Q' size modifier. -// w: double width elements, same num elts -// n: double width elements, half num elts -// h: half width elements, double num elts -// q: half width elements, quad num elts -// e: half width elements, double num elts, unsigned -// m: half width elements, same num elts -// i: constant int -// l: constant uint64 -// s: scalar of element type -// z: scalar of half width element type, signed -// r: scalar of double width element type, signed -// a: scalar of element type (splat to vector type) -// b: scalar of unsigned integer/long type (int/float args) -// $: scalar of signed integer/long type (int/float args) -// y: scalar of float -// o: scalar of double -// k: default elt width, double num elts -// 2,3,4: array of default vectors -// B,C,D: array of default elts, force 'Q' size modifier. -// p: pointer type -// c: const pointer type - -// Every intrinsic subclasses Inst. -class Inst <string n, string p, string t, Operation o> { - string Name = n; - string Prototype = p; - string Types = t; - string ArchGuard = ""; - - Operation Operation = o; - bit CartesianProductOfTypes = 0; - bit BigEndianSafe = 0; - bit isShift = 0; - bit isScalarShift = 0; - bit isScalarNarrowShift = 0; - bit isVCVT_N = 0; - // For immediate checks: the immediate will be assumed to specify the lane of - // a Q register. Only used for intrinsics which end up calling polymorphic - // builtins. - bit isLaneQ = 0; - - // Certain intrinsics have different names than their representative - // instructions. This field allows us to handle this correctly when we - // are generating tests. - string InstName = ""; - - // Certain intrinsics even though they are not a WOpInst or LOpInst, - // generate a WOpInst/LOpInst instruction (see below for definition - // of a WOpInst/LOpInst). For testing purposes we need to know - // this. Ex: vset_lane which outputs vmov instructions. - bit isHiddenWInst = 0; - bit isHiddenLInst = 0; -} - -// The following instruction classes are implemented via builtins. -// These declarations are used to generate Builtins.def: -// -// SInst: Instruction with signed/unsigned suffix (e.g., "s8", "u8", "p8") -// IInst: Instruction with generic integer suffix (e.g., "i8") -// WInst: Instruction with only bit size suffix (e.g., "8") -class SInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} -class IInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} -class WInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} - -// The following instruction classes are implemented via operators -// instead of builtins. As such these declarations are only used for -// the purpose of generating tests. -// -// SOpInst: Instruction with signed/unsigned suffix (e.g., "s8", -// "u8", "p8"). -// IOpInst: Instruction with generic integer suffix (e.g., "i8"). -// WOpInst: Instruction with bit size only suffix (e.g., "8"). -// LOpInst: Logical instruction with no bit size suffix. -// NoTestOpInst: Intrinsic that has no corresponding instruction. -class SOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class IOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class WOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class LOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class NoTestOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} - -//===----------------------------------------------------------------------===// -// Operations -//===----------------------------------------------------------------------===// - -def OP_ADD : Op<(op "+", $p0, $p1)>; -def OP_ADDL : Op<(op "+", (call "vmovl", $p0), (call "vmovl", $p1))>; -def OP_ADDLHi : Op<(op "+", (call "vmovl_high", $p0), - (call "vmovl_high", $p1))>; -def OP_ADDW : Op<(op "+", $p0, (call "vmovl", $p1))>; -def OP_ADDWHi : Op<(op "+", $p0, (call "vmovl_high", $p1))>; -def OP_SUB : Op<(op "-", $p0, $p1)>; -def OP_SUBL : Op<(op "-", (call "vmovl", $p0), (call "vmovl", $p1))>; -def OP_SUBLHi : Op<(op "-", (call "vmovl_high", $p0), - (call "vmovl_high", $p1))>; -def OP_SUBW : Op<(op "-", $p0, (call "vmovl", $p1))>; -def OP_SUBWHi : Op<(op "-", $p0, (call "vmovl_high", $p1))>; -def OP_MUL : Op<(op "*", $p0, $p1)>; -def OP_MLA : Op<(op "+", $p0, (op "*", $p1, $p2))>; -def OP_MLAL : Op<(op "+", $p0, (call "vmull", $p1, $p2))>; -def OP_MULLHi : Op<(call "vmull", (call "vget_high", $p0), - (call "vget_high", $p1))>; -def OP_MULLHi_P64 : Op<(call "vmull", - (cast "poly64_t", (call "vget_high", $p0)), - (cast "poly64_t", (call "vget_high", $p1)))>; -def OP_MULLHi_N : Op<(call "vmull_n", (call "vget_high", $p0), $p1)>; -def OP_MLALHi : Op<(call "vmlal", $p0, (call "vget_high", $p1), - (call "vget_high", $p2))>; -def OP_MLALHi_N : Op<(call "vmlal_n", $p0, (call "vget_high", $p1), $p2)>; -def OP_MLS : Op<(op "-", $p0, (op "*", $p1, $p2))>; -def OP_MLSL : Op<(op "-", $p0, (call "vmull", $p1, $p2))>; -def OP_MLSLHi : Op<(call "vmlsl", $p0, (call "vget_high", $p1), - (call "vget_high", $p2))>; -def OP_MLSLHi_N : Op<(call "vmlsl_n", $p0, (call "vget_high", $p1), $p2)>; -def OP_MUL_N : Op<(op "*", $p0, (dup $p1))>; -def OP_MLA_N : Op<(op "+", $p0, (op "*", $p1, (dup $p2)))>; -def OP_MLS_N : Op<(op "-", $p0, (op "*", $p1, (dup $p2)))>; -def OP_FMLA_N : Op<(call "vfma", $p0, $p1, (dup $p2))>; -def OP_FMLS_N : Op<(call "vfms", $p0, $p1, (dup $p2))>; -def OP_MLAL_N : Op<(op "+", $p0, (call "vmull", $p1, (dup $p2)))>; -def OP_MLSL_N : Op<(op "-", $p0, (call "vmull", $p1, (dup $p2)))>; -def OP_MUL_LN : Op<(op "*", $p0, (splat $p1, $p2))>; -def OP_MULX_LN : Op<(call "vmulx", $p0, (splat $p1, $p2))>; -def OP_MULL_LN : Op<(call "vmull", $p0, (splat $p1, $p2))>; -def OP_MULLHi_LN: Op<(call "vmull", (call "vget_high", $p0), (splat $p1, $p2))>; -def OP_MLA_LN : Op<(op "+", $p0, (op "*", $p1, (splat $p2, $p3)))>; -def OP_MLS_LN : Op<(op "-", $p0, (op "*", $p1, (splat $p2, $p3)))>; -def OP_MLAL_LN : Op<(op "+", $p0, (call "vmull", $p1, (splat $p2, $p3)))>; -def OP_MLALHi_LN: Op<(op "+", $p0, (call "vmull", (call "vget_high", $p1), - (splat $p2, $p3)))>; -def OP_MLSL_LN : Op<(op "-", $p0, (call "vmull", $p1, (splat $p2, $p3)))>; -def OP_MLSLHi_LN : Op<(op "-", $p0, (call "vmull", (call "vget_high", $p1), - (splat $p2, $p3)))>; -def OP_QDMULL_LN : Op<(call "vqdmull", $p0, (splat $p1, $p2))>; -def OP_QDMULLHi_LN : Op<(call "vqdmull", (call "vget_high", $p0), - (splat $p1, $p2))>; -def OP_QDMLAL_LN : Op<(call "vqdmlal", $p0, $p1, (splat $p2, $p3))>; -def OP_QDMLALHi_LN : Op<(call "vqdmlal", $p0, (call "vget_high", $p1), - (splat $p2, $p3))>; -def OP_QDMLSL_LN : Op<(call "vqdmlsl", $p0, $p1, (splat $p2, $p3))>; -def OP_QDMLSLHi_LN : Op<(call "vqdmlsl", $p0, (call "vget_high", $p1), - (splat $p2, $p3))>; -def OP_QDMULH_LN : Op<(call "vqdmulh", $p0, (splat $p1, $p2))>; -def OP_QRDMULH_LN : Op<(call "vqrdmulh", $p0, (splat $p1, $p2))>; -def OP_QRDMLAH : Op<(call "vqadd", $p0, (call "vqrdmulh", $p1, $p2))>; -def OP_QRDMLSH : Op<(call "vqsub", $p0, (call "vqrdmulh", $p1, $p2))>; -def OP_QRDMLAH_LN : Op<(call "vqadd", $p0, (call "vqrdmulh", $p1, (splat $p2, $p3)))>; -def OP_QRDMLSH_LN : Op<(call "vqsub", $p0, (call "vqrdmulh", $p1, (splat $p2, $p3)))>; -def OP_FMS_LN : Op<(call "vfma_lane", $p0, $p1, (op "-", $p2), $p3)>; -def OP_FMS_LNQ : Op<(call "vfma_laneq", $p0, $p1, (op "-", $p2), $p3)>; -def OP_TRN1 : Op<(shuffle $p0, $p1, (interleave (decimate mask0, 2), - (decimate mask1, 2)))>; -def OP_ZIP1 : Op<(shuffle $p0, $p1, (lowhalf (interleave mask0, mask1)))>; -def OP_UZP1 : Op<(shuffle $p0, $p1, (add (decimate mask0, 2), - (decimate mask1, 2)))>; -def OP_TRN2 : Op<(shuffle $p0, $p1, (interleave - (decimate (rotl mask0, 1), 2), - (decimate (rotl mask1, 1), 2)))>; -def OP_ZIP2 : Op<(shuffle $p0, $p1, (highhalf (interleave mask0, mask1)))>; -def OP_UZP2 : Op<(shuffle $p0, $p1, (add (decimate (rotl mask0, 1), 2), - (decimate (rotl mask1, 1), 2)))>; -def OP_EQ : Op<(cast "R", (op "==", $p0, $p1))>; -def OP_GE : Op<(cast "R", (op ">=", $p0, $p1))>; -def OP_LE : Op<(cast "R", (op "<=", $p0, $p1))>; -def OP_GT : Op<(cast "R", (op ">", $p0, $p1))>; -def OP_LT : Op<(cast "R", (op "<", $p0, $p1))>; -def OP_NEG : Op<(op "-", $p0)>; -def OP_NOT : Op<(op "~", $p0)>; -def OP_AND : Op<(op "&", $p0, $p1)>; -def OP_OR : Op<(op "|", $p0, $p1)>; -def OP_XOR : Op<(op "^", $p0, $p1)>; -def OP_ANDN : Op<(op "&", $p0, (op "~", $p1))>; -def OP_ORN : Op<(op "|", $p0, (op "~", $p1))>; -def OP_CAST : Op<(cast "R", $p0)>; -def OP_HI : Op<(shuffle $p0, $p0, (highhalf mask0))>; -def OP_LO : Op<(shuffle $p0, $p0, (lowhalf mask0))>; -def OP_CONC : Op<(shuffle $p0, $p1, (add mask0, mask1))>; -def OP_DUP : Op<(dup $p0)>; -def OP_DUP_LN : Op<(splat $p0, $p1)>; -def OP_SEL : Op<(cast "R", (op "|", - (op "&", $p0, (cast $p0, $p1)), - (op "&", (op "~", $p0), (cast $p0, $p2))))>; -def OP_REV16 : Op<(shuffle $p0, $p0, (rev 16, mask0))>; -def OP_REV32 : Op<(shuffle $p0, $p0, (rev 32, mask0))>; -def OP_REV64 : Op<(shuffle $p0, $p0, (rev 64, mask0))>; -def OP_XTN : Op<(call "vcombine", $p0, (call "vmovn", $p1))>; -def OP_SQXTUN : Op<(call "vcombine", (cast $p0, "U", $p0), - (call "vqmovun", $p1))>; -def OP_QXTN : Op<(call "vcombine", $p0, (call "vqmovn", $p1))>; -def OP_VCVT_NA_HI_F16 : Op<(call "vcombine", $p0, (call "vcvt_f16_f32", $p1))>; -def OP_VCVT_NA_HI_F32 : Op<(call "vcombine", $p0, (call "vcvt_f32_f64", $p1))>; -def OP_VCVT_EX_HI_F32 : Op<(call "vcvt_f32_f16", (call "vget_high", $p0))>; -def OP_VCVT_EX_HI_F64 : Op<(call "vcvt_f64_f32", (call "vget_high", $p0))>; -def OP_VCVTX_HI : Op<(call "vcombine", $p0, (call "vcvtx_f32", $p1))>; -def OP_REINT : Op<(cast "R", $p0)>; -def OP_ADDHNHi : Op<(call "vcombine", $p0, (call "vaddhn", $p1, $p2))>; -def OP_RADDHNHi : Op<(call "vcombine", $p0, (call "vraddhn", $p1, $p2))>; -def OP_SUBHNHi : Op<(call "vcombine", $p0, (call "vsubhn", $p1, $p2))>; -def OP_RSUBHNHi : Op<(call "vcombine", $p0, (call "vrsubhn", $p1, $p2))>; -def OP_ABDL : Op<(cast "R", (call "vmovl", (cast $p0, "U", - (call "vabd", $p0, $p1))))>; -def OP_ABDLHi : Op<(call "vabdl", (call "vget_high", $p0), - (call "vget_high", $p1))>; -def OP_ABA : Op<(op "+", $p0, (call "vabd", $p1, $p2))>; -def OP_ABAL : Op<(op "+", $p0, (call "vabdl", $p1, $p2))>; -def OP_ABALHi : Op<(call "vabal", $p0, (call "vget_high", $p1), - (call "vget_high", $p2))>; -def OP_QDMULLHi : Op<(call "vqdmull", (call "vget_high", $p0), - (call "vget_high", $p1))>; -def OP_QDMULLHi_N : Op<(call "vqdmull_n", (call "vget_high", $p0), $p1)>; -def OP_QDMLALHi : Op<(call "vqdmlal", $p0, (call "vget_high", $p1), - (call "vget_high", $p2))>; -def OP_QDMLALHi_N : Op<(call "vqdmlal_n", $p0, (call "vget_high", $p1), $p2)>; -def OP_QDMLSLHi : Op<(call "vqdmlsl", $p0, (call "vget_high", $p1), - (call "vget_high", $p2))>; -def OP_QDMLSLHi_N : Op<(call "vqdmlsl_n", $p0, (call "vget_high", $p1), $p2)>; -def OP_DIV : Op<(op "/", $p0, $p1)>; -def OP_LONG_HI : Op<(cast "R", (call (name_replace "_high_", "_"), - (call "vget_high", $p0), $p1))>; -def OP_NARROW_HI : Op<(cast "R", (call "vcombine", - (cast "R", "H", $p0), - (cast "R", "H", - (call (name_replace "_high_", "_"), - $p1, $p2))))>; -def OP_MOVL_HI : LOp<[(save_temp $a1, (call "vget_high", $p0)), - (cast "R", - (call "vshll_n", $a1, (literal "int32_t", "0")))]>; -def OP_COPY_LN : Op<(call "vset_lane", (call "vget_lane", $p2, $p3), $p0, $p1)>; -def OP_SCALAR_MUL_LN : Op<(op "*", $p0, (call "vget_lane", $p1, $p2))>; -def OP_SCALAR_MULX_LN : Op<(call "vmulx", $p0, (call "vget_lane", $p1, $p2))>; -def OP_SCALAR_VMULX_LN : LOp<[(save_temp $x, (call "vget_lane", $p0, - (literal "int32_t", "0"))), - (save_temp $y, (call "vget_lane", $p1, $p2)), - (save_temp $z, (call "vmulx", $x, $y)), - (call "vset_lane", $z, $p0, $p2)]>; -def OP_SCALAR_VMULX_LNQ : LOp<[(save_temp $x, (call "vget_lane", $p0, - (literal "int32_t", "0"))), - (save_temp $y, (call "vget_lane", $p1, $p2)), - (save_temp $z, (call "vmulx", $x, $y)), - (call "vset_lane", $z, $p0, (literal "int32_t", - "0"))]>; -class ScalarMulOp<string opname> : - Op<(call opname, $p0, (call "vget_lane", $p1, $p2))>; - -def OP_SCALAR_QDMULL_LN : ScalarMulOp<"vqdmull">; -def OP_SCALAR_QDMULH_LN : ScalarMulOp<"vqdmulh">; -def OP_SCALAR_QRDMULH_LN : ScalarMulOp<"vqrdmulh">; - -def OP_SCALAR_QRDMLAH_LN : Op<(call "vqadd", $p0, (call "vqrdmulh", $p1, - (call "vget_lane", $p2, $p3)))>; -def OP_SCALAR_QRDMLSH_LN : Op<(call "vqsub", $p0, (call "vqrdmulh", $p1, - (call "vget_lane", $p2, $p3)))>; - -def OP_SCALAR_HALF_GET_LN : Op<(bitcast "float16_t", - (call "vget_lane", - (bitcast "int16x4_t", $p0), $p1))>; -def OP_SCALAR_HALF_GET_LNQ : Op<(bitcast "float16_t", - (call "vget_lane", - (bitcast "int16x8_t", $p0), $p1))>; -def OP_SCALAR_HALF_SET_LN : Op<(bitcast "float16x4_t", - (call "vset_lane", - (bitcast "int16_t", $p0), - (bitcast "int16x4_t", $p1), $p2))>; -def OP_SCALAR_HALF_SET_LNQ : Op<(bitcast "float16x8_t", - (call "vset_lane", - (bitcast "int16_t", $p0), - (bitcast "int16x8_t", $p1), $p2))>; - -//===----------------------------------------------------------------------===// -// Instructions -//===----------------------------------------------------------------------===// - -//////////////////////////////////////////////////////////////////////////////// -// E.3.1 Addition -def VADD : IOpInst<"vadd", "ddd", - "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUl", OP_ADD>; -def VADDL : SOpInst<"vaddl", "wdd", "csiUcUsUi", OP_ADDL>; -def VADDW : SOpInst<"vaddw", "wwd", "csiUcUsUi", OP_ADDW>; -def VHADD : SInst<"vhadd", "ddd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VRHADD : SInst<"vrhadd", "ddd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VQADD : SInst<"vqadd", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VADDHN : IInst<"vaddhn", "hkk", "silUsUiUl">; -def VRADDHN : IInst<"vraddhn", "hkk", "silUsUiUl">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.2 Multiplication -def VMUL : IOpInst<"vmul", "ddd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_MUL>; -def VMULP : SInst<"vmul", "ddd", "PcQPc">; -def VMLA : IOpInst<"vmla", "dddd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_MLA>; -def VMLAL : SOpInst<"vmlal", "wwdd", "csiUcUsUi", OP_MLAL>; -def VMLS : IOpInst<"vmls", "dddd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_MLS>; -def VMLSL : SOpInst<"vmlsl", "wwdd", "csiUcUsUi", OP_MLSL>; -def VQDMULH : SInst<"vqdmulh", "ddd", "siQsQi">; -def VQRDMULH : SInst<"vqrdmulh", "ddd", "siQsQi">; - -let ArchGuard = "defined(__ARM_FEATURE_QRDMX)" in { -def VQRDMLAH : SOpInst<"vqrdmlah", "dddd", "siQsQi", OP_QRDMLAH>; -def VQRDMLSH : SOpInst<"vqrdmlsh", "dddd", "siQsQi", OP_QRDMLSH>; -} - -def VQDMLAL : SInst<"vqdmlal", "wwdd", "si">; -def VQDMLSL : SInst<"vqdmlsl", "wwdd", "si">; -def VMULL : SInst<"vmull", "wdd", "csiUcUsUiPc">; -def VQDMULL : SInst<"vqdmull", "wdd", "si">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.3 Subtraction -def VSUB : IOpInst<"vsub", "ddd", - "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUl", OP_SUB>; -def VSUBL : SOpInst<"vsubl", "wdd", "csiUcUsUi", OP_SUBL>; -def VSUBW : SOpInst<"vsubw", "wwd", "csiUcUsUi", OP_SUBW>; -def VQSUB : SInst<"vqsub", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VHSUB : SInst<"vhsub", "ddd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VSUBHN : IInst<"vsubhn", "hkk", "silUsUiUl">; -def VRSUBHN : IInst<"vrsubhn", "hkk", "silUsUiUl">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.4 Comparison -def VCEQ : IOpInst<"vceq", "udd", "csifUcUsUiPcQcQsQiQfQUcQUsQUiQPc", OP_EQ>; -def VCGE : SOpInst<"vcge", "udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_GE>; -let InstName = "vcge" in -def VCLE : SOpInst<"vcle", "udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_LE>; -def VCGT : SOpInst<"vcgt", "udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_GT>; -let InstName = "vcgt" in -def VCLT : SOpInst<"vclt", "udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_LT>; -let InstName = "vacge" in { -def VCAGE : IInst<"vcage", "udd", "fQf">; -def VCALE : IInst<"vcale", "udd", "fQf">; -} -let InstName = "vacgt" in { -def VCAGT : IInst<"vcagt", "udd", "fQf">; -def VCALT : IInst<"vcalt", "udd", "fQf">; -} -def VTST : WInst<"vtst", "udd", "csiUcUsUiPcPsQcQsQiQUcQUsQUiQPcQPs">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.5 Absolute Difference -def VABD : SInst<"vabd", "ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">; -def VABDL : SOpInst<"vabdl", "wdd", "csiUcUsUi", OP_ABDL>; -def VABA : SOpInst<"vaba", "dddd", "csiUcUsUiQcQsQiQUcQUsQUi", OP_ABA>; -def VABAL : SOpInst<"vabal", "wwdd", "csiUcUsUi", OP_ABAL>; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.6 Max/Min -def VMAX : SInst<"vmax", "ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">; -def VMIN : SInst<"vmin", "ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.7 Pairwise Addition -def VPADD : IInst<"vpadd", "ddd", "csiUcUsUif">; -def VPADDL : SInst<"vpaddl", "nd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VPADAL : SInst<"vpadal", "nnd", "csiUcUsUiQcQsQiQUcQUsQUi">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.8-9 Folding Max/Min -def VPMAX : SInst<"vpmax", "ddd", "csiUcUsUif">; -def VPMIN : SInst<"vpmin", "ddd", "csiUcUsUif">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.10 Reciprocal/Sqrt -def VRECPS : IInst<"vrecps", "ddd", "fQf">; -def VRSQRTS : IInst<"vrsqrts", "ddd", "fQf">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.11 Shifts by signed variable -def VSHL : SInst<"vshl", "ddx", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VQSHL : SInst<"vqshl", "ddx", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VRSHL : SInst<"vrshl", "ddx", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VQRSHL : SInst<"vqrshl", "ddx", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.12 Shifts by constant -let isShift = 1 in { -def VSHR_N : SInst<"vshr_n", "ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VSHL_N : IInst<"vshl_n", "ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VRSHR_N : SInst<"vrshr_n", "ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VSRA_N : SInst<"vsra_n", "dddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VRSRA_N : SInst<"vrsra_n", "dddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VQSHL_N : SInst<"vqshl_n", "ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">; -def VQSHLU_N : SInst<"vqshlu_n", "udi", "csilQcQsQiQl">; -def VSHRN_N : IInst<"vshrn_n", "hki", "silUsUiUl">; -def VQSHRUN_N : SInst<"vqshrun_n", "eki", "sil">; -def VQRSHRUN_N : SInst<"vqrshrun_n", "eki", "sil">; -def VQSHRN_N : SInst<"vqshrn_n", "hki", "silUsUiUl">; -def VRSHRN_N : IInst<"vrshrn_n", "hki", "silUsUiUl">; -def VQRSHRN_N : SInst<"vqrshrn_n", "hki", "silUsUiUl">; -def VSHLL_N : SInst<"vshll_n", "wdi", "csiUcUsUi">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.13 Shifts with insert -def VSRI_N : WInst<"vsri_n", "dddi", - "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPs">; -def VSLI_N : WInst<"vsli_n", "dddi", - "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPs">; -} - -//////////////////////////////////////////////////////////////////////////////// -// E.3.14 Loads and stores of a single vector -def VLD1 : WInst<"vld1", "dc", - "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD1_LANE : WInst<"vld1_lane", "dcdi", - "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD1_DUP : WInst<"vld1_dup", "dc", - "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VST1 : WInst<"vst1", "vpd", - "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VST1_LANE : WInst<"vst1_lane", "vpdi", - "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.15 Loads and stores of an N-element structure -def VLD2 : WInst<"vld2", "2c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD3 : WInst<"vld3", "3c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD4 : WInst<"vld4", "4c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD2_DUP : WInst<"vld2_dup", "2c", "UcUsUiUlcsilhfPcPs">; -def VLD3_DUP : WInst<"vld3_dup", "3c", "UcUsUiUlcsilhfPcPs">; -def VLD4_DUP : WInst<"vld4_dup", "4c", "UcUsUiUlcsilhfPcPs">; -def VLD2_LANE : WInst<"vld2_lane", "2c2i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; -def VLD3_LANE : WInst<"vld3_lane", "3c3i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; -def VLD4_LANE : WInst<"vld4_lane", "4c4i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; -def VST2 : WInst<"vst2", "vp2", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VST3 : WInst<"vst3", "vp3", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VST4 : WInst<"vst4", "vp4", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VST2_LANE : WInst<"vst2_lane", "vp2i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; -def VST3_LANE : WInst<"vst3_lane", "vp3i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; -def VST4_LANE : WInst<"vst4_lane", "vp4i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.16 Extract lanes from a vector -let InstName = "vmov" in -def VGET_LANE : IInst<"vget_lane", "sdi", - "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.17 Set lanes within a vector -let InstName = "vmov" in -def VSET_LANE : IInst<"vset_lane", "dsdi", - "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.18 Initialize a vector from bit pattern -def VCREATE : NoTestOpInst<"vcreate", "dl", "csihfUcUsUiUlPcPsl", OP_CAST> { - let BigEndianSafe = 1; -} - -//////////////////////////////////////////////////////////////////////////////// -// E.3.19 Set all lanes to same value -let InstName = "vmov" in { -def VDUP_N : WOpInst<"vdup_n", "ds", - "UcUsUicsiPcPshfQUcQUsQUiQcQsQiQPcQPsQhQflUlQlQUl", - OP_DUP>; -def VMOV_N : WOpInst<"vmov_n", "ds", - "UcUsUicsiPcPshfQUcQUsQUiQcQsQiQPcQPsQhQflUlQlQUl", - OP_DUP>; -} -let InstName = "" in -def VDUP_LANE: WOpInst<"vdup_lane", "dgi", - "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl", - OP_DUP_LN>; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.20 Combining vectors -def VCOMBINE : NoTestOpInst<"vcombine", "kdd", "csilhfUcUsUiUlPcPs", OP_CONC>; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.21 Splitting vectors -let InstName = "vmov" in { -def VGET_HIGH : NoTestOpInst<"vget_high", "dk", "csilhfUcUsUiUlPcPs", OP_HI>; -def VGET_LOW : NoTestOpInst<"vget_low", "dk", "csilhfUcUsUiUlPcPs", OP_LO>; -} - -//////////////////////////////////////////////////////////////////////////////// -// E.3.22 Converting vectors - -def VCVT_F16_F32 : SInst<"vcvt_f16_f32", "md", "Hf">; -def VCVT_F32_F16 : SInst<"vcvt_f32_f16", "wd", "h">; - -def VCVT_S32 : SInst<"vcvt_s32", "xd", "fQf">; -def VCVT_U32 : SInst<"vcvt_u32", "ud", "fQf">; -def VCVT_F32 : SInst<"vcvt_f32", "fd", "iUiQiQUi">; -let isVCVT_N = 1 in { -def VCVT_N_S32 : SInst<"vcvt_n_s32", "xdi", "fQf">; -def VCVT_N_U32 : SInst<"vcvt_n_u32", "udi", "fQf">; -def VCVT_N_F32 : SInst<"vcvt_n_f32", "fdi", "iUiQiQUi">; -} - -def VMOVN : IInst<"vmovn", "hk", "silUsUiUl">; -def VMOVL : SInst<"vmovl", "wd", "csiUcUsUi">; -def VQMOVN : SInst<"vqmovn", "hk", "silUsUiUl">; -def VQMOVUN : SInst<"vqmovun", "ek", "sil">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.23-24 Table lookup, Extended table lookup -let InstName = "vtbl" in { -def VTBL1 : WInst<"vtbl1", "ddt", "UccPc">; -def VTBL2 : WInst<"vtbl2", "d2t", "UccPc">; -def VTBL3 : WInst<"vtbl3", "d3t", "UccPc">; -def VTBL4 : WInst<"vtbl4", "d4t", "UccPc">; -} -let InstName = "vtbx" in { -def VTBX1 : WInst<"vtbx1", "dddt", "UccPc">; -def VTBX2 : WInst<"vtbx2", "dd2t", "UccPc">; -def VTBX3 : WInst<"vtbx3", "dd3t", "UccPc">; -def VTBX4 : WInst<"vtbx4", "dd4t", "UccPc">; -} - -//////////////////////////////////////////////////////////////////////////////// -// E.3.25 Operations with a scalar value -def VMLA_LANE : IOpInst<"vmla_lane", "dddgi", - "siUsUifQsQiQUsQUiQf", OP_MLA_LN>; -def VMLAL_LANE : SOpInst<"vmlal_lane", "wwddi", "siUsUi", OP_MLAL_LN>; -def VQDMLAL_LANE : SOpInst<"vqdmlal_lane", "wwddi", "si", OP_QDMLAL_LN>; -def VMLS_LANE : IOpInst<"vmls_lane", "dddgi", - "siUsUifQsQiQUsQUiQf", OP_MLS_LN>; -def VMLSL_LANE : SOpInst<"vmlsl_lane", "wwddi", "siUsUi", OP_MLSL_LN>; -def VQDMLSL_LANE : SOpInst<"vqdmlsl_lane", "wwddi", "si", OP_QDMLSL_LN>; -def VMUL_N : IOpInst<"vmul_n", "dds", "sifUsUiQsQiQfQUsQUi", OP_MUL_N>; -def VMUL_LANE : IOpInst<"vmul_lane", "ddgi", - "sifUsUiQsQiQfQUsQUi", OP_MUL_LN>; -def VMULL_N : SInst<"vmull_n", "wda", "siUsUi">; -def VMULL_LANE : SOpInst<"vmull_lane", "wddi", "siUsUi", OP_MULL_LN>; -def VQDMULL_N : SInst<"vqdmull_n", "wda", "si">; -def VQDMULL_LANE : SOpInst<"vqdmull_lane", "wddi", "si", OP_QDMULL_LN>; -def VQDMULH_N : SInst<"vqdmulh_n", "dda", "siQsQi">; -def VQDMULH_LANE : SOpInst<"vqdmulh_lane", "ddgi", "siQsQi", OP_QDMULH_LN>; -def VQRDMULH_N : SInst<"vqrdmulh_n", "dda", "siQsQi">; -def VQRDMULH_LANE : SOpInst<"vqrdmulh_lane", "ddgi", "siQsQi", OP_QRDMULH_LN>; - -let ArchGuard = "defined(__ARM_FEATURE_QRDMX)" in { -def VQRDMLAH_LANE : SOpInst<"vqrdmlah_lane", "dddgi", "siQsQi", OP_QRDMLAH_LN>; -def VQRDMLSH_LANE : SOpInst<"vqrdmlsh_lane", "dddgi", "siQsQi", OP_QRDMLSH_LN>; -} - -def VMLA_N : IOpInst<"vmla_n", "ddda", "siUsUifQsQiQUsQUiQf", OP_MLA_N>; -def VMLAL_N : SOpInst<"vmlal_n", "wwda", "siUsUi", OP_MLAL_N>; -def VQDMLAL_N : SInst<"vqdmlal_n", "wwda", "si">; -def VMLS_N : IOpInst<"vmls_n", "ddds", "siUsUifQsQiQUsQUiQf", OP_MLS_N>; -def VMLSL_N : SOpInst<"vmlsl_n", "wwda", "siUsUi", OP_MLSL_N>; -def VQDMLSL_N : SInst<"vqdmlsl_n", "wwda", "si">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.26 Vector Extract -def VEXT : WInst<"vext", "dddi", - "cUcPcsUsPsiUilUlfQcQUcQPcQsQUsQPsQiQUiQlQUlQf">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.27 Reverse vector elements -def VREV64 : WOpInst<"vrev64", "dd", "csiUcUsUiPcPsfQcQsQiQUcQUsQUiQPcQPsQf", - OP_REV64>; -def VREV32 : WOpInst<"vrev32", "dd", "csUcUsPcPsQcQsQUcQUsQPcQPs", OP_REV32>; -def VREV16 : WOpInst<"vrev16", "dd", "cUcPcQcQUcQPc", OP_REV16>; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.28 Other single operand arithmetic -def VABS : SInst<"vabs", "dd", "csifQcQsQiQf">; -def VQABS : SInst<"vqabs", "dd", "csiQcQsQi">; -def VNEG : SOpInst<"vneg", "dd", "csifQcQsQiQf", OP_NEG>; -def VQNEG : SInst<"vqneg", "dd", "csiQcQsQi">; -def VCLS : SInst<"vcls", "dd", "csiQcQsQi">; -def VCLZ : IInst<"vclz", "dd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VCNT : WInst<"vcnt", "dd", "UccPcQUcQcQPc">; -def VRECPE : SInst<"vrecpe", "dd", "fUiQfQUi">; -def VRSQRTE : SInst<"vrsqrte", "dd", "fUiQfQUi">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.29 Logical operations -def VMVN : LOpInst<"vmvn", "dd", "csiUcUsUiPcQcQsQiQUcQUsQUiQPc", OP_NOT>; -def VAND : LOpInst<"vand", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_AND>; -def VORR : LOpInst<"vorr", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_OR>; -def VEOR : LOpInst<"veor", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_XOR>; -def VBIC : LOpInst<"vbic", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_ANDN>; -def VORN : LOpInst<"vorn", "ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_ORN>; -let isHiddenLInst = 1 in -def VBSL : SInst<"vbsl", "dudd", - "csilUcUsUiUlfPcPsQcQsQiQlQUcQUsQUiQUlQfQPcQPs">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.30 Transposition operations -def VTRN : WInst<"vtrn", "2dd", "csiUcUsUifPcPsQcQsQiQUcQUsQUiQfQPcQPs">; -def VZIP : WInst<"vzip", "2dd", "csiUcUsUifPcPsQcQsQiQUcQUsQUiQfQPcQPs">; -def VUZP : WInst<"vuzp", "2dd", "csiUcUsUifPcPsQcQsQiQUcQUsQUiQfQPcQPs">; - -//////////////////////////////////////////////////////////////////////////////// -// E.3.31 Vector reinterpret cast operations -def VREINTERPRET - : NoTestOpInst<"vreinterpret", "dd", - "csilUcUsUiUlhfPcPsQcQsQiQlQUcQUsQUiQUlQhQfQPcQPs", OP_REINT> { - let CartesianProductOfTypes = 1; - let ArchGuard = "!defined(__aarch64__)"; - let BigEndianSafe = 1; -} - -//////////////////////////////////////////////////////////////////////////////// -// Vector fused multiply-add operations - -def VFMA : SInst<"vfma", "dddd", "fQf">; - -//////////////////////////////////////////////////////////////////////////////// -// fp16 vector operations -def SCALAR_HALF_GET_LANE : IOpInst<"vget_lane", "sdi", "h", OP_SCALAR_HALF_GET_LN>; -def SCALAR_HALF_SET_LANE : IOpInst<"vset_lane", "dsdi", "h", OP_SCALAR_HALF_SET_LN>; -def SCALAR_HALF_GET_LANEQ : IOpInst<"vget_lane", "sdi", "Qh", OP_SCALAR_HALF_GET_LNQ>; -def SCALAR_HALF_SET_LANEQ : IOpInst<"vset_lane", "dsdi", "Qh", OP_SCALAR_HALF_SET_LNQ>; - -//////////////////////////////////////////////////////////////////////////////// -// AArch64 Intrinsics - -let ArchGuard = "defined(__aarch64__)" in { - -//////////////////////////////////////////////////////////////////////////////// -// Load/Store -def LD1 : WInst<"vld1", "dc", "dQdPlQPl">; -def LD2 : WInst<"vld2", "2c", "QUlQldQdPlQPl">; -def LD3 : WInst<"vld3", "3c", "QUlQldQdPlQPl">; -def LD4 : WInst<"vld4", "4c", "QUlQldQdPlQPl">; -def ST1 : WInst<"vst1", "vpd", "dQdPlQPl">; -def ST2 : WInst<"vst2", "vp2", "QUlQldQdPlQPl">; -def ST3 : WInst<"vst3", "vp3", "QUlQldQdPlQPl">; -def ST4 : WInst<"vst4", "vp4", "QUlQldQdPlQPl">; - -def LD1_X2 : WInst<"vld1_x2", "2c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def LD3_x3 : WInst<"vld1_x3", "3c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def LD4_x4 : WInst<"vld1_x4", "4c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; - -def ST1_X2 : WInst<"vst1_x2", "vp2", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def ST1_X3 : WInst<"vst1_x3", "vp3", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def ST1_X4 : WInst<"vst1_x4", "vp4", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; - -def LD1_LANE : WInst<"vld1_lane", "dcdi", "dQdPlQPl">; -def LD2_LANE : WInst<"vld2_lane", "2c2i", "lUlQcQUcQPcQlQUldQdPlQPl">; -def LD3_LANE : WInst<"vld3_lane", "3c3i", "lUlQcQUcQPcQlQUldQdPlQPl">; -def LD4_LANE : WInst<"vld4_lane", "4c4i", "lUlQcQUcQPcQlQUldQdPlQPl">; -def ST1_LANE : WInst<"vst1_lane", "vpdi", "dQdPlQPl">; -def ST2_LANE : WInst<"vst2_lane", "vp2i", "lUlQcQUcQPcQlQUldQdPlQPl">; -def ST3_LANE : WInst<"vst3_lane", "vp3i", "lUlQcQUcQPcQlQUldQdPlQPl">; -def ST4_LANE : WInst<"vst4_lane", "vp4i", "lUlQcQUcQPcQlQUldQdPlQPl">; - -def LD1_DUP : WInst<"vld1_dup", "dc", "dQdPlQPl">; -def LD2_DUP : WInst<"vld2_dup", "2c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; -def LD3_DUP : WInst<"vld3_dup", "3c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; -def LD4_DUP : WInst<"vld4_dup", "4c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; - -def VLDRQ : WInst<"vldrq", "sc", "Pk">; -def VSTRQ : WInst<"vstrq", "vps", "Pk">; - -//////////////////////////////////////////////////////////////////////////////// -// Addition -def ADD : IOpInst<"vadd", "ddd", "dQd", OP_ADD>; - -//////////////////////////////////////////////////////////////////////////////// -// Subtraction -def SUB : IOpInst<"vsub", "ddd", "dQd", OP_SUB>; - -//////////////////////////////////////////////////////////////////////////////// -// Multiplication -def MUL : IOpInst<"vmul", "ddd", "dQd", OP_MUL>; -def MLA : IOpInst<"vmla", "dddd", "dQd", OP_MLA>; -def MLS : IOpInst<"vmls", "dddd", "dQd", OP_MLS>; - -//////////////////////////////////////////////////////////////////////////////// -// Multiplication Extended -def MULX : SInst<"vmulx", "ddd", "fdQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Division -def FDIV : IOpInst<"vdiv", "ddd", "fdQfQd", OP_DIV>; - -//////////////////////////////////////////////////////////////////////////////// -// Vector fused multiply-add operations -def FMLA : SInst<"vfma", "dddd", "dQd">; -def FMLS : SInst<"vfms", "dddd", "fdQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// MUL, MLA, MLS, FMA, FMS definitions with scalar argument -def VMUL_N_A64 : IOpInst<"vmul_n", "dds", "Qd", OP_MUL_N>; - -def FMLA_N : SOpInst<"vfma_n", "ddds", "fQfQd", OP_FMLA_N>; -def FMLS_N : SOpInst<"vfms_n", "ddds", "fQfQd", OP_FMLS_N>; - -def MLA_N : SOpInst<"vmla_n", "ddds", "Qd", OP_MLA_N>; -def MLS_N : SOpInst<"vmls_n", "ddds", "Qd", OP_MLS_N>; - -//////////////////////////////////////////////////////////////////////////////// -// Logical operations -def BSL : SInst<"vbsl", "dudd", "dPlQdQPl">; - -//////////////////////////////////////////////////////////////////////////////// -// Absolute Difference -def ABD : SInst<"vabd", "ddd", "dQd">; - -//////////////////////////////////////////////////////////////////////////////// -// saturating absolute/negate -def ABS : SInst<"vabs", "dd", "dQdlQl">; -def QABS : SInst<"vqabs", "dd", "lQl">; -def NEG : SOpInst<"vneg", "dd", "dlQdQl", OP_NEG>; -def QNEG : SInst<"vqneg", "dd", "lQl">; - -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Accumulated of Unsigned Value -def SUQADD : SInst<"vuqadd", "ddd", "csilQcQsQiQl">; - -//////////////////////////////////////////////////////////////////////////////// -// Unsigned Saturating Accumulated of Signed Value -def USQADD : SInst<"vsqadd", "ddd", "UcUsUiUlQUcQUsQUiQUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Reciprocal/Sqrt -def FRECPS : IInst<"vrecps", "ddd", "dQd">; -def FRSQRTS : IInst<"vrsqrts", "ddd", "dQd">; -def FRECPE : SInst<"vrecpe", "dd", "dQd">; -def FRSQRTE : SInst<"vrsqrte", "dd", "dQd">; -def FSQRT : SInst<"vsqrt", "dd", "fdQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// bitwise reverse -def RBIT : IInst<"vrbit", "dd", "cUcPcQcQUcQPc">; - -//////////////////////////////////////////////////////////////////////////////// -// Integer extract and narrow to high -def XTN2 : SOpInst<"vmovn_high", "qhk", "silUsUiUl", OP_XTN>; - -//////////////////////////////////////////////////////////////////////////////// -// Signed integer saturating extract and unsigned narrow to high -def SQXTUN2 : SOpInst<"vqmovun_high", "qhk", "sil", OP_SQXTUN>; - -//////////////////////////////////////////////////////////////////////////////// -// Integer saturating extract and narrow to high -def QXTN2 : SOpInst<"vqmovn_high", "qhk", "silUsUiUl", OP_QXTN>; - -//////////////////////////////////////////////////////////////////////////////// -// Converting vectors - -def VCVT_F32_F64 : SInst<"vcvt_f32_f64", "md", "Qd">; -def VCVT_F64_F32 : SInst<"vcvt_f64_f32", "wd", "f">; - -def VCVT_S64 : SInst<"vcvt_s64", "xd", "dQd">; -def VCVT_U64 : SInst<"vcvt_u64", "ud", "dQd">; -def VCVT_F64 : SInst<"vcvt_f64", "Fd", "lUlQlQUl">; - -def VCVT_HIGH_F16_F32 : SOpInst<"vcvt_high_f16", "hmj", "Hf", OP_VCVT_NA_HI_F16>; -def VCVT_HIGH_F32_F16 : SOpInst<"vcvt_high_f32", "wk", "h", OP_VCVT_EX_HI_F32>; -def VCVT_HIGH_F32_F64 : SOpInst<"vcvt_high_f32", "qfj", "d", OP_VCVT_NA_HI_F32>; -def VCVT_HIGH_F64_F32 : SOpInst<"vcvt_high_f64", "wj", "f", OP_VCVT_EX_HI_F64>; - -def VCVTX_F32_F64 : SInst<"vcvtx_f32", "fj", "d">; -def VCVTX_HIGH_F32_F64 : SOpInst<"vcvtx_high_f32", "qfj", "d", OP_VCVTX_HI>; - -//////////////////////////////////////////////////////////////////////////////// -// Comparison -def FCAGE : IInst<"vcage", "udd", "dQd">; -def FCAGT : IInst<"vcagt", "udd", "dQd">; -def FCALE : IInst<"vcale", "udd", "dQd">; -def FCALT : IInst<"vcalt", "udd", "dQd">; -def CMTST : WInst<"vtst", "udd", "lUlPlQlQUlQPl">; -def CFMEQ : SOpInst<"vceq", "udd", "lUldQdQlQUlPlQPl", OP_EQ>; -def CFMGE : SOpInst<"vcge", "udd", "lUldQdQlQUl", OP_GE>; -def CFMLE : SOpInst<"vcle", "udd", "lUldQdQlQUl", OP_LE>; -def CFMGT : SOpInst<"vcgt", "udd", "lUldQdQlQUl", OP_GT>; -def CFMLT : SOpInst<"vclt", "udd", "lUldQdQlQUl", OP_LT>; - -def CMEQ : SInst<"vceqz", "ud", - "csilfUcUsUiUlPcPsPlQcQsQiQlQfQUcQUsQUiQUlQPcQPsdQdQPl">; -def CMGE : SInst<"vcgez", "ud", "csilfdQcQsQiQlQfQd">; -def CMLE : SInst<"vclez", "ud", "csilfdQcQsQiQlQfQd">; -def CMGT : SInst<"vcgtz", "ud", "csilfdQcQsQiQlQfQd">; -def CMLT : SInst<"vcltz", "ud", "csilfdQcQsQiQlQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Max/Min Integer -def MAX : SInst<"vmax", "ddd", "dQd">; -def MIN : SInst<"vmin", "ddd", "dQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Pairwise Max/Min -def MAXP : SInst<"vpmax", "ddd", "QcQsQiQUcQUsQUiQfQd">; -def MINP : SInst<"vpmin", "ddd", "QcQsQiQUcQUsQUiQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Pairwise MaxNum/MinNum Floating Point -def FMAXNMP : SInst<"vpmaxnm", "ddd", "fQfQd">; -def FMINNMP : SInst<"vpminnm", "ddd", "fQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Pairwise Addition -def ADDP : IInst<"vpadd", "ddd", "QcQsQiQlQUcQUsQUiQUlQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Shifts by constant -let isShift = 1 in { -// Left shift long high -def SHLL_HIGH_N : SOpInst<"vshll_high_n", "ndi", "HcHsHiHUcHUsHUi", - OP_LONG_HI>; - -//////////////////////////////////////////////////////////////////////////////// -def SRI_N : WInst<"vsri_n", "dddi", "PlQPl">; -def SLI_N : WInst<"vsli_n", "dddi", "PlQPl">; - -// Right shift narrow high -def SHRN_HIGH_N : IOpInst<"vshrn_high_n", "hmdi", - "HsHiHlHUsHUiHUl", OP_NARROW_HI>; -def QSHRUN_HIGH_N : SOpInst<"vqshrun_high_n", "hmdi", - "HsHiHl", OP_NARROW_HI>; -def RSHRN_HIGH_N : IOpInst<"vrshrn_high_n", "hmdi", - "HsHiHlHUsHUiHUl", OP_NARROW_HI>; -def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "hmdi", - "HsHiHl", OP_NARROW_HI>; -def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "hmdi", - "HsHiHlHUsHUiHUl", OP_NARROW_HI>; -def QRSHRN_HIGH_N : SOpInst<"vqrshrn_high_n", "hmdi", - "HsHiHlHUsHUiHUl", OP_NARROW_HI>; -} - -//////////////////////////////////////////////////////////////////////////////// -// Converting vectors -def VMOVL_HIGH : SOpInst<"vmovl_high", "nd", "HcHsHiHUcHUsHUi", OP_MOVL_HI>; - -let isVCVT_N = 1 in { -def CVTF_N_F64 : SInst<"vcvt_n_f64", "Fdi", "lUlQlQUl">; -def FCVTZS_N_S64 : SInst<"vcvt_n_s64", "xdi", "dQd">; -def FCVTZS_N_U64 : SInst<"vcvt_n_u64", "udi", "dQd">; -} - -//////////////////////////////////////////////////////////////////////////////// -// 3VDiff class using high 64-bit in operands -def VADDL_HIGH : SOpInst<"vaddl_high", "wkk", "csiUcUsUi", OP_ADDLHi>; -def VADDW_HIGH : SOpInst<"vaddw_high", "wwk", "csiUcUsUi", OP_ADDWHi>; -def VSUBL_HIGH : SOpInst<"vsubl_high", "wkk", "csiUcUsUi", OP_SUBLHi>; -def VSUBW_HIGH : SOpInst<"vsubw_high", "wwk", "csiUcUsUi", OP_SUBWHi>; - -def VABDL_HIGH : SOpInst<"vabdl_high", "wkk", "csiUcUsUi", OP_ABDLHi>; -def VABAL_HIGH : SOpInst<"vabal_high", "wwkk", "csiUcUsUi", OP_ABALHi>; - -def VMULL_HIGH : SOpInst<"vmull_high", "wkk", "csiUcUsUiPc", OP_MULLHi>; -def VMULL_HIGH_N : SOpInst<"vmull_high_n", "wks", "siUsUi", OP_MULLHi_N>; -def VMLAL_HIGH : SOpInst<"vmlal_high", "wwkk", "csiUcUsUi", OP_MLALHi>; -def VMLAL_HIGH_N : SOpInst<"vmlal_high_n", "wwks", "siUsUi", OP_MLALHi_N>; -def VMLSL_HIGH : SOpInst<"vmlsl_high", "wwkk", "csiUcUsUi", OP_MLSLHi>; -def VMLSL_HIGH_N : SOpInst<"vmlsl_high_n", "wwks", "siUsUi", OP_MLSLHi_N>; - -def VADDHN_HIGH : SOpInst<"vaddhn_high", "qhkk", "silUsUiUl", OP_ADDHNHi>; -def VRADDHN_HIGH : SOpInst<"vraddhn_high", "qhkk", "silUsUiUl", OP_RADDHNHi>; -def VSUBHN_HIGH : SOpInst<"vsubhn_high", "qhkk", "silUsUiUl", OP_SUBHNHi>; -def VRSUBHN_HIGH : SOpInst<"vrsubhn_high", "qhkk", "silUsUiUl", OP_RSUBHNHi>; - -def VQDMULL_HIGH : SOpInst<"vqdmull_high", "wkk", "si", OP_QDMULLHi>; -def VQDMULL_HIGH_N : SOpInst<"vqdmull_high_n", "wks", "si", OP_QDMULLHi_N>; -def VQDMLAL_HIGH : SOpInst<"vqdmlal_high", "wwkk", "si", OP_QDMLALHi>; -def VQDMLAL_HIGH_N : SOpInst<"vqdmlal_high_n", "wwks", "si", OP_QDMLALHi_N>; -def VQDMLSL_HIGH : SOpInst<"vqdmlsl_high", "wwkk", "si", OP_QDMLSLHi>; -def VQDMLSL_HIGH_N : SOpInst<"vqdmlsl_high_n", "wwks", "si", OP_QDMLSLHi_N>; -def VMULL_P64 : SInst<"vmull", "rss", "Pl">; -def VMULL_HIGH_P64 : SOpInst<"vmull_high", "rdd", "HPl", OP_MULLHi_P64>; - - -//////////////////////////////////////////////////////////////////////////////// -// Extract or insert element from vector -def GET_LANE : IInst<"vget_lane", "sdi", "dQdPlQPl">; -def SET_LANE : IInst<"vset_lane", "dsdi", "dQdPlQPl">; -def COPY_LANE : IOpInst<"vcopy_lane", "ddidi", - "csilUcUsUiUlPcPsPlfd", OP_COPY_LN>; -def COPYQ_LANE : IOpInst<"vcopy_lane", "ddigi", - "QcQsQiQlQUcQUsQUiQUlQPcQPsQfQdQPl", OP_COPY_LN>; -def COPY_LANEQ : IOpInst<"vcopy_laneq", "ddiki", - "csilPcPsPlUcUsUiUlfd", OP_COPY_LN>; -def COPYQ_LANEQ : IOpInst<"vcopy_laneq", "ddidi", - "QcQsQiQlQUcQUsQUiQUlQPcQPsQfQdQPl", OP_COPY_LN>; - -//////////////////////////////////////////////////////////////////////////////// -// Set all lanes to same value -def VDUP_LANE1: WOpInst<"vdup_lane", "dgi", "hdQhQdPlQPl", OP_DUP_LN>; -def VDUP_LANE2: WOpInst<"vdup_laneq", "dji", - "csilUcUsUiUlPcPshfdQcQsQiQlQPcQPsQUcQUsQUiQUlQhQfQdPlQPl", - OP_DUP_LN>; -def DUP_N : WOpInst<"vdup_n", "ds", "dQdPlQPl", OP_DUP>; -def MOV_N : WOpInst<"vmov_n", "ds", "dQdPlQPl", OP_DUP>; - -//////////////////////////////////////////////////////////////////////////////// -def COMBINE : NoTestOpInst<"vcombine", "kdd", "dPl", OP_CONC>; - -//////////////////////////////////////////////////////////////////////////////// -//Initialize a vector from bit pattern -def CREATE : NoTestOpInst<"vcreate", "dl", "dPl", OP_CAST> { - let BigEndianSafe = 1; -} - -//////////////////////////////////////////////////////////////////////////////// - -def VMLA_LANEQ : IOpInst<"vmla_laneq", "dddji", - "siUsUifQsQiQUsQUiQf", OP_MLA_LN>; -def VMLS_LANEQ : IOpInst<"vmls_laneq", "dddji", - "siUsUifQsQiQUsQUiQf", OP_MLS_LN>; - -def VFMA_LANE : IInst<"vfma_lane", "dddgi", "fdQfQd">; -def VFMA_LANEQ : IInst<"vfma_laneq", "dddji", "fdQfQd"> { - let isLaneQ = 1; -} -def VFMS_LANE : IOpInst<"vfms_lane", "dddgi", "fdQfQd", OP_FMS_LN>; -def VFMS_LANEQ : IOpInst<"vfms_laneq", "dddji", "fdQfQd", OP_FMS_LNQ>; - -def VMLAL_LANEQ : SOpInst<"vmlal_laneq", "wwdki", "siUsUi", OP_MLAL_LN>; -def VMLAL_HIGH_LANE : SOpInst<"vmlal_high_lane", "wwkdi", "siUsUi", - OP_MLALHi_LN>; -def VMLAL_HIGH_LANEQ : SOpInst<"vmlal_high_laneq", "wwkki", "siUsUi", - OP_MLALHi_LN>; -def VMLSL_LANEQ : SOpInst<"vmlsl_laneq", "wwdki", "siUsUi", OP_MLSL_LN>; -def VMLSL_HIGH_LANE : SOpInst<"vmlsl_high_lane", "wwkdi", "siUsUi", - OP_MLSLHi_LN>; -def VMLSL_HIGH_LANEQ : SOpInst<"vmlsl_high_laneq", "wwkki", "siUsUi", - OP_MLSLHi_LN>; - -def VQDMLAL_LANEQ : SOpInst<"vqdmlal_laneq", "wwdki", "si", OP_QDMLAL_LN>; -def VQDMLAL_HIGH_LANE : SOpInst<"vqdmlal_high_lane", "wwkdi", "si", - OP_QDMLALHi_LN>; -def VQDMLAL_HIGH_LANEQ : SOpInst<"vqdmlal_high_laneq", "wwkki", "si", - OP_QDMLALHi_LN>; -def VQDMLSL_LANEQ : SOpInst<"vqdmlsl_laneq", "wwdki", "si", OP_QDMLSL_LN>; -def VQDMLSL_HIGH_LANE : SOpInst<"vqdmlsl_high_lane", "wwkdi", "si", - OP_QDMLSLHi_LN>; -def VQDMLSL_HIGH_LANEQ : SOpInst<"vqdmlsl_high_laneq", "wwkki", "si", - OP_QDMLSLHi_LN>; - -// Newly add double parameter for vmul_lane in aarch64 -// Note: d type is handled by SCALAR_VMUL_LANE -def VMUL_LANE_A64 : IOpInst<"vmul_lane", "ddgi", "Qd", OP_MUL_LN>; - -// Note: d type is handled by SCALAR_VMUL_LANEQ -def VMUL_LANEQ : IOpInst<"vmul_laneq", "ddji", - "sifUsUiQsQiQUsQUiQfQd", OP_MUL_LN>; -def VMULL_LANEQ : SOpInst<"vmull_laneq", "wdki", "siUsUi", OP_MULL_LN>; -def VMULL_HIGH_LANE : SOpInst<"vmull_high_lane", "wkdi", "siUsUi", - OP_MULLHi_LN>; -def VMULL_HIGH_LANEQ : SOpInst<"vmull_high_laneq", "wkki", "siUsUi", - OP_MULLHi_LN>; - -def VQDMULL_LANEQ : SOpInst<"vqdmull_laneq", "wdki", "si", OP_QDMULL_LN>; -def VQDMULL_HIGH_LANE : SOpInst<"vqdmull_high_lane", "wkdi", "si", - OP_QDMULLHi_LN>; -def VQDMULL_HIGH_LANEQ : SOpInst<"vqdmull_high_laneq", "wkki", "si", - OP_QDMULLHi_LN>; - -def VQDMULH_LANEQ : SOpInst<"vqdmulh_laneq", "ddji", "siQsQi", OP_QDMULH_LN>; -def VQRDMULH_LANEQ : SOpInst<"vqrdmulh_laneq", "ddji", "siQsQi", OP_QRDMULH_LN>; - -let ArchGuard = "defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)" in { -def VQRDMLAH_LANEQ : SOpInst<"vqrdmlah_laneq", "dddji", "siQsQi", OP_QRDMLAH_LN>; -def VQRDMLSH_LANEQ : SOpInst<"vqrdmlsh_laneq", "dddji", "siQsQi", OP_QRDMLSH_LN>; -} - -// Note: d type implemented by SCALAR_VMULX_LANE -def VMULX_LANE : IOpInst<"vmulx_lane", "ddgi", "fQfQd", OP_MULX_LN>; -// Note: d type is implemented by SCALAR_VMULX_LANEQ -def VMULX_LANEQ : IOpInst<"vmulx_laneq", "ddji", "fQfQd", OP_MULX_LN>; - -//////////////////////////////////////////////////////////////////////////////// -// Across vectors class -def VADDLV : SInst<"vaddlv", "rd", "csiUcUsUiQcQsQiQUcQUsQUi">; -def VMAXV : SInst<"vmaxv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQd">; -def VMINV : SInst<"vminv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQd">; -def VADDV : SInst<"vaddv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQdQlQUl">; -def FMAXNMV : SInst<"vmaxnmv", "sd", "fQfQd">; -def FMINNMV : SInst<"vminnmv", "sd", "fQfQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Newly added Vector Extract for f64 -def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">; - -//////////////////////////////////////////////////////////////////////////////// -// Crypto -let ArchGuard = "__ARM_FEATURE_CRYPTO" in { -def AESE : SInst<"vaese", "ddd", "QUc">; -def AESD : SInst<"vaesd", "ddd", "QUc">; -def AESMC : SInst<"vaesmc", "dd", "QUc">; -def AESIMC : SInst<"vaesimc", "dd", "QUc">; - -def SHA1H : SInst<"vsha1h", "ss", "Ui">; -def SHA1SU1 : SInst<"vsha1su1", "ddd", "QUi">; -def SHA256SU0 : SInst<"vsha256su0", "ddd", "QUi">; - -def SHA1C : SInst<"vsha1c", "ddsd", "QUi">; -def SHA1P : SInst<"vsha1p", "ddsd", "QUi">; -def SHA1M : SInst<"vsha1m", "ddsd", "QUi">; -def SHA1SU0 : SInst<"vsha1su0", "dddd", "QUi">; -def SHA256H : SInst<"vsha256h", "dddd", "QUi">; -def SHA256H2 : SInst<"vsha256h2", "dddd", "QUi">; -def SHA256SU1 : SInst<"vsha256su1", "dddd", "QUi">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Float -> Int conversions with explicit rounding mode - -let ArchGuard = "__ARM_ARCH >= 8" in { -def FCVTNS_S32 : SInst<"vcvtn_s32", "xd", "fQf">; -def FCVTNU_S32 : SInst<"vcvtn_u32", "ud", "fQf">; -def FCVTPS_S32 : SInst<"vcvtp_s32", "xd", "fQf">; -def FCVTPU_S32 : SInst<"vcvtp_u32", "ud", "fQf">; -def FCVTMS_S32 : SInst<"vcvtm_s32", "xd", "fQf">; -def FCVTMU_S32 : SInst<"vcvtm_u32", "ud", "fQf">; -def FCVTAS_S32 : SInst<"vcvta_s32", "xd", "fQf">; -def FCVTAU_S32 : SInst<"vcvta_u32", "ud", "fQf">; -} - -let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__)" in { -def FCVTNS_S64 : SInst<"vcvtn_s64", "xd", "dQd">; -def FCVTNU_S64 : SInst<"vcvtn_u64", "ud", "dQd">; -def FCVTPS_S64 : SInst<"vcvtp_s64", "xd", "dQd">; -def FCVTPU_S64 : SInst<"vcvtp_u64", "ud", "dQd">; -def FCVTMS_S64 : SInst<"vcvtm_s64", "xd", "dQd">; -def FCVTMU_S64 : SInst<"vcvtm_u64", "ud", "dQd">; -def FCVTAS_S64 : SInst<"vcvta_s64", "xd", "dQd">; -def FCVTAU_S64 : SInst<"vcvta_u64", "ud", "dQd">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Round to Integral - -let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_DIRECTED_ROUNDING)" in { -def FRINTN_S32 : SInst<"vrndn", "dd", "fQf">; -def FRINTA_S32 : SInst<"vrnda", "dd", "fQf">; -def FRINTP_S32 : SInst<"vrndp", "dd", "fQf">; -def FRINTM_S32 : SInst<"vrndm", "dd", "fQf">; -def FRINTX_S32 : SInst<"vrndx", "dd", "fQf">; -def FRINTZ_S32 : SInst<"vrnd", "dd", "fQf">; -} - -let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__) && defined(__ARM_FEATURE_DIRECTED_ROUNDING)" in { -def FRINTN_S64 : SInst<"vrndn", "dd", "dQd">; -def FRINTA_S64 : SInst<"vrnda", "dd", "dQd">; -def FRINTP_S64 : SInst<"vrndp", "dd", "dQd">; -def FRINTM_S64 : SInst<"vrndm", "dd", "dQd">; -def FRINTX_S64 : SInst<"vrndx", "dd", "dQd">; -def FRINTZ_S64 : SInst<"vrnd", "dd", "dQd">; -def FRINTI_S64 : SInst<"vrndi", "dd", "fdQfQd">; -} - -//////////////////////////////////////////////////////////////////////////////// -// MaxNum/MinNum Floating Point - -let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_NUMERIC_MAXMIN)" in { -def FMAXNM_S32 : SInst<"vmaxnm", "ddd", "fQf">; -def FMINNM_S32 : SInst<"vminnm", "ddd", "fQf">; -} - -let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__) && defined(__ARM_FEATURE_NUMERIC_MAXMIN)" in { -def FMAXNM_S64 : SInst<"vmaxnm", "ddd", "dQd">; -def FMINNM_S64 : SInst<"vminnm", "ddd", "dQd">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Permutation -def VTRN1 : SOpInst<"vtrn1", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_TRN1>; -def VZIP1 : SOpInst<"vzip1", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_ZIP1>; -def VUZP1 : SOpInst<"vuzp1", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_UZP1>; -def VTRN2 : SOpInst<"vtrn2", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_TRN2>; -def VZIP2 : SOpInst<"vzip2", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_ZIP2>; -def VUZP2 : SOpInst<"vuzp2", "ddd", - "csiUcUsUifPcPsQcQsQiQlQUcQUsQUiQUlQfQdQPcQPsQPl", OP_UZP2>; - -//////////////////////////////////////////////////////////////////////////////// -// Table lookup -let InstName = "vtbl" in { -def VQTBL1_A64 : WInst<"vqtbl1", "djt", "UccPcQUcQcQPc">; -def VQTBL2_A64 : WInst<"vqtbl2", "dBt", "UccPcQUcQcQPc">; -def VQTBL3_A64 : WInst<"vqtbl3", "dCt", "UccPcQUcQcQPc">; -def VQTBL4_A64 : WInst<"vqtbl4", "dDt", "UccPcQUcQcQPc">; -} -let InstName = "vtbx" in { -def VQTBX1_A64 : WInst<"vqtbx1", "ddjt", "UccPcQUcQcQPc">; -def VQTBX2_A64 : WInst<"vqtbx2", "ddBt", "UccPcQUcQcQPc">; -def VQTBX3_A64 : WInst<"vqtbx3", "ddCt", "UccPcQUcQcQPc">; -def VQTBX4_A64 : WInst<"vqtbx4", "ddDt", "UccPcQUcQcQPc">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Vector reinterpret cast operations - -// NeonEmitter implicitly takes the cartesian product of the type string with -// itself during generation so, unlike all other intrinsics, this one should -// include *all* types, not just additional ones. -def VVREINTERPRET - : NoTestOpInst<"vreinterpret", "dd", - "csilUcUsUiUlhfdPcPsPlQcQsQiQlQUcQUsQUiQUlQhQfQdQPcQPsQPlQPk", OP_REINT> { - let CartesianProductOfTypes = 1; - let BigEndianSafe = 1; - let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__)"; -} - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Intrinsics -// Scalar Arithmetic - -// Scalar Addition -def SCALAR_ADD : SInst<"vadd", "sss", "SlSUl">; -// Scalar Saturating Add -def SCALAR_QADD : SInst<"vqadd", "sss", "ScSsSiSlSUcSUsSUiSUl">; - -// Scalar Subtraction -def SCALAR_SUB : SInst<"vsub", "sss", "SlSUl">; -// Scalar Saturating Sub -def SCALAR_QSUB : SInst<"vqsub", "sss", "ScSsSiSlSUcSUsSUiSUl">; - -let InstName = "vmov" in { -def VGET_HIGH_A64 : NoTestOpInst<"vget_high", "dk", "dPl", OP_HI>; -def VGET_LOW_A64 : NoTestOpInst<"vget_low", "dk", "dPl", OP_LO>; -} - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Shift -// Scalar Shift Left -def SCALAR_SHL: SInst<"vshl", "sss", "SlSUl">; -// Scalar Saturating Shift Left -def SCALAR_QSHL: SInst<"vqshl", "sss", "ScSsSiSlSUcSUsSUiSUl">; -// Scalar Saturating Rounding Shift Left -def SCALAR_QRSHL: SInst<"vqrshl", "sss", "ScSsSiSlSUcSUsSUiSUl">; -// Scalar Shift Rouding Left -def SCALAR_RSHL: SInst<"vrshl", "sss", "SlSUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Shift (Immediate) -let isScalarShift = 1 in { -// Signed/Unsigned Shift Right (Immediate) -def SCALAR_SSHR_N: SInst<"vshr_n", "ssi", "SlSUl">; -// Signed/Unsigned Rounding Shift Right (Immediate) -def SCALAR_SRSHR_N: SInst<"vrshr_n", "ssi", "SlSUl">; - -// Signed/Unsigned Shift Right and Accumulate (Immediate) -def SCALAR_SSRA_N: SInst<"vsra_n", "sssi", "SlSUl">; -// Signed/Unsigned Rounding Shift Right and Accumulate (Immediate) -def SCALAR_SRSRA_N: SInst<"vrsra_n", "sssi", "SlSUl">; - -// Shift Left (Immediate) -def SCALAR_SHL_N: SInst<"vshl_n", "ssi", "SlSUl">; -// Signed/Unsigned Saturating Shift Left (Immediate) -def SCALAR_SQSHL_N: SInst<"vqshl_n", "ssi", "ScSsSiSlSUcSUsSUiSUl">; -// Signed Saturating Shift Left Unsigned (Immediate) -def SCALAR_SQSHLU_N: SInst<"vqshlu_n", "ssi", "ScSsSiSl">; - -// Shift Right And Insert (Immediate) -def SCALAR_SRI_N: SInst<"vsri_n", "sssi", "SlSUl">; -// Shift Left And Insert (Immediate) -def SCALAR_SLI_N: SInst<"vsli_n", "sssi", "SlSUl">; - -let isScalarNarrowShift = 1 in { - // Signed/Unsigned Saturating Shift Right Narrow (Immediate) - def SCALAR_SQSHRN_N: SInst<"vqshrn_n", "zsi", "SsSiSlSUsSUiSUl">; - // Signed/Unsigned Saturating Rounded Shift Right Narrow (Immediate) - def SCALAR_SQRSHRN_N: SInst<"vqrshrn_n", "zsi", "SsSiSlSUsSUiSUl">; - // Signed Saturating Shift Right Unsigned Narrow (Immediate) - def SCALAR_SQSHRUN_N: SInst<"vqshrun_n", "zsi", "SsSiSl">; - // Signed Saturating Rounded Shift Right Unsigned Narrow (Immediate) - def SCALAR_SQRSHRUN_N: SInst<"vqrshrun_n", "zsi", "SsSiSl">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed/Unsigned Fixed-point Convert To Floating-Point (Immediate) -def SCALAR_SCVTF_N_F32: SInst<"vcvt_n_f32", "ysi", "SiSUi">; -def SCALAR_SCVTF_N_F64: SInst<"vcvt_n_f64", "osi", "SlSUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Convert To Signed/Unsigned Fixed-point (Immediate) -def SCALAR_FCVTZS_N_S32 : SInst<"vcvt_n_s32", "$si", "Sf">; -def SCALAR_FCVTZU_N_U32 : SInst<"vcvt_n_u32", "bsi", "Sf">; -def SCALAR_FCVTZS_N_S64 : SInst<"vcvt_n_s64", "$si", "Sd">; -def SCALAR_FCVTZU_N_U64 : SInst<"vcvt_n_u64", "bsi", "Sd">; -} - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Reduce Pairwise Addition (Scalar and Floating Point) -def SCALAR_ADDP : SInst<"vpadd", "sd", "SfSHlSHdSHUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Reduce Floating Point Pairwise Max/Min -def SCALAR_FMAXP : SInst<"vpmax", "sd", "SfSQd">; - -def SCALAR_FMINP : SInst<"vpmin", "sd", "SfSQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Reduce Floating Point Pairwise maxNum/minNum -def SCALAR_FMAXNMP : SInst<"vpmaxnm", "sd", "SfSQd">; -def SCALAR_FMINNMP : SInst<"vpminnm", "sd", "SfSQd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Integer Saturating Doubling Multiply Half High -def SCALAR_SQDMULH : SInst<"vqdmulh", "sss", "SsSi">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Integer Saturating Rounding Doubling Multiply Half High -def SCALAR_SQRDMULH : SInst<"vqrdmulh", "sss", "SsSi">; - -let ArchGuard = "defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)" in { -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Rounding Doubling Multiply Accumulate Returning High Half -def SCALAR_SQRDMLAH : SOpInst<"vqrdmlah", "ssss", "SsSi", OP_QRDMLAH>; - -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Rounding Doubling Multiply Subtract Returning High Half -def SCALAR_SQRDMLSH : SOpInst<"vqrdmlsh", "ssss", "SsSi", OP_QRDMLSH>; -} - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Multiply Extended -def SCALAR_FMULX : IInst<"vmulx", "sss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Reciprocal Step -def SCALAR_FRECPS : IInst<"vrecps", "sss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Reciprocal Square Root Step -def SCALAR_FRSQRTS : IInst<"vrsqrts", "sss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Integer Convert To Floating-point -def SCALAR_SCVTFS : SInst<"vcvt_f32", "ys", "Si">; -def SCALAR_SCVTFD : SInst<"vcvt_f64", "os", "Sl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Unsigned Integer Convert To Floating-point -def SCALAR_UCVTFS : SInst<"vcvt_f32", "ys", "SUi">; -def SCALAR_UCVTFD : SInst<"vcvt_f64", "os", "SUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Converts -def SCALAR_FCVTXN : IInst<"vcvtx_f32", "ys", "Sd">; -def SCALAR_FCVTNSS : SInst<"vcvtn_s32", "$s", "Sf">; -def SCALAR_FCVTNUS : SInst<"vcvtn_u32", "bs", "Sf">; -def SCALAR_FCVTNSD : SInst<"vcvtn_s64", "$s", "Sd">; -def SCALAR_FCVTNUD : SInst<"vcvtn_u64", "bs", "Sd">; -def SCALAR_FCVTMSS : SInst<"vcvtm_s32", "$s", "Sf">; -def SCALAR_FCVTMUS : SInst<"vcvtm_u32", "bs", "Sf">; -def SCALAR_FCVTMSD : SInst<"vcvtm_s64", "$s", "Sd">; -def SCALAR_FCVTMUD : SInst<"vcvtm_u64", "bs", "Sd">; -def SCALAR_FCVTASS : SInst<"vcvta_s32", "$s", "Sf">; -def SCALAR_FCVTAUS : SInst<"vcvta_u32", "bs", "Sf">; -def SCALAR_FCVTASD : SInst<"vcvta_s64", "$s", "Sd">; -def SCALAR_FCVTAUD : SInst<"vcvta_u64", "bs", "Sd">; -def SCALAR_FCVTPSS : SInst<"vcvtp_s32", "$s", "Sf">; -def SCALAR_FCVTPUS : SInst<"vcvtp_u32", "bs", "Sf">; -def SCALAR_FCVTPSD : SInst<"vcvtp_s64", "$s", "Sd">; -def SCALAR_FCVTPUD : SInst<"vcvtp_u64", "bs", "Sd">; -def SCALAR_FCVTZSS : SInst<"vcvt_s32", "$s", "Sf">; -def SCALAR_FCVTZUS : SInst<"vcvt_u32", "bs", "Sf">; -def SCALAR_FCVTZSD : SInst<"vcvt_s64", "$s", "Sd">; -def SCALAR_FCVTZUD : SInst<"vcvt_u64", "bs", "Sd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Reciprocal Estimate -def SCALAR_FRECPE : IInst<"vrecpe", "ss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Reciprocal Exponent -def SCALAR_FRECPX : IInst<"vrecpx", "ss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Reciprocal Square Root Estimate -def SCALAR_FRSQRTE : IInst<"vrsqrte", "ss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Integer Comparison -def SCALAR_CMEQ : SInst<"vceq", "sss", "SlSUl">; -def SCALAR_CMEQZ : SInst<"vceqz", "ss", "SlSUl">; -def SCALAR_CMGE : SInst<"vcge", "sss", "Sl">; -def SCALAR_CMGEZ : SInst<"vcgez", "ss", "Sl">; -def SCALAR_CMHS : SInst<"vcge", "sss", "SUl">; -def SCALAR_CMLE : SInst<"vcle", "sss", "SlSUl">; -def SCALAR_CMLEZ : SInst<"vclez", "ss", "Sl">; -def SCALAR_CMLT : SInst<"vclt", "sss", "SlSUl">; -def SCALAR_CMLTZ : SInst<"vcltz", "ss", "Sl">; -def SCALAR_CMGT : SInst<"vcgt", "sss", "Sl">; -def SCALAR_CMGTZ : SInst<"vcgtz", "ss", "Sl">; -def SCALAR_CMHI : SInst<"vcgt", "sss", "SUl">; -def SCALAR_CMTST : SInst<"vtst", "sss", "SlSUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Comparison -def SCALAR_FCMEQ : IInst<"vceq", "bss", "SfSd">; -def SCALAR_FCMEQZ : IInst<"vceqz", "bs", "SfSd">; -def SCALAR_FCMGE : IInst<"vcge", "bss", "SfSd">; -def SCALAR_FCMGEZ : IInst<"vcgez", "bs", "SfSd">; -def SCALAR_FCMGT : IInst<"vcgt", "bss", "SfSd">; -def SCALAR_FCMGTZ : IInst<"vcgtz", "bs", "SfSd">; -def SCALAR_FCMLE : IInst<"vcle", "bss", "SfSd">; -def SCALAR_FCMLEZ : IInst<"vclez", "bs", "SfSd">; -def SCALAR_FCMLT : IInst<"vclt", "bss", "SfSd">; -def SCALAR_FCMLTZ : IInst<"vcltz", "bs", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Absolute Compare Mask Greater Than Or Equal -def SCALAR_FACGE : IInst<"vcage", "bss", "SfSd">; -def SCALAR_FACLE : IInst<"vcale", "bss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Floating-point Absolute Compare Mask Greater Than -def SCALAR_FACGT : IInst<"vcagt", "bss", "SfSd">; -def SCALAR_FACLT : IInst<"vcalt", "bss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Absolute Value -def SCALAR_ABS : SInst<"vabs", "ss", "Sl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Absolute Difference -def SCALAR_ABD : IInst<"vabd", "sss", "SfSd">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Saturating Absolute Value -def SCALAR_SQABS : SInst<"vqabs", "ss", "ScSsSiSl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Negate -def SCALAR_NEG : SInst<"vneg", "ss", "Sl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Saturating Negate -def SCALAR_SQNEG : SInst<"vqneg", "ss", "ScSsSiSl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Saturating Accumulated of Unsigned Value -def SCALAR_SUQADD : SInst<"vuqadd", "sss", "ScSsSiSl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Unsigned Saturating Accumulated of Signed Value -def SCALAR_USQADD : SInst<"vsqadd", "sss", "SUcSUsSUiSUl">; - -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Doubling Multiply-Add Long -def SCALAR_SQDMLAL : SInst<"vqdmlal", "rrss", "SsSi">; - -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Doubling Multiply-Subtract Long -def SCALAR_SQDMLSL : SInst<"vqdmlsl", "rrss", "SsSi">; - -//////////////////////////////////////////////////////////////////////////////// -// Signed Saturating Doubling Multiply Long -def SCALAR_SQDMULL : SInst<"vqdmull", "rss", "SsSi">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Saturating Extract Unsigned Narrow -def SCALAR_SQXTUN : SInst<"vqmovun", "zs", "SsSiSl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Signed Saturating Extract Narrow -def SCALAR_SQXTN : SInst<"vqmovn", "zs", "SsSiSl">; - -//////////////////////////////////////////////////////////////////////////////// -// Scalar Unsigned Saturating Extract Narrow -def SCALAR_UQXTN : SInst<"vqmovn", "zs", "SUsSUiSUl">; - -// Scalar Floating Point multiply (scalar, by element) -def SCALAR_FMUL_LANE : IOpInst<"vmul_lane", "ssdi", "SfSd", OP_SCALAR_MUL_LN>; -def SCALAR_FMUL_LANEQ : IOpInst<"vmul_laneq", "ssji", "SfSd", OP_SCALAR_MUL_LN>; - -// Scalar Floating Point multiply extended (scalar, by element) -def SCALAR_FMULX_LANE : IOpInst<"vmulx_lane", "ssdi", "SfSd", OP_SCALAR_MULX_LN>; -def SCALAR_FMULX_LANEQ : IOpInst<"vmulx_laneq", "ssji", "SfSd", OP_SCALAR_MULX_LN>; - -def SCALAR_VMUL_N : IInst<"vmul_n", "dds", "d">; - -// VMUL_LANE_A64 d type implemented using scalar mul lane -def SCALAR_VMUL_LANE : IInst<"vmul_lane", "ddgi", "d">; - -// VMUL_LANEQ d type implemented using scalar mul lane -def SCALAR_VMUL_LANEQ : IInst<"vmul_laneq", "ddji", "d"> { - let isLaneQ = 1; -} - -// VMULX_LANE d type implemented using scalar vmulx_lane -def SCALAR_VMULX_LANE : IOpInst<"vmulx_lane", "ddgi", "d", OP_SCALAR_VMULX_LN>; - -// VMULX_LANEQ d type implemented using scalar vmulx_laneq -def SCALAR_VMULX_LANEQ : IOpInst<"vmulx_laneq", "ddji", "d", OP_SCALAR_VMULX_LNQ>; - -// Scalar Floating Point fused multiply-add (scalar, by element) -def SCALAR_FMLA_LANE : IInst<"vfma_lane", "sssdi", "SfSd">; -def SCALAR_FMLA_LANEQ : IInst<"vfma_laneq", "sssji", "SfSd">; - -// Scalar Floating Point fused multiply-subtract (scalar, by element) -def SCALAR_FMLS_LANE : IOpInst<"vfms_lane", "sssdi", "SfSd", OP_FMS_LN>; -def SCALAR_FMLS_LANEQ : IOpInst<"vfms_laneq", "sssji", "SfSd", OP_FMS_LNQ>; - -// Signed Saturating Doubling Multiply Long (scalar by element) -def SCALAR_SQDMULL_LANE : SOpInst<"vqdmull_lane", "rsdi", "SsSi", OP_SCALAR_QDMULL_LN>; -def SCALAR_SQDMULL_LANEQ : SOpInst<"vqdmull_laneq", "rsji", "SsSi", OP_SCALAR_QDMULL_LN>; - -// Signed Saturating Doubling Multiply-Add Long (scalar by element) -def SCALAR_SQDMLAL_LANE : SInst<"vqdmlal_lane", "rrsdi", "SsSi">; -def SCALAR_SQDMLAL_LANEQ : SInst<"vqdmlal_laneq", "rrsji", "SsSi">; - -// Signed Saturating Doubling Multiply-Subtract Long (scalar by element) -def SCALAR_SQDMLS_LANE : SInst<"vqdmlsl_lane", "rrsdi", "SsSi">; -def SCALAR_SQDMLS_LANEQ : SInst<"vqdmlsl_laneq", "rrsji", "SsSi">; - -// Scalar Integer Saturating Doubling Multiply Half High (scalar by element) -def SCALAR_SQDMULH_LANE : SOpInst<"vqdmulh_lane", "ssdi", "SsSi", OP_SCALAR_QDMULH_LN>; -def SCALAR_SQDMULH_LANEQ : SOpInst<"vqdmulh_laneq", "ssji", "SsSi", OP_SCALAR_QDMULH_LN>; - -// Scalar Integer Saturating Rounding Doubling Multiply Half High -def SCALAR_SQRDMULH_LANE : SOpInst<"vqrdmulh_lane", "ssdi", "SsSi", OP_SCALAR_QRDMULH_LN>; -def SCALAR_SQRDMULH_LANEQ : SOpInst<"vqrdmulh_laneq", "ssji", "SsSi", OP_SCALAR_QRDMULH_LN>; - -let ArchGuard = "defined(__ARM_FEATURE_QRDMX) && defined(__aarch64__)" in { -// Signed Saturating Rounding Doubling Multiply Accumulate Returning High Half -def SCALAR_SQRDMLAH_LANE : SOpInst<"vqrdmlah_lane", "sssdi", "SsSi", OP_SCALAR_QRDMLAH_LN>; -def SCALAR_SQRDMLAH_LANEQ : SOpInst<"vqrdmlah_laneq", "sssji", "SsSi", OP_SCALAR_QRDMLAH_LN>; - -// Signed Saturating Rounding Doubling Multiply Subtract Returning High Half -def SCALAR_SQRDMLSH_LANE : SOpInst<"vqrdmlsh_lane", "sssdi", "SsSi", OP_SCALAR_QRDMLSH_LN>; -def SCALAR_SQRDMLSH_LANEQ : SOpInst<"vqrdmlsh_laneq", "sssji", "SsSi", OP_SCALAR_QRDMLSH_LN>; -} - -def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; -def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; -} |