diff options
Diffstat (limited to 'include/clang/Basic')
62 files changed, 4345 insertions, 2242 deletions
diff --git a/include/clang/Basic/ABI.h b/include/clang/Basic/ABI.h index 018f500..fecf613 100644 --- a/include/clang/Basic/ABI.h +++ b/include/clang/Basic/ABI.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// These enums/classes describe ABI related information about constructors, -// destructors and thunks. -// +/// +/// \file +/// \brief Enums/classes describing ABI related information about constructors, +/// destructors and thunks. +/// //===----------------------------------------------------------------------===// #ifndef CLANG_BASIC_ABI_H @@ -19,27 +20,27 @@ namespace clang { -/// CXXCtorType - C++ constructor types +/// \brief C++ constructor types. enum CXXCtorType { - Ctor_Complete, // Complete object ctor - Ctor_Base, // Base object ctor - Ctor_CompleteAllocating // Complete object allocating ctor + Ctor_Complete, ///< Complete object ctor + Ctor_Base, ///< Base object ctor + Ctor_CompleteAllocating ///< Complete object allocating ctor }; -/// CXXDtorType - C++ destructor types +/// \brief C++ destructor types. enum CXXDtorType { - Dtor_Deleting, // Deleting dtor - Dtor_Complete, // Complete object dtor - Dtor_Base // Base object dtor + Dtor_Deleting, ///< Deleting dtor + Dtor_Complete, ///< Complete object dtor + Dtor_Base ///< Base object dtor }; -/// ReturnAdjustment - A return adjustment. +/// \brief A return adjustment. struct ReturnAdjustment { - /// NonVirtual - The non-virtual adjustment from the derived object to its + /// \brief The non-virtual adjustment from the derived object to its /// nearest virtual base. int64_t NonVirtual; - /// VBaseOffsetOffset - The offset (in bytes), relative to the address point + /// \brief The offset (in bytes), relative to the address point /// of the virtual base class offset. int64_t VBaseOffsetOffset; @@ -63,13 +64,13 @@ struct ReturnAdjustment { } }; -/// ThisAdjustment - A 'this' pointer adjustment. +/// \brief A \c this pointer adjustment. struct ThisAdjustment { - /// NonVirtual - The non-virtual adjustment from the derived object to its + /// \brief The non-virtual adjustment from the derived object to its /// nearest virtual base. int64_t NonVirtual; - /// VCallOffsetOffset - The offset (in bytes), relative to the address point, + /// \brief The offset (in bytes), relative to the address point, /// of the virtual call offset. int64_t VCallOffsetOffset; @@ -93,13 +94,13 @@ struct ThisAdjustment { } }; -/// ThunkInfo - The 'this' pointer adjustment as well as an optional return +/// \brief The \c this pointer adjustment as well as an optional return /// adjustment for a thunk. struct ThunkInfo { - /// This - The 'this' pointer adjustment. + /// \brief The \c this pointer adjustment. ThisAdjustment This; - /// Return - The return adjustment. + /// \brief The return adjustment. ReturnAdjustment Return; ThunkInfo() { } diff --git a/include/clang/Basic/AddressSpaces.h b/include/clang/Basic/AddressSpaces.h index d44a9c3b..4b1cea5 100644 --- a/include/clang/Basic/AddressSpaces.h +++ b/include/clang/Basic/AddressSpaces.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file provides definitions for the various language-specific address -// spaces. -// +/// +/// \file +/// \brief Provides definitions for the various language-specific address +/// spaces. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_ADDRESSSPACES_H @@ -19,8 +20,9 @@ namespace clang { namespace LangAS { -/// This enum defines the set of possible language-specific address spaces. -/// It uses a high starting offset so as not to conflict with any address +/// \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, @@ -29,6 +31,10 @@ enum ID { opencl_local, opencl_constant, + cuda_device, + cuda_constant, + cuda_shared, + Last, Count = Last-Offset }; diff --git a/include/clang/Basic/AllDiagnostics.h b/include/clang/Basic/AllDiagnostics.h index 7e77435..7304c8f 100644 --- a/include/clang/Basic/AllDiagnostics.h +++ b/include/clang/Basic/AllDiagnostics.h @@ -6,16 +6,17 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file includes all the separate Diagnostic headers & some related -// helpers. -// +/// +/// \file +/// \brief Includes all the separate Diagnostic headers & some related helpers. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ALL_DIAGNOSTICS_H #define LLVM_CLANG_ALL_DIAGNOSTICS_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" diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index e8e0f35..99180e4 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -80,23 +80,40 @@ class EnumArgument<string name, string type, list<string> values, list<string> Enums = enums; } +// This handles one spelling of an attribute. +class Spelling<string name, string variety> { + string Name = name; + string Variety = variety; +} + +class GNU<string name> : Spelling<name, "GNU">; +class Declspec<string name> : Spelling<name, "Declspec">; +class CXX11<string namespace, string name> : Spelling<name, "CXX11"> { + string Namespace = namespace; +} + class Attr { // The various ways in which an attribute can be spelled in source - list<string> Spellings; + list<Spelling> Spellings; // The things to which an attribute can appertain list<AttrSubject> Subjects; // The arguments allowed on an attribute list<Argument> Args = []; - // The namespaces in which the attribute appears in C++0x attributes. - // The attribute will not be permitted in C++0x attribute-specifiers if - // this is empty; the empty string can be used as a namespace. - list<string> Namespaces = []; // 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 each of the spellings is a distinct attribute. + bit DistinctSpellings = 0; // Any additional text that should be included verbatim in the class. code AdditionalMembers = [{}]; } @@ -112,16 +129,21 @@ class InheritableParamAttr : InheritableAttr; // Attributes begin here // +def AddressSpace : Attr { + let Spellings = [GNU<"address_space">]; + let Args = [IntArgument<"AddressSpace">]; + let ASTNode = 0; +} + def Alias : InheritableAttr { - let Spellings = ["alias"]; + let Spellings = [GNU<"alias">]; let Args = [StringArgument<"Aliasee">]; } def Aligned : InheritableAttr { - let Spellings = ["aligned"]; + let Spellings = [GNU<"aligned">, GNU<"align">]; let Subjects = [NonBitField, NormalVar, Tag]; - let Args = [AlignedArgument<"Alignment">]; - let Namespaces = ["", "std"]; + let Args = [AlignedArgument<"Alignment">, BoolArgument<"IsMSDeclSpec">]; } def AlignMac68k : InheritableAttr { @@ -129,16 +151,27 @@ def AlignMac68k : InheritableAttr { let SemaHandler = 0; } +def AllocSize : Attr { + let Spellings = [GNU<"alloc_size">]; + let Args = [VariadicUnsignedArgument<"Args">]; +} + def AlwaysInline : InheritableAttr { - let Spellings = ["always_inline"]; + let Spellings = [GNU<"always_inline">]; +} + +def TLSModel : InheritableAttr { + let Spellings = [GNU<"tls_model">]; + let Subjects = [Var]; + let Args = [StringArgument<"Model">]; } def AnalyzerNoReturn : InheritableAttr { - let Spellings = ["analyzer_noreturn"]; + let Spellings = [GNU<"analyzer_noreturn">]; } def Annotate : InheritableParamAttr { - let Spellings = ["annotate"]; + let Spellings = [GNU<"annotate">]; let Args = [StringArgument<"Annotation">]; } @@ -149,7 +182,7 @@ def AsmLabel : InheritableAttr { } def Availability : InheritableAttr { - let Spellings = ["availability"]; + let Spellings = [GNU<"availability">]; let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">, VersionArgument<"deprecated">, VersionArgument<"obsoleted">, BoolArgument<"unavailable">, StringArgument<"message">]; @@ -163,18 +196,25 @@ def Availability : InheritableAttr { } def Blocks : InheritableAttr { - let Spellings = ["blocks"]; + let Spellings = [GNU<"blocks">]; let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>]; } +def Bounded : Attr { + let Spellings = [GNU<"bounded">]; + let ASTNode = 0; + let SemaHandler = 0; + let Ignored = 1; +} + def CarriesDependency : InheritableParamAttr { - let Spellings = ["carries_dependency"]; + let Spellings = [GNU<"carries_dependency">, CXX11<"","carries_dependency">, + CXX11<"std","carries_dependency">]; let Subjects = [ParmVar, Function]; - let Namespaces = ["", "std"]; } def CDecl : InheritableAttr { - let Spellings = ["cdecl", "__cdecl"]; + let Spellings = [GNU<"cdecl">, GNU<"__cdecl">]; } // cf_audited_transfer indicates that the given function has been @@ -182,7 +222,7 @@ def CDecl : InheritableAttr { // cf_returns_retained attributes. It is generally applied by // '#pragma clang arc_cf_code_audited' rather than explicitly. def CFAuditedTransfer : InheritableAttr { - let Spellings = ["cf_audited_transfer"]; + let Spellings = [GNU<"cf_audited_transfer">]; let Subjects = [Function]; } @@ -190,133 +230,151 @@ def CFAuditedTransfer : InheritableAttr { // It indicates that the function has unknown or unautomatable // transfer semantics. def CFUnknownTransfer : InheritableAttr { - let Spellings = ["cf_unknown_transfer"]; + let Spellings = [GNU<"cf_unknown_transfer">]; let Subjects = [Function]; } +def CFReturnsAutoreleased : Attr { + let Spellings = [GNU<"cf_returns_autoreleased">]; + let ASTNode = 0; +} + def CFReturnsRetained : InheritableAttr { - let Spellings = ["cf_returns_retained"]; + let Spellings = [GNU<"cf_returns_retained">]; let Subjects = [ObjCMethod, Function]; } def CFReturnsNotRetained : InheritableAttr { - let Spellings = ["cf_returns_not_retained"]; + let Spellings = [GNU<"cf_returns_not_retained">]; let Subjects = [ObjCMethod, Function]; } def CFConsumed : InheritableParamAttr { - let Spellings = ["cf_consumed"]; + let Spellings = [GNU<"cf_consumed">]; let Subjects = [ParmVar]; } def Cleanup : InheritableAttr { - let Spellings = ["cleanup"]; + let Spellings = [GNU<"cleanup">]; let Args = [FunctionArgument<"FunctionDecl">]; } +def Cold : InheritableAttr { + let Spellings = [GNU<"cold">]; +} + def Common : InheritableAttr { - let Spellings = ["common"]; + let Spellings = [GNU<"common">]; } def Const : InheritableAttr { - let Spellings = ["const"]; + let Spellings = [GNU<"const">, GNU<"__const">]; } def Constructor : InheritableAttr { - let Spellings = ["constructor"]; + let Spellings = [GNU<"constructor">]; let Args = [IntArgument<"Priority">]; } def CUDAConstant : InheritableAttr { - let Spellings = ["constant"]; + let Spellings = [GNU<"constant">]; } -def CUDADevice : Attr { - let Spellings = ["device"]; +def CUDADevice : InheritableAttr { + let Spellings = [GNU<"device">]; } def CUDAGlobal : InheritableAttr { - let Spellings = ["global"]; + let Spellings = [GNU<"global">]; } -def CUDAHost : Attr { - let Spellings = ["host"]; +def CUDAHost : InheritableAttr { + let Spellings = [GNU<"host">]; } def CUDALaunchBounds : InheritableAttr { - let Spellings = ["launch_bounds"]; + let Spellings = [GNU<"launch_bounds">]; let Args = [IntArgument<"MaxThreads">, DefaultIntArgument<"MinBlocks", 0>]; } def CUDAShared : InheritableAttr { - let Spellings = ["shared"]; + let Spellings = [GNU<"shared">]; } def OpenCLKernel : Attr { - let Spellings = ["opencl_kernel_function"]; + let Spellings = [GNU<"opencl_kernel_function">]; +} + +def OpenCLImageAccess : Attr { + let Spellings = [GNU<"opencl_image_access">]; + let Args = [IntArgument<"Access">]; + let ASTNode = 0; } def Deprecated : InheritableAttr { - let Spellings = ["deprecated"]; + let Spellings = [GNU<"deprecated">]; let Args = [StringArgument<"Message">]; } def Destructor : InheritableAttr { - let Spellings = ["destructor"]; + let Spellings = [GNU<"destructor">]; let Args = [IntArgument<"Priority">]; } -def DLLExport : InheritableAttr { - let Spellings = ["dllexport"]; +def ExtVectorType : Attr { + let Spellings = [GNU<"ext_vector_type">]; + let Args = [ExprArgument<"NumElements">]; + let ASTNode = 0; } -def DLLImport : InheritableAttr { - let Spellings = ["dllimport"]; +def FallThrough : Attr { + let Spellings = [CXX11<"clang","fallthrough">]; + let Subjects = [NullStmt]; } def FastCall : InheritableAttr { - let Spellings = ["fastcall", "__fastcall"]; + let Spellings = [GNU<"fastcall">, GNU<"__fastcall">]; } -def Final : InheritableAttr { +def Final : InheritableAttr { let Spellings = []; let SemaHandler = 0; } -def MsStruct : InheritableAttr { - let Spellings = ["__ms_struct__"]; -} - def Format : InheritableAttr { - let Spellings = ["format"]; + let Spellings = [GNU<"format">]; let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">, IntArgument<"FirstArg">]; } def FormatArg : InheritableAttr { - let Spellings = ["format_arg"]; + let Spellings = [GNU<"format_arg">]; let Args = [IntArgument<"FormatIdx">]; } def GNUInline : InheritableAttr { - let Spellings = ["gnu_inline"]; + let Spellings = [GNU<"gnu_inline">]; +} + +def Hot : InheritableAttr { + let Spellings = [GNU<"hot">]; } def IBAction : InheritableAttr { - let Spellings = ["ibaction"]; + let Spellings = [GNU<"ibaction">]; } def IBOutlet : InheritableAttr { - let Spellings = ["iboutlet"]; + let Spellings = [GNU<"iboutlet">]; } def IBOutletCollection : InheritableAttr { - let Spellings = ["iboutletcollection"]; + let Spellings = [GNU<"iboutletcollection">]; let Args = [TypeArgument<"Interface">, SourceLocArgument<"InterfaceLoc">]; } def Malloc : InheritableAttr { - let Spellings = ["malloc"]; + let Spellings = [GNU<"malloc">]; } def MaxFieldAlignment : InheritableAttr { @@ -326,7 +384,7 @@ def MaxFieldAlignment : InheritableAttr { } def MayAlias : InheritableAttr { - let Spellings = ["may_alias"]; + let Spellings = [GNU<"may_alias">]; } def MSP430Interrupt : InheritableAttr { @@ -345,28 +403,46 @@ def MBlazeSaveVolatiles : InheritableAttr { let SemaHandler = 0; } +def Mode : Attr { + let Spellings = [GNU<"mode">]; + let Args = [IdentifierArgument<"Mode">]; + let ASTNode = 0; +} + def Naked : InheritableAttr { - let Spellings = ["naked"]; + let Spellings = [GNU<"naked">]; +} + +def NeonPolyVectorType : Attr { + let Spellings = [GNU<"neon_polyvector_type">]; + let Args = [IntArgument<"NumElements">]; + let ASTNode = 0; +} + +def NeonVectorType : Attr { + let Spellings = [GNU<"neon_vector_type">]; + let Args = [IntArgument<"NumElements">]; + let ASTNode = 0; } def ReturnsTwice : InheritableAttr { - let Spellings = ["returns_twice"]; + let Spellings = [GNU<"returns_twice">]; } def NoCommon : InheritableAttr { - let Spellings = ["nocommon"]; + let Spellings = [GNU<"nocommon">]; } def NoDebug : InheritableAttr { - let Spellings = ["nodebug"]; + let Spellings = [GNU<"nodebug">]; } def NoInline : InheritableAttr { - let Spellings = ["noinline"]; + let Spellings = [GNU<"noinline">]; } def NonNull : InheritableAttr { - let Spellings = ["nonnull"]; + let Spellings = [GNU<"nonnull">]; let Args = [VariadicUnsignedArgument<"Args">]; let AdditionalMembers = [{bool isNonNull(unsigned idx) const { @@ -379,58 +455,58 @@ def NonNull : InheritableAttr { } def NoReturn : InheritableAttr { - let Spellings = ["noreturn"]; + let Spellings = [GNU<"noreturn">, CXX11<"","noreturn">, + CXX11<"std","noreturn">]; // FIXME: Does GCC allow this on the function instead? let Subjects = [Function]; - let Namespaces = ["", "std"]; } def NoInstrumentFunction : InheritableAttr { - let Spellings = ["no_instrument_function"]; + let Spellings = [GNU<"no_instrument_function">]; let Subjects = [Function]; } def NoThrow : InheritableAttr { - let Spellings = ["nothrow"]; + let Spellings = [GNU<"nothrow">]; } def NSBridged : InheritableAttr { - let Spellings = ["ns_bridged"]; + let Spellings = [GNU<"ns_bridged">]; let Subjects = [Record]; let Args = [IdentifierArgument<"BridgedType">]; } def NSReturnsRetained : InheritableAttr { - let Spellings = ["ns_returns_retained"]; + let Spellings = [GNU<"ns_returns_retained">]; let Subjects = [ObjCMethod, Function]; } def NSReturnsNotRetained : InheritableAttr { - let Spellings = ["ns_returns_not_retained"]; + let Spellings = [GNU<"ns_returns_not_retained">]; let Subjects = [ObjCMethod, Function]; } def NSReturnsAutoreleased : InheritableAttr { - let Spellings = ["ns_returns_autoreleased"]; + let Spellings = [GNU<"ns_returns_autoreleased">]; let Subjects = [ObjCMethod, Function]; } def NSConsumesSelf : InheritableAttr { - let Spellings = ["ns_consumes_self"]; + let Spellings = [GNU<"ns_consumes_self">]; let Subjects = [ObjCMethod]; } def NSConsumed : InheritableParamAttr { - let Spellings = ["ns_consumed"]; + let Spellings = [GNU<"ns_consumed">]; let Subjects = [ParmVar]; } def ObjCException : InheritableAttr { - let Spellings = ["objc_exception"]; + let Spellings = [GNU<"objc_exception">]; } def ObjCMethodFamily : InheritableAttr { - let Spellings = ["objc_method_family"]; + let Spellings = [GNU<"objc_method_family">]; let Subjects = [ObjCMethod]; let Args = [EnumArgument<"Family", "FamilyKind", ["none", "alloc", "copy", "init", "mutableCopy", "new"], @@ -439,26 +515,26 @@ def ObjCMethodFamily : InheritableAttr { } def ObjCNSObject : InheritableAttr { - let Spellings = ["NSObject"]; + let Spellings = [GNU<"NSObject">]; } def ObjCPreciseLifetime : Attr { - let Spellings = ["objc_precise_lifetime"]; + let Spellings = [GNU<"objc_precise_lifetime">]; let Subjects = [Var]; } def ObjCReturnsInnerPointer : Attr { - let Spellings = ["objc_returns_inner_pointer"]; + let Spellings = [GNU<"objc_returns_inner_pointer">]; let Subjects = [ObjCMethod]; } def ObjCRootClass : Attr { - let Spellings = ["objc_root_class"]; + let Spellings = [GNU<"objc_root_class">]; let Subjects = [ObjCInterface]; } def Overloadable : Attr { - let Spellings = ["overloadable"]; + let Spellings = [GNU<"overloadable">]; } def Override : InheritableAttr { @@ -467,7 +543,9 @@ def Override : InheritableAttr { } def Ownership : InheritableAttr { - let Spellings = ["ownership_holds", "ownership_returns", "ownership_takes"]; + let Spellings = [GNU<"ownership_holds">, GNU<"ownership_returns">, + GNU<"ownership_takes">]; + let DistinctSpellings = 1; let Args = [EnumArgument<"OwnKind", "OwnershipKind", ["ownership_holds", "ownership_returns", "ownership_takes"], ["Holds", "Returns", "Takes"]>, @@ -475,118 +553,151 @@ def Ownership : InheritableAttr { } def Packed : InheritableAttr { - let Spellings = ["packed"]; + let Spellings = [GNU<"packed">]; } def Pcs : InheritableAttr { - let Spellings = ["pcs"]; + let Spellings = [GNU<"pcs">]; let Args = [EnumArgument<"PCS", "PCSType", ["aapcs", "aapcs-vfp"], ["AAPCS", "AAPCS_VFP"]>]; } def Pure : InheritableAttr { - let Spellings = ["pure"]; + let Spellings = [GNU<"pure">]; } def Regparm : InheritableAttr { - let Spellings = ["regparm"]; + let Spellings = [GNU<"regparm">]; let Args = [UnsignedArgument<"NumParams">]; } def ReqdWorkGroupSize : InheritableAttr { - let Spellings = ["reqd_work_group_size"]; + let Spellings = [GNU<"reqd_work_group_size">]; let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">, UnsignedArgument<"ZDim">]; } +def WorkGroupSizeHint : InheritableAttr { + let Spellings = [GNU<"work_group_size_hint">]; + let Args = [UnsignedArgument<"XDim">, + UnsignedArgument<"YDim">, + UnsignedArgument<"ZDim">]; +} + def InitPriority : InheritableAttr { - let Spellings = ["init_priority"]; + let Spellings = [GNU<"init_priority">]; let Args = [UnsignedArgument<"Priority">]; } def Section : InheritableAttr { - let Spellings = ["section"]; + let Spellings = [GNU<"section">]; let Args = [StringArgument<"Name">]; } def Sentinel : InheritableAttr { - let Spellings = ["sentinel"]; + let Spellings = [GNU<"sentinel">]; let Args = [DefaultIntArgument<"Sentinel", 0>, DefaultIntArgument<"NullPos", 0>]; } def StdCall : InheritableAttr { - let Spellings = ["stdcall", "__stdcall"]; + let Spellings = [GNU<"stdcall">, GNU<"__stdcall">]; } def ThisCall : InheritableAttr { - let Spellings = ["thiscall", "__thiscall"]; + let Spellings = [GNU<"thiscall">, GNU<"__thiscall">]; } def Pascal : InheritableAttr { - let Spellings = ["pascal", "__pascal"]; + let Spellings = [GNU<"pascal">]; } def TransparentUnion : InheritableAttr { - let Spellings = ["transparent_union"]; + let Spellings = [GNU<"transparent_union">]; } def Unavailable : InheritableAttr { - let Spellings = ["unavailable"]; + let Spellings = [GNU<"unavailable">]; let Args = [StringArgument<"Message">]; } def ArcWeakrefUnavailable : InheritableAttr { - let Spellings = ["objc_arc_weak_reference_unavailable"]; + let Spellings = [GNU<"objc_arc_weak_reference_unavailable">]; let Subjects = [ObjCInterface]; } +def ObjCGC : Attr { + let Spellings = [GNU<"objc_gc">]; + let Args = [IdentifierArgument<"Kind">]; + let ASTNode = 0; +} + +def ObjCOwnership : Attr { + let Spellings = [GNU<"objc_ownership">]; + let Args = [IdentifierArgument<"Kind">]; + let ASTNode = 0; +} + def ObjCRequiresPropertyDefs : InheritableAttr { - let Spellings = ["objc_requires_property_definitions"]; + let Spellings = [GNU<"objc_requires_property_definitions">]; let Subjects = [ObjCInterface]; } def Unused : InheritableAttr { - let Spellings = ["unused"]; + let Spellings = [GNU<"unused">]; } def Used : InheritableAttr { - let Spellings = ["used"]; + let Spellings = [GNU<"used">]; } def Uuid : InheritableAttr { - let Spellings = ["uuid"]; + let Spellings = [GNU<"uuid">]; let Args = [StringArgument<"Guid">]; let Subjects = [CXXRecord]; } +def VectorSize : Attr { + let Spellings = [GNU<"vector_size">]; + let Args = [ExprArgument<"NumBytes">]; + let ASTNode = 0; +} + +def VecTypeHint : Attr { + let Spellings = [GNU<"vec_type_hint">]; + let ASTNode = 0; + let SemaHandler = 0; + let Ignored = 1; +} + def Visibility : InheritableAttr { - let Spellings = ["visibility"]; + let Clone = 0; + let Spellings = [GNU<"visibility">]; let Args = [EnumArgument<"Visibility", "VisibilityType", ["default", "hidden", "internal", "protected"], ["Default", "Hidden", "Hidden", "Protected"]>]; } def VecReturn : InheritableAttr { - let Spellings = ["vecreturn"]; + let Spellings = [GNU<"vecreturn">]; let Subjects = [CXXRecord]; } def WarnUnusedResult : InheritableAttr { - let Spellings = ["warn_unused_result"]; + let Spellings = [GNU<"warn_unused_result">]; } def Weak : InheritableAttr { - let Spellings = ["weak"]; + let Spellings = [GNU<"weak">]; } def WeakImport : InheritableAttr { - let Spellings = ["weak_import"]; + let Spellings = [GNU<"weak_import">]; } def WeakRef : InheritableAttr { - let Spellings = ["weakref"]; + let Spellings = [GNU<"weakref">]; } def X86ForceAlignArgPointer : InheritableAttr { @@ -595,68 +706,68 @@ def X86ForceAlignArgPointer : InheritableAttr { // AddressSafety attribute (e.g. for AddressSanitizer) def NoAddressSafetyAnalysis : InheritableAttr { - let Spellings = ["no_address_safety_analysis"]; + let Spellings = [GNU<"no_address_safety_analysis">]; } // C/C++ Thread safety attributes (e.g. for deadlock, data race checking) def GuardedVar : InheritableAttr { - let Spellings = ["guarded_var"]; + let Spellings = [GNU<"guarded_var">]; } def PtGuardedVar : InheritableAttr { - let Spellings = ["pt_guarded_var"]; + let Spellings = [GNU<"pt_guarded_var">]; } def Lockable : InheritableAttr { - let Spellings = ["lockable"]; + let Spellings = [GNU<"lockable">]; } def ScopedLockable : InheritableAttr { - let Spellings = ["scoped_lockable"]; + let Spellings = [GNU<"scoped_lockable">]; } def NoThreadSafetyAnalysis : InheritableAttr { - let Spellings = ["no_thread_safety_analysis"]; + let Spellings = [GNU<"no_thread_safety_analysis">]; } def GuardedBy : InheritableAttr { - let Spellings = ["guarded_by"]; + let Spellings = [GNU<"guarded_by">]; let Args = [ExprArgument<"Arg">]; let LateParsed = 1; let TemplateDependent = 1; } def PtGuardedBy : InheritableAttr { - let Spellings = ["pt_guarded_by"]; + let Spellings = [GNU<"pt_guarded_by">]; let Args = [ExprArgument<"Arg">]; let LateParsed = 1; let TemplateDependent = 1; } def AcquiredAfter : InheritableAttr { - let Spellings = ["acquired_after"]; + let Spellings = [GNU<"acquired_after">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def AcquiredBefore : InheritableAttr { - let Spellings = ["acquired_before"]; + let Spellings = [GNU<"acquired_before">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def ExclusiveLockFunction : InheritableAttr { - let Spellings = ["exclusive_lock_function"]; + let Spellings = [GNU<"exclusive_lock_function">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def SharedLockFunction : InheritableAttr { - let Spellings = ["shared_lock_function"]; + let Spellings = [GNU<"shared_lock_function">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; @@ -665,7 +776,7 @@ def SharedLockFunction : InheritableAttr { // The first argument is an integer or boolean value specifying the return value // of a successful lock acquisition. def ExclusiveTrylockFunction : InheritableAttr { - let Spellings = ["exclusive_trylock_function"]; + let Spellings = [GNU<"exclusive_trylock_function">]; let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; @@ -674,43 +785,85 @@ def ExclusiveTrylockFunction : InheritableAttr { // The first argument is an integer or boolean value specifying the return value // of a successful lock acquisition. def SharedTrylockFunction : InheritableAttr { - let Spellings = ["shared_trylock_function"]; + let Spellings = [GNU<"shared_trylock_function">]; let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def UnlockFunction : InheritableAttr { - let Spellings = ["unlock_function"]; + let Spellings = [GNU<"unlock_function">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def LockReturned : InheritableAttr { - let Spellings = ["lock_returned"]; + let Spellings = [GNU<"lock_returned">]; let Args = [ExprArgument<"Arg">]; let LateParsed = 1; let TemplateDependent = 1; } def LocksExcluded : InheritableAttr { - let Spellings = ["locks_excluded"]; + let Spellings = [GNU<"locks_excluded">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def ExclusiveLocksRequired : InheritableAttr { - let Spellings = ["exclusive_locks_required"]; + let Spellings = [GNU<"exclusive_locks_required">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } def SharedLocksRequired : InheritableAttr { - let Spellings = ["shared_locks_required"]; + let Spellings = [GNU<"shared_locks_required">]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; } + +// Microsoft-related attributes + +def MsStruct : InheritableAttr { + let Spellings = [Declspec<"ms_struct">]; +} + +def DLLExport : InheritableAttr { + let Spellings = [Declspec<"dllexport">]; +} + +def DLLImport : InheritableAttr { + let Spellings = [Declspec<"dllimport">]; +} + +def ForceInline : InheritableAttr { + let Spellings = [Declspec<"__forceinline">]; +} + +def Win64 : InheritableAttr { + let Spellings = [Declspec<"w64">]; +} + +def Ptr32 : InheritableAttr { + let Spellings = [Declspec<"__ptr32">]; +} + +def Ptr64 : InheritableAttr { + let Spellings = [Declspec<"__ptr64">]; +} + +def SingleInheritance : InheritableAttr { + let Spellings = [Declspec<"__single_inheritance">]; +} + +def MultipleInheritance : InheritableAttr { + let Spellings = [Declspec<"__multiple_inheritance">]; +} + +def VirtualInheritance : InheritableAttr { + let Spellings = [Declspec<"__virtual_inheritance">]; +} diff --git a/include/clang/Basic/AttrKinds.h b/include/clang/Basic/AttrKinds.h index 9d5ae58..150a30e 100644 --- a/include/clang/Basic/AttrKinds.h +++ b/include/clang/Basic/AttrKinds.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the attr::Kind enum -// +/// +/// \file +/// \brief Defines the clang::attr::Kind enum. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_ATTRKINDS_H @@ -18,7 +19,7 @@ namespace clang { namespace attr { -// Kind - This is a list of all the recognized kinds of attributes. +// \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, diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index d1af218..1b060a5 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -33,7 +33,8 @@ // H -> SEL // a -> __builtin_va_list // A -> "reference" to __builtin_va_list -// V -> Vector, following num elements and a base type. +// 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 @@ -475,6 +476,7 @@ BUILTIN(__builtin___vprintf_chk, "iicC*a", "FP:1:") BUILTIN(__builtin_expect, "LiLiLi" , "nc") BUILTIN(__builtin_prefetch, "vvC*.", "nc") +BUILTIN(__builtin_readcyclecounter, "ULLi", "n") BUILTIN(__builtin_trap, "v", "nr") BUILTIN(__builtin_unreachable, "v", "nr") BUILTIN(__builtin_shufflevector, "v." , "nc") @@ -725,6 +727,10 @@ LIBBUILTIN(strndup, "c*cC*z", "f", "string.h", ALL_LANGUAGES) LIBBUILTIN(index, "c*cC*i", "f", "strings.h", ALL_LANGUAGES) LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h", ALL_LANGUAGES) LIBBUILTIN(bzero, "vv*z", "f", "strings.h", ALL_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_LANGUAGES) LIBBUILTIN(strncasecmp, "icC*cC*z", "f", "strings.h", ALL_LANGUAGES) // POSIX unistd.h @@ -804,33 +810,85 @@ LIBBUILTIN(NSLog, "vG.", "fp:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG) LIBBUILTIN(NSLogv, "vGa", "fP:0:", "Foundation/NSObjCRuntime.h", OBJC_LANG) // Builtin math library functions -LIBBUILTIN(pow, "ddd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(powl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(powf, "fff", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(acos, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(acosl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(acosf, "ff", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sqrt, "dd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sqrtf, "ff", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(asin, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(asinl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(asinf, "ff", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sin, "dd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinl, "LdLd", "fe", "math.h", ALL_LANGUAGES) -LIBBUILTIN(sinf, "ff", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(atan, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(atanl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(atanf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(atan2, "ddd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(atan2l, "LdLdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(atan2f, "fff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(ceil, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(ceill, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(ceilf, "ff", "fe", "math.h", ALL_LANGUAGES) LIBBUILTIN(cos, "dd", "fe", "math.h", ALL_LANGUAGES) LIBBUILTIN(cosl, "LdLd", "fe", "math.h", ALL_LANGUAGES) LIBBUILTIN(cosf, "ff", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(exp, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(expl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(expf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(fabs, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fabsl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fabsf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(floor, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(floorl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(floorf, "ff", "fe", "math.h", ALL_LANGUAGES) + LIBBUILTIN(fma, "dddd", "fc", "math.h", ALL_LANGUAGES) LIBBUILTIN(fmal, "LdLdLdLd", "fc", "math.h", ALL_LANGUAGES) LIBBUILTIN(fmaf, "ffff", "fc", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fmax, "ddd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fmaxl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fmaxf, "fff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(fmin, "ddd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fminl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(fminf, "fff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(log, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(logl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(logf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(pow, "ddd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(powl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(powf, "fff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(round, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(roundl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(roundf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(sin, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(sinl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(sinf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(sqrt, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(sqrtl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(sqrtf, "ff", "fe", "math.h", ALL_LANGUAGES) + +LIBBUILTIN(tan, "dd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(tanl, "LdLd", "fe", "math.h", ALL_LANGUAGES) +LIBBUILTIN(tanf, "ff", "fe", "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, "UiUicC*", "nc") +BUILTIN(__builtin_annotation, "v.", "tn") #undef BUILTIN #undef LIBBUILTIN diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 5afa020..257daf1 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines enum values for all the target-independent builtin -// functions. -// +/// +/// \file +/// \brief Defines enum values for all the target-independent builtin +/// functions. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_BUILTINS_H @@ -56,7 +57,7 @@ struct Info { bool operator!=(const Info &RHS) const { return !(*this == RHS); } }; -/// Builtin::Context - This holds information about target-independent and +/// \brief Holds information about both target-independent and /// target-specific builtins, allowing easy queries by clients. class Context { const Info *TSRecords; @@ -67,7 +68,7 @@ public: /// \brief Perform target-specific initialization void InitializeTarget(const TargetInfo &Target); - /// InitializeBuiltins - Mark the identifiers for all the builtins with their + /// \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); @@ -76,39 +77,39 @@ public: void GetBuiltinNames(SmallVectorImpl<const char *> &Names, bool NoBuiltins); - /// Builtin::GetName - Return the identifier name for the specified builtin, + /// \brief Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". const char *GetName(unsigned ID) const { return GetRecord(ID).Name; } - /// GetTypeString - Get the type descriptor string for the specified builtin. + /// \brief Get the type descriptor string for the specified builtin. const char *GetTypeString(unsigned ID) const { return GetRecord(ID).Type; } - /// isConst - Return true if this function has no side effects and doesn't + /// \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') != 0; } - /// isNoThrow - Return true if we know this builtin never throws an exception. + /// \brief Return true if we know this builtin never throws an exception. bool isNoThrow(unsigned ID) const { return strchr(GetRecord(ID).Attributes, 'n') != 0; } - /// isNoReturn - Return true if we know this builtin never returns. + /// \brief Return true if we know this builtin never returns. bool isNoReturn(unsigned ID) const { return strchr(GetRecord(ID).Attributes, 'r') != 0; } - /// isReturnsTwice - Return true if we know this builtin can return twice. + /// \brief Return true if we know this builtin can return twice. bool isReturnsTwice(unsigned ID) const { return strchr(GetRecord(ID).Attributes, 'j') != 0; } - /// isLibFunction - Return true if this is a builtin for a libc/libm function, + /// \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') != 0; @@ -146,10 +147,10 @@ public: /// argument and whether this function as a va_list argument. bool isScanfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - /// isConstWithoutErrno - 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. + /// \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') != 0; } diff --git a/include/clang/Basic/BuiltinsHexagon.def b/include/clang/Basic/BuiltinsHexagon.def index 334224f..c071a46 100644 --- a/include/clang/Basic/BuiltinsHexagon.def +++ b/include/clang/Basic/BuiltinsHexagon.def @@ -1,4 +1,4 @@ -//==--- BuiltinsHexagon.def - Hexagon Builtin function database --*- C++ -*-==// +//===-- BuiltinsHexagon.def - Hexagon Builtin function database --*- C++ -*-==// // // The LLVM Compiler Infrastructure // @@ -7,683 +7,872 @@ // //===----------------------------------------------------------------------===// // -// This file defines the X86-specific builtin function database. Users of +// This file defines the Hexagon-specific builtin function database. Users of // this file must define the BUILTIN macro to make use of this information. // //===----------------------------------------------------------------------===// -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_C2_bitsset, "bii", "") -BUILTIN(__builtin_HEXAGON_C2_bitsclr, "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_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_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_A2_vcmpbgtu, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmpheq, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmphgt, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmphgtu, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmpweq, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmpwgt, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vcmpwgtu, "bLLiLLi", "") -BUILTIN(__builtin_HEXAGON_C2_tfrpr, "ii", "") -BUILTIN(__builtin_HEXAGON_C2_tfrrp, "bi", "") -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_mpyu_up, "Uiii", "") -BUILTIN(__builtin_HEXAGON_M2_dpmpyss_rnd_s0, "iii", "") -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_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_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_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_M2_hmmpyl_rs1, "iii", "") -BUILTIN(__builtin_HEXAGON_M2_hmmpyh_rs1, "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_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_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_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_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_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_vaddubs, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vaddh, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vaddhs, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vadduhs, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vaddw, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vaddws, "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_vradduh, "iLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vsubub, "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_A2_vminh, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vmaxh, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vminub, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A2_vmaxub, "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_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_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_addasl_rrri, "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_S2_extractu, "iiii", "") -BUILTIN(__builtin_HEXAGON_S2_insertp, "LLiLLiLLiii", "") -BUILTIN(__builtin_HEXAGON_S2_extractup, "LLiLLiii", "") -BUILTIN(__builtin_HEXAGON_S2_insert_rp, "iiiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_extractu_rp, "iiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_insertp_rp, "LLiLLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_extractup_rp, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_tstbit_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_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_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_S2_parityp, "iLLiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_lfsp, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_clbnorm, "ii", "") -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_ct0, "ii", "") -BUILTIN(__builtin_HEXAGON_S2_ct1, "ii", "") -BUILTIN(__builtin_HEXAGON_S2_interleave, "LLiLLi", "") -BUILTIN(__builtin_HEXAGON_S2_deinterleave, "LLiLLi", "") +// The format of this database matches clang/Basic/Builtins.def. -BUILTIN(__builtin_SI_to_SXTHI_asrh, "ii", "") - -BUILTIN(__builtin_M2_vrcmpys_s1, "LLiLLii", "") -BUILTIN(__builtin_M2_vrcmpys_acc_s1, "LLiLLiLLii", "") -BUILTIN(__builtin_M2_vrcmpys_s1rp, "iLLii", "") - -BUILTIN(__builtin_M2_vradduh, "iLLiLLi", "") -BUILTIN(__builtin_A2_addsp, "LLiiLLi", "") -BUILTIN(__builtin_A2_addpsat, "LLiLLiLLi", "") +// The builtins below are not autogenerated from iset.py. +// Make sure you do not overwrite these. -BUILTIN(__builtin_A2_maxp, "LLiLLiLLi", "") -BUILTIN(__builtin_A2_maxup, "LLiLLiLLi", "") - -BUILTIN(__builtin_HEXAGON_A4_orn, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_andn, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_ornp, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A4_andnp, "LLiLLiLLi", "") -BUILTIN(__builtin_HEXAGON_A4_combineir, "LLiii", "") -BUILTIN(__builtin_HEXAGON_A4_combineri, "LLiii", "") -BUILTIN(__builtin_HEXAGON_C4_cmpneqi, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_cmpneq, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_cmpltei, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_cmplte, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_cmplteui, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_cmplteu, "bii", "") -BUILTIN(__builtin_HEXAGON_A4_rcmpneq, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_rcmpneqi, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_rcmpeq, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_rcmpeqi, "iii", "") -BUILTIN(__builtin_HEXAGON_C4_fastcorner9, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_fastcorner9_not, "bii", "") -BUILTIN(__builtin_HEXAGON_C4_and_andn, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_and_and, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_and_orn, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_and_or, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_or_andn, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_or_and, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_or_orn, "biii", "") -BUILTIN(__builtin_HEXAGON_C4_or_or, "biii", "") -BUILTIN(__builtin_HEXAGON_S4_addaddi, "iiii", "") -BUILTIN(__builtin_HEXAGON_S4_subaddi, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_xor_xacc, "LLiLLiLLiLLi", "") - -BUILTIN(__builtin_HEXAGON_M4_and_and, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_and_or, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_and_xor, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_and_andn, "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_M4_or_and, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_or_or, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_or_xor, "iiii", "") -BUILTIN(__builtin_HEXAGON_M4_or_andn, "iiii", "") -BUILTIN(__builtin_HEXAGON_S4_or_andix, "iiii", "") -BUILTIN(__builtin_HEXAGON_S4_or_andi, "iiii", "") -BUILTIN(__builtin_HEXAGON_S4_or_ori, "iiii", "") +BUILTIN(__builtin_SI_to_SXTHI_asrh, "ii", "") +BUILTIN(__builtin_circ_ldd, "LLi*LLi*LLi*ii", "") -BUILTIN(__builtin_HEXAGON_A4_modwrapu, "iii", "") +// The builtins above are not autogenerated from iset.py. +// Make sure you do not overwrite these. -BUILTIN(__builtin_HEXAGON_A4_cround_ri, "iii", "") -BUILTIN(__builtin_HEXAGON_A4_cround_rr, "iii", "") -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_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/BuiltinsMips.def b/include/clang/Basic/BuiltinsMips.def new file mode 100644 index 0000000..d013715 --- /dev/null +++ b/include/clang/Basic/BuiltinsMips.def @@ -0,0 +1,125 @@ +//===-- 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. + +// 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") + +#undef BUILTIN diff --git a/include/clang/Basic/BuiltinsPTX.def b/include/clang/Basic/BuiltinsNVPTX.def index f90a43f..f90a43f 100644 --- a/include/clang/Basic/BuiltinsPTX.def +++ b/include/clang/Basic/BuiltinsNVPTX.def diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 4aea980..75e6074 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -303,8 +303,6 @@ BUILTIN(__builtin_ia32_lddqu, "V16ccC*", "") BUILTIN(__builtin_ia32_palignr128, "V16cV16cV16cIc", "") BUILTIN(__builtin_ia32_insertps128, "V4fV4fV4fi", "") -BUILTIN(__builtin_ia32_storelv4si, "vV2i*V2LLi", "") - BUILTIN(__builtin_ia32_pblendvb128, "V16cV16cV16cV16c", "") BUILTIN(__builtin_ia32_pblendw128, "V8sV8sV8sIi", "") BUILTIN(__builtin_ia32_blendpd, "V2dV2dV2dIi", "") @@ -354,23 +352,30 @@ BUILTIN(__builtin_ia32_pcmpistri128, "iV16cV16cIc", "") BUILTIN(__builtin_ia32_pcmpestrm128, "V16cV16ciV16ciIc", "") BUILTIN(__builtin_ia32_pcmpestri128, "iV16ciV16ciIc","") -// FIXME: These builtins are horribly broken; reenable when PR11305 is fixed. -//BUILTIN(__builtin_ia32_pcmpistria128, "iV16cV16cIc","") -//BUILTIN(__builtin_ia32_pcmpistric128, "iV16cV16cIc","") -//BUILTIN(__builtin_ia32_pcmpistrio128, "iV16cV16cIc","") -//BUILTIN(__builtin_ia32_pcmpistris128, "iV16cV16cIc","") -//BUILTIN(__builtin_ia32_pcmpistriz128, "iV16cV16cIc","") -//BUILTIN(__builtin_ia32_pcmpestria128, "iV16ciV16ciIc","") -//BUILTIN(__builtin_ia32_pcmpestric128, "iV16ciV16ciIc","") -//BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciic","") -//BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","") -//BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","") +BUILTIN(__builtin_ia32_pcmpistria128, "iV16cV16cIc","") +BUILTIN(__builtin_ia32_pcmpistric128, "iV16cV16cIc","") +BUILTIN(__builtin_ia32_pcmpistrio128, "iV16cV16cIc","") +BUILTIN(__builtin_ia32_pcmpistris128, "iV16cV16cIc","") +BUILTIN(__builtin_ia32_pcmpistriz128, "iV16cV16cIc","") +BUILTIN(__builtin_ia32_pcmpestria128, "iV16ciV16ciIc","") +BUILTIN(__builtin_ia32_pcmpestric128, "iV16ciV16ciIc","") +BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciIc","") +BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","") +BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","") BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "") BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "") BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "") BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "") +// SSE4a +BUILTIN(__builtin_ia32_extrqi, "V2LLiV2LLiIcIc", "") +BUILTIN(__builtin_ia32_extrq, "V2LLiV2LLiV16c", "") +BUILTIN(__builtin_ia32_insertqi, "V2LLiV2LLiV2LLiIcIc", "") +BUILTIN(__builtin_ia32_insertq, "V2LLiV2LLiV2LLi", "") +BUILTIN(__builtin_ia32_movntsd, "vd*V2d", "") +BUILTIN(__builtin_ia32_movntss, "vf*V4f", "") + // AES BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "") BUILTIN(__builtin_ia32_aesenclast128, "V2LLiV2LLiV2LLi", "") @@ -379,6 +384,9 @@ BUILTIN(__builtin_ia32_aesdeclast128, "V2LLiV2LLiV2LLi", "") BUILTIN(__builtin_ia32_aesimc128, "V2LLiV2LLi", "") BUILTIN(__builtin_ia32_aeskeygenassist128, "V2LLiV2LLiIc", "") +// CLMUL +BUILTIN(__builtin_ia32_pclmulqdq128, "V2LLiV2LLiV2LLiIc", "") + // AVX BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "") BUILTIN(__builtin_ia32_addsubps256, "V8fV8fV8f", "") @@ -586,6 +594,30 @@ BUILTIN(__builtin_ia32_psrlv4si, "V4iV4iV4i", "") BUILTIN(__builtin_ia32_psrlv4di, "V4LLiV4LLiV4LLi", "") BUILTIN(__builtin_ia32_psrlv2di, "V2LLiV2LLiV2LLi", "") +// GATHER +BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2dV2dC*V4iV2dIc", "") +BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4dV4dC*V4iV4dIc", "") +BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2dV2dC*V2LLiV2dIc", "") +BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4dV4dC*V4LLiV4dIc", "") +BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4fV4fC*V4iV4fIc", "") +BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8fV8fC*V8iV8fIc", "") +BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4fV4fC*V2LLiV4fIc", "") +BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4fV4fC*V4LLiV4fIc", "") + +BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiV2LLiC*V4iV2LLiIc", "") +BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiV4LLiC*V4iV4LLiIc", "") +BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiV2LLiC*V2LLiV2LLiIc", "") +BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiV4LLiC*V4LLiV4LLiIc", "") +BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iV4iC*V4iV4iIc", "") +BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iV8iC*V8iV8iIc", "") +BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iV4iC*V2LLiV4iIc", "") +BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iV4iC*V4LLiV4iIc", "") + +// RDRAND +BUILTIN(__builtin_ia32_rdrand16_step, "UiUs*", "") +BUILTIN(__builtin_ia32_rdrand32_step, "UiUi*", "") +BUILTIN(__builtin_ia32_rdrand64_step, "UiULLi*", "") + // BMI BUILTIN(__builtin_ia32_bextr_u32, "UiUiUi", "") BUILTIN(__builtin_ia32_bextr_u64, "ULLiULLiULLi", "") @@ -632,4 +664,71 @@ BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "") BUILTIN(__builtin_ia32_vfmsubaddps256, "V8fV8fV8fV8f", "") BUILTIN(__builtin_ia32_vfmsubaddpd256, "V4dV4dV4dV4d", "") +// XOP +BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "") +BUILTIN(__builtin_ia32_vpmacsww, "V8sV8sV8sV8s", "") +BUILTIN(__builtin_ia32_vpmacsswd, "V4iV8sV8sV4i", "") +BUILTIN(__builtin_ia32_vpmacswd, "V4iV8sV8sV4i", "") +BUILTIN(__builtin_ia32_vpmacssdd, "V4iV4iV4iV4i", "") +BUILTIN(__builtin_ia32_vpmacsdd, "V4iV4iV4iV4i", "") +BUILTIN(__builtin_ia32_vpmacssdql, "V2LLiV4iV4iV2LLi", "") +BUILTIN(__builtin_ia32_vpmacsdql, "V2LLiV4iV4iV2LLi", "") +BUILTIN(__builtin_ia32_vpmacssdqh, "V2LLiV4iV4iV2LLi", "") +BUILTIN(__builtin_ia32_vpmacsdqh, "V2LLiV4iV4iV2LLi", "") +BUILTIN(__builtin_ia32_vpmadcsswd, "V4iV8sV8sV4i", "") +BUILTIN(__builtin_ia32_vpmadcswd, "V4iV8sV8sV4i", "") + +BUILTIN(__builtin_ia32_vphaddbw, "V8sV16c", "") +BUILTIN(__builtin_ia32_vphaddbd, "V4iV16c", "") +BUILTIN(__builtin_ia32_vphaddbq, "V2LLiV16c", "") +BUILTIN(__builtin_ia32_vphaddwd, "V4iV8s", "") +BUILTIN(__builtin_ia32_vphaddwq, "V2LLiV8s", "") +BUILTIN(__builtin_ia32_vphadddq, "V2LLiV4i", "") +BUILTIN(__builtin_ia32_vphaddubw, "V8sV16c", "") +BUILTIN(__builtin_ia32_vphaddubd, "V4iV16c", "") +BUILTIN(__builtin_ia32_vphaddubq, "V2LLiV16c", "") +BUILTIN(__builtin_ia32_vphadduwd, "V4iV8s", "") +BUILTIN(__builtin_ia32_vphadduwq, "V2LLiV8s", "") +BUILTIN(__builtin_ia32_vphaddudq, "V2LLiV4i", "") +BUILTIN(__builtin_ia32_vphsubbw, "V8sV16c", "") +BUILTIN(__builtin_ia32_vphsubwd, "V4iV8s", "") +BUILTIN(__builtin_ia32_vphsubdq, "V2LLiV4i", "") +BUILTIN(__builtin_ia32_vpcmov, "V2LLiV2LLiV2LLiV2LLi", "") +BUILTIN(__builtin_ia32_vpcmov_256, "V4LLiV4LLiV4LLiV4LLi", "") +BUILTIN(__builtin_ia32_vpperm, "V16cV16cV16cV16c", "") +BUILTIN(__builtin_ia32_vprotb, "V16cV16cV16c", "") +BUILTIN(__builtin_ia32_vprotw, "V8sV8sV8s", "") +BUILTIN(__builtin_ia32_vprotd, "V4iV4iV4i", "") +BUILTIN(__builtin_ia32_vprotq, "V2LLiV2LLiV2LLi", "") +BUILTIN(__builtin_ia32_vprotbi, "V16cV16cIc", "") +BUILTIN(__builtin_ia32_vprotwi, "V8sV8sIc", "") +BUILTIN(__builtin_ia32_vprotdi, "V4iV4iIc", "") +BUILTIN(__builtin_ia32_vprotqi, "V2LLiV2LLiIc", "") +BUILTIN(__builtin_ia32_vpshlb, "V16cV16cV16c", "") +BUILTIN(__builtin_ia32_vpshlw, "V8sV8sV8s", "") +BUILTIN(__builtin_ia32_vpshld, "V4iV4iV4i", "") +BUILTIN(__builtin_ia32_vpshlq, "V2LLiV2LLiV2LLi", "") +BUILTIN(__builtin_ia32_vpshab, "V16cV16cV16c", "") +BUILTIN(__builtin_ia32_vpshaw, "V8sV8sV8s", "") +BUILTIN(__builtin_ia32_vpshad, "V4iV4iV4i", "") +BUILTIN(__builtin_ia32_vpshaq, "V2LLiV2LLiV2LLi", "") +BUILTIN(__builtin_ia32_vpcomub, "V16cV16cV16cIc", "") +BUILTIN(__builtin_ia32_vpcomuw, "V8sV8sV8sIc", "") +BUILTIN(__builtin_ia32_vpcomud, "V4iV4iV4iIc", "") +BUILTIN(__builtin_ia32_vpcomuq, "V2LLiV2LLiV2LLiIc", "") +BUILTIN(__builtin_ia32_vpcomb, "V16cV16cV16cIc", "") +BUILTIN(__builtin_ia32_vpcomw, "V8sV8sV8sIc", "") +BUILTIN(__builtin_ia32_vpcomd, "V4iV4iV4iIc", "") +BUILTIN(__builtin_ia32_vpcomq, "V2LLiV2LLiV2LLiIc", "") +BUILTIN(__builtin_ia32_vpermil2pd, "V2dV2dV2dV2LLiIc", "") +BUILTIN(__builtin_ia32_vpermil2pd256, "V4dV4dV4dV4LLiIc", "") +BUILTIN(__builtin_ia32_vpermil2ps, "V4fV4fV4fV4iIc", "") +BUILTIN(__builtin_ia32_vpermil2ps256, "V8fV8fV8fV8iIc", "") +BUILTIN(__builtin_ia32_vfrczss, "V4fV4f", "") +BUILTIN(__builtin_ia32_vfrczsd, "V2dV2d", "") +BUILTIN(__builtin_ia32_vfrczps, "V4fV4f", "") +BUILTIN(__builtin_ia32_vfrczpd, "V2dV2d", "") +BUILTIN(__builtin_ia32_vfrczps256, "V8fV8f", "") +BUILTIN(__builtin_ia32_vfrczpd256, "V4dV4d", "") + #undef BUILTIN diff --git a/include/clang/Basic/CMakeLists.txt b/include/clang/Basic/CMakeLists.txt index 3df88c7..274b94d 100644 --- a/include/clang/Basic/CMakeLists.txt +++ b/include/clang/Basic/CMakeLists.txt @@ -7,6 +7,7 @@ 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) diff --git a/include/clang/Basic/CommentNodes.td b/include/clang/Basic/CommentNodes.td new file mode 100644 index 0000000..7bf32b7 --- /dev/null +++ b/include/clang/Basic/CommentNodes.td @@ -0,0 +1,27 @@ +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/ConvertUTF.h b/include/clang/Basic/ConvertUTF.h index 7fb5874..e7cfa8a 100644 --- a/include/clang/Basic/ConvertUTF.h +++ b/include/clang/Basic/ConvertUTF.h @@ -110,6 +110,8 @@ typedef unsigned char Boolean; /* 0 or 1 */ #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF #define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF +#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT 4 + typedef enum { conversionOK, /* conversion successful */ sourceExhausted, /* partial character in source, but hit end */ @@ -139,11 +141,13 @@ ConversionResult ConvertUTF8toUTF32 ( ConversionResult ConvertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); +#endif ConversionResult ConvertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); +#ifdef CLANG_NEEDS_THESE_ONE_DAY ConversionResult ConvertUTF16toUTF32 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); @@ -159,6 +163,37 @@ Boolean isLegalUTF8String(const UTF8 *source, const UTF8 *sourceEnd); #ifdef __cplusplus } + +/*************************************************************************/ +/* Below are LLVM-specific wrappers of the functions above. */ + +#include "llvm/ADT/StringRef.h" + +namespace clang { + +/** + * Convert an UTF8 StringRef to UTF8, UTF16, or UTF32 depending on + * WideCharWidth. The converted data is written to ResultPtr, which needs to + * point to at least WideCharWidth * (Source.Size() + 1) bytes. On success, + * ResultPtr will point one after the end of the copied string. + * \return true on success. + */ +bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source, + char *&ResultPtr); + +/** + * Convert an Unicode code point to UTF8 sequence. + * + * \param Source a Unicode code point. + * \param [in,out] ResultPtr pointer to the output buffer, needs to be at least + * \c UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes. On success \c ResultPtr is + * updated one past end of the converted sequence. + * + * \returns true on success. + */ +bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr); + +} #endif #endif diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index e157178..3997fb8 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Diagnostic-related interfaces. -// +/// +/// \file +/// \brief Defines the Diagnostic-related interfaces. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DIAGNOSTIC_H @@ -82,7 +83,7 @@ public: } /// \brief Create a code modification hint that inserts the given - /// code from \arg FromRange at a specific location. + /// code from \p FromRange at a specific location. static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc, CharSourceRange FromRange, bool BeforePreviousInsertions = false) { @@ -121,14 +122,15 @@ public: } }; -/// DiagnosticsEngine - This concrete class is used by the front-end to report -/// problems and issues. It 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. +/// \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> { public: - /// Level - The level of the diagnostic, after it has been through mapping. + /// \brief The level of the diagnostic, after it has been through mapping. enum Level { Ignored = DiagnosticIDs::Ignored, Note = DiagnosticIDs::Note, @@ -137,34 +139,36 @@ public: Fatal = DiagnosticIDs::Fatal }; - /// ExtensionHandling - How do we handle otherwise-unmapped extension? This - /// is controlled by -pedantic and -pedantic-errors. + /// \brief How do we handle otherwise-unmapped extension? + /// + /// This is controlled by -pedantic and -pedantic-errors. enum ExtensionHandling { Ext_Ignore, Ext_Warn, Ext_Error }; enum ArgumentKind { - ak_std_string, // std::string - ak_c_string, // const char * - ak_sint, // int - ak_uint, // unsigned - ak_identifierinfo, // IdentifierInfo - ak_qualtype, // QualType - ak_declarationname, // DeclarationName - ak_nameddecl, // NamedDecl * - ak_nestednamespec, // NestedNameSpecifier * - ak_declcontext // DeclContext * + ak_std_string, ///< std::string + ak_c_string, ///< const char * + ak_sint, ///< int + ak_uint, ///< 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> }; - /// Specifies which overload candidates to display when overload resolution - /// fails. + /// \brief Specifies which overload candidates to display when overload + /// resolution fails. enum OverloadsShown { Ovl_All, ///< Show all overloads. Ovl_Best ///< Show just the "best" overload candidates. }; - /// ArgumentValue - This typedef represents on argument value, which is a - /// union discriminated by ArgumentKind, with a value. + /// \brief Represents on argument value, which is a union discriminated + /// by ArgumentKind, with a value. typedef std::pair<ArgumentKind, intptr_t> ArgumentValue; private: @@ -175,6 +179,9 @@ private: 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, @@ -187,12 +194,13 @@ private: bool OwnsDiagClient; 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::Mapping), 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. + /// \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::Mapping), 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 @@ -220,8 +228,10 @@ private: 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. + /// 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; @@ -239,9 +249,11 @@ private: } }; - /// \brief A 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. + /// \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; @@ -255,25 +267,24 @@ private: } void PushDiagStatePoint(DiagState *State, SourceLocation L) { - FullSourceLoc Loc(L, *SourceMgr); + FullSourceLoc Loc(L, getSourceManager()); // Make sure that DiagStatePoints is always sorted according to Loc. - assert((Loc.isValid() || DiagStatePoints.empty()) && - "Adding invalid loc point after another point"); - assert((Loc.isInvalid() || DiagStatePoints.empty() || - DiagStatePoints.back().Loc.isInvalid() || + 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, - FullSourceLoc(Loc, *SourceMgr))); + 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; - /// ErrorOccurred / FatalErrorOccurred - This is set to true when an error or - /// fatal error is emitted, and is sticky. + /// \brief Sticky flag set to \c true when an error is emitted. bool ErrorOccurred; + + /// \brief Sticky flag set to \c true when a fatal error is emitted. bool FatalErrorOccurred; /// \brief Indicates that an unrecoverable error has occurred. @@ -284,18 +295,20 @@ private: unsigned TrapNumErrorsOccurred; unsigned TrapNumUnrecoverableErrorsOccurred; - /// LastDiagLevel - This is the level of the last diagnostic emitted. This is - /// used to emit continuation diagnostics with the same level as the + /// \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 - unsigned NumErrorsSuppressed; // Number of errors suppressed + unsigned NumWarnings; ///< Number of warnings reported + unsigned NumErrors; ///< Number of errors reported + unsigned NumErrorsSuppressed; ///< Number of errors suppressed - /// ArgToStringFn - A function pointer that converts an opaque diagnostic - /// argument to a strings. This takes the modifiers and argument that was - /// present in the diagnostic. + /// \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 (whose length is NumPrevArgs) indicates the previous /// arguments formatted for this diagnostic. Implementations of this function @@ -361,14 +374,15 @@ public: // how diagnostics are emitted. // - /// pushMappings - Copies the current DiagMappings and pushes the new copy + /// \brief Copies the current DiagMappings and pushes the new copy /// onto the top of the stack. void pushMappings(SourceLocation Loc); - /// popMappings - Pops the current DiagMappings off the top of the stack - /// causing the new top of the stack to be the active mappings. Returns - /// true if the pop happens, false if there is only one DiagMapping on the - /// stack. + /// \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. @@ -377,8 +391,10 @@ public: /// ownership of \c client. void setClient(DiagnosticConsumer *client, bool ShouldOwnClient = true); - /// setErrorLimit - Specify a limit for the number of errors we should - /// emit before giving up. Zero disables the limit. + /// \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 @@ -405,29 +421,28 @@ public: return ConstexprBacktraceLimit; } - /// setIgnoreAllWarnings - When set to true, any unmapped warnings are - /// ignored. If this and WarningsAsErrors are both set, then this one wins. + /// \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; } - /// setEnableAllWarnings - When set to true, any unmapped ignored warnings - /// are no longer ignored. If this and IgnoreAllWarnings are both set, - /// then that one wins. + /// \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 getEnableAllWarnngs() const { return EnableAllWarnings; } - /// setWarningsAsErrors - When set to true, any warnings reported are issued - /// as errors. + /// \brief When set to true, any warnings reported are issued as errors. void setWarningsAsErrors(bool Val) { WarningsAsErrors = Val; } bool getWarningsAsErrors() const { return WarningsAsErrors; } - /// setErrorsAsFatal - When set to true, any error reported is made a - /// fatal error. + /// \brief When set to true, any error reported is made a fatal error. void setErrorsAsFatal(bool Val) { ErrorsAsFatal = Val; } bool getErrorsAsFatal() const { return ErrorsAsFatal; } - /// setSuppressSystemWarnings - When set to true mask warnings that - /// come from system headers. + /// \brief When set to true mask warnings that come from system headers. void setSuppressSystemWarnings(bool Val) { SuppressSystemWarnings = Val; } bool getSuppressSystemWarnings() const { return SuppressSystemWarnings; } @@ -438,76 +453,105 @@ public: 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. + /// 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. This can - /// be used by clients who suppress diagnostics themselves. + /// \brief Pretend that the last diagnostic issued was ignored. + /// + /// This can be used by clients who suppress diagnostics themselves. void setLastDiagnosticIgnored() { LastDiagLevel = DiagnosticIDs::Ignored; } - /// setExtensionHandlingBehavior - This controls whether otherwise-unmapped - /// extension diagnostics are mapped onto ignore/warning/error. This - /// corresponds to the GCC -pedantic and -pedantic-errors option. + /// \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(ExtensionHandling H) { ExtBehavior = H; } ExtensionHandling getExtensionHandlingBehavior() const { return ExtBehavior; } - /// AllExtensionsSilenced - This is a counter bumped when an __extension__ - /// block is encountered. When non-zero, all extension diagnostics are - /// entirely silenced, no matter how they are mapped. + /// \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. + /// \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 setDiagnosticMapping(diag::kind Diag, diag::Mapping Map, SourceLocation Loc); - /// setDiagnosticGroupMapping - Change an entire diagnostic group (e.g. - /// "unknown-pragmas" to have the specified mapping. This returns true and - /// ignores the request if "Group" was unknown, false otherwise. + /// \brief Change an entire diagnostic group (e.g. "unknown-pragmas") to + /// have the specified mapping. /// - /// 'Loc' is the source location that this change of diagnostic state should + /// \returns true (and ignores the request) if "Group" was unknown, false + /// otherwise. + /// + /// \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 setDiagnosticGroupMapping(StringRef Group, diag::Mapping Map, SourceLocation Loc = SourceLocation()); - /// \brief Set the warning-as-error flag for the given diagnostic. This - /// function always only operates on the current diagnostic state. + /// \brief Set the warning-as-error flag for the given diagnostic. + /// + /// This function always only operates on the current diagnostic state. void setDiagnosticWarningAsError(diag::kind Diag, bool Enabled); - /// \brief Set the warning-as-error flag for the given diagnostic group. This - /// function always only operates on the current diagnostic state. + /// \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. This function - /// always only operates on the current diagnostic state. + /// \brief Set the error-as-fatal flag for the given diagnostic. + /// + /// This function always only operates on the current diagnostic state. void setDiagnosticErrorAsFatal(diag::kind Diag, bool Enabled); - /// \brief Set the error-as-fatal flag for the given diagnostic group. This - /// function always only operates on the current diagnostic state. + /// \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. Mainly to be used - /// by -Wno-everything to disable all warnings but allow subsequent -W options - /// to enable specific warnings. + /// \brief Add the specified mapping to all diagnostics. + /// + /// Mainly to be used by -Wno-everything to disable all warnings but allow + /// subsequent -W options to enable specific warnings. void setMappingToAllDiagnostics(diag::Mapping Map, SourceLocation Loc = SourceLocation()); @@ -525,15 +569,16 @@ public: this->NumWarnings = NumWarnings; } - /// getCustomDiagID - Return an ID for a diagnostic with the specified message - /// and level. If this is the first request for this diagnosic, it is - /// registered and created, otherwise the existing ID is returned. + /// \brief Return an ID for a diagnostic with the specified message and level. + /// + /// If this is the first request for this diagnosic, it is registered and + /// created, otherwise the existing ID is returned. unsigned getCustomDiagID(Level L, StringRef Message) { return Diags->getCustomDiagID((DiagnosticIDs::Level)L, Message); } - /// ConvertArgToString - This method converts a diagnostic argument (as an - /// intptr_t) into the string that represents it. + /// \brief Converts a diagnostic argument (as an intptr_t) into the string + /// that represents it. void ConvertArgToString(ArgumentKind Kind, intptr_t Val, const char *Modifier, unsigned ModLen, const char *Argument, unsigned ArgLen, @@ -568,12 +613,15 @@ public: return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this); } - /// Report - Issue the message to the client. @c DiagID is a member of the - /// @c diag::kind enum. This actually returns aninstance of DiagnosticBuilder - /// which emits the diagnostics (through @c ProcessDiag) when it is destroyed. - /// @c Pos represents the source location associated with the diagnostic, + /// \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 Pos, unsigned DiagID); + inline DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID); inline DiagnosticBuilder Report(unsigned DiagID); void Report(const StoredDiagnostic &storedDiag); @@ -624,55 +672,60 @@ private: friend class PartialDiagnostic; friend class DiagnosticErrorTrap; - /// CurDiagLoc - This is the location of the current diagnostic that is in - /// flight. + /// \brief The location of the current diagnostic that is in flight. SourceLocation CurDiagLoc; - /// CurDiagID - This is the ID of the current diagnostic that is in flight. + /// \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 { - /// MaxArguments - 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. + /// \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, - /// MaxRanges - The maximum number of ranges we can hold. + /// \brief The maximum number of ranges we can hold. MaxRanges = 10, - /// MaxFixItHints - The maximum number of ranges we can hold. + /// \brief The maximum number of ranges we can hold. MaxFixItHints = 10 }; - /// NumDiagArgs - This contains the number of entries in Arguments. + /// \brief The number of entries in Arguments. signed char NumDiagArgs; - /// NumDiagRanges - This is the number of ranges in the DiagRanges array. + /// \brief The number of ranges in the DiagRanges array. unsigned char NumDiagRanges; - /// NumDiagFixItHints - This is the number of hints in the DiagFixItHints - /// array. + /// \brief The number of hints in the DiagFixItHints array. unsigned char NumDiagFixItHints; - /// DiagArgumentsKind - This is an array of ArgumentKind::ArgumentKind enum - /// values, with one for each argument. This specifies whether the argument - /// is in DiagArgumentsStr or in DiagArguments. + /// \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]; - /// DiagArgumentsStr - This holds the values of each string argument for the - /// current diagnostic. This value is only used when the corresponding - /// ArgumentKind is ak_std_string. + /// \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]; - /// DiagArgumentsVal - 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. + /// \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]; - /// DiagRanges - The list of ranges added to this diagnostic. + /// \brief The list of ranges added to this diagnostic. CharSourceRange DiagRanges[MaxRanges]; - /// FixItHints - If valid, provides a hint with some code to insert, remove, + /// \brief If valid, provides a hint with some code to insert, remove, /// or modify at a particular position. FixItHint DiagFixItHints[MaxFixItHints]; @@ -691,11 +744,9 @@ private: return MappingInfo; } - /// ProcessDiag - This is the method used to report a diagnostic that is - /// finally fully formed. + /// \brief Used to report a diagnostic that is finally fully formed. /// - /// \returns true if the diagnostic was emitted, false if it was - /// suppressed. + /// \returns true if the diagnostic was emitted, false if it was suppressed. bool ProcessDiag() { return Diags->ProcessDiag(*this); } @@ -710,7 +761,9 @@ protected: friend class Sema; /// \brief Emit the current diagnostic and clear the diagnostic state. - bool EmitCurrentDiagnostic(); + /// + /// \param Force Emit the diagnostic regardless of suppression settings. + bool EmitCurrentDiagnostic(bool Force = false); unsigned getCurrentDiagID() const { return CurDiagID; } @@ -746,7 +799,7 @@ public: return Diag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors; } - // Set to initial state of "no errors occurred". + /// \brief Set to initial state of "no errors occurred". void reset() { NumErrors = Diag.TrapNumErrorsOccurred; NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred; @@ -757,11 +810,12 @@ public: // DiagnosticBuilder //===----------------------------------------------------------------------===// -/// DiagnosticBuilder - This is 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. +/// \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. @@ -779,15 +833,25 @@ class DiagnosticBuilder { // Emit() would end up with if we used that as our status variable. mutable bool IsActive; + /// \brief Flag indicating that this diagnostic is being emitted via a + /// call to ForceEmit. + mutable bool IsForceEmit; + void operator=(const DiagnosticBuilder&); // DO NOT IMPLEMENT friend class DiagnosticsEngine; + + DiagnosticBuilder() + : DiagObj(0), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(false), + IsForceEmit(false) { } + explicit DiagnosticBuilder(DiagnosticsEngine *diagObj) - : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(true) { + : DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixits(0), IsActive(true), + IsForceEmit(false) { assert(diagObj && "DiagnosticBuilder requires a valid DiagnosticsEngine!"); } friend class PartialDiagnostic; - + protected: void FlushCounts() { DiagObj->NumDiagArgs = NumArgs; @@ -799,9 +863,10 @@ protected: void Clear() const { DiagObj = 0; IsActive = false; + IsForceEmit = false; } - /// isActive - Determine whether this diagnostic is still active. + /// \brief Determine whether this diagnostic is still active. bool isActive() const { return IsActive; } /// \brief Force the diagnostic builder to emit the diagnostic now. @@ -821,7 +886,7 @@ protected: FlushCounts(); // Process the diagnostic. - bool Result = DiagObj->EmitCurrentDiagnostic(); + bool Result = DiagObj->EmitCurrentDiagnostic(IsForceEmit); // This diagnostic is dead. Clear(); @@ -835,20 +900,36 @@ public: DiagnosticBuilder(const DiagnosticBuilder &D) { DiagObj = D.DiagObj; IsActive = D.IsActive; + IsForceEmit = D.IsForceEmit; D.Clear(); NumArgs = D.NumArgs; NumRanges = D.NumRanges; NumFixits = D.NumFixits; } - /// Destructor - The dtor emits the diagnostic. + /// \brief Retrieve an empty diagnostic builder. + static DiagnosticBuilder getEmpty() { + return DiagnosticBuilder(); + } + + /// \brief Emits the diagnostic. ~DiagnosticBuilder() { Emit(); } - /// Operator bool: conversion of DiagnosticBuilder to bool always returns - /// true. This allows is to be used in boolean error contexts like: + /// \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 { @@ -951,9 +1032,6 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, return DB; } -/// Report - Issue the message to the client. DiagID is a member of the -/// diag::kind enum. This actually returns a new instance of DiagnosticBuilder -/// which emits the diagnostics (through ProcessDiag) when it is destroyed. inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc, unsigned DiagID){ assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); @@ -969,9 +1047,9 @@ inline DiagnosticBuilder DiagnosticsEngine::Report(unsigned DiagID) { // Diagnostic //===----------------------------------------------------------------------===// -/// Diagnostic - This is a little helper class (which is basically a smart -/// pointer that forward info from DiagnosticsEngine) that allows clients to -/// enquire about the currently in-flight 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; @@ -988,62 +1066,71 @@ public: unsigned getNumArgs() const { return DiagObj->NumDiagArgs; } - /// getArgKind - Return the kind of the specified index. Based on the kind - /// of argument, the accessors below can be used to get the value. + /// \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]; } - /// getArgStdStr - Return the provided argument string specified by 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]; } - /// getArgCStr - Return the specified C string argument. + /// \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]); } - /// getArgSInt - Return the specified signed integer argument. + /// \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]; } - /// getArgUInt - Return the specified unsigned integer argument. + /// \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]; } - /// getArgIdentifier - Return the specified IdentifierInfo argument. + /// \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]); } - /// getRawArg - Return the specified non-string argument in an opaque form. + /// \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]; } - - /// getNumRanges - Return the number of source ranges associated with this - /// diagnostic. + /// \brief Return the number of source ranges associated with this diagnostic. unsigned getNumRanges() const { return DiagObj->NumDiagRanges; } + /// \pre Idx < getNumRanges() const CharSourceRange &getRange(unsigned Idx) const { assert(Idx < DiagObj->NumDiagRanges && "Invalid diagnostic range index!"); return DiagObj->DiagRanges[Idx]; @@ -1067,13 +1154,14 @@ public: return getNumFixItHints()? DiagObj->DiagFixItHints : 0; } - /// FormatDiagnostic - Format this diagnostic into a string, substituting the - /// formal arguments into the %0 slots. The result is appended onto the Str - /// array. + /// \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; - /// FormatDiagnostic - Format the given format-string into the - /// output buffer using the arguments stored in this diagnostic. + /// \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; }; @@ -1131,12 +1219,12 @@ public: } }; -/// DiagnosticConsumer - This is an abstract interface implemented by clients of -/// the front-end, which formats and prints fully processed diagnostics. +/// \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 + unsigned NumWarnings; ///< Number of warnings reported + unsigned NumErrors; ///< Number of errors reported public: DiagnosticConsumer() : NumWarnings(0), NumErrors(0) { } @@ -1147,7 +1235,7 @@ public: virtual ~DiagnosticConsumer(); - /// BeginSourceFile - Callback to inform the diagnostic client that processing + /// \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 @@ -1155,32 +1243,35 @@ public: /// diagnostics with source range information are required to only be emitted /// in between BeginSourceFile() and EndSourceFile(). /// - /// \arg LO - The language options for the source file being processed. - /// \arg PP - The preprocessor object being used for the source; this optional - /// and may not be present, for example when processing AST source files. + /// \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 = 0) {} - /// EndSourceFile - 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 \see BeginSourceFile() are inaccessible. + /// \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() {} - /// IncludeInDiagnosticCounts - This method (whose default implementation - /// returns true) indicates whether the diagnostics handled by this + /// \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; - /// HandleDiagnostic - Handle this diagnostic, reporting it to the user or + /// \brief Handle this diagnostic, reporting it to the user or /// capturing it to a log as needed. /// - /// Default implementation just keeps track of the total number of warnings - /// and errors. + /// The default implementation just keeps track of the total number of + /// warnings and errors. virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info); @@ -1189,8 +1280,7 @@ public: virtual DiagnosticConsumer *clone(DiagnosticsEngine &Diags) const = 0; }; -/// IgnoringDiagConsumer - This is a diagnostic client that just ignores all -/// diags. +/// \brief A diagnostic client that ignores all diagnostics. class IgnoringDiagConsumer : public DiagnosticConsumer { virtual void anchor(); void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, @@ -1202,6 +1292,22 @@ class IgnoringDiagConsumer : public DiagnosticConsumer { } }; +// 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; + } // end namespace clang #endif diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td index 109cd08..6dfecdc 100644 --- a/include/clang/Basic/Diagnostic.td +++ b/include/clang/Basic/Diagnostic.td @@ -88,6 +88,7 @@ class AccessControl { bit AccessControl = 1; } // Definitions for Diagnostics. include "DiagnosticASTKinds.td" include "DiagnosticAnalysisKinds.td" +include "DiagnosticCommentKinds.td" include "DiagnosticCommonKinds.td" include "DiagnosticDriverKinds.td" include "DiagnosticFrontendKinds.td" diff --git a/include/clang/Basic/DiagnosticCommentKinds.td b/include/clang/Basic/DiagnosticCommentKinds.td new file mode 100644 index 0000000..235ca79 --- /dev/null +++ b/include/clang/Basic/DiagnosticCommentKinds.td @@ -0,0 +1,125 @@ +//==--- 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 he 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">; + +// Commands + +def warn_doc_block_command_empty_paragraph : Warning< + "empty paragraph passed to '\\%0' command">, + InGroup<Documentation>, DefaultIgnore; + +def warn_doc_block_command_duplicate : Warning< + "duplicated command '\\%0'">, + InGroup<Documentation>, DefaultIgnore; + +def note_doc_block_command_previous : Note< + "previous command '\\%0' here">; + +def note_doc_block_command_previous_alias : Note< + "previous command '\\%0' (an alias of '\\%1') 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< + "'\\param' command used in a comment that is not attached to " + "a function 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< + "'\\tparam' 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< + "'\\%0' 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< + "'\\%0' command used in a comment that is attached to a " + "%select{function returning void|constructor|destructor|" + "method returning void}1">, + InGroup<Documentation>, DefaultIgnore; + +} // end of documentation issue category +} // end of AST component diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 103fc00..f859287 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -74,6 +74,8 @@ def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, def warn_module_build : Warning<"building module '%0' from source">, InGroup<ModuleBuild>, DefaultIgnore; 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">; // Sema && Lex def ext_longlong : Extension< @@ -106,4 +108,8 @@ 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">; } diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index b443159..583b234 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -33,8 +33,6 @@ 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_unable_to_make_temp : Error< - "unable to make temporary file: %0">; def err_drv_unable_to_remove_file : Error< "unable to remove file: %0">; def err_drv_command_failure : Error< @@ -94,23 +92,32 @@ def err_drv_invalid_arch_for_deployment_target : Error< def err_drv_objc_gc_arr : Error< "cannot specify both '-fobjc-arc' and '%0'">; def err_arc_nonfragile_abi : Error< - "-fobjc-arc is not supported with fragile abi">; + "-fobjc-arc is not supported with legacy abi">; def err_arc_unsupported : Error< "-fobjc-arc is not supported on current deployment target">; def err_drv_mg_requires_m_or_mm : Error< "option '-MG' requires '-M' or '-MM'">; +def err_drv_asan_android_requires_pie : Error< + "AddressSanitizer on Android requires '-pie'">; +def err_drv_unknown_objc_runtime : Error< + "unknown or ill-formed Objective-C runtime '%0'">; def warn_c_kext : Warning< - "ignoring -fapple-kext which is valid for c++ and objective-c++ only">; + "ignoring -fapple-kext which is valid for C++ and Objective-C++ only">; def warn_drv_input_file_unused : Warning< - "%0: '%1' input unused when '%2' is present">; + "%0: '%1' input unused%select{ when '%3' is present|}2">, + InGroup<DiagGroup<"unused-command-line-argument">>; +def warn_drv_input_file_unused_by_cpp : Warning< + "%0: '%1' input unused in cpp mode">, + InGroup<DiagGroup<"unused-command-line-argument">>; def warn_drv_preprocessed_input_file_unused : Warning< - "%0: previously preprocessed input unused when '%1' is present">; + "%0: previously preprocessed input%select{ unused when '%2' is present|}1">, + InGroup<DiagGroup<"unused-command-line-argument">>; def warn_drv_unused_argument : Warning< "argument unused during compilation: '%0'">, InGroup<DiagGroup<"unused-command-line-argument">>; def warn_drv_empty_joined_argument : Warning< - "joined argument expects addition arg: '%0'">, + "joined argument expects additional value: '%0'">, InGroup<DiagGroup<"unused-command-line-argument">>; def warn_drv_not_using_clang_cpp : Warning< "not using the clang preprocessor due to user override">; diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index 5d6b887..417a22c 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -48,14 +48,12 @@ 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_unable_to_rename_temp : Error< - "unable to rename temporary '%0' to output file '%1': '%2'">; def err_fe_unable_to_open_logfile : Error< "unable to open logfile 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.">; + "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< @@ -65,6 +63,10 @@ def warn_fe_serialized_diag_failure : Warning< "unable to open file %0 for serializing diagnostics (%1)">, InGroup<DiagGroup<"serialized-diagnostics">>; +def err_verify_missing_line : Error< + "missing or invalid line number following '@' in expected %0">; +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< @@ -93,19 +95,19 @@ def warn_unknown_warning_option : Warning< "unknown warning option '%0'">, InGroup<DiagGroup<"unknown-warning-option"> >; def warn_unknown_negative_warning_option : Warning< - "unknown warning option '%0'?">, - InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore; + "unknown warning option '%0'">, + InGroup<DiagGroup<"unknown-warning-option"> >; def warn_unknown_warning_option_suggest : Warning< "unknown warning option '%0'; did you mean '%1'?">, InGroup<DiagGroup<"unknown-warning-option"> >; def warn_unknown_negative_warning_option_suggest : Warning< "unknown warning option '%0'; did you mean '%1'?">, - InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore; + InGroup<DiagGroup<"unknown-warning-option"> >; def warn_unknown_warning_specifier : Warning< "unknown %0 warning specifier: '%1'">, InGroup<DiagGroup<"unknown-warning-option"> >; -def warn_unknown_analyzer_checker : Warning< +def err_unknown_analyzer_checker : Error< "no analyzer checkers are associated with '%0'">; def warn_incompatible_analyzer_plugin_api : Warning< "checker plugin '%0' is not compatible with this version of the analyzer">, diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index c839853..b95a90b 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -25,6 +25,7 @@ def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">; def : DiagGroup<"attributes">; def : DiagGroup<"bad-function-cast">; def Availability : DiagGroup<"availability">; +def Section : DiagGroup<"section">; def AutoImport : DiagGroup<"auto-import">; def ConstantConversion : DiagGroup<"constant-conversion">; def LiteralConversion : DiagGroup<"literal-conversion">; @@ -32,6 +33,7 @@ def StringConversion : DiagGroup<"string-conversion">; def SignConversion : DiagGroup<"sign-conversion">; def BoolConversion : DiagGroup<"bool-conversion">; def IntConversion : DiagGroup<"int-conversion">; +def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">; def NullConversion : DiagGroup<"null-conversion">; def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">; def CXXCompat: DiagGroup<"c++-compat">; @@ -56,8 +58,13 @@ def DeprecatedImplementations :DiagGroup<"deprecated-implementations">; def : DiagGroup<"disabled-optimization">; def : DiagGroup<"discard-qual">; def : DiagGroup<"div-by-zero">; +def DocumentationHTML : DiagGroup<"documentation-html">; +def DocumentationPedantic : DiagGroup<"documentation-pedantic">; +def Documentation : DiagGroup<"documentation", [DocumentationHTML]>; def EmptyBody : DiagGroup<"empty-body">; def ExtraTokens : DiagGroup<"extra-tokens">; +def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">; +def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>; def FormatExtraArgs : DiagGroup<"format-extra-args">; def FormatZeroLength : DiagGroup<"format-zero-length">; @@ -96,6 +103,7 @@ def CXX11Compat : DiagGroup<"c++11-compat", def : DiagGroup<"c++0x-compat", [CXX11Compat]>; 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">; @@ -142,9 +150,13 @@ def : 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">; def OverlengthStrings : DiagGroup<"overlength-strings">; def OverloadedVirtual : DiagGroup<"overloaded-virtual">; def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">; +def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">; def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">; def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">; def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">; @@ -162,7 +174,8 @@ def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">; def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>; def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy", [CXX98CompatBindToTemporaryCopy]>; -def SelfAssignment : DiagGroup<"self-assign">; +def SelfAssignmentField : DiagGroup<"self-assign-field">; +def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>; def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">; def Sentinel : DiagGroup<"sentinel">; def MissingMethodReturnType : DiagGroup<"missing-method-return-type">; @@ -206,12 +219,18 @@ def MethodDuplicate : DiagGroup<"duplicate-method-match">; def CoveredSwitchDefault : DiagGroup<"covered-switch-default">; 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 Unicode : DiagGroup<"unicode">; -def Uninitialized : DiagGroup<"uninitialized">; def UninitializedMaybe : DiagGroup<"conditional-uninitialized">; +def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">; +def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes]>; def UnknownPragmas : DiagGroup<"unknown-pragmas">; def NSobjectAttribute : DiagGroup<"NSObject-attribute">; def UnknownAttributes : DiagGroup<"attributes">; @@ -223,6 +242,7 @@ 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]>; @@ -250,7 +270,6 @@ def AutomaticReferenceCounting : DiagGroup<"arc", ARCRetainCycles, ARCNonPodMemAccess]>; def Selector : DiagGroup<"selector">; -def NonfragileAbi2 : DiagGroup<"nonfragile-abi2">; def Protocol : DiagGroup<"protocol">; def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">; def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">; @@ -296,7 +315,8 @@ def Conversion : DiagGroup<"conversion", StringConversion, SignConversion, BoolConversion, - NullConversion, + NullConversion, // NULL->non-pointer + NonLiteralNullConversion, // (1-1)->pointer (etc) IntConversion]>, DiagCategory<"Value Conversion Issue">; @@ -304,6 +324,7 @@ def Unused : DiagGroup<"unused", [UnusedArgument, UnusedFunction, UnusedLabel, // UnusedParameter, (matches GCC's behavior) // UnusedMemberFunction, (clean-up llvm before enabling) + UnusedPrivateField, UnusedValue, UnusedVariable]>, DiagCategory<"Unused Entity Issue">; @@ -354,13 +375,19 @@ def Most : DiagGroup<"most", [ ]>; // Thread Safety warnings -def ThreadSafety : DiagGroup<"thread-safety">; +def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">; +def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">; +def ThreadSafety : DiagGroup<"thread-safety", + [ThreadSafetyAttributes, ThreadSafetyAnalysis]>; // 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 : DiagGroup<"all", [Most, Parentheses, Switch]>; +// 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=-Wendif-tokens @@ -381,7 +408,7 @@ def NonGCC : DiagGroup<"non-gcc", // A warning group for warnings about using C++11 features as extensions in // earlier C++ versions. -def CXX11 : DiagGroup<"c++11-extensions">; +def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi]>; def : DiagGroup<"c++0x-extensions", [CXX11]>; def DelegatingCtorCycles : DiagGroup<"delegating-ctor-cycles">; @@ -413,3 +440,8 @@ def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [ def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [ ObjCRedundantAPIUse ]>; + +def ObjCStringComparison : DiagGroup<"objc-string-compare">; +def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [ + ObjCStringComparison + ]>; diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index a6c22db..11552af 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Diagnostic IDs-related interfaces. -// +/// +/// \file +/// \brief Defines the Diagnostic IDs-related interfaces. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DIAGNOSTICIDS_H @@ -37,14 +38,15 @@ namespace clang { DIAG_START_LEX = DIAG_START_SERIALIZATION + 120, DIAG_START_PARSE = DIAG_START_LEX + 300, DIAG_START_AST = DIAG_START_PARSE + 400, - DIAG_START_SEMA = DIAG_START_AST + 100, + DIAG_START_COMMENT = DIAG_START_AST + 100, + DIAG_START_SEMA = DIAG_START_COMMENT + 100, DIAG_START_ANALYSIS = DIAG_START_SEMA + 3000, DIAG_UPPER_LIMIT = DIAG_START_ANALYSIS + 100 }; class CustomDiagInfo; - /// diag::kind - All of the diagnostics that can be emitted by the frontend. + /// \brief All of the diagnostics that can be emitted by the frontend. typedef unsigned kind; // Get typedefs for common diagnostics. @@ -63,10 +65,10 @@ namespace clang { /// one). enum Mapping { // NOTE: 0 means "uncomputed". - MAP_IGNORE = 1, //< Map this diagnostic to nothing, ignore it. - MAP_WARNING = 2, //< Map this diagnostic to a warning. - MAP_ERROR = 3, //< Map this diagnostic to an error. - MAP_FATAL = 4 //< Map this diagnostic to a fatal error. + MAP_IGNORE = 1, ///< Map this diagnostic to nothing, ignore it. + MAP_WARNING = 2, ///< Map this diagnostic to a warning. + MAP_ERROR = 3, ///< Map this diagnostic to an error. + MAP_FATAL = 4 ///< Map this diagnostic to a fatal error. }; } @@ -111,83 +113,84 @@ public: /// by multiple Diagnostics for multiple translation units. class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> { public: - /// Level - The level of the diagnostic, after it has been through mapping. + /// Level The level of the diagnostic, after it has been through mapping. enum Level { Ignored, Note, Warning, Error, Fatal }; private: - /// CustomDiagInfo - Information for uniquing and looking up custom diags. + /// \brief Information for uniquing and looking up custom diags. diag::CustomDiagInfo *CustomDiagInfo; public: DiagnosticIDs(); ~DiagnosticIDs(); - /// getCustomDiagID - Return an ID for a diagnostic with the specified message - /// and level. If this is the first request for this diagnosic, it is - /// registered and created, otherwise the existing ID is returned. + /// \brief Return an ID for a diagnostic with the specified message and level. + /// + /// If this is the first request for this diagnosic, it is registered and + /// created, otherwise the existing ID is returned. unsigned getCustomDiagID(Level L, StringRef Message); //===--------------------------------------------------------------------===// // Diagnostic classification and reporting interfaces. // - /// getDescription - Given a diagnostic ID, return a description of the - /// issue. + /// \brief Given a diagnostic ID, return a description of the issue. StringRef getDescription(unsigned DiagID) const; - /// isBuiltinWarningOrExtension - Return true if the unmapped diagnostic level - /// of 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. + /// \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. + /// \brief Determine whether the given built-in diagnostic ID is a Note. static bool isBuiltinNote(unsigned DiagID); - /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic - /// ID is for an extension of some sort. - /// + /// \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); } - /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic - /// ID is for an extension of some sort. 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. + /// \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); - /// getWarningOptionForDiag - Return the lowest-level warning option that - /// enables the specified diagnostic. If there is no -Wfoo flag that controls - /// the diagnostic, this returns null. + /// \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); - /// getCategoryNumberForDiag - Return the category number that a specified - /// DiagID belongs to, or 0 if no category. + /// \brief Return the category number that a specified \p DiagID belongs to, + /// or 0 if no category. static unsigned getCategoryNumberForDiag(unsigned DiagID); - /// getNumberOfCategories - Return the number of categories + /// \brief Return the number of diagnostic categories. static unsigned getNumberOfCategories(); - /// getCategoryNameFromID - Given a category ID, return the name of the - /// category. + /// \brief Given a category ID, return the name of the category. static StringRef getCategoryNameFromID(unsigned CategoryID); - /// isARCDiagnostic - Return true if a given diagnostic falls into an - /// ARC diagnostic category; + /// \brief Return true if a given diagnostic falls into an ARC diagnostic + /// category. static bool isARCDiagnostic(unsigned DiagID); - /// \brief Enumeration describing how the the emission of a diagnostic should + /// \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 @@ -253,20 +256,23 @@ private: DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc, const DiagnosticsEngine &Diag) const; - /// getDiagnosticLevel - This is an internal implementation helper used when - /// DiagClass is already known. + /// \brief An internal implementation helper used when \p DiagClass is + /// already known. DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, unsigned DiagClass, SourceLocation Loc, const DiagnosticsEngine &Diag) const; - /// ProcessDiag - This is the method used to report a diagnostic that is - /// finally fully formed. + /// \brief Used to report a diagnostic that is finally fully formed. /// - /// \returns true if the diagnostic was emitted, false if it was + /// \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; diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 670283e..cc958db 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -64,9 +64,12 @@ def ext_token_used : Extension<"extension used">, def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">, InGroup<CXX11Compat>, DefaultIgnore; -def warn_unterminated_string : ExtWarn<"missing terminating '\"' character">; -def warn_unterminated_char : ExtWarn<"missing terminating ' character">; -def err_empty_character : Error<"empty character constant">; +def ext_unterminated_string : ExtWarn<"missing terminating '\"' character">, + InGroup<InvalidPPToken>; +def ext_unterminated_char : ExtWarn<"missing terminating ' 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">; @@ -177,6 +180,7 @@ def err_bad_character_encoding : Error< def warn_bad_character_encoding : ExtWarn< "illegal character encoding in character literal">, InGroup<DiagGroup<"invalid-source-encoding">>; +def err_lexing_string : Error<"failure when lexing a string">; //===----------------------------------------------------------------------===// @@ -251,7 +255,7 @@ 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">; -def ext_variadic_macro : Extension<"variadic macros were introduced in C99">, +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">, @@ -264,15 +268,19 @@ def ext_embedded_directive : Extension< "embedding a directive within macro arguments has undefined behavior">, InGroup<DiagGroup<"embedded-directive">>; def ext_missing_varargs_arg : Extension< - "varargs argument missing, but tolerated as an extension">; + "must specify at least one argument for '...' parameter of variadic macro">, + InGroup<GNU>; def ext_empty_fnmacro_arg : Extension< - "empty macro arguments were standardized in C99">; + "empty macro arguments are a C99 feature">, InGroup<C99>; def warn_cxx98_compat_empty_fnmacro_arg : Warning< - "empty macro argument list is incompatible with C++98">, + "empty macro arguments are incompatible with C++98">, InGroup<CXX98CompatPedantic>, DefaultIgnore; +def note_macro_here : Note<"macro %0 defined here">; def err_pp_invalid_directive : Error<"invalid 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">; @@ -324,8 +332,7 @@ 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">, - InGroup<MalformedWarningCheck>; + "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>; @@ -394,7 +401,7 @@ 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< - "Use of comma pasting extension is non-portable">; + "token pasting of ',' and __VA_ARGS__ is a GNU extension">, InGroup<GNU>; def err_unterm_macro_invoc : Error< "unterminated function-like macro invocation">; def err_too_many_args_in_macro_invoc : Error< @@ -412,6 +419,9 @@ 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<GNU>; def err_pp_line_invalid_filename : Error< "invalid filename for #line directive">; def warn_pp_line_decimal : Warning< diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index c183da7..8cb82fd 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -20,23 +20,32 @@ def warn_file_asm_volatile : Warning< let CategoryName = "Parse Issue" in { -def ext_empty_source_file : Extension<"ISO C forbids an empty source file">; -def ext_top_level_semi : Extension< - "extra ';' outside of a function">; +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_struct_semi : Extension< - "extra ';' inside a %0">; -def ext_extra_ivar_semi : Extension< - "extra ';' inside instance variable list">; +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_duplicate_declspec : Extension<"duplicate '%0' declaration specifier">; def ext_plain_complex : ExtWarn< "plain '_Complex' requires a type specifier; assuming '_Complex double'">; def ext_integer_complex : Extension< "complex integer types are an extension">; -def ext_thread_before : Extension<"'__thread' before 'static'">; +def ext_thread_before : Extension<"'__thread' before '%0'">; def ext_empty_struct_union : Extension< "empty %select{struct|union}0 is a GNU extension">, InGroup<GNU>; @@ -58,9 +67,12 @@ def ext_c99_compound_literal : Extension< "compound literals are a C99-specific feature">, InGroup<C99>; def ext_c99_flexible_array_member : Extension< "Flexible array members are a C99-specific feature">, InGroup<C99>; -def ext_enumerator_list_comma : Extension< - "commas at the end of enumerator lists are a %select{C99|C++11}0-specific " - "feature">; +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; @@ -89,8 +101,8 @@ def err_duplicate_default_assoc : Error< def note_previous_default_assoc : Note< "previous default generic association is here">; -def ext_c11_alignas : Extension< - "_Alignas is a C11-specific feature">, InGroup<C11>; +def ext_c11_alignment : Extension< + "%0 is a C11-specific feature">, InGroup<C11>; def ext_gnu_indirect_goto : Extension< "use of GNU indirect-goto extension">, InGroup<GNU>; @@ -311,7 +323,7 @@ def err_templated_using_directive : Error< def err_templated_using_declaration : Error< "cannot template a using declaration">; def err_unexected_colon_in_nested_name_spec : Error< - "unexpected ':' in nested name specifier">; + "unexpected ':' in nested name specifier; did you mean '::'?">; def err_bool_redeclaration : Error< "redeclaration of C++ built-in type 'bool'">; def ext_c11_static_assert : Extension< @@ -336,6 +348,9 @@ 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< @@ -377,6 +392,8 @@ def err_synthesized_property_name : Error< 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'">; @@ -396,9 +413,8 @@ 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 warn_parens_disambiguated_as_function_decl : Warning< - "parentheses were disambiguated as a function declarator">, - InGroup<VexingParse>; +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>; @@ -474,6 +490,10 @@ def err_l_square_l_square_not_attribute : Error< "introducing an attribute">; def err_alignas_pack_exp_unsupported : Error< "pack expansions in alignment specifiers are not supported yet">; +def err_ms_declspec_type : Error< + "__declspec attributes must be an identifier or string literal">; +def warn_ms_declspec_unknown : Warning< + "unknown __declspec attribute %0 ignored">, InGroup<UnknownAttributes>; /// C++ Templates def err_expected_template : Error<"expected template">; @@ -491,9 +511,12 @@ 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_cxx0x_right_shift_in_template_arg : Warning< "use of right-shift operator ('>>') in template argument will require " - "parentheses in C++11">; + "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; @@ -648,9 +671,11 @@ 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">; + "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">; + "'unavailable' availability overrides all other availability information">, + InGroup<Availability>; // Language specific pragmas // - Generic warnings diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 0614ade..6d7b52e 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -14,6 +14,19 @@ let Component = "Sema" in { let CategoryName = "Semantic Issue" in { +// 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<DiagGroup<"loop-analysis">>, DefaultIgnore; + +def warn_identical_enum_values : Warning< + "all elements of %0 are initialized with literals to value %1">, + InGroup<DiagGroup<"unique-enum">>; +def note_identical_enum_values : Note< + "initialize the last element with the previous element to silence " + "this warning">; + // Constant expressions def err_expr_not_ice : Error< "expression is not an %select{integer|integral}0 constant expression">; @@ -145,6 +158,11 @@ def warn_redefinition_in_param_list : Warning< 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< @@ -160,9 +178,15 @@ def warn_used_but_marked_unused: Warning<"%0 was marked unused but was used">, 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; " @@ -173,6 +197,9 @@ def warn_return_value_size: Warning< 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; @@ -325,10 +352,14 @@ def warn_dyn_class_memaccess : Warning< def note_bad_memaccess_silence : Note< "explicitly cast the pointer to silence this warning">; def warn_sizeof_pointer_expr_memaccess : Warning< - "argument to 'sizeof' in %0 call is the same expression as the " - "%select{destination|source}1; did you mean to " - "%select{dereference it|remove the addressof|provide an explicit length}2?">, + "'%0' call operates on objects of type %1 while the size is based on a " + "different type %2">, InGroup<DiagGroup<"sizeof-pointer-memaccess">>; +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">, @@ -342,9 +373,11 @@ def note_strlcpycat_wrong_size : Note< 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>, DefaultIgnore; + "buffer overflow">, InGroup<StrncatSize>; def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " - "to be size of the source">, InGroup<StrncatSize>, DefaultIgnore; + "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">; @@ -442,6 +475,8 @@ 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_is_id : Note< @@ -452,7 +487,7 @@ 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>, DefaultIgnore; + InGroup<ObjCRootClass>; def note_objc_needs_superclass : Note< "add a super class to fix this problem">; def warn_dup_category_def : Warning< @@ -462,7 +497,7 @@ 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: %1 vs %2">; + "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< @@ -481,12 +516,12 @@ def note_required_for_protocol_at : def warn_conflicting_overriding_ret_types : Warning< "conflicting return type in " - "declaration of %0: %1 vs %2">, + "declaration of %0%diff{: $ vs $|}1,2">, InGroup<OverridingMethodMismatch>, DefaultIgnore; def warn_conflicting_ret_types : Warning< "conflicting return type in " - "implementation of %0: %1 vs %2">; + "implementation of %0%diff{: $ vs $|}1,2">; def warn_conflicting_overriding_ret_type_modifiers : Warning< "conflicting distributed object modifiers on return type " @@ -510,12 +545,12 @@ def warn_non_covariant_ret_types : Warning< def warn_conflicting_overriding_param_types : Warning< "conflicting parameter types in " - "declaration of %0: %1 vs %2">, + "declaration of %0%diff{: $ vs $|}1,2">, InGroup<OverridingMethodMismatch>, DefaultIgnore; def warn_conflicting_param_types : Warning< "conflicting parameter types in " - "implementation of %0: %1 vs %2">; + "implementation of %0%diff{: $ vs $|}1,2">; def warn_conflicting_param_modifiers : Warning< "conflicting distributed object modifiers on parameter type " "in implementation of %0">, @@ -575,15 +610,17 @@ 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">; + "'assign' is assumed">, + InGroup<ObjCPropertyNoAttribute>; def warn_objc_isa_use : Warning< "direct access to objective-c's isa is deprecated " "in favor of object_setClass() and object_getClass()">, InGroup<DiagGroup<"deprecated-objc-isa-usage">>; def warn_objc_property_default_assign_on_object : Warning< - "default property attribute 'assign' not appropriate for non-gc object">; + "default property attribute 'assign' not appropriate for non-GC object">, + InGroup<ObjCPropertyNoAttribute>; def warn_property_attr_mismatch : Warning< - "property attribute in continuation class does not match the primary class">; + "property attribute in class extension does not match the primary class">; def warn_objc_property_copy_missing_on_block : Warning< "'copy' attribute must be specified for the block property " "when -fobjc-gc-only is specified">; @@ -610,9 +647,19 @@ def warn_auto_synthesizing_protocol_property :Warning< "auto property synthesis will not synthesize property" " declared in a protocol">, InGroup<DiagGroup<"objc-protocol-property-synthesis">>; +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 error_property_setter_ambiguous_use : Error< + "synthesized properties '%0' and '%1' both claim setter %2 -" + " use of this setter will cause unexpected behavior">; def err_ownin_getter_rule : Error< "property's synthesized getter follows Cocoa naming" " convention for returning 'owned' objects">; @@ -621,16 +668,16 @@ def warn_default_atomic_custom_getter_setter : Warning< "(property should be marked 'atomic' if this is intended)">, InGroup<CustomAtomic>, DefaultIgnore; def err_use_continuation_class : Error< - "illegal redeclaration of property in continuation class %0" + "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 continuation class does not match " + "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 continuation class %0" + "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<"continuation class has no primary class">; +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">; @@ -664,15 +711,16 @@ def warn_arc_perform_selector_leaks : Warning< def err_gc_weak_property_strong_type : Error< "weak attribute declared on a __strong type property in GC mode">; def warn_receiver_is_weak : Warning < - "weak receiver may be unpredictably null in ARC mode">, + "weak %select{receiver|property|implicit property}0 may be " + "unpredictably null in ARC mode">, InGroup<DiagGroup<"receiver-is-weak">>, DefaultIgnore; - -def error_synthesized_ivar_yet_not_supported : Error< - "instance variable synthesis not yet supported" - " (need to declare %0 explicitly)">; +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 ivar %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 ivar %1 declared in super class %2">; def error_weak_property : Error< @@ -690,6 +738,9 @@ def warn_objc_property_attr_mutually_exclusive : Warning< def warn_objc_missing_super_dealloc : Warning< "method possibly missing a [super dealloc] 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_objc_missing_super_finalize : Warning< "method possibly missing a [super finalize] call">, InGroup<ObjCMissingSuperCalls>; @@ -697,6 +748,12 @@ def warn_undeclared_selector : Warning< "undeclared selector %0">, 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< + "readonly IBOutlet property should be changed to be readwrite">; +def warn_auto_readonly_iboutlet_property : Warning< + "readonly IBOutlet property 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; @@ -823,8 +880,6 @@ def warn_missing_exception_specification : Warning< "%0 is missing exception specification '%1'">; def err_noexcept_needs_constant_expression : Error< "argument to noexcept specifier must be a constant expression">; -def err_exception_spec_unknown : Error< - "exception specification is not available until end of class definition">; // C++ access checking def err_class_redeclared_with_different_access : Error< @@ -854,6 +909,9 @@ def err_access_field_ctor : Error< "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">, @@ -1015,8 +1073,9 @@ def ext_anonymous_struct_union_qualified : Extension< "anonymous %select{struct|union}0 cannot be '%select{const|volatile|" "restrict}1'">; def err_different_return_type_for_overriding_virtual_function : Error< - "virtual function %0 has a different return type (%1) than the " - "function it overrides (which has return type %2)">; + "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">; @@ -1094,36 +1153,43 @@ def err_destructor_template : Error< 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}0 of type %1 with an " - "%select{rvalue|lvalue}2 of type %3" - "%select{|: different classes (%5 vs %6)" + "base class|a constructor delegation|a vector element}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 (%6 vs %7)" - "|: different return type (%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 to type %0 cannot bind " - "to lvalue of type %1">; +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 to type %1 cannot bind to a " - "temporary of type %2">; + "%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 to type %1 cannot bind to a " - "value of unrelated type %2">; + "%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 of reference to type %0 to a value of type %1 drops qualifiers">; + "binding of reference %diff{to type $ to a value of type $ drops qualifiers|" + "drops qualifiers}0,1">; def err_reference_bind_failed : Error< - "reference to type %0 could not bind to an %select{rvalue|lvalue}1 of type " - "%2">; + "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">; @@ -1154,19 +1220,21 @@ def warn_uninit_self_reference_in_init : Warning< "variable %0 is uninitialized when used within its own initialization">, InGroup<Uninitialized>; def warn_uninit_var : Warning< - "variable %0 is uninitialized when used here">, - InGroup<Uninitialized>, DefaultIgnore; -def warn_maybe_uninit_var : - Warning<"variable %0 may be uninitialized when used here">, - InGroup<UninitializedMaybe>, DefaultIgnore; -def note_uninit_var_def : Note< - "variable %0 is declared here">; -def warn_uninit_var_captured_by_block : Warning< - "variable %0 is uninitialized when captured by block">, + "variable %0 is uninitialized when %select{used here|captured by block}1">, InGroup<Uninitialized>, DefaultIgnore; -def warn_maybe_uninit_var_captured_by_block : Warning< - "variable %0 may be uninitialized when captured by block">, +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}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; @@ -1174,6 +1242,9 @@ def note_block_var_fixit_add_initialization : Note< "maybe you meant to use __block %0">; 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 err_temp_copy_no_viable : Error< @@ -1316,10 +1387,8 @@ def err_delegating_initializer_alone : Error< 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">, InGroup<DelegatingCtorCycles>; -def note_which_delegates_to : Note< - "which delegates to">, 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< @@ -1370,6 +1439,8 @@ 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{class|struct}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{class|struct}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">; @@ -1427,6 +1498,10 @@ def warn_cxx98_compat_unicode_type : Warning< // 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< "__attribute ((NSObject)) is for pointer types only">; @@ -1451,6 +1526,8 @@ def err_attribute_bad_neon_vector_size : Error< "Neon vector size must be 64 or 128 bits">; def err_attribute_argument_not_int : Error< "'%0' attribute requires integer constant">; +def err_aligned_attribute_argument_not_int : Error< + "'aligned' attribute requires integer constant">; def err_attribute_argument_not_class : Error< "%0 attribute requires arguments that are class type or point to class type">; def err_attribute_first_argument_not_int_or_bool : Error< @@ -1522,17 +1599,19 @@ def err_undeclared_nsnumber : Error< "NSNumber must be available to use Objective-C literals">; def err_invalid_nsnumber_type : Error< "%0 is not a valid literal type for NSNumber">; +def err_undeclared_nsstring : Error< + "cannot box a string value because NSString has not been declared">; +def err_objc_illegal_boxed_expression_type : Error< + "illegal type %0 used in a boxed expression">; +def err_objc_incomplete_boxed_expression_type : Error< + "incomplete type %0 used in a boxed expression">; def err_undeclared_nsarray : Error< "NSArray must be available to use Objective-C array literals">; def err_undeclared_nsdictionary : Error< "NSDictionary must be available to use Objective-C dictionary " "literals">; -def err_undeclared_arraywithobjects : Error< - "declaration of %0 is missing in NSArray class">; -def err_undeclared_dictwithobjects : Error< - "declaration of %0 is missing in NSDictionary class">; -def err_undeclared_nsnumber_method : Error< - "declaration of %0 is missing in NSNumber class">; +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< @@ -1545,50 +1624,81 @@ def err_invalid_collection_element : Error< 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 warn_objc_string_literal_comparison : Warning< + "direct comparison of a string literal has undefined behavior">, + InGroup<ObjCStringComparison>; +def note_objc_literal_comparison_isequal : Note< + "use 'isEqual:' instead">; 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_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 err_attribute_section_local_variable : Error< "'section' attribute is not valid on local variables">; +def warn_mismatched_section : Warning< + "section does not match previous declaration">, InGroup<Section>; + def err_attribute_aligned_not_power_of_two : Error< "requested alignment is not a power of 2">; +def err_attribute_aligned_greater_than_8192 : Error< + "requested alignment must be 8192 bytes or smaller">; def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning< "'%0' redeclared without %1 attribute: previous %1 ignored">; -def warn_attribute_ignored : Warning<"%0 attribute ignored">; +def warn_attribute_ignored : Warning<"%0 attribute ignored">, + 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_unhandled_ms_attribute_ignored : Warning< + "__declspec attribute %0 is not supported">, + InGroup<IgnoredAttributes>; def warn_attribute_invalid_on_stmt : Warning< "attribute %0 cannot be specified on a statement">, InGroup<IgnoredAttributes>; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after \"%select{class|struct|union|enum}1\" to apply attribute to type declaration">, InGroup<IgnoredAttributes>; def warn_attribute_precede_definition : Warning< - "attribute declaration must precede definition">; + "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">; + "%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">; + "__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">; + "Objective-C GC does not allow weak variables on the stack">, + InGroup<IgnoredAttributes>; def warn_nsobject_attribute : Warning< "__attribute ((NSObject)) may be put on a typedef only, " "attribute is ignored">, InGroup<NSobjectAttribute>; def warn_attribute_weak_on_local : Warning< - "__weak attribute cannot be specified on an automatic variable">; + "__weak attribute cannot be specified on an automatic variable">, + 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 warn_attribute_weak_import_invalid_on_definition : Warning< - "'weak_import' attribute cannot be specified on a definition">; + "'weak_import' attribute cannot be specified on a definition">, + InGroup<IgnoredAttributes>; def err_attribute_weakref_not_static : Error< "weakref declaration must have internal linkage">; def err_attribute_weakref_not_global_context : Error< @@ -1602,22 +1712,31 @@ def warn_attribute_wrong_decl_type : Warning< "variables and functions|functions and methods|parameters|" "functions, methods and blocks|functions, methods, and parameters|" "classes|variables|methods|variables, functions and labels|" - "fields and global variables|structs}1">; + "fields and global variables|structs|" + "variables, functions and tag types|thread-local variables}1">, + InGroup<IgnoredAttributes>; def err_attribute_wrong_decl_type : Error< "%0 attribute only applies to %select{functions|unions|" "variables and functions|functions and methods|parameters|" "functions, methods and blocks|functions, methods, and parameters|" "classes|variables|methods|variables, functions and labels|" - "fields and global variables|structs}1">; + "fields and global variables|structs|thread-local variables}1">; def warn_function_attribute_wrong_type : Warning< - "'%0' only applies to function types; type here is %1">; + "'%0' only applies to function types; type here is %1">, + InGroup<IgnoredAttributes>; def warn_pointer_attribute_wrong_type : Warning< - "'%0' only applies to pointer types; type here is %1">; + "'%0' only applies to pointer types; type here is %1">, + InGroup<IgnoredAttributes>; def warn_objc_object_attribute_wrong_type : Warning< - "'%0' only applies to objective-c object or block pointer types; type here is %1">; + "'%0' only applies to Objective-C object or block pointer types; type here is %1">, + InGroup<IgnoredAttributes>; +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">; + " 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< @@ -1649,79 +1768,95 @@ def warn_attribute_not_on_decl : Error< // Availability attribute def warn_availability_unknown_platform : Warning< - "unknown platform %0 in availability macro">; + "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">; - + "attribute ignored">, InGroup<Availability>; +def warn_mismatched_availability: Warning< + "availability does not match previous declaration">, InGroup<Availability>; + // Thread Safety Attributes -// Errors when parsing the attributes +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 'lockable' attribute; type here is '%1'">, + InGroup<ThreadSafetyAttributes>, DefaultIgnore; +def warn_thread_attribute_argument_not_class : Warning< + "%0 attribute requires arguments that are class type or point to" + " class type; 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 'lockable' 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 warn_thread_attribute_wrong_decl_type : Warning< + "%0 attribute only applies to %select{" + "fields and global variables|functions and methods|" + "classes and structs}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">; -def warn_attribute_argument_not_lockable : Warning< - "%0 attribute requires arguments whose type is annotated " - "with 'lockable' attribute; type here is '%1'">, - InGroup<ThreadSafety>, DefaultIgnore; -def warn_attribute_decl_not_lockable : Warning< - "%0 attribute can only be applied in a context annotated " - "with 'lockable' attribute">, - InGroup<ThreadSafety>, DefaultIgnore; -def warn_attribute_argument_not_class : Warning< - "%0 attribute requires arguments that are class type or point to" - " class type; type here is '%1'">, - InGroup<ThreadSafety>, DefaultIgnore; + +// Thread Safety Analysis def warn_unlock_but_no_lock : Warning< "unlocking '%0' that was not locked">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_double_lock : Warning< "locking '%0' that is already locked">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_no_unlock : Warning< "mutex '%0' is still locked at the end of function">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; +def warn_expecting_locked : Warning< + "expecting mutex '%0' to be locked at the end of function">, + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; // FIXME: improve the error message about locks not in scope def warn_lock_some_predecessors : Warning< "mutex '%0' is not locked on every path through here">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_expecting_lock_held_on_loop : Warning< "expecting mutex '%0' to be locked at start of each loop">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def note_locked_here : Note<"mutex acquired here">; def warn_lock_exclusive_and_shared : Warning< "mutex '%0' is locked exclusively and shared in the same scope">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def note_lock_exclusive_and_shared : Note< - "the other lock of mutex '%0' is here">, - InGroup<ThreadSafety>, DefaultIgnore; + "the other lock of mutex '%0' is here">; def warn_variable_requires_lock : Warning< "%select{reading|writing}2 variable '%0' requires locking " "%select{'%1'|'%1' exclusively}2">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_var_deref_requires_lock : Warning< "%select{reading|writing}2 the value pointed to by '%0' requires locking " "%select{'%1'|'%1' exclusively}2">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_variable_requires_any_lock : Warning< "%select{reading|writing}1 variable '%0' requires locking " "%select{any mutex|any mutex exclusively}1">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_var_deref_requires_any_lock : Warning< "%select{reading|writing}1 the value pointed to by '%0' requires locking " "%select{any mutex|any mutex exclusively}1">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_fun_requires_lock : Warning< "calling function '%0' requires %select{shared|exclusive}2 lock on '%1'">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_fun_excludes_mutex : Warning< "cannot call function '%0' while mutex '%1' is locked">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_cannot_resolve_lock : Warning< "cannot resolve lock expression">, - InGroup<ThreadSafety>, DefaultIgnore; + InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_impcast_vector_scalar : Warning< @@ -1755,8 +1890,7 @@ def warn_impcast_bitfield_precision_constant : Warning< "implicit truncation from %2 to bitfield changes value from %0 to %1">, InGroup<ConstantConversion>; def warn_impcast_literal_float_to_integer : Warning< - "implicit conversion turns literal floating-point number into integer: " - "%0 to %1">, + "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">, @@ -1767,6 +1901,9 @@ def warn_impcast_different_enum_types : Warning< 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 NULL constant to %0">, InGroup<NullConversion>; @@ -1783,28 +1920,37 @@ def warn_cast_align : Warning< InGroup<CastAlign>, DefaultIgnore; def warn_attribute_ignored_for_field_of_type : Warning< - "%0 attribute ignored for field of type %1">; + "%0 attribute ignored for field of type %1">, + InGroup<IgnoredAttributes>; 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">; + "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">; + "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">; + "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">; + "transparent_union attribute ignored">, + InGroup<IgnoredAttributes>; def warn_attribute_type_not_supported : Warning< - "'%0' attribute argument not supported: %1">; -def warn_attribute_unknown_visibility : Warning<"unknown visibility '%0'">; + "'%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 err_unknown_machine_mode : Error<"unknown machine mode %0">; def err_unsupported_machine_mode : Error<"unsupported machine mode %0">; def err_mode_not_primitive : Error< @@ -1814,13 +1960,17 @@ def err_mode_wrong_type : Error< 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">; + "'nonnull' attribute applied to function with no pointer arguments">, + InGroup<IgnoredAttributes>; def warn_attribute_malloc_pointer_only : Warning< - "'malloc' attribute only applies to functions returning a pointer type">; + "'malloc' attribute only applies to functions returning a pointer type">, + InGroup<IgnoredAttributes>; def warn_attribute_sentinel_named_arguments : Warning< - "'sentinel' attribute requires named arguments">; + "'sentinel' attribute requires named arguments">, + InGroup<IgnoredAttributes>; def warn_attribute_sentinel_not_variadic : Warning< - "'sentinel' attribute only supported for variadic %select{functions|blocks}0">; + "'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< @@ -1832,8 +1982,8 @@ def err_attribute_cleanup_arg_not_function : Error< 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 type %1 which is incompatible with " - "type %2">; + "'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< @@ -1842,9 +1992,11 @@ def err_attribute_regparm_invalid_number : Error< // Clang-Specific Attributes def warn_attribute_iboutlet : Warning< - "%0 attribute can only be applied to instance variables or properties">; + "%0 attribute can only be applied to instance variables or properties">, + InGroup<IgnoredAttributes>; def warn_attribute_ibaction: Warning< - "ibaction attribute can only be applied to Objective-C instance methods">; + "ibaction attribute can only be applied to Objective-C instance methods">, + InGroup<IgnoredAttributes>; def err_iboutletcollection_type : Error< "invalid type %0 as argument of iboutletcollection attribute">; def warn_iboutlet_object_type : Warning< @@ -1862,10 +2014,12 @@ 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}1 that " - "return %select{an Objective-C object|a pointer|a non-retainable pointer}2">; + "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}1 " - "parameters">; + "parameters">, + InGroup<IgnoredAttributes>; def err_ns_bridged_not_interface : Error< "parameter of 'ns_bridged' attribute does not name an Objective-C class">; @@ -1928,8 +2082,9 @@ def note_default_argument_declared_here : Note< "default argument declared here">; def ext_param_promoted_not_compatible_with_prototype : ExtWarn< - "promoted type %0 of K&R function parameter is not compatible with the " - "parameter type %1 declared in a previous prototype">, + "%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>; @@ -1964,10 +2119,11 @@ def note_ovl_candidate : Note<"candidate " "is the implicit copy assignment operator|" "is the implicit move assignment operator|" "is an inherited constructor}0%1" - "%select{| has different class (expected %3 but has %4)" + "%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 (expected %4 but has %5)" - "| has different return type (%3 expected 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 " @@ -1981,7 +2137,7 @@ 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 (%2 vs. %3)">; + "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">; @@ -1995,7 +2151,9 @@ def note_ovl_candidate_underqualified : Note< "candidate template ignored: can't deduce a type for %0 which would " "make %2 equal %1">; def note_ovl_candidate_substitution_failure : Note< - "candidate template ignored: substitution failure %0">; + "candidate template ignored: substitution failure%0%1">; +def note_ovl_candidate_disabled_by_enable_if : Note< + "candidate template ignored: disabled by %0%1">; // Note that we don't treat templates differently for this diagnostic. def note_ovl_candidate_arity : Note<"candidate " @@ -2009,6 +2167,17 @@ def note_ovl_candidate_arity : Note<"candidate " "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 |" @@ -2035,7 +2204,8 @@ def note_ovl_candidate_bad_conv_incomplete : Note<"candidate " "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" "constructor (inherited)}0%1 " - "not viable: cannot convert argument of incomplete type %2 to %3">; + "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 |" @@ -2065,12 +2235,13 @@ def note_ovl_candidate_bad_conv : Note<"candidate " "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" "constructor (inherited)}0%1" - " not viable: no known conversion from %2 to %3 for " - "%select{%ordinal5 argument|object argument}4; " - "%select{|dereference the argument with *|" - "take the address of the argument with &|" - "remove *|" - "remove &}6">; + " 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 |" @@ -2080,8 +2251,20 @@ def note_ovl_candidate_bad_arc_conv : Note<"candidate " "function (the implicit copy assignment operator)|" "function (the implicit move assignment operator)|" "constructor (inherited)}0%1" - " not viable: cannot implicitly convert argument of type %2 to %3 for " + " 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 |" @@ -2163,7 +2346,7 @@ def note_ovl_candidate_bad_target : Note< " %select{__device__|__global__|__host__|__host__ __device__}2 function">; def note_ambiguous_type_conversion: Note< - "because of ambiguity in conversion of %0 to %1">; + "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< @@ -2317,6 +2500,8 @@ def note_template_decl_here : Note<"template is declared here">; def note_member_of_template_here : Note<"member 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 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< @@ -2353,6 +2538,9 @@ def err_template_arg_not_ice : Error< "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< @@ -2360,7 +2548,7 @@ def err_template_arg_wrongtype_null_constant : Error< "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 (%0 vs %1)">; + "its corresponding template parameter%diff{ ($ vs $)|}0,1">; def err_template_arg_not_convertible : Error< "non-type template argument of type %0 cannot be converted to a value " "of type %1">; @@ -2371,11 +2559,13 @@ 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 %0 cannot bind to template " - "argument of type %1">; + "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 of type %0 to template " - "argument of type %1 ignores qualifiers">; + "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_object_or_func_form : Error< @@ -2701,6 +2891,9 @@ def note_explicit_instantiation_definition_here : Note< // 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< @@ -2768,28 +2961,28 @@ def err_unexpanded_parameter_pack_0 : Error< "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}0 " + "__if_exists name|__if_not_exists name|lambda|block}0 " "contains an unexpanded parameter pack">; def err_unexpanded_parameter_pack_1 : 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}0 " + "__if_exists name|__if_not_exists name|lambda|block}0 " "contains unexpanded parameter pack %1">; def err_unexpanded_parameter_pack_2 : 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}0 " + "__if_exists name|__if_not_exists name|lambda|block}0 " "contains unexpanded parameter packs %1 and %2">; def err_unexpanded_parameter_pack_3_or_more : 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}0 " + "__if_exists name|__if_not_exists name|lambda|block}0 " "contains unexpanded parameter packs %1, %2, ...">; def err_pack_expansion_without_parameter_packs : Error< @@ -2878,8 +3071,8 @@ def note_deleted_dtor_no_operator_delete : Note< def note_deleted_special_member_class_subobject : Note< "%select{default constructor|copy constructor|move constructor|" "copy assignment operator|move assignment operator|destructor}0 of " - "%select{||||union }4%1 is implicitly deleted because " - "%select{base class %3|field %3}2 has " + "%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" @@ -2898,8 +3091,8 @@ 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 %0 is implicitly deleted " - "because field %1 is of %select{reference|const-qualified}3 type %2">; + "%select{copy|move}0 assignment operator of %1 is implicitly deleted " + "because field %2 is of %select{reference|const-qualified}4 type %3">; // This should eventually be an error. def warn_undefined_internal : Warning< @@ -2907,6 +3100,17 @@ def warn_undefined_internal : Warning< DiagGroup<"undefined-internal">; def note_used_here : Note<"used here">; +def warn_internal_in_extern_inline : ExtWarn< + "static %select{function|variable}0 %1 is used in an inline function with " + "external linkage">, InGroup<DiagGroup<"static-in-inline"> >; +def ext_internal_in_extern_inline : Extension< + "static %select{function|variable}0 %1 is used in an inline function with " + "external linkage">, InGroup<DiagGroup<"static-in-inline"> >; +def note_convert_inline_to_static : Note< + "use 'static' to give inline function %0 internal linkage">; +def note_internal_decl_declared_here : Note< + "%0 declared here">; + def warn_redefinition_of_typedef : ExtWarn< "redefinition of typedef %0 is a C11 feature">, InGroup<DiagGroup<"typedef-redefinition"> >; @@ -2939,7 +3143,8 @@ 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 (%1 vs %2)">; + "%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< @@ -2977,6 +3182,9 @@ def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">; def err_duplicate_member : Error<"duplicate member %0">; def err_misplaced_ivar : Error< "ivars may not be placed in %select{categories|class extension}0">; +def warn_ivars_in_interface : Warning< + "declaration of ivars 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)">; @@ -3041,7 +3249,8 @@ 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">; +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< @@ -3070,6 +3279,15 @@ 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">; @@ -3190,7 +3408,7 @@ def note_protected_by___block : Note< def note_protected_by_objc_ownership : Note< "jump bypasses initialization of retaining variable">; def note_enters_block_captures_cxx_obj : Note< - "jump enters lifetime of block which captures a destructible c++ object">; + "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< @@ -3219,7 +3437,7 @@ def note_exits_objc_autoreleasepool : Note< def note_exits_objc_ownership : Note< "jump exits scope of retaining variable">; def note_exits_block_captures_cxx_obj : Note< - "jump exits lifetime of block which captures a destructible c++ object">; + "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< @@ -3329,7 +3547,8 @@ def warn_arc_non_pod_class_with_object_member : Warning< "to make it ABI-compatible">, InGroup<AutomaticReferenceCountingABI>, DefaultIgnore; def warn_arc_retained_assign : Warning< - "assigning retained object to %select{weak|unsafe_unretained}0 variable" + "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< @@ -3356,8 +3575,7 @@ def err_arc_autoreleasing_capture : Error< 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">, - InGroup<AutomaticReferenceCounting>; + "%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< @@ -3378,7 +3596,7 @@ 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<DiagGroup<"receiver-forward-class">>, DefaultIgnore; + InGroup<ForwardClassReceiver>, DefaultIgnore; def err_arc_collection_forward : Error< "collection expression type %0 is a forward declaration">; def err_arc_multiple_method_decl : Error< @@ -3454,7 +3672,7 @@ def err_illegal_decl_array_of_functions : Error< 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">; + "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< @@ -3507,14 +3725,18 @@ def ext_offsetof_extended_field_designator : Extension< InGroup<DiagGroup<"extended-offsetof">>; def warn_offsetof_non_pod_type : ExtWarn<"offset of on non-POD type %0">, InGroup<InvalidOffsetof>; +def warn_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 warn_floatingpoint_eq : Warning< "comparing floating point with == or != is unsafe">, InGroup<DiagGroup<"float-equal">>, DefaultIgnore; -def warn_division_by_zero : Warning<"division by zero is undefined">; -def warn_remainder_by_zero : Warning<"remainder by zero is undefined">; +def warn_division_by_zero : Warning<"division by zero is undefined">, + InGroup<DivZero>; +def warn_remainder_by_zero : Warning<"remainder by zero is undefined">, + InGroup<DivZero>; 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">, @@ -3576,17 +3798,17 @@ def warn_sizeof_array_param : Warning< InGroup<SizeofArrayArgument>; def err_sizeof_nonfragile_interface : Error< - "invalid application of '%select{alignof|sizeof}1' to interface %0 in " - "non-fragile ABI">; + "application of '%select{alignof|sizeof}1' to interface %0 is " + "not supported on this architecture and platform">; def err_atdef_nonfragile_interface : Error< - "invalid application of @defs in non-fragile ABI">; + "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 in " - "non-fragile ABI">; + "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 in " - "non-fragile ABI">; + "arithmetic on pointer to interface %0, which is not a constant size for " + "this architecture and platform">; def ext_subscript_non_lvalue : Extension< @@ -3624,6 +3846,8 @@ def warn_subscript_is_char : Warning<"array subscript is of type 'char'">, 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">; @@ -3636,11 +3860,15 @@ def note_enum_specialized_here : Note< "enum %0 was explicitly specialized here">; def err_member_redeclared : Error<"class member cannot be redeclared">; +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_def_does_not_match : Error< "out-of-line definition of %0 does not match any declaration in %1">; +def err_friend_decl_does_not_match : Error< + "friend declaration of %0 does not match any declaration in %1">; def err_member_def_does_not_match_suggest : Error< "out-of-line definition of %0 does not match any declaration in %1; " "did you mean %2?">; @@ -3664,8 +3892,8 @@ 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 (%1 vs %2)">; + "type of %ordinal0 parameter of member 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< @@ -3697,12 +3925,15 @@ def err_array_init_not_init_list : Error< "array initializer must be an initializer " "list%select{| or string literal}0">; def err_array_init_different_type : Error< - "cannot initialize array of type %0 with array of type %1">; + "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 of type %0 with non-constant array of type %1">; + "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 of type %0 from a compound literal of type %1 is " - "a GNU extension">, InGroup<GNU>; + "initialization of an array " + "%diff{of type $ from a compound literal of type $|" + "from a compound literal}0,1 is a GNU extension">, InGroup<GNU>; // This is intentionally not disabled by -Wno-gnu. def ext_array_init_parens : ExtWarn< "parenthesized initialization of a member array is a GNU extension">, @@ -3745,7 +3976,7 @@ 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.">, + "behavior">, InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore; def err_objc_object_assignment : Error< @@ -3753,7 +3984,8 @@ def err_objc_object_assignment : Error< def err_typecheck_invalid_operands : Error< "invalid operands to binary expression (%0 and %1)">; def err_typecheck_sub_ptr_compatible : Error< - "%0 and %1 are not pointers to compatible types">; + "%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< @@ -3769,13 +4001,14 @@ def ext_typecheck_comparison_of_pointer_integer : ExtWarn< 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 (%0 and %1)">; + "comparison of distinct pointer types%diff{ ($ and $)|}0,1">; def ext_typecheck_cond_incompatible_operands : ExtWarn< "incompatible operand types (%0 and %1)">; def err_cond_voidptr_arc : Error < - "operands to conditional of types %0 and %1 are incompatible in ARC mode">; + "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 (%0 and %1)">; + "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">; @@ -3792,7 +4025,8 @@ 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 (%0 and %1)">, + "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">, @@ -3865,8 +4099,8 @@ def err_objc_subscript_key_type : Error< 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">; + "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< @@ -3874,17 +4108,17 @@ def err_objc_multiple_subscript_type_conversion : Error< "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">; + " 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">; + " 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">; + "Objective-C index expression has incomplete class type %0">; def err_illegal_container_subscripting_op : Error< - "illegal operation on objective-c container subscripting">; + "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< @@ -3902,7 +4136,7 @@ def ext_gnu_ptr_func_arith : Extension< "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">; + "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< @@ -3930,13 +4164,17 @@ 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">; + "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')">; + "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">; + "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')">; + "instance method %objcinstance0 not found (return type defaults to 'id')">, + InGroup<MethodAccess>; def error_no_super_class_message : Error< "no @interface declaration found in class messaging of %0">; def error_root_class_cannot_use_super : Error< @@ -3951,7 +4189,7 @@ 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'">; + "casting it to 'id'">,InGroup<ObjCReceiver>; def err_bad_receiver_type : Error<"bad receiver type %0">; def err_unknown_receiver_suggest : Error< "unknown receiver %0; did you mean %1?">; @@ -3978,7 +4216,7 @@ def warn_objc_pointer_cxx_catch_fragile : Warning< "can not catch an exception thrown with @throw in C++ in the non-unified " "exception model">, InGroup<ObjCNonUnifiedException>; def err_objc_object_catch : Error< - "can't catch an Objective C object by value">; + "can't catch an Objective-C object by value">; def err_incomplete_type_objc_at_encode : Error< "'@encode' of incomplete type %0">; @@ -4050,7 +4288,7 @@ def err_bad_cxx_cast_member_pointer_size : Error< 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.">, + "reinterpret_cast from %0 to %1 has undefined behavior">, InGroup<DiagGroup<"undefined-reinterpret-cast">>, DefaultIgnore; // These messages don't adhere to the pattern. @@ -4191,11 +4429,12 @@ 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; %0 can be converted to %1 " - "and vice versa">; + "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; %0 and %1 can be converted to several " - "common types">; + "conditional expression is ambiguous; %diff{$ and $|types}0,1 " + "can be converted to several common types">; def err_throw_incomplete : Error< "cannot throw object of incomplete type %0">; @@ -4233,10 +4472,6 @@ let CategoryName = "Lambda Issue" in { def note_lambda_decl : Note<"lambda expression begins here">; def err_lambda_unevaluated_operand : Error< "lambda expression in an unevaluated operand">; - def ext_lambda_implies_void_return : ExtWarn< - "C++11 requires lambda with omitted result type to consist of a single " - "return statement">, - InGroup<LambdaExtensions>; def err_lambda_return_init_list : Error< "cannot deduce lambda return type from initializer list">; def err_lambda_capture_default_arg : Error< @@ -4278,8 +4513,10 @@ def ext_pseudo_dtor_on_void : ExtWarn< "pseudo-destructors on type void are a Microsoft extension">, InGroup<Microsoft>; def err_pseudo_dtor_type_mismatch : Error< - "the type of object expression (%0) does not match the type being destroyed " - "(%1) in pseudo-destructor expression">; + "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< @@ -4296,11 +4533,12 @@ def err_type_defined_in_condition : Error< def err_typecheck_bool_condition : Error< "value of type %0 is not contextually convertible to 'bool'">; def err_typecheck_ambiguous_condition : Error< - "conversion from %0 to %1 is ambiguous">; + "conversion %diff{from $ to $|between types}0,1 is ambiguous">; def err_typecheck_nonviable_condition : Error< - "no viable conversion from %0 to %1">; + "no viable conversion%diff{ from $ to $|}0,1">; def err_typecheck_deleted_function : Error< - "conversion function from %0 to %1 invokes a deleted function">; + "conversion function %diff{from $ to $|between types}0,1 " + "invokes a deleted function">; def err_expected_class_or_namespace : Error<"expected a class or namespace">; def err_expected_class : Error<"%0 is not a class%select{ or namespace|, " @@ -4314,6 +4552,9 @@ def err_invalid_declarator_in_function : Error< def err_not_tag_in_scope : Error< "no %select{struct|union|class|enum}0 named %1 in %2">; +def err_no_typeid_with_fno_rtti : Error< + "cannot use typeid 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< @@ -4344,42 +4585,66 @@ def note_equality_comparison_silence : Note< // In most of these diagnostics the %2 is a value from the // Sema::AssignmentAction enumeration def err_typecheck_convert_incompatible : Error< - "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from incompatible type|to parameter of incompatible type|" - "from a function with incompatible result type|to incompatible type|" - "with an expression of incompatible type|to parameter of incompatible type|" - "to incompatible type}2 %1" + "%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 (%5 vs %6)" + "%select{|: different classes%diff{ ($ vs $)|}5,6" "|: different number of parameters (%5 vs %6)" - "|: type mismatch at %ordinal5 parameter (%6 vs %7)" - "|: different return type (%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< - "return type %0 must match previous return type %1 when %select{block " + "%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 warn_incompatible_qualified_id : Warning< - "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from incompatible type|to parameter of incompatible type|" - "from a function with incompatible result type|to incompatible type|" - "with an expression of incompatible type|to parameter of incompatible type|" - "to incompatible type}2 %1">; + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1" + "%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 *|" @@ -4387,92 +4652,163 @@ def ext_typecheck_convert_pointer_int : ExtWarn< InGroup<IntConversion>; def ext_typecheck_convert_int_pointer : ExtWarn< "incompatible integer to pointer conversion " - "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1" + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1 " - "converts between void pointer and function pointer">; + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1 " - "converts between pointers to integer types with different sign">, + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1" + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1 discards " - "qualifiers">, + "%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<IncompatiblePointerTypes>; def ext_nested_pointer_qualifier_mismatch : ExtWarn< - "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1 discards " - "qualifiers in nested 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" + " discards qualifiers in nested pointer types">, InGroup<IncompatiblePointerTypes>; def warn_incompatible_vectors : Warning< "incompatible vector types " - "%select{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1">, + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1">; + "%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{assigning to|passing|returning|converting|initializing|sending|casting}2" - " %0 " - "%select{from|to parameter of type|from a function with result type|to type|" - "with an expression of type|to parameter of type|to type}2 %1">; + "%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{assigning %1 to %0" - "|passing %0 to parameter of type %1" - "|returning %0 from a function with result type %1" - "|converting %0 to type %1" - "|initializing %0 with an expression of type %1" - "|sending %0 to parameter of type %1" - "|casting %0 to type %1}2" + "%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{assigning %1 to %0" - "|passing %0 to parameter of type %1" - "|returning %0 from a function with result type %1" - "|converting %0 to type %1" - "|initializing %0 with an expression of type %1" - "|sending %0 to parameter of type %1" - "|casting %0 to type %1}2" + "%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 (%0 and %1)">; + "comparison of distinct block types%diff{ ($ and $)|}0,1">; def err_typecheck_array_not_modifiable_lvalue : Error< "array type %0 is not assignable">; @@ -4505,18 +4841,34 @@ 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_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 note_callee_decl : Note< "%0 declared here">; def note_defined_here : Note<"%0 defined here">; @@ -4558,11 +4910,19 @@ 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_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<DiagGroup<"non-pod-varargs">>, 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}1">; - + "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">, @@ -4573,7 +4933,8 @@ def warn_cxx98_compat_pass_non_pod_arg_to_vararg : Warning< InGroup<CXX98Compat>, DefaultIgnore; def err_typecheck_call_invalid_ordered_compare : Error< - "ordered compare requires two args of floating point type (%0 and %1)">; + "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)">; @@ -4597,17 +4958,18 @@ def err_cast_pointer_to_non_pointer_int : Error< 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 (%0 and %1)">; + "incompatible operand types%diff{ ($ and $)|}0,1">; def ext_typecheck_cond_incompatible_operands_nonstandard : ExtWarn< - "incompatible operand types (%0 and %1) use non-standard composite pointer " - "type %2">; + "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 warn_typecheck_cond_incompatible_pointers : ExtWarn< - "pointer type mismatch (%0 and %1)">, + "pointer type mismatch%diff{ ($ and $)|}0,1">, InGroup<DiagGroup<"pointer-type-mismatch">>; def warn_typecheck_cond_pointer_integer_mismatch : ExtWarn< - "pointer/integer type mismatch in conditional expression (%0 and %1)">, + "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">; @@ -4628,6 +4990,10 @@ def warn_unused_call : Warning< 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{equality|inequality}0 comparison result unused">, InGroup<UnusedComparison>; @@ -4661,7 +5027,8 @@ let CategoryName = "Inline Assembly Issue" in { 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 %0 matching output with type %1">; + "unsupported inline asm: input with type " + "%diff{$ matching output with type $|}0,1">; def err_asm_unknown_register_name : Error<"unknown register name '%0' in asm">; def warn_asm_label_on_auto_decl : Warning< "ignored asm label '%0' on automatic variable">; @@ -4673,12 +5040,16 @@ let CategoryName = "Inline Assembly Issue" in { "invalid use of a cast in a 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_unsupported_msasm : ExtWarn< + "MS-style inline assembly is not supported">, InGroup<Microsoft>; } let CategoryName = "Semantic Issue" in { def err_invalid_conversion_between_vectors : Error< - "invalid conversion between vector type %0 and %1 of different size">; + "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">; @@ -4730,6 +5101,9 @@ def err_in_class_initializer_literal_type : Error< "'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_references_def_ctor : Error< + "defaulted default constructor of %0 cannot be used by non-static data " + "member initializer which appears before end of class definition">; def ext_in_class_initializer_non_constant : Extension< "in-class initializer for static data member is not a constant expression; " @@ -4846,9 +5220,9 @@ def err_operator_new_delete_invalid_result_type : Error< 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.">; + "%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.">; + "%0 template must have at least two parameters">; def err_operator_new_dependent_param_type : Error< "%0 cannot take a dependent type as first parameter; " @@ -4912,60 +5286,33 @@ def warn_cxx98_compat_explicit_conversion_functions : Warning< InGroup<CXX98Compat>, DefaultIgnore; // C++11 defaulted functions -def err_defaulted_default_ctor_params : Error< - "an explicitly-defaulted default constructor must have no parameters">; -def err_defaulted_copy_ctor_params : Error< - "an explicitly-defaulted copy constructor must have exactly one parameter">; -def err_defaulted_copy_ctor_volatile_param : Error< - "the parameter for an explicitly-defaulted copy constructor may not be " - "volatile">; -def err_defaulted_copy_ctor_const_param : Error< - "the parameter for this explicitly-defaulted copy constructor is const, but " - "a member or base requires it to be non-const">; -def err_defaulted_copy_assign_params : Error< - "an explicitly-defaulted copy assignment operator must have exactly one " - "parameter">; -def err_defaulted_copy_assign_return_type : Error< - "an explicitly-defaulted copy assignment operator must return an unqualified " - "lvalue reference to its class type">; +def err_defaulted_special_member_params : Error< + "an explicitly-defaulted %select{|copy |move }0constructor cannot " + "have default arguments">; +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', 'constexpr' 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_special_member_copy_non_const_param : Error< + "explicitly-defaulted copy %select{constructor|assignment operator}0 with " + "a non-const parameter must be defaulted outside the class, unless a base or " + "member requires the parameter 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_defaulted_copy_assign_volatile_param : Error< - "the parameter for an explicitly-defaulted copy assignment operator may not " - "be volatile">; -def err_defaulted_copy_assign_const_param : Error< - "the parameter for this explicitly-defaulted copy assignment operator is " - "const, but a member or base requires it to be non-const">; -def err_defaulted_copy_assign_quals : Error< - "an explicitly-defaulted copy assignment operator may not have 'const', " - "'constexpr' or 'volatile' qualifiers">; -def err_defaulted_move_ctor_params : Error< - "an explicitly-defaulted move constructor must have exactly one parameter">; -def err_defaulted_move_ctor_volatile_param : Error< - "the parameter for an explicitly-defaulted move constructor may not be " - "volatile">; -def err_defaulted_move_ctor_const_param : Error< - "the parameter for an explicitly-defaulted move constructor may not be " - "const">; -def err_defaulted_move_assign_params : Error< - "an explicitly-defaulted move assignment operator must have exactly one " - "parameter">; -def err_defaulted_move_assign_return_type : Error< - "an explicitly-defaulted move assignment operator must return an unqualified " - "lvalue reference to its class type">; -def err_defaulted_move_assign_not_ref : Error< - "the parameter for an explicitly-defaulted move assignment operator must be an " - "rvalue reference type">; -def err_defaulted_move_assign_volatile_param : Error< - "the parameter for an explicitly-defaulted move assignment operator may not " - "be volatile">; -def err_defaulted_move_assign_const_param : Error< - "the parameter for an explicitly-defaulted move assignment operator may not " - "be const">; -def err_defaulted_move_assign_quals : Error< - "an explicitly-defaulted move assignment operator may not have 'const', " - "'constexpr' or 'volatile' qualifiers">; def err_incorrect_defaulted_exception_spec : Error< "exception specification of explicitly defaulted %select{default constructor|" "copy constructor|move constructor|copy assignment operator|move assignment " @@ -4995,9 +5342,6 @@ def warn_array_index_exceeds_bounds : Warning< def note_array_index_out_of_bounds : Note< "array %0 declared here">; -def warn_printf_write_back : Warning< - "use of '%%n' in format string discouraged (potentially insecure)">, - InGroup<FormatSecurity>; def warn_printf_insufficient_data_args : Warning< "more '%%' conversions than data arguments">, InGroup<Format>; def warn_printf_data_arg_not_used : Warning< @@ -5066,7 +5410,8 @@ 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_printf_c_str: Note<"did you mean to call the %0 method?">; + def warn_null_arg : Warning< "null passed to a callee which requires a non-null argument">, InGroup<NonNull>; @@ -5118,6 +5463,10 @@ def warn_stringcompare : Warning< "unspecified (use strncmp instead)">, InGroup<DiagGroup<"string-compare">>; +def warn_identity_field_assign : Warning< + "assigning %select{field|instance variable}0 to itself">, + InGroup<SelfAssignmentField>; + // Generic selections. def err_assoc_type_incomplete : Error< "type %0 in generic association incomplete">; @@ -5141,14 +5490,15 @@ def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" def err_block_returning_array_function : Error< "block cannot return %select{array|function}0 type %1">; -// Builtin annotation string. -def err_builtin_annotation_not_string_constant : Error< - "__builtin_annotation requires a non wide string constant">; +// 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">, - InGroup<DiagGroup<"CFString-literal">>; + "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">, @@ -5168,6 +5518,8 @@ def warn_case_value_overflow : Warning< "overflow converting case value to switch condition type (%0 to %1)">, InGroup<DiagGroup<"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'">; @@ -5197,11 +5549,35 @@ def warn_missing_cases : Warning< "%0 enumeration values not handled in switch: %1, %2, %3...">, 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 '[[clang::fallthrough]];' 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_assignement : 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< @@ -5229,8 +5605,7 @@ def warn_empty_while_body : Warning< 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">, - InGroup<EmptyBody>; + "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">; @@ -5318,17 +5693,22 @@ def err_selector_element_not_lvalue : Error< def err_selector_element_type : Error< "selector element type %0 is not a valid object">; def err_collection_expr_type : Error< - "collection expression type %0 is not a valid object">; + "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 : Warning< + "attribute %0 is already applied with different parameters">, + InGroup<IgnoredAttributes>; + // 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">; + "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'">; @@ -5376,13 +5756,19 @@ def warn_attribute_method_def : Warning< "attributes on method implementation and its declaration must match">, InGroup<DiagGroup<"mismatched-method-attributes">>; def ext_typecheck_base_super : Warning< - "method parameter type %0 does not match " - "super class method parameter type %1">, InGroup<SuperSubClassMismatch>, DefaultIgnore; + "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_type_or_class_name_suggest : Error< + "unknown %select{type|class}2 name %0; did you mean %1?">; def err_unknown_typename_suggest : Error< "unknown type name %0; did you mean %1?">; def err_unknown_nested_typename_suggest : Error< @@ -5457,14 +5843,19 @@ def err_filter_expression_integral : Error< // 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_static_function_scope : Error< + "variables in function scope cannot be declared static">; } // end of sema 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 %0, but " - "is declared to return %1">; + "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">; @@ -5494,5 +5885,9 @@ def err_module_private_definition : Error< "definition of %0 must be imported before it is required">; } -} // end of sema component. +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 +} // end of sema component. diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td index 7f9fe26..a440e80 100644 --- a/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/include/clang/Basic/DiagnosticSerializationKinds.td @@ -10,7 +10,7 @@ let Component = "Serialization" in { def err_fe_unable_to_read_pch_file : Error< - "unable to read PCH file: '%0'">; + "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< @@ -22,6 +22,8 @@ def err_fe_pch_error_at_end_block : Error< def err_fe_pch_file_modified : Error< "file '%0' has been modified since the precompiled header was built">, DefaultFatal; +def err_fe_pch_file_overridden : Error< + "file '%0' from the precompiled header has been overridden">; def warn_pch_target_triple : Error< "PCH file was compiled for the target '%0' but the current translation " diff --git a/include/clang/Basic/ExceptionSpecificationType.h b/include/clang/Basic/ExceptionSpecificationType.h index e911bde..edd89ec 100644 --- a/include/clang/Basic/ExceptionSpecificationType.h +++ b/include/clang/Basic/ExceptionSpecificationType.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the ExceptionSpecificationType enumeration and various -// utility functions. -// +/// +/// \file +/// \brief Defines the ExceptionSpecificationType enumeration and various +/// utility functions. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H #define LLVM_CLANG_BASIC_EXCEPTIONSPECIFICATIONTYPE_H @@ -24,7 +25,7 @@ enum ExceptionSpecificationType { EST_MSAny, ///< Microsoft throw(...) extension EST_BasicNoexcept, ///< noexcept EST_ComputedNoexcept, ///< noexcept(expression) - EST_Delayed, ///< not known yet + EST_Unevaluated, ///< not evaluated yet, for special member function EST_Uninstantiated ///< not instantiated yet }; @@ -36,6 +37,10 @@ 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, diff --git a/include/clang/Basic/ExpressionTraits.h b/include/clang/Basic/ExpressionTraits.h index c4e6a1c..e877715 100644 --- a/include/clang/Basic/ExpressionTraits.h +++ b/include/clang/Basic/ExpressionTraits.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines enumerations for expression traits intrinsics. -// +/// +/// \file +/// \brief Defines enumerations for expression traits intrinsics. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_EXPRESSIONTRAITS_H diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index 5c7d9eb..b00f2b7 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the FileManager interface. -// +/// +/// \file +/// \brief Defines the clang::FileManager interface and associated types. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FILEMANAGER_H @@ -40,9 +41,8 @@ namespace clang { class FileManager; class FileSystemStatCache; -/// DirectoryEntry - Cached information about one directory (either on -/// the disk or in the virtual file system). -/// +/// \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; @@ -51,10 +51,11 @@ public: const char *getName() const { return Name; } }; -/// FileEntry - Cached information about one file (either on the disk -/// or in the virtual file system). If the 'FD' member is valid, then -/// this FileEntry has an open file descriptor for the file. +/// \brief Cached information about one file (either on disk +/// or in the virtual file system). /// +/// If the 'FD' 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. @@ -96,8 +97,7 @@ public: time_t getModificationTime() const { return ModTime; } mode_t getFileMode() const { return FileMode; } - /// getDir - Return the directory the file lives in. - /// + /// \brief Return the directory the file lives in. const DirectoryEntry *getDir() const { return Dir; } bool operator<(const FileEntry &RHS) const { @@ -105,10 +105,12 @@ public: } }; -/// FileManager - 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. +/// \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> { FileSystemOptions FileSystemOpts; @@ -116,30 +118,37 @@ class FileManager : public RefCountedBase<FileManager> { class UniqueDirContainer; class UniqueFileContainer; - /// UniqueRealDirs/UniqueRealFiles - Cache for existing real - /// directories/files. - /// + /// \brief Cache for existing real directories. UniqueDirContainer &UniqueRealDirs; + + /// \brief Cache for existing real files. UniqueFileContainer &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 + /// \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<DirectoryEntry*, 4> VirtualDirectoryEntries; /// \brief The virtual files that we have allocated. SmallVector<FileEntry*, 4> VirtualFileEntries; - /// SeenDirEntries/SeenFileEntries - This is a cache that maps paths - /// to directory/file entries (either real or virtual) we have - /// looked up. The actual Entries for real directories/files are + /// \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; - /// NextFileUID - Each FileEntry we create is assigned a unique ID #. + /// \brief Each FileEntry we create is assigned a unique ID #. /// unsigned NextFileUID; @@ -177,8 +186,13 @@ public: /// \brief Removes the specified FileSystemStatCache object from the manager. void removeStatCache(FileSystemStatCache *statCache); - /// getDirectory - Lookup, cache, and verify the specified directory - /// (real or virtual). This returns NULL if the directory doesn't exist. + /// \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. @@ -186,7 +200,9 @@ public: bool CacheFailure = true); /// \brief Lookup, cache, and verify the specified file (real or - /// virtual). This returns NULL if the file doesn't exist. + /// virtual). + /// + /// This returns NULL if the file doesn't exist. /// /// \param OpenFile if true and the file exists, it will be opened. /// @@ -199,23 +215,29 @@ public: const FileSystemOptions &getFileSystemOptions() { return FileSystemOpts; } /// \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. + /// 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::MemoryBuffer *getBufferForFile(const FileEntry *Entry, - std::string *ErrorStr = 0); + std::string *ErrorStr = 0, + bool isVolatile = false); llvm::MemoryBuffer *getBufferForFile(StringRef Filename, std::string *ErrorStr = 0); - // getNoncachedStatValue - Will get the 'stat' information for the given path. - // If the path is relative, it will be resolved against the WorkingDir of the - // FileManager's FileSystemOptions. + /// \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. bool getNoncachedStatValue(StringRef Path, struct stat &StatBuf); + /// \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. @@ -226,6 +248,11 @@ public: 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); + void PrintStats() const; }; diff --git a/include/clang/Basic/FileSystemOptions.h b/include/clang/Basic/FileSystemOptions.h index 81e928d..38f1346 100644 --- a/include/clang/Basic/FileSystemOptions.h +++ b/include/clang/Basic/FileSystemOptions.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the FileSystemOptions interface. -// +/// +/// \file +/// \brief Defines the clang::FileSystemOptions interface. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_FILESYSTEMOPTIONS_H diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index 96a2f90..a802c7c 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the FileSystemStatCache interface. -// +/// +/// \file +/// \brief Defines the FileSystemStatCache interface. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FILESYSTEMSTATCACHE_H @@ -34,13 +35,14 @@ 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. + CacheExists, ///< We know the file exists and its cached stat data. + CacheMissing ///< We know that the file doesn't exist. }; - /// FileSystemStatCache::get - Get the 'stat' information for the specified - /// path, using the cache to accellerate it if possible. This returns true if - /// the path does not exist or false if it exists. + /// \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 FileDescriptor is non-null, then this lookup should only return success /// for files (not directories). If it is null this lookup should only return diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index cc0080b..dc6acda 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the IdentifierInfo, IdentifierTable, and Selector -// interfaces. -// +/// +/// \file +/// \brief Defines the clang::IdentifierInfo, clang::IdentifierTable, and +/// clang::Selector interfaces. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_IDENTIFIERTABLE_H @@ -37,12 +38,12 @@ namespace clang { class MultiKeywordSelector; // private class used by Selector class DeclarationName; // AST class that stores declaration names - /// IdentifierLocPair - A simple pair of identifier info and location. + /// \brief A simple pair of identifier info and location. typedef std::pair<IdentifierInfo*, SourceLocation> IdentifierLocPair; -/// IdentifierInfo - One of these records is kept for each identifier that -/// is lexed. This contains information about whether the token was #define'd, +/// 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. @@ -67,7 +68,7 @@ class IdentifierInfo { 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 + bool IsModulesImport : 1; // True if this is the 'import' contextual // keyword. // 1 bit left in 32-bit word. @@ -83,15 +84,16 @@ public: IdentifierInfo(); - /// isStr - Return true if this is the identifier for the specified string. + /// \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); } - /// getNameStart - Return the beginning of the actual string for this - /// identifier. The returned string is properly null terminated. + /// \brief Return the beginning of the actual null-terminated string for this + /// identifier. /// const char *getNameStart() const { if (Entry) return Entry->getKeyData(); @@ -104,7 +106,7 @@ public: return ((const actualtype*) this)->second; } - /// getLength - Efficiently return the length of this identifier info. + /// \brief Efficiently return the length of this identifier info. /// unsigned getLength() const { if (Entry) return Entry->getKeyLength(); @@ -118,13 +120,12 @@ public: return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1; } - /// getName - Return the actual identifier string. + /// \brief Return the actual identifier string. StringRef getName() const { return StringRef(getNameStart(), getLength()); } - /// hasMacroDefinition - Return true if this identifier is #defined to some - /// other value. + /// \brief Return true if this identifier is \#defined to some other value. bool hasMacroDefinition() const { return HasMacro; } @@ -158,13 +159,14 @@ public: RevertedTokenID = true; } - /// getPPKeywordID - Return the preprocessor keyword ID for this identifier. + /// \brief Return the preprocessor keyword ID for this identifier. + /// /// For example, "define" will return tok::pp_define. tok::PPKeywordKind getPPKeywordID() const; - /// getObjCKeywordID - Return the Objective-C keyword ID for the this - /// identifier. For example, 'class' will return tok::objc_class if ObjC is - /// enabled. + /// \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); @@ -400,10 +402,11 @@ public: virtual IdentifierInfo *GetIdentifier(unsigned ID) = 0; }; -/// IdentifierTable - This table implements an efficient mapping from strings to -/// IdentifierInfo nodes. It 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. +/// \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! @@ -413,8 +416,8 @@ class IdentifierTable { IdentifierInfoLookup* ExternalLookup; public: - /// IdentifierTable ctor - Create the identifier table, populating it with - /// info about the language keywords for the language specified by LangOpts. + /// \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 = 0); @@ -432,8 +435,8 @@ public: return HashTable.getAllocator(); } - /// get - Return the identifier token info for the specified named identifier. - /// + /// \brief Return the identifier token info for the specified named + /// identifier. IdentifierInfo &get(StringRef Name) { llvm::StringMapEntry<IdentifierInfo*> &Entry = HashTable.GetOrCreateValue(Name); @@ -507,15 +510,16 @@ public: iterator end() const { return HashTable.end(); } unsigned size() const { return HashTable.size(); } - /// PrintStats - Print some statistics to stderr that indicate how well the + /// \brief Print some statistics to stderr that indicate how well the /// hashing is doing. void PrintStats() const; void AddKeywords(const LangOptions &LangOpts); }; -/// ObjCMethodFamily - A family of Objective-C methods. These -/// families have no inherent meaning in the language, but are +/// \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 @@ -562,11 +566,13 @@ enum ObjCMethodFamily { /// InvalidObjCMethodFamily. enum { ObjCMethodFamilyBitWidth = 4 }; -/// An invalid value of ObjCMethodFamily. +/// \brief An invalid value of ObjCMethodFamily. enum { InvalidObjCMethodFamily = (1 << ObjCMethodFamilyBitWidth) - 1 }; -/// Selector - This smart pointer class efficiently represents Objective-C -/// method names. This class will either point to an IdentifierInfo or a +/// \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. @@ -574,9 +580,10 @@ class Selector { friend class Diagnostic; enum IdentifierInfoFlag { - // MultiKeywordSelector = 0. + // Empty selector = 0. ZeroArg = 0x1, OneArg = 0x2, + MultiArg = 0x3, ArgFlags = ZeroArg|OneArg }; uintptr_t InfoPtr; // a pointer to the MultiKeywordSelector or IdentifierInfo. @@ -590,13 +597,18 @@ class Selector { Selector(MultiKeywordSelector *SI) { InfoPtr = reinterpret_cast<uintptr_t>(SI); assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); + InfoPtr |= MultiArg; } IdentifierInfo *getAsIdentifierInfo() const { - if (getIdentifierInfoFlag()) + if (getIdentifierInfoFlag() < MultiArg) return reinterpret_cast<IdentifierInfo *>(InfoPtr & ~ArgFlags); return 0; } + MultiKeywordSelector *getMultiKeywordSelector() const { + return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags); + } + unsigned getIdentifierInfoFlag() const { return InfoPtr & ArgFlags; } @@ -661,11 +673,12 @@ public: /// name was supplied. StringRef getNameForSlot(unsigned argIndex) const; - /// getAsString - Derive the full selector name (e.g. "foo:bar:") and return + /// \brief Derive the full selector name (e.g. "foo:bar:") and return /// it as an std::string. + // FIXME: Add a print method that uses a raw_ostream. std::string getAsString() const; - /// getMethodFamily - Derive the conventional family of this method. + /// \brief Derive the conventional family of this method. ObjCMethodFamily getMethodFamily() const { return getMethodFamilyImpl(*this); } @@ -678,7 +691,7 @@ public: } }; -/// SelectorTable - This table allows us to fully hide how we implement +/// \brief This table allows us to fully hide how we implement /// multi-keyword caching. class SelectorTable { void *Impl; // Actually a SelectorTableImpl @@ -688,9 +701,10 @@ public: SelectorTable(); ~SelectorTable(); - /// getSelector - This can create any sort of selector. NumArgs indicates - /// whether this is a no argument selector "foo", a single argument selector - /// "foo:" or multi-argument "foo:bar:". + /// \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) { @@ -700,11 +714,12 @@ public: return Selector(ID, 0); } - /// Return the total amount of memory allocated for managing selectors. + /// \brief Return the total amount of memory allocated for managing selectors. size_t getTotalMemory() const; - /// constructSetterName - Return the setter name for the given - /// identifier, i.e. "set" + Name where the initial character of Name + /// \brief Return the setter name for the given identifier. + /// + /// This is "set" + \p Name where the initial character of \p Name /// has been capitalized. static Selector constructSetterName(IdentifierTable &Idents, SelectorTable &SelTable, diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h index 813b49e..13c5b44 100644 --- a/include/clang/Basic/LLVM.h +++ b/include/clang/Basic/LLVM.h @@ -7,9 +7,10 @@ // //===----------------------------------------------------------------------===// // -// This file forward declares and imports various common LLVM datatypes that -// clang wants to use unqualified. -// +/// \file +/// \brief Forward declares and imports various common LLVM datatypes that +/// clang wants to use unqualified. +/// //===----------------------------------------------------------------------===// #ifndef CLANG_BASIC_LLVM_H diff --git a/include/clang/Basic/Lambda.h b/include/clang/Basic/Lambda.h index df50d94..b1ad6ac 100644 --- a/include/clang/Basic/Lambda.h +++ b/include/clang/Basic/Lambda.h @@ -6,9 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines several types used to describe C++ lambda -// expressions that are shared between the parser and AST. +/// +/// \file +/// \brief Defines several types used to describe C++ lambda expressions +/// that are shared between the parser and AST. +/// //===----------------------------------------------------------------------===// @@ -17,16 +19,15 @@ namespace clang { -/// LambdaCaptureDefault - The default, if any, capture method for a -/// lambda expression. +/// \brief The default, if any, capture method for a lambda expression. enum LambdaCaptureDefault { LCD_None, LCD_ByCopy, LCD_ByRef }; -/// LambdaCaptureKind - The different capture forms in a lambda -/// introducer: 'this' or a copied or referenced variable. +/// \brief The different capture forms in a lambda introducer: 'this' or a +/// copied or referenced variable. enum LambdaCaptureKind { LCK_This, LCK_ByCopy, diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def index d2ce7c0..fab17a2 100644 --- a/include/clang/Basic/LangOptions.def +++ b/include/clang/Basic/LangOptions.def @@ -50,8 +50,6 @@ LANGOPT(CPlusPlus , 1, 0, "C++") LANGOPT(CPlusPlus0x , 1, 0, "C++0x") LANGOPT(ObjC1 , 1, 0, "Objective-C 1") LANGOPT(ObjC2 , 1, 0, "Objective-C 2") -LANGOPT(ObjCNonFragileABI , 1, 0, "Objective-C modern abi") -LANGOPT(ObjCNonFragileABI2 , 1, 0, "Objective-C enhanced modern abi") BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0, "Objective-C auto-synthesized properties") BENIGN_LANGOPT(ObjCInferRelatedResultType , 1, 1, @@ -80,7 +78,6 @@ LANGOPT(SjLjExceptions , 1, 0, "setjmp-longjump exception handling") LANGOPT(TraditionalCPP , 1, 0, "traditional CPP emulation") LANGOPT(RTTI , 1, 1, "run-time type information") LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout") -LANGOPT(NeXTRuntime , 1, 1, "NeXT Objective-C runtime") LANGOPT(Freestanding, 1, 0, "freestanding implementation") LANGOPT(NoBuiltin , 1, 0, "disable builtin functions") @@ -102,6 +99,7 @@ LANGOPT(GNUInline , 1, 0, "GNU inline semantics") LANGOPT(NoInlineDefine , 1, 0, "__NO_INLINE__ predefined macro") LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro") LANGOPT(FastMath , 1, 0, "__FAST_MATH__ predefined macro") +LANGOPT(FiniteMathOnly , 1, 0, "__FINITE_MATH_ONLY__ predefined macro") BENIGN_LANGOPT(ObjCGCBitmapPrint , 1, 0, "printing of GC's bitmap layout for __weak/__strong ivars") @@ -112,6 +110,7 @@ LANGOPT(ShortWChar , 1, 0, "unsigned short wchar_t") LANGOPT(ShortEnums , 1, 0, "short enum types") LANGOPT(OpenCL , 1, 0, "OpenCL") +LANGOPT(OpenCLVersion , 32, 0, "OpenCL version") LANGOPT(CUDA , 1, 0, "CUDA") LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators") @@ -125,7 +124,7 @@ BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden default visibility for inl 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(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support") BENIGN_LANGOPT(AddressSanitizer , 1, 0, "AddressSanitizer enabled") BENIGN_LANGOPT(ThreadSanitizer , 1, 0, "ThreadSanitizer enabled") @@ -150,8 +149,9 @@ ENUM_LANGOPT(StackProtector, StackProtectorMode, 2, SSPOff, "stack protector mode") ENUM_LANGOPT(SignedOverflowBehavior, SignedOverflowBehaviorTy, 2, SOB_Undefined, "signed integer overflow handling") +ENUM_LANGOPT(FPContractMode, FPContractModeKind, 2, FPC_On, "FP_CONTRACT mode") -BENIGN_LANGOPT(InstantiationDepth, 32, 1024, +BENIGN_LANGOPT(InstantiationDepth, 32, 512, "maximum template instantiation depth") BENIGN_LANGOPT(ConstexprCallDepth, 32, 512, "maximum constexpr call depth") diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index ce4ff06..fbb014e 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the LangOptions interface. -// +/// +/// \file +/// \brief Defines the clang::LangOptions interface. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LANGOPTIONS_H @@ -16,6 +17,7 @@ #include <string> #include "clang/Basic/LLVM.h" +#include "clang/Basic/ObjCRuntime.h" #include "clang/Basic/Visibility.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" @@ -39,8 +41,8 @@ protected: #include "clang/Basic/LangOptions.def" }; -/// LangOptions - This class keeps track of the various options that can be -/// enabled, which controls the dialect of C that is accepted. +/// \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 RefCountedBase<LangOptions>, public LangOptionsBase { public: typedef clang::Visibility Visibility; @@ -54,10 +56,20 @@ public: SOB_Trapping // -ftrapv }; + enum FPContractModeKind { + FPC_Off, // Form fused FP ops only where result will not be affected. + FPC_On, // Form fused FP ops according to FP_CONTRACT rules. + FPC_Fast // Aggressively fuse FP ops (E.g. FMA). + }; + public: + clang::ObjCRuntime ObjCRuntime; + std::string ObjCConstantStringClass; - /// The name of the handler function to be called when -ftrapv is specified. + /// \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; @@ -82,7 +94,7 @@ public: void resetNonModularOptions(); }; -/// Floating point control options +/// \brief Floating point control options class FPOptions { public: unsigned fp_contract : 1; @@ -93,7 +105,7 @@ public: fp_contract(LangOpts.DefaultFPContract) {} }; -/// OpenCL volatile options +/// \brief OpenCL volatile options class OpenCLOptions { public: #define OPENCLEXT(nm) unsigned nm : 1; @@ -116,7 +128,6 @@ enum TranslationUnitKind { TU_Module }; - /// \brief } // end namespace clang #endif diff --git a/include/clang/Basic/Linkage.h b/include/clang/Basic/Linkage.h index 09a5a0b..6bc1f5d 100644 --- a/include/clang/Basic/Linkage.h +++ b/include/clang/Basic/Linkage.h @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Linkage enumeration and various utility -// functions. -// +/// +/// \file +/// \brief Defines the Linkage enumeration and various utility functions. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_LINKAGE_H #define LLVM_CLANG_BASIC_LINKAGE_H @@ -28,8 +28,9 @@ enum Linkage { /// translation units). InternalLinkage, - /// \brief External linkage within a unique namespace. From the - /// language perspective, these entities have external + /// \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 @@ -41,8 +42,9 @@ enum Linkage { ExternalLinkage }; -/// \brief A more specific kind of linkage. This is relevant to CodeGen and -/// AST file reading. +/// \brief A more specific kind of linkage than enum Linkage. +/// +/// This is relevant to CodeGen and AST file reading. enum GVALinkage { GVA_Internal, GVA_C99Inline, @@ -52,14 +54,13 @@ enum GVALinkage { GVA_ExplicitTemplateInstantiation }; -/// \brief Determine whether the given linkage is semantically -/// external. +/// \brief Determine whether the given linkage is semantically external. inline bool isExternalLinkage(Linkage L) { return L == UniqueExternalLinkage || L == ExternalLinkage; } /// \brief Compute the minimum linkage given two linages. -static inline Linkage minLinkage(Linkage L1, Linkage L2) { +inline Linkage minLinkage(Linkage L1, Linkage L2) { return L1 < L2? L1 : L2; } diff --git a/include/clang/Basic/MacroBuilder.h b/include/clang/Basic/MacroBuilder.h index 1d0f1e8..6df3a38 100644 --- a/include/clang/Basic/MacroBuilder.h +++ b/include/clang/Basic/MacroBuilder.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the MacroBuilder utility class. -// +/// +/// \file +/// \brief Defines the clang::MacroBuilder utility class. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_MACROBUILDER_H @@ -24,13 +25,13 @@ class MacroBuilder { public: MacroBuilder(raw_ostream &Output) : Out(Output) {} - /// Append a #define line for macro of the form "#define Name Value\n". + /// 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". + /// 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'; } diff --git a/include/clang/Basic/Makefile b/include/clang/Basic/Makefile index 702afac..6a33133 100644 --- a/include/clang/Basic/Makefile +++ b/include/clang/Basic/Makefile @@ -1,6 +1,7 @@ CLANG_LEVEL := ../../.. BUILT_SOURCES = \ DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \ + DiagnosticCommentKinds.inc \ DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \ DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \ DiagnosticParseKinds.inc DiagnosticSemaKinds.inc \ diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index 82dbd5b..c8027f4 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Module class, which describes a module in the source -// code. -// +/// +/// \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 @@ -137,7 +138,7 @@ public: llvm::SmallVector<ExportDecl, 2> Exports; /// \brief Describes an exported module that has not yet been resolved - /// (perhaps because tASThe module it refers to has not yet been loaded). + /// (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; @@ -243,7 +244,7 @@ public: return Umbrella && Umbrella.is<const DirectoryEntry *>(); } - /// \briaf Add the given feature requirement to the list of features + /// \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 diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h new file mode 100644 index 0000000..b24fe7c --- /dev/null +++ b/include/clang/Basic/ObjCRuntime.h @@ -0,0 +1,264 @@ +//===--- 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_OBJCRUNTIME_H +#define LLVM_CLANG_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, + + /// '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 false; + case iOS: 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; + // Mac runtimes use legacy dispatch everywhere except x86-64 + } else if (isNeXTFamily() && isNonFragile()) + return Arch != llvm::Triple::x86_64; + return true; + } + + /// \brief Is this runtime basically of the GNUstep family of runtimes? + bool isGNUFamily() const { + switch (getKind()) { + case FragileMacOSX: + case MacOSX: + case iOS: + 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 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 hasARC() const { + switch (getKind()) { + case FragileMacOSX: return false; + case MacOSX: return getVersion() >= VersionTuple(10, 7); + case iOS: return getVersion() >= VersionTuple(5); + + case GCC: return false; + case GNUstep: return getVersion() >= VersionTuple(1, 6); + case ObjFW: return false; // XXX: this will change soon + } + llvm_unreachable("bad kind"); + } + + /// \brief Does this runtime natively provide ARC-compliant 'weak' + /// entrypoints? + bool hasWeak() const { + // Right now, this is always equivalent to the ARC decision. + return hasARC(); + } + + /// \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 false; + + // 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 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 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 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 FragileMacOSX: return false; + case GCC: return true; + case GNUstep: return true; + case ObjFW: return true; + } + llvm_unreachable("bad kind"); + } + + /// \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/OnDiskHashTable.h b/include/clang/Basic/OnDiskHashTable.h index b92f1cf..79273fc 100644 --- a/include/clang/Basic/OnDiskHashTable.h +++ b/include/clang/Basic/OnDiskHashTable.h @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines facilities for reading and writing on-disk hash -// tables. -// +/// +/// \file +/// \brief Defines facilities for reading and writing on-disk hash tables. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_ON_DISK_HASH_TABLE_H #define LLVM_CLANG_BASIC_ON_DISK_HASH_TABLE_H diff --git a/include/clang/Basic/OpenCL.h b/include/clang/Basic/OpenCL.h index 6f9785f..3b3f259 100644 --- a/include/clang/Basic/OpenCL.h +++ b/include/clang/Basic/OpenCL.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines some OpenCL-specific enums. -// +/// +/// \file +/// \brief Defines some OpenCL-specific enums. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_OPENCL_H @@ -16,7 +17,7 @@ namespace clang { -/// Names for the OpenCL image access qualifiers (OpenCL 1.1 6.6). +/// \brief Names for the OpenCL image access qualifiers (OpenCL 1.1 6.6). enum OpenCLImageAccess { CLIA_read_only = 1, CLIA_write_only = 2, diff --git a/include/clang/Basic/OperatorKinds.h b/include/clang/Basic/OperatorKinds.h index c0a9505..108014f 100644 --- a/include/clang/Basic/OperatorKinds.h +++ b/include/clang/Basic/OperatorKinds.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines C++ overloaded operators. -// +/// +/// \file +/// \brief Defines an enumeration for C++ overloaded operators. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_OPERATOR_KINDS_H @@ -16,10 +17,10 @@ namespace clang { -/// OverloadedOperatorKind - Enumeration specifying the different kinds of -/// C++ overloaded operators. +/// \brief Enumeration specifying the different kinds of C++ overloaded +/// operators. enum OverloadedOperatorKind { - OO_None, //< Not an overloaded operator + OO_None, ///< Not an overloaded operator #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \ OO_##Name, #include "clang/Basic/OperatorKinds.def" diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h index 007e6a4..3f4626e 100644 --- a/include/clang/Basic/PartialDiagnostic.h +++ b/include/clang/Basic/PartialDiagnostic.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file implements a partial diagnostic that can be emitted anwyhere -// in a DiagnosticBuilder stream. -// +/// +/// \file +/// \brief Implements a partial diagnostic that can be emitted anwyhere +/// in a DiagnosticBuilder stream. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_PARTIALDIAGNOSTIC_H @@ -37,25 +38,26 @@ public: Storage() : NumDiagArgs(0), NumDiagRanges(0) { } enum { - /// MaxArguments - The maximum number of arguments we can hold. We + /// \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 }; - /// NumDiagArgs - This contains the number of entries in Arguments. + /// \brief The number of entries in Arguments. unsigned char NumDiagArgs; - /// NumDiagRanges - This is the number of ranges in the DiagRanges array. + /// \brief This is the number of ranges in the DiagRanges array. unsigned char NumDiagRanges; - /// DiagArgumentsKind - This is an array of ArgumentKind::ArgumentKind enum - /// values, with one for each argument. This specifies whether the argument - /// is in DiagArgumentsStr or in DiagArguments. + /// \brief Specifies for each argument whether it is in DiagArgumentsStr + /// or in DiagArguments. unsigned char DiagArgumentsKind[MaxArguments]; - /// DiagArgumentsVal - The values for the various substitution positions. + /// \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. @@ -65,12 +67,13 @@ public: /// string arguments. std::string DiagArgumentsStr[MaxArguments]; - /// DiagRanges - The list of ranges added to this diagnostic. It currently - /// only support 10 ranges, could easily be extended if needed. + /// \brief The list of ranges added to this diagnostic. + /// + /// It currently only support 10 ranges, could easily be extended if needed. CharSourceRange DiagRanges[10]; - /// FixItHints - If valid, provides a hint with some code - /// to insert, remove, or modify at a particular position. + /// \brief If valid, provides a hint with some code to insert, remove, or + /// modify at a particular position. SmallVector<FixItHint, 6> FixItHints; }; @@ -114,10 +117,10 @@ private: // in the sense that its bits can be safely memcpy'ed and destructed // in the new location. - /// DiagID - The diagnostic ID. + /// \brief The diagnostic ID. mutable unsigned DiagID; - /// DiagStorage - Storage for args and ranges. + /// \brief Storage for args and ranges. mutable Storage *DiagStorage; /// \brief Allocator used to allocate storage for this diagnostic. @@ -179,6 +182,12 @@ private: } 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(0), Allocator(0) { } + PartialDiagnostic(unsigned DiagID, StorageAllocator &Allocator) : DiagID(DiagID), DiagStorage(0), Allocator(&Allocator) { } @@ -237,6 +246,12 @@ public: 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 { @@ -283,6 +298,18 @@ public: DB.AddFixItHint(DiagStorage->FixItHints[i]); } + void EmitToString(DiagnosticsEngine &Diags, + llvm::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) { diff --git a/include/clang/Basic/PrettyStackTrace.h b/include/clang/Basic/PrettyStackTrace.h index 06a1264..967d0d1 100644 --- a/include/clang/Basic/PrettyStackTrace.h +++ b/include/clang/Basic/PrettyStackTrace.h @@ -6,11 +6,12 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the PrettyStackTraceEntry class, which is used to make -// crashes give more contextual information about what the program was doing -// when it crashed. -// +/// +/// \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 CLANG_BASIC_PRETTYSTACKTRACE_H @@ -21,8 +22,8 @@ namespace clang { - /// PrettyStackTraceLoc - If a crash happens while one of these objects are - /// live, the message is printed out along with the specified source location. + /// 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; diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index d5fa7e7..d6bba38 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the SourceLocation class. -// +/// +/// \file +/// \brief Defines the clang::SourceLocation class and associated facilities. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_SOURCELOCATION_H @@ -31,12 +32,12 @@ namespace clang { class SourceManager; -/// FileID - This is an opaque identifier used by SourceManager which refers to -/// a source file (MemoryBuffer) along with its #include path and #line data. +/// \brief An opaque identifier used by SourceManager which refers to a +/// source file (MemoryBuffer) along with its \#include path and \#line data. /// class FileID { - /// ID - Opaque identifier, 0 is "invalid". >0 is this module, <-1 is - /// something loaded from another module. + /// \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) {} @@ -135,24 +136,28 @@ public: return L; } - /// getRawEncoding - 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. + /// \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; } - /// getFromRawEncoding - Turn a raw encoding of a SourceLocation object into + /// \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; } - /// getPtrEncoding - 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. + /// \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". @@ -161,7 +166,7 @@ public: /// getFromPtrEncoding - Turn a pointer encoding of a SourceLocation object /// into a real SourceLocation. - static SourceLocation getFromPtrEncoding(void *Encoding) { + static SourceLocation getFromPtrEncoding(const void *Encoding) { return getFromRawEncoding((unsigned)(uintptr_t)Encoding); } @@ -181,7 +186,7 @@ inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) { return LHS.getRawEncoding() < RHS.getRawEncoding(); } -/// SourceRange - a trival tuple used to represent a source range. +/// \brief A trival tuple used to represent a source range. class SourceRange { SourceLocation B; SourceLocation E; @@ -208,7 +213,8 @@ public: } }; -/// CharSourceRange - This class represents a character granular source range. +/// \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 or the range and the start of the /// last token of the range (a "token range"). In the token range case, the @@ -242,7 +248,7 @@ public: return getCharRange(SourceRange(B, E)); } - /// isTokenRange - Return true if the end of this range specifies the start of + /// \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; } @@ -259,17 +265,19 @@ public: bool isInvalid() const { return !isValid(); } }; -/// FullSourceLoc - A SourceLocation and its associated SourceManager. Useful -/// for argument passing to functions that expect both objects. +/// \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: - /// Creates a FullSourceLoc where isValid() returns false. + /// \brief Creates a FullSourceLoc where isValid() returns \c false. explicit FullSourceLoc() : SrcMgr(0) {} 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; @@ -290,13 +298,14 @@ public: const llvm::MemoryBuffer* getBuffer(bool *Invalid = 0) const; - /// getBufferData - Return a StringRef to the source buffer data for the + /// \brief Return a StringRef to the source buffer data for the /// specified FileID. StringRef getBufferData(bool *Invalid = 0) const; - /// getDecomposedLoc - 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. + /// \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; @@ -323,8 +332,9 @@ public: } }; - /// Prints information about this FullSourceLoc to stderr. Useful for - /// debugging. + /// \brief Prints information about this FullSourceLoc to stderr. + /// + /// This is useful for debugging. LLVM_ATTRIBUTE_USED void dump() const; friend inline bool @@ -340,10 +350,11 @@ public: }; -/// PresumedLoc - This class 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. +/// \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 { @@ -356,25 +367,30 @@ public: : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) { } - /// isInvalid - 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. + /// \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 == 0; } bool isValid() const { return Filename != 0; } - /// getFilename - Return the presumed filename of this location. This can be - /// affected by #line etc. + /// \brief Return the presumed filename of this location. + /// + /// This can be affected by \#line etc. const char *getFilename() const { return Filename; } - /// getLine - Return the presumed line number of this location. This can be - /// affected by #line etc. + /// \brief Return the presumed line number of this location. + /// + /// This can be affected by \#line etc. unsigned getLine() const { return Line; } - /// getColumn - Return the presumed column number of this location. This can - /// not be affected by #line, but is packaged here for convenience. + /// \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; } - /// getIncludeLoc - Return the presumed include location of this location. + /// \brief Return the presumed include location of this location. + /// /// This can be affected by GNU linemarker directives. SourceLocation getIncludeLoc() const { return IncludeLoc; } }; diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index bcb2d56..32268d7 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -6,22 +6,46 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the SourceManager interface. -// +/// +/// \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_SOURCEMANAGER_H #define LLVM_CLANG_SOURCEMANAGER_H #include "clang/Basic/LLVM.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/SourceLocation.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/DataTypes.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/DenseSet.h" #include "llvm/Support/MemoryBuffer.h" #include <map> #include <vector> @@ -38,38 +62,25 @@ class LangOptions; class ASTWriter; class ASTReader; -/// There are three different types of locations in a file: a spelling -/// location, an expansion location, and a presumed location. -/// -/// Given an example of: -/// #define min(x, y) x < y ? x : y -/// -/// and then later on a use of min: -/// #line 17 -/// return min(a, b); -/// -/// 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. - -/// SrcMgr - Public enums and private classes that are part of the +/// \namespace +/// \brief Public enums and private classes that are part of the /// SourceManager implementation. /// namespace SrcMgr { - /// CharacteristicKind - This is used to represent 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 various other cases. + /// \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 }; - /// ContentCache - One instance of this struct is kept for every file - /// loaded or used. This object owns the MemoryBuffer object. + /// \brief One instance of this struct is kept for every file loaded or used. + //// + /// This object owns the MemoryBuffer object. class ContentCache { enum CCFlags { /// \brief Whether the buffer is invalid. @@ -78,30 +89,37 @@ namespace SrcMgr { DoNotFreeFlag = 0x02 }; - /// Buffer - The actual buffer containing the characters from the input - /// file. This is owned by the ContentCache object. - /// The bits indicate indicates whether the buffer is invalid. + /// \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<const llvm::MemoryBuffer *, 2> Buffer; public: - /// Reference to the file entry representing this ContentCache. + /// \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. + /// + /// 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; - /// SourceLineCache - A bump pointer allocated array of offsets for each - /// source line. This is lazily computed. This is owned by the - /// SourceManager BumpPointerAllocator object. + /// \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; - /// NumLines - The number of lines in this ContentCache. This is only valid - /// if SourceLineCache is non-null. + /// \brief The number of lines in this ContentCache. + /// + /// This is only valid if SourceLineCache is non-null. unsigned NumLines : 31; /// \brief Indicates whether the buffer itself was provided to override @@ -110,22 +128,29 @@ namespace SrcMgr { /// 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; ContentCache(const FileEntry *Ent = 0) : Buffer(0, false), OrigEntry(Ent), ContentsEntry(Ent), - SourceLineCache(0), NumLines(0), BufferOverridden(false) {} + SourceLineCache(0), NumLines(0), BufferOverridden(false), + IsSystemFile(false) {} ContentCache(const FileEntry *Ent, const FileEntry *contentEnt) : Buffer(0, false), OrigEntry(Ent), ContentsEntry(contentEnt), - SourceLineCache(0), NumLines(0), BufferOverridden(false) {} + SourceLineCache(0), NumLines(0), BufferOverridden(false), + IsSystemFile(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. + /// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory + /// is not transferred, so this is a logical error. ContentCache(const ContentCache &RHS) - : Buffer(0, false), SourceLineCache(0), BufferOverridden(false) + : Buffer(0, false), SourceLineCache(0), BufferOverridden(false), + IsSystemFile(false) { OrigEntry = RHS.OrigEntry; ContentsEntry = RHS.ContentsEntry; @@ -136,13 +161,13 @@ namespace SrcMgr { NumLines = RHS.NumLines; } - /// getBuffer - Returns the memory buffer for the associated content. + /// \brief Returns the memory buffer for the associated content. /// /// \param Diag Object through which diagnostics will be emitted if the - /// buffer cannot be retrieved. + /// buffer cannot be retrieved. /// /// \param Loc If specified, is the location that invalid file diagnostics - /// will be emitted at. + /// will be emitted at. /// /// \param Invalid If non-NULL, will be set \c true if an error occurred. const llvm::MemoryBuffer *getBuffer(DiagnosticsEngine &Diag, @@ -150,15 +175,18 @@ namespace SrcMgr { SourceLocation Loc = SourceLocation(), bool *Invalid = 0) const; - /// getSize - 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. + /// \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; - /// getSizeBytesMapped - Returns the number of bytes actually mapped for - /// this ContentCache. This can be 0 if the MemBuffer was not actually - /// expanded. + /// \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 @@ -196,35 +224,37 @@ namespace SrcMgr { ContentCache &operator=(const ContentCache& RHS); }; - /// FileInfo - Information about a FileID, basically just the logical file + /// \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 + /// 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 { - /// IncludeLoc - The location of the #include that brought in this file. - /// This is an invalid SLOC for the main file (top of the #include chain). + /// \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. + /// preprocessing of this \#include, including this SLocEntry. + /// /// Zero means the preprocessor didn't provide such info for this SLocEntry. unsigned NumCreatedFIDs; - /// Data - This contains the ContentCache* and the bits indicating the - /// characteristic of the file and whether it has #line info, all bitmangled - /// together. + /// \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: - /// get - Return a FileInfo object. + /// \brief Return a FileInfo object. static FileInfo get(SourceLocation IL, const ContentCache *Con, CharacteristicKind FileCharacter) { FileInfo X; @@ -244,36 +274,35 @@ namespace SrcMgr { return reinterpret_cast<const ContentCache*>(Data & ~7UL); } - /// getCharacteristic - Return whether this is a system header or not. + /// \brief Return whether this is a system header or not. CharacteristicKind getFileCharacteristic() const { return (CharacteristicKind)(Data & 3); } - /// hasLineDirectives - Return true if this FileID has #line directives in - /// it. + /// \brief Return true if this FileID has \#line directives in it. bool hasLineDirectives() const { return (Data & 4) != 0; } - /// setHasLineDirectives - Set the flag that indicates that this FileID has + /// \brief Set the flag that indicates that this FileID has /// line table entries associated with it. void setHasLineDirectives() { Data |= 4; } }; - /// ExpansionInfo - Each ExpansionInfo encodes the expansion location - where + /// \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. - /// SpellingLoc - Where the spelling for the token can be found. + /// \brief Where the spelling for the token can be found. unsigned SpellingLoc; - /// ExpansionLocStart/ExpansionLocEnd - In a macro expansion, these + /// In a macro expansion, ExpansionLocStart and ExpansionLocEnd /// indicate the start and end of the expansion. In object-like macros, - /// these will be the same. In a function-like macro expansion, the start + /// 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 instantitions, the end will be 'SourceLocation()', an + /// macro-argument instantiations, the end will be 'SourceLocation()', an /// invalid location. unsigned ExpansionLocStart, ExpansionLocEnd; @@ -305,11 +334,12 @@ namespace SrcMgr { getExpansionLocStart() != getExpansionLocEnd(); } - /// create - 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. + /// \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; @@ -319,14 +349,15 @@ namespace SrcMgr { return X; } - /// createForMacroArg - 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. + /// \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 @@ -335,7 +366,7 @@ namespace SrcMgr { /// \endcode /// /// When expanding '\c F(42)', the '\c x' would call this with an - /// SpellingLoc pointing at '\c 42' anad an ExpansionLoc pointing at its + /// 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) { @@ -346,9 +377,10 @@ namespace SrcMgr { } }; - /// SLocEntry - 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. + /// \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; // low bit is set for expansion info. union { @@ -401,37 +433,43 @@ public: }; -/// IsBeforeInTranslationUnitCache - This class holds the cache used by -/// isBeforeInTranslationUnit. The cache structure is complex enough to be -/// worth breaking out of SourceManager. +/// \brief Holds the cache used by isBeforeInTranslationUnit. +/// +/// The cache structure is complex enough to be worth breaking out of +/// SourceManager. class IsBeforeInTranslationUnitCache { - /// L/R QueryFID - These are the FID's of the cached query. If these match up - /// with a subsequent query, the result can be reused. + /// \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. + /// \brief True if LQueryFID was created before RQueryFID. + /// + /// This is used to compare macro expansion locations. bool IsLQFIDBeforeRQFID; - /// CommonFID - This is the file found in common between the two #include - /// traces. It is the nearest common ancestor of the #include tree. + /// \brief The file found in common between the two \#include traces, i.e., + /// the nearest common ancestor of the \#include tree. FileID CommonFID; - /// L/R CommonOffset - This is 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 vise versa) then these can be a + /// \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: - /// isCacheValid - Return true if the currently cached values match up with - /// the specified LHS/RHS query. If not, we can't use the cache. + /// \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; } - /// getCachedResult - If the cache is valid, compute the result given the - /// specified offsets in the LHS/RHS FID's. + /// \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. @@ -449,7 +487,7 @@ public: return LOffset < ROffset; } - // Set up a new query. + /// \brief Set up a new query. void setQueryFIDs(FileID LHS, FileID RHS, bool isLFIDBeforeRFID) { assert(LHS != RHS); LQueryFID = LHS; @@ -474,7 +512,7 @@ public: /// \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. +/// 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 @@ -491,8 +529,10 @@ class SourceManager : public RefCountedBase<SourceManager> { mutable llvm::BumpPtrAllocator ContentCacheAlloc; - /// FileInfos - Memoized information about all of the files tracked by this - /// SourceManager. This set allows us to merge ContentCache entries based + /// \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; @@ -501,11 +541,31 @@ class SourceManager : public RefCountedBase<SourceManager> { /// files, should report the original file name. Defaults to true. bool OverridenFilesKeepOriginalName; - /// \brief Files that have been overriden with the contents from another file. - llvm::DenseMap<const FileEntry *, const FileEntry *> OverriddenFiles; + /// \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; + + struct OverriddenFilesInfoTy { + /// \brief Files that have been overriden 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. + OwningPtr<OverriddenFilesInfoTy> OverriddenFilesInfo; + + OverriddenFilesInfoTy &getOverriddenFilesInfo() { + if (!OverriddenFilesInfo) + OverriddenFilesInfo.reset(new OverriddenFilesInfoTy); + return *OverriddenFilesInfo; + } - /// MemBufferInfos - Information about various memory buffers that we have - /// read in. All FileEntry* within the stored ContentCache objects are NULL, + /// \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; @@ -545,23 +605,25 @@ class SourceManager : public RefCountedBase<SourceManager> { /// \brief An external source for source location entries. ExternalSLocEntrySource *ExternalSLocEntries; - /// LastFileIDLookup - This is a one-entry cache to speed up getFileID. + /// \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; - /// LineTable - This holds information for #line directives. It is referenced - /// by indices from SLocEntryTable. + /// \brief Holds information for \#line directives. + /// + /// This is referenced by indices from SLocEntryTable. LineTableInfo *LineTable; - /// LastLineNo - These ivars serve as a cache used in the getLineNumber + /// \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; - /// MainFileID - The file ID for the main source file of the translation unit. + /// \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. @@ -588,7 +650,8 @@ class SourceManager : public RefCountedBase<SourceManager> { explicit SourceManager(const SourceManager&); void operator=(const SourceManager&); public: - SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr); + SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr, + bool UserFilesAreVolatile = false); ~SourceManager(); void clearIDTables(); @@ -603,9 +666,15 @@ public: OverridenFilesKeepOriginalName = value; } - /// createMainFileIDForMembuffer - Create the FileID for a memory buffer - /// that will represent the FileID for the main source. One example - /// of when this would be used is when the main source is read from STDIN. + /// \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 Create the FileID for a memory buffer that will represent the + /// FileID for the main source. + /// + /// One example of when this would be used is when the main source is read + /// from STDIN. FileID createMainFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer) { assert(MainFileID.isInvalid() && "MainFileID already set!"); MainFileID = createFileIDForMemBuffer(Buffer); @@ -616,10 +685,10 @@ public: // MainFileID creation and querying methods. //===--------------------------------------------------------------------===// - /// getMainFileID - Returns the FileID of the main source file. + /// \brief Returns the FileID of the main source file. FileID getMainFileID() const { return MainFileID; } - /// createMainFileID - Create the FileID for the main source file. + /// \brief Create the FileID for the main source file. FileID createMainFileID(const FileEntry *SourceFile, SrcMgr::CharacteristicKind Kind = SrcMgr::C_User) { assert(MainFileID.isInvalid() && "MainFileID already set!"); @@ -646,20 +715,24 @@ public: // Methods to create new FileID's and macro expansions. //===--------------------------------------------------------------------===// - /// createFileID - Create a new FileID that represents the specified file - /// being #included from the specified IncludePosition. This translates NULL - /// into standard input. + /// \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); + const SrcMgr::ContentCache * + IR = getOrCreateContentCache(SourceFile, + /*isSystemFile=*/FileCharacter != SrcMgr::C_User); assert(IR && "getOrCreateContentCache() cannot return NULL"); return createFileID(IR, IncludePos, FileCharacter, LoadedID, LoadedOffset); } - /// createFileIDForMemBuffer - 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. + /// \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 createFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer, int LoadedID = 0, unsigned LoadedOffset = 0, SourceLocation IncludeLoc = SourceLocation()) { @@ -667,7 +740,7 @@ public: SrcMgr::C_User, LoadedID, LoadedOffset); } - /// createMacroArgExpansionLoc - Return a new SourceLocation that encodes the + /// \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. @@ -675,7 +748,7 @@ public: SourceLocation ExpansionLoc, unsigned TokLength); - /// createExpansionLoc - Return a new SourceLocation that encodes the fact + /// \brief Return a new SourceLocation that encodes the fact /// that a token from SpellingLoc should actually be referenced from /// ExpansionLoc. SourceLocation createExpansionLoc(SourceLocation Loc, @@ -706,7 +779,7 @@ public: const llvm::MemoryBuffer *Buffer, bool DoNotFree = false); - /// \brief Override the the given source file with another one. + /// \brief Override the given source file with another one. /// /// \param SourceFile the source file which will be overriden. /// @@ -715,13 +788,32 @@ public: 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); + //===--------------------------------------------------------------------===// // FileID manipulation methods. //===--------------------------------------------------------------------===// - /// getBuffer - 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. + /// \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. const llvm::MemoryBuffer *getBuffer(FileID FID, SourceLocation Loc, bool *Invalid = 0) const { bool MyInvalid = false; @@ -752,7 +844,7 @@ public: Invalid); } - /// getFileEntryForID - Returns the FileEntry record for the provided FileID. + /// \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); @@ -765,7 +857,7 @@ public: return Content->OrigEntry; } - /// Returns the FileEntry record for the provided SLocEntry. + /// \brief Returns the FileEntry record for the provided SLocEntry. const FileEntry *getFileEntryForSLocEntry(const SrcMgr::SLocEntry &sloc) const { const SrcMgr::ContentCache *Content = sloc.getFile().getContentCache(); @@ -774,7 +866,7 @@ public: return Content->OrigEntry; } - /// getBufferData - Return a StringRef to the source buffer data for the + /// \brief Return a StringRef to the source buffer data for the /// specified FileID. /// /// \param FID The file ID whose contents will be returned. @@ -808,10 +900,11 @@ public: // SourceLocation manipulation methods. //===--------------------------------------------------------------------===// - /// getFileID - 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. + /// \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(); @@ -823,8 +916,15 @@ public: return getFileIDSlow(SLocOffset); } - /// getLocForStartOfFile - Return the source location corresponding to the - /// first byte of the specified file. + /// \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); @@ -847,7 +947,7 @@ public: return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID) - 1); } - /// \brief Returns the include location if \p FID is a #include'd file + /// \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; @@ -858,7 +958,7 @@ public: return Entry.getFile().getIncludeLoc(); } - /// getExpansionLoc - Given a SourceLocation object, return the expansion + /// \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 @@ -875,20 +975,24 @@ public: return getFileLocSlowCase(Loc); } - /// getImmediateExpansionRange - Loc is required to be an expansion location. - /// Return the start/end of the expansion information. + /// \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; - /// getExpansionRange - Given a SourceLocation object, return the range of + /// \brief Given a SourceLocation object, return the range of /// tokens covered by the expansion the ultimate file. std::pair<SourceLocation,SourceLocation> getExpansionRange(SourceLocation Loc) const; - /// getSpellingLoc - 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. + /// \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. @@ -896,15 +1000,18 @@ public: return getSpellingLocSlowCase(Loc); } - /// getImmediateSpellingLoc - 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. + /// \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; - /// getDecomposedLoc - 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. + /// \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; @@ -914,9 +1021,10 @@ public: return std::make_pair(FID, Loc.getOffset()-E.getOffset()); } - /// getDecomposedExpansionLoc - 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. + /// \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); @@ -932,9 +1040,10 @@ public: return getDecomposedExpansionLocSlowCase(E); } - /// getDecomposedSpellingLoc - 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. + /// \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); @@ -949,22 +1058,25 @@ public: return getDecomposedSpellingLocSlowCase(E, Offset); } - /// getFileOffset - This method returns the offset from the start - /// of the file that the specified SourceLocation represents. This is not very - /// meaningful for a macro ID. + /// \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; } - /// isMacroArgExpansion - This method tests whether the given source location - /// represents a macro argument's expansion into the function-like macro - /// definition. Such source locations only appear inside of the expansion + /// \brief Tests whether the given source location represents a macro + /// argument's expansion into the function-like macro definition. + /// + /// Such source locations only appear inside of the expansion /// locations representing where a particular function-like macro was /// expanded. bool isMacroArgExpansion(SourceLocation Loc) 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, @@ -988,9 +1100,10 @@ public: } /// \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. + /// 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(); @@ -1010,13 +1123,14 @@ public: // Queries about the code at a SourceLocation. //===--------------------------------------------------------------------===// - /// getCharacterData - Return a pointer to the start of the specified location + /// \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 = 0) const; - /// getColumnNumber - Return the column # for the specified file position. + /// \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 @@ -1029,34 +1143,41 @@ public: unsigned getPresumedColumnNumber(SourceLocation Loc, bool *Invalid = 0) const; - /// getLineNumber - 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. + /// \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 = 0) const; unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid = 0) const; unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = 0) const; unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = 0) const; - /// 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. + /// \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 = 0) const; - /// getFileCharacteristic - return the file characteristic of the specified - /// source location, indicating whether this is a normal file, a system + /// \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; - /// getPresumedLoc - This method 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. + /// \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. @@ -1067,25 +1188,23 @@ public: /// presumed location. PresumedLoc getPresumedLoc(SourceLocation Loc) const; - /// isFromSameFile - Returns true if both SourceLocations correspond to - /// the same file. + /// \brief Returns true if both SourceLocations correspond to the same file. bool isFromSameFile(SourceLocation Loc1, SourceLocation Loc2) const { return getFileID(Loc1) == getFileID(Loc2); } - /// isFromMainFile - Returns true if the file of provided SourceLocation is - /// the main file. + /// \brief Returns true if the file of provided SourceLocation is the main + /// file. bool isFromMainFile(SourceLocation Loc) const { return getFileID(Loc) == getMainFileID(); } - /// isInSystemHeader - Returns if a SourceLocation is in a system header. + /// \brief Returns if a SourceLocation is in a system header. bool isInSystemHeader(SourceLocation Loc) const { return getFileCharacteristic(Loc) != SrcMgr::C_User; } - /// isInExternCSystemHeader - Returns if a SourceLocation is in an "extern C" - /// system header. + /// \brief Returns if a SourceLocation is in an "extern C" system header. bool isInExternCSystemHeader(SourceLocation Loc) const { return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem; } @@ -1117,13 +1236,14 @@ public: // Line Table Manipulation Routines //===--------------------------------------------------------------------===// - /// getLineTableFilenameID - Return the uniqued ID for the specified filename. + /// \brief Return the uniqued ID for the specified filename. /// unsigned getLineTableFilenameID(StringRef Str); - /// AddLineNote - 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. + /// \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, @@ -1139,7 +1259,7 @@ public: // Queries for performance analysis. //===--------------------------------------------------------------------===// - /// Return the total amount of physical memory allocated by the + /// \brief Return the total amount of physical memory allocated by the /// ContentCache allocator. size_t getContentCacheSize() const { return ContentCacheAlloc.getTotalMemory(); @@ -1153,12 +1273,12 @@ public: : malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {} }; - /// Return the amount of memory used by memory buffers, breaking down + /// \brief Return the amount of memory used by memory buffers, breaking down /// by heap-backed versus mmap'ed memory. MemoryBufferSizes getMemoryBufferSizes() const; - // Return the amount of memory used for various side tables and - // data structures in the SourceManager. + /// \brief Return the amount of memory used for various side tables and + /// data structures in the SourceManager. size_t getDataStructureSizes() const; //===--------------------------------------------------------------------===// @@ -1199,19 +1319,6 @@ public: /// \returns true if LHS source location comes before RHS, false otherwise. bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; - /// \brief Comparison function class. - class LocBeforeThanCompare : public std::binary_function<SourceLocation, - SourceLocation, bool> { - SourceManager &SM; - - public: - explicit LocBeforeThanCompare(SourceManager &SM) : SM(SM) { } - - bool operator()(SourceLocation LHS, SourceLocation RHS) const { - return SM.isBeforeInTranslationUnit(LHS, RHS); - } - }; - /// \brief Determines the order of 2 source locations in the "source location /// address space". bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { @@ -1241,7 +1348,7 @@ public: return FileInfos.find(File) != FileInfos.end(); } - /// PrintStats - Print statistics to stderr. + /// \brief Print statistics to stderr. /// void PrintStats() const; @@ -1313,6 +1420,65 @@ public: return !isLoadedFileID(FID); } + /// Get a presumed location suitable for displaying in a diagnostic message, + /// taking into account macro arguments and expansions. + PresumedLoc getPresumedLocForDisplay(SourceLocation Loc) const { + // This is a condensed form of the algorithm used by emitCaretDiagnostic to + // walk to the top of the macro call stack. + while (Loc.isMacroID()) { + Loc = skipToMacroArgExpansion(Loc); + Loc = getImmediateMacroCallerLoc(Loc); + } + + return getPresumedLoc(Loc); + } + + /// Look through spelling locations for a macro argument expansion, and if + /// found skip to it so that we can trace the argument rather than the macros + /// in which that argument is used. If no macro argument expansion is found, + /// don't skip anything and return the starting location. + SourceLocation skipToMacroArgExpansion(SourceLocation StartLoc) const { + for (SourceLocation L = StartLoc; L.isMacroID(); + L = getImmediateSpellingLoc(L)) { + if (isMacroArgExpansion(L)) + return L; + } + // Otherwise just return initial location, there's nothing to skip. + return StartLoc; + } + + /// 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 typed into 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; + } + + /// Gets the location of the immediate macro callee, one level down the stack + /// toward the leaf macro. + SourceLocation getImmediateMacroCalleeLoc(SourceLocation Loc) const { + if (!Loc.isMacroID()) return Loc; + + // When we have the location of (part of) an expanded parameter, its + // expansion location points to the unexpanded parameter reference within + // the macro definition (or callee). + if (isMacroArgExpansion(Loc)) + return getImmediateExpansionRange(Loc).first; + + // Otherwise, the callee of the macro is located where this location was + // spelled inside the macro definition. + return getImmediateSpellingLoc(Loc); + } + private: const llvm::MemoryBuffer *getFakeBufferForRecovery() const; const SrcMgr::ContentCache *getFakeContentCacheForRecovery() const; @@ -1332,15 +1498,14 @@ private: return getLoadedSLocEntry(static_cast<unsigned>(-ID - 2), Invalid); } - /// createExpansionLoc - Implements the common elements of storing an - /// expansion info struct into the SLocEntry table and producing a source - /// location that refers to it. + /// 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); - /// isOffsetInFileID - Return true if the specified FileID contains the + /// \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); @@ -1352,28 +1517,29 @@ private: return true; // If it is the last local entry, then it does if the location is local. - if (static_cast<unsigned>(FID.ID+1) == LocalSLocEntryTable.size()) { + 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 < getSLocEntry(FileID::get(FID.ID+1)).getOffset(); + return SLocOffset < getSLocEntryByID(FID.ID+1).getOffset(); } - /// createFileID - 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. + /// \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); + getOrCreateContentCache(const FileEntry *SourceFile, + bool isSystemFile = false); - /// createMemBufferContentCache - Create a new ContentCache for the specified - /// memory buffer. + /// \brief Create a new ContentCache for the specified memory buffer. const SrcMgr::ContentCache* createMemBufferContentCache(const llvm::MemoryBuffer *Buf); @@ -1396,6 +1562,35 @@ private: 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) { + return SM.isBeforeInTranslationUnit(LHS.getBegin(), RHS.getBegin()); + } +}; } // end namespace clang diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h index 1cb16b4..af95b78 100644 --- a/include/clang/Basic/SourceManagerInternals.h +++ b/include/clang/Basic/SourceManagerInternals.h @@ -6,15 +6,16 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the implementation details of the SourceManager -// class. -// +/// +/// \file +/// \brief Defines implementation details of the clang::SourceManager class. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_SOURCEMANAGER_INTERNALS_H #define LLVM_CLANG_SOURCEMANAGER_INTERNALS_H +#include "clang/Basic/SourceLocation.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/StringMap.h" #include <map> @@ -26,22 +27,23 @@ namespace clang { //===----------------------------------------------------------------------===// struct LineEntry { - /// FileOffset - The offset in this file that the line entry occurs at. + /// \brief The offset in this file that the line entry occurs at. unsigned FileOffset; - /// LineNo - The presumed line number of this line entry: #line 4. + /// \brief The presumed line number of this line entry: \#line 4. unsigned LineNo; - /// FilenameID - The ID of the filename identified by this line entry: - /// #line 4 "foo.c". This is -1 if not specified. + /// \brief The ID of the filename identified by this line entry: + /// \#line 4 "foo.c". This is -1 if not specified. int FilenameID; - /// Flags - Set the 0 if no flags, 1 if a system header, + /// \brief Set the 0 if no flags, 1 if a system header, SrcMgr::CharacteristicKind FileKind; - /// IncludeOffset - This is 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. + /// \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, @@ -71,20 +73,20 @@ inline bool operator<(unsigned Offset, const LineEntry &E) { return Offset < E.FileOffset; } -/// LineTableInfo - This class is used to hold and unique data used to -/// represent #line information. +/// \brief Used to hold and unique data used to represent \#line information. class LineTableInfo { - /// FilenameIDs - This map is used to assign unique IDs to filenames in - /// #line directives. This allows us to unique the filenames that + /// \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; - /// LineEntries - This is a map from FileIDs to a list of line entries (sorted - /// by the offset they occur in the file. - std::map<int, std::vector<LineEntry> > LineEntries; + /// \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: LineTableInfo() { } @@ -104,25 +106,26 @@ public: } unsigned getNumFilenames() const { return FilenamesByID.size(); } - void AddLineNote(int FID, unsigned Offset, + void AddLineNote(FileID FID, unsigned Offset, unsigned LineNo, int FilenameID); - void AddLineNote(int FID, unsigned Offset, + void AddLineNote(FileID FID, unsigned Offset, unsigned LineNo, int FilenameID, unsigned EntryExit, SrcMgr::CharacteristicKind FileKind); - /// FindNearestLineEntry - Find the line entry nearest to FID that is before - /// it. If there is no line entry before Offset in FID, return null. - const LineEntry *FindNearestLineEntry(int FID, unsigned Offset); + /// \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<int, std::vector<LineEntry> >::iterator iterator; + 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(int FID, const std::vector<LineEntry> &Entries); + void AddEntry(FileID FID, const std::vector<LineEntry> &Entries); }; } // end namespace clang diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h index 9e71827..96cada1 100644 --- a/include/clang/Basic/Specifiers.h +++ b/include/clang/Basic/Specifiers.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines various enumerations that describe declaration and -// type specifiers. -// +/// +/// \file +/// \brief Defines various enumerations that describe declaration and +/// type specifiers. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_SPECIFIERS_H @@ -63,9 +64,8 @@ namespace clang { TST_error // erroneous type }; - /// WrittenBuiltinSpecs - Structure that packs information about the - /// type specifiers that were written in a particular type specifier - /// sequence. + /// \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; @@ -73,9 +73,8 @@ namespace clang { bool ModeAttr : 1; }; - /// AccessSpecifier - A C++ access specifier (public, private, - /// protected), plus the special value "none" which means - /// different things in different contexts. + /// \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, @@ -83,24 +82,24 @@ namespace clang { AS_none }; - /// ExprValueKind - The categorization of expression values, - /// currently following the C++0x scheme. + /// \brief The categorization of expression values, currently following the + /// C++11 scheme. enum ExprValueKind { - /// An r-value expression (a pr-value in the C++0x taxonomy) + /// \brief An r-value expression (a pr-value in the C++11 taxonomy) /// produces a temporary value. VK_RValue, - /// An l-value expression is a reference to an object with + /// \brief An l-value expression is a reference to an object with /// independent storage. VK_LValue, - /// An x-value expression is a reference to an object with + /// \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 }; - /// A further classification of the kind of object referenced by an + /// \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. @@ -112,13 +111,13 @@ namespace clang { /// 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. + /// 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. + /// 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 }; @@ -159,15 +158,22 @@ namespace clang { SC_Register }; - /// Checks whether the given storage class is legal for functions. + /// \brief Checks whether the given storage class is legal for functions. inline bool isLegalForFunction(StorageClass SC) { return SC <= SC_PrivateExtern; } - /// Checks whether the given storage class is legal for variables. + /// \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. + }; } // end namespace clang #endif // LLVM_CLANG_BASIC_SPECIFIERS_H diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index e7718cd..47738af 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -31,6 +31,9 @@ def DefaultStmt : DStmt<SwitchCase>; // GNU Extensions def AsmStmt : Stmt; +// MS Extensions +def MSAsmStmt : Stmt; + // Obj-C statements def ObjCAtTryStmt : Stmt; def ObjCAtCatchStmt : Stmt; @@ -134,7 +137,7 @@ def LambdaExpr : DStmt<Expr>; // Obj-C Expressions. def ObjCStringLiteral : DStmt<Expr>; -def ObjCNumericLiteral : DStmt<Expr>; +def ObjCBoxedExpr : DStmt<Expr>; def ObjCArrayLiteral : DStmt<Expr>; def ObjCDictionaryLiteral : DStmt<Expr>; def ObjCEncodeExpr : DStmt<Expr>; diff --git a/include/clang/Basic/TargetBuiltins.h b/include/clang/Basic/TargetBuiltins.h index 7c04bf7..1d5004c 100644 --- a/include/clang/Basic/TargetBuiltins.h +++ b/include/clang/Basic/TargetBuiltins.h @@ -6,6 +6,12 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Enumerates target-specific builtins in their own namespaces within +/// namespace ::clang. +/// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_TARGET_BUILTINS_H #define LLVM_CLANG_BASIC_TARGET_BUILTINS_H @@ -15,7 +21,7 @@ namespace clang { - /// ARM builtins + /// \brief ARM builtins namespace ARM { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -25,7 +31,7 @@ namespace clang { }; } - /// PPC builtins + /// \brief PPC builtins namespace PPC { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -35,18 +41,18 @@ namespace clang { }; } - /// PTX builtins - namespace PTX { + /// \brief NVPTX builtins + namespace NVPTX { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, -#include "clang/Basic/BuiltinsPTX.def" +#include "clang/Basic/BuiltinsNVPTX.def" LastTSBuiltin }; } - /// X86 builtins + /// \brief X86 builtins namespace X86 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -56,9 +62,9 @@ namespace clang { }; } - /// NeonTypeFlags - Flags to identify the types for overloaded Neon - /// builtins. These must be kept in sync with the flags in - /// utils/TableGen/NeonEmitter.h. + /// \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, @@ -96,7 +102,7 @@ namespace clang { bool isQuad() const { return (Flags & QuadFlag) != 0; } }; - /// Hexagon builtins + /// \brief Hexagon builtins namespace Hexagon { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -105,6 +111,16 @@ namespace clang { 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 + }; + } } // end namespace clang. #endif diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index a03cf83..54d49e6 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the TargetInfo interface. -// +/// +/// \file +/// \brief Defines the clang::TargetInfo interface. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_TARGETINFO_H @@ -41,7 +42,7 @@ class TargetOptions; namespace Builtin { struct Info; } -/// TargetCXXABI - The types of C++ ABIs for which we can generate code. +/// \brief The types of C++ ABIs for which we can generate code. enum TargetCXXABI { /// The generic ("Itanium") C++ ABI, documented at: /// http://www.codesourcery.com/public/cxx-abi/ @@ -57,7 +58,7 @@ enum TargetCXXABI { CXXABI_Microsoft }; -/// TargetInfo - This class exposes information about the current target. +/// \brief Exposes information about the current target. /// class TargetInfo : public RefCountedBase<TargetInfo> { llvm::Triple Triple; @@ -79,6 +80,7 @@ protected: unsigned char LongLongWidth, LongLongAlign; unsigned char SuitableAlign; unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth; + unsigned short MaxVectorAlign; const char *DescriptionString; const char *UserLabelPrefix; const char *MCountName; @@ -99,7 +101,7 @@ protected: TargetInfo(const std::string &T); public: - /// CreateTargetInfo - Construct a target for the given options. + /// \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 @@ -128,11 +130,35 @@ public: 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 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 + }; + protected: IntType SizeType, IntMaxType, UIntMaxType, PtrDiffType, IntPtrType, WCharType, WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType; - /// Flag whether the Objective-C built-in boolean type should be signed char. + /// \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; @@ -144,10 +170,12 @@ protected: /// boundary. unsigned UseBitFieldTypeAlignment : 1; - /// Control 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. + /// \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 @@ -170,19 +198,20 @@ public: IntType getSigAtomicType() const { return SigAtomicType; } - /// getTypeWidth - Return the width (in bits) of the specified integer type - /// enum. For example, SignedInt -> getIntWidth(). + /// \brief Return the width (in bits) of the specified integer type enum. + /// + /// For example, SignedInt -> getIntWidth(). unsigned getTypeWidth(IntType T) const; - /// getTypeAlign - Return the alignment (in bits) of the specified integer - /// type enum. For example, SignedInt -> getIntAlign(). + /// \brief Return the alignment (in bits) of the specified integer type enum. + /// + /// For example, SignedInt -> getIntAlign(). unsigned getTypeAlign(IntType T) const; - /// isTypeSigned - Return whether an integer types is signed. Returns true if - /// the type is signed; false otherwise. + /// \brief Returns true if the type is signed; false otherwise. static bool isTypeSigned(IntType T); - /// getPointerWidth - Return the width of pointers on this target, for the + /// \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); @@ -191,17 +220,21 @@ public: return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace); } - /// getBoolWidth/Align - Return the size of '_Bool' and C++ 'bool' for this - /// target, in bits. + /// \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 - /// getShortWidth/Align - Return the size of 'signed short' and - /// 'unsigned short' for this target, in bits. + /// \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 @@ -219,7 +252,7 @@ public: unsigned getLongLongWidth() const { return LongLongWidth; } unsigned getLongLongAlign() const { return LongLongAlign; } - /// getSuitableAlign - Return the alignment that is suitable for storing any + /// \brief Return the alignment that is suitable for storing any /// object with a fundamental alignment requirement. unsigned getSuitableAlign() const { return SuitableAlign; } @@ -261,7 +294,7 @@ public: return *LongDoubleFormat; } - /// getFloatEvalMethod - Return the value for the C99 FLT_EVAL_METHOD macro. + /// \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 @@ -269,21 +302,22 @@ public: unsigned getLargeArrayMinWidth() const { return LargeArrayMinWidth; } unsigned getLargeArrayAlign() const { return LargeArrayAlign; } - /// getMaxAtomicPromoteWidth - Return the maximum width lock-free atomic - /// operation which will ever be supported for the given target + /// \brief Return the maximum width lock-free atomic operation which will + /// ever be supported for the given target unsigned getMaxAtomicPromoteWidth() const { return MaxAtomicPromoteWidth; } - /// getMaxAtomicInlineWidth - Return the maximum width lock-free atomic - /// operation which can be inlined given the supported features of the - /// given target. + /// \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; } - /// getIntMaxTWidth - Return the size of intmax_t and uintmax_t for this - /// target, in bits. + /// \brief Return the maximum vector alignment supported for the given target. + unsigned getMaxVectorAlign() const { return MaxVectorAlign; } + + /// \brief Return the size of intmax_t and uintmax_t for this target, in bits. unsigned getIntMaxTWidth() const { return getTypeWidth(IntMaxType); } - /// getRegisterWidth - Return the "preferred" register width on this target. + /// \brief Return the "preferred" register width on this target. uint64_t 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 @@ -291,22 +325,24 @@ public: return LongWidth; } - /// getUserLabelPrefix - This 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. + /// \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; } - /// MCountName - This returns name of the mcount instrumentation function. + /// \brief Returns the name of the mcount instrumentation function. const char *getMCountName() const { return MCountName; } - /// useSignedCharForObjCBool - 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. + /// \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; } @@ -314,87 +350,91 @@ public: UseSignedCharForObjCBool = false; } - /// useBitFieldTypeAlignment() - Check whether the alignment of bit-field - /// types is respected when laying out structures. + /// \brief Check whether the alignment of bit-field types is respected + /// when laying out structures. bool useBitFieldTypeAlignment() const { return UseBitFieldTypeAlignment; } - /// useZeroLengthBitfieldAlignment() - Check whether zero length bitfields - /// should force alignment of the next member. + /// \brief Check whether zero length bitfields should force alignment of + /// the next member. bool useZeroLengthBitfieldAlignment() const { return UseZeroLengthBitfieldAlignment; } - /// getZeroLengthBitfieldBoundary() - Get the fixed alignment value in bits - /// for a member that follows a zero length bitfield. + /// \brief Get the fixed alignment value in bits for a member that follows + /// a zero length bitfield. unsigned getZeroLengthBitfieldBoundary() const { return ZeroLengthBitfieldBoundary; } - /// hasAlignMac68kSupport - Check whether this target support '#pragma options - /// align=mac68k'. + /// \brief Check whether this target support '\#pragma options align=mac68k'. bool hasAlignMac68kSupport() const { return HasAlignMac68kSupport; } - /// getTypeName - Return the user string for the specified integer type enum. + /// \brief Return the user string for the specified integer type enum. + /// /// For example, SignedShort -> "short". static const char *getTypeName(IntType T); - /// getTypeConstantSuffix - Return the constant suffix for the specified - /// integer type enum. For example, SignedLong -> "L". + /// \brief Return the constant suffix for the specified integer type enum. + /// + /// For example, SignedLong -> "L". static const char *getTypeConstantSuffix(IntType T); /// \brief Check whether the given real type should use the "fpret" flavor of - /// Obj-C message passing on this target. + /// 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 Obj-C message passing on this target. + /// of Objective-C message passing on this target. bool useObjCFP2RetForComplexLongDouble() const { return ComplexLongDoubleUsesFP2Ret; } ///===---- Other target property query methods --------------------------===// - /// getTargetDefines - Appends the target-specific #define values for this + /// \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; - /// getTargetBuiltins - Return information about target-specific builtins for + /// 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 void getTargetBuiltins(const Builtin::Info *&Records, unsigned &NumRecords) const = 0; - /// isCLZForZeroUndef - The __builtin_clz* and __builtin_ctz* built-in + /// 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; } - /// getVAListDeclaration - Return the declaration to use for - /// __builtin_va_list, which is target-specific. - virtual const char *getVAListDeclaration() const = 0; + /// \brief Returns the kind of __builtin_va_list type that should be used + /// with this target. + virtual BuiltinVaListKind getBuiltinVaListKind() const = 0; - /// isValidClobber - Returns whether the passed in string is - /// a valid clobber in an inline asm statement. This is used by - /// Sema. + /// \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; - /// isValidGCCRegisterName - Returns whether the passed in string - /// is a valid register name according to GCC. This is used by Sema for - /// inline asm statements. + /// \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; - // getNormalizedGCCRegisterName - Returns the "normalized" GCC register name. - // For example, on x86 it will return "ax" when "eax" is passed in. + /// \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 { @@ -421,13 +461,15 @@ public: bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; } bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; } - /// hasMatchingInput - Return true if this output operand has a matching + /// \brief Return true if this output operand has a matching /// (tied) input operand. bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; } - /// hasTiedOperand() - 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. + /// \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!"); @@ -439,9 +481,10 @@ public: void setAllowsRegister() { Flags |= CI_AllowsRegister; } void setHasMatchingInput() { Flags |= CI_HasMatchingInput; } - /// setTiedOperand - Indicate that this is an input operand that is tied to - /// the specified output operand. Copy over the various constraint - /// information from the output. + /// \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; @@ -471,11 +514,11 @@ public: return std::string(1, *Constraint); } - // Returns a string of target-specific clobbers, in LLVM format. + /// \brief Returns a string of target-specific clobbers, in LLVM format. virtual const char *getClobbers() const = 0; - /// getTriple - Return the target triple of the primary target. + /// \brief Returns the target triple of the primary target. const llvm::Triple &getTriple() const { return Triple; } @@ -494,14 +537,13 @@ public: const unsigned RegNum; }; - /// hasProtectedVisibility - Does this target support "protected" - /// visibility? + /// \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 wierd semantics designed around the convenience of dynamic + /// 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. @@ -509,28 +551,29 @@ public: virtual bool useGlobalsForAutomaticVariables() const { return false; } - /// getCFStringSection - Return the section to use for CFString - /// literals, or 0 if no special section is used. + /// \brief Return the section to use for CFString literals, or 0 if no + /// special section is used. virtual const char *getCFStringSection() const { return "__DATA,__cfstring"; } - /// getNSStringSection - Return the section to use for NSString - /// literals, or 0 if no special section is used. + /// \brief Return the section to use for NSString literals, or 0 if no + /// special section is used. virtual const char *getNSStringSection() const { return "__OBJC,__cstring_object,regular,no_dead_strip"; } - /// getNSStringNonFragileABISection - Return the section to use for - /// NSString literals, or 0 if no special section is used (NonFragile ABI). + /// \brief Return the section to use for NSString literals, or 0 if no + /// special section is used (NonFragile ABI). virtual const char *getNSStringNonFragileABISection() const { return "__DATA, __objc_stringobj, regular, no_dead_strip"; } - /// isValidSectionSpecifier - This is 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 + /// \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 @@ -541,43 +584,44 @@ public: return ""; } - /// setForcedLangOptions - Set forced language options. + /// \brief Set forced language options. + /// /// Apply changes to the target information with respect to certain /// language options which change the target configuration. virtual void setForcedLangOptions(LangOptions &Opts); - /// getDefaultFeatures - Get the default set of target features for the CPU; + /// \brief Get the default set of target features for the CPU; /// this should include all legal feature strings on the target. virtual void getDefaultFeatures(llvm::StringMap<bool> &Features) const { } - /// getABI - Get the ABI in use. + /// \brief Get the ABI currently in use. virtual const char *getABI() const { return ""; } - /// getCXXABI - Get the C++ ABI in use. + /// \brief Get the C++ ABI currently in use. virtual TargetCXXABI getCXXABI() const { return CXXABI; } - /// setCPU - Target the specific CPU. + /// \brief Target the specified CPU. /// - /// \return - False on error (invalid CPU name). + /// \return False on error (invalid CPU name). virtual bool setCPU(const std::string &Name) { return false; } - /// setABI - Use the specific ABI. + /// \brief Use the specified ABI. /// - /// \return - False on error (invalid ABI name). + /// \return False on error (invalid ABI name). virtual bool setABI(const std::string &Name) { return false; } - /// setCXXABI - Use this specific C++ ABI. + /// \brief Use this specified C++ ABI. /// - /// \return - False on error (invalid C++ ABI name). + /// \return False on error (invalid C++ ABI name). bool setCXXABI(const std::string &Name) { static const TargetCXXABI Unknown = static_cast<TargetCXXABI>(-1); TargetCXXABI ABI = llvm::StringSwitch<TargetCXXABI>(Name) @@ -589,27 +633,28 @@ public: return setCXXABI(ABI); } - /// setCXXABI - Set the C++ ABI to be used by this implementation. + /// \brief Set the C++ ABI to be used by this implementation. /// - /// \return - False on error (ABI not valid on this target) + /// \return False on error (ABI not valid on this target) virtual bool setCXXABI(TargetCXXABI ABI) { CXXABI = ABI; return true; } - /// setFeatureEnabled - Enable or disable a specific target feature, + /// \brief Enable or disable a specific target feature; /// the feature name must be valid. /// - /// \return - False on error (invalid feature name). + /// \return False on error (invalid feature name). virtual bool setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name, bool Enabled) const { return false; } - /// HandleTargetOptions - 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. + /// \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. @@ -621,19 +666,20 @@ public: return false; } - // getRegParmMax - Returns maximal number of args passed in registers. + // \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; } - /// isTLSSupported - Whether the target supports thread-local storage. + /// \brief Whether the target supports thread-local storage. bool isTLSSupported() const { return TLSSupported; } - /// hasNoAsmVariants - Return true if {|} are normal characters in the - /// asm string. If this returns false (the default), then {abc|xyz} is syntax + /// \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. @@ -641,14 +687,13 @@ public: return NoAsmVariants; } - /// getEHDataRegisterNumber - Return the register number that - /// __builtin_eh_return_regno would return with the specified argument. + /// \brief Return the register number that __builtin_eh_return_regno would + /// return with the specified argument. virtual int getEHDataRegisterNumber(unsigned RegNo) const { return -1; } - /// getStaticInitSectionSpecifier - Return the section to use for C++ static - /// initialization functions. + /// \brief Return the section to use for C++ static initialization functions. virtual const char *getStaticInitSectionSpecifier() const { return 0; } diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h index f3c206f..15ececd 100644 --- a/include/clang/Basic/TargetOptions.h +++ b/include/clang/Basic/TargetOptions.h @@ -6,6 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +/// +/// \file +/// \brief Defines the clang::TargetOptions class. +/// +//===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_TARGETOPTIONS_H #define LLVM_CLANG_FRONTEND_TARGETOPTIONS_H @@ -15,7 +20,7 @@ namespace clang { -/// TargetOptions - Options for controlling the target. +/// \brief Options for controlling the target. class TargetOptions { public: /// If given, the name of the target triple to compile for. If not given the diff --git a/include/clang/Basic/TemplateKinds.h b/include/clang/Basic/TemplateKinds.h index c6ea05b..dda011a 100644 --- a/include/clang/Basic/TemplateKinds.h +++ b/include/clang/Basic/TemplateKinds.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the TemplateNameKind enum. -// +/// +/// \file +/// \brief Defines the clang::TemplateNameKind enum. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TEMPLATEKINDS_H #define LLVM_CLANG_TEMPLATEKINDS_H diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 2e4d34d..fc03191 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -211,6 +211,8 @@ PUNCTUATOR(greatergreatergreater, ">>>") // KEYCXX0X - This is a C++ keyword introduced to C++ in C++0x // KEYGNU - This is a keyword if GNU extensions are enabled // KEYMS - This is a keyword if Microsoft extensions are enabled +// KEYNOMS - This is a keyword that must never be enabled under +// Microsoft mode // KEYOPENCL - This is a keyword in OpenCL // KEYALTIVEC - This is a keyword in AltiVec // KEYBORLAND - This is a keyword if Borland extensions are enabled @@ -251,6 +253,7 @@ KEYWORD(void , KEYALL) KEYWORD(volatile , KEYALL) KEYWORD(while , KEYALL) KEYWORD(_Alignas , KEYALL) +KEYWORD(_Alignof , KEYALL) KEYWORD(_Atomic , KEYALL) KEYWORD(_Bool , KEYNOCXX) KEYWORD(_Complex , KEYALL) @@ -310,8 +313,8 @@ CXX_KEYWORD_OPERATOR(xor_eq , caretequal) // C++0x keywords KEYWORD(alignas , KEYCXX0X) KEYWORD(alignof , KEYCXX0X) -KEYWORD(char16_t , KEYCXX0X) -KEYWORD(char32_t , KEYCXX0X) +KEYWORD(char16_t , KEYCXX0X|KEYNOMS) +KEYWORD(char32_t , KEYCXX0X|KEYNOMS) KEYWORD(constexpr , KEYCXX0X) KEYWORD(decltype , KEYCXX0X) KEYWORD(noexcept , KEYCXX0X) @@ -342,6 +345,9 @@ KEYWORD(__PRETTY_FUNCTION__ , KEYALL) // GNU Extensions (outside impl-reserved namespace) KEYWORD(typeof , KEYGNU) +// MS Extensions +KEYWORD(L__FUNCTION__ , KEYMS) + // GNU and MS Type Traits KEYWORD(__has_nothrow_assign , KEYCXX) KEYWORD(__has_nothrow_copy , KEYCXX) @@ -486,28 +492,33 @@ ALIAS("__volatile" , volatile , KEYALL) ALIAS("__volatile__" , volatile , KEYALL) // Microsoft extensions which should be disabled in strict conformance mode -KEYWORD(__ptr64 , KEYMS) -KEYWORD(__ptr32 , 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) -ALIAS("__int8" , char , KEYMS) -ALIAS("__int16" , short , KEYMS) -ALIAS("__int32" , int , KEYMS) -ALIAS("_asm" , asm , KEYMS) -ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) -ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) -ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) -ALIAS("_thiscall" , __thiscall , KEYMS) -ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) -ALIAS("_inline" , inline , KEYMS) -ALIAS("_declspec" , __declspec , KEYMS) -ALIAS("__interface" , struct , KEYMS) +KEYWORD(__ptr64 , KEYMS) +KEYWORD(__ptr32 , 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) +ALIAS("__int8" , char , KEYMS) +ALIAS("__int16" , short , KEYMS) +ALIAS("__int32" , int , 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("_uuidof" , __uuidof , KEYMS | KEYBORLAND) +ALIAS("_inline" , inline , KEYMS) +ALIAS("_declspec" , __declspec , KEYMS) +ALIAS("__interface" , struct , KEYMS) // Borland Extensions which should be disabled in strict conformance mode. ALIAS("_pascal" , __pascal , KEYBORLAND) @@ -584,6 +595,11 @@ ANNOTATION(pragma_vis) // 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) + #undef ANNOTATION #undef TESTING_KEYWORD #undef OBJC2_AT_KEYWORD diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h index 515390a..478add8 100644 --- a/include/clang/Basic/TokenKinds.h +++ b/include/clang/Basic/TokenKinds.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the TokenKind enum and support functions. -// +/// +/// \file +/// \brief Defines the clang::TokenKind enum and support functions. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOKENKINDS_H @@ -18,24 +19,23 @@ namespace clang { namespace tok { -/// TokenKind - This provides a simple uniform namespace for tokens from all C -/// languages. +/// \brief Provides a simple uniform namespace for tokens from all C languages. enum TokenKind { #define TOK(X) X, #include "clang/Basic/TokenKinds.def" NUM_TOKENS }; -/// PPKeywordKind - This provides a namespace for preprocessor keywords which -/// start with a '#' at the beginning of the line. +/// \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 }; -/// ObjCKeywordKind - This provides a namespace for Objective-C keywords which -/// start with an '@'. +/// \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, @@ -43,8 +43,7 @@ enum ObjCKeywordKind { NUM_OBJC_KEYWORDS }; -/// OnOffSwitch - This defines the possible values of an on-off-switch -/// (C99 6.10.6p2). +/// \brief Defines the possible values of an on-off-switch (C99 6.10.6p2). enum OnOffSwitch { OOS_ON, OOS_OFF, OOS_DEFAULT }; diff --git a/include/clang/Basic/TypeTraits.h b/include/clang/Basic/TypeTraits.h index 721f44f..0a5a864 100644 --- a/include/clang/Basic/TypeTraits.h +++ b/include/clang/Basic/TypeTraits.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines enumerations for the type traits support. -// +/// +/// \file +/// \brief Defines enumerations for the type traits support. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TYPETRAITS_H @@ -16,7 +17,7 @@ namespace clang { - /// UnaryTypeTrait - Names for the unary type traits. + /// \brief Names for the unary type traits. enum UnaryTypeTrait { UTT_HasNothrowAssign, UTT_HasNothrowCopy, @@ -62,7 +63,7 @@ namespace clang { UTT_IsVolatile }; - /// BinaryTypeTrait - Names for the binary type traits. + /// \brief Names for the binary type traits. enum BinaryTypeTrait { BTT_IsBaseOf, BTT_IsConvertible, @@ -72,13 +73,13 @@ namespace clang { BTT_IsTriviallyAssignable }; - /// ArrayTypeTrait - Names for the array type traits. + /// \brief Names for the array type traits. enum ArrayTypeTrait { ATT_ArrayRank, ATT_ArrayExtent }; - /// UnaryExprOrTypeTrait - Names for the "expression or type" traits. + /// \brief Names for the "expression or type" traits. enum UnaryExprOrTypeTrait { UETT_SizeOf, UETT_AlignOf, diff --git a/include/clang/Basic/Version.h b/include/clang/Basic/Version.h index f3f5b5a..3f1b4d8 100644 --- a/include/clang/Basic/Version.h +++ b/include/clang/Basic/Version.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This header defines version macros and version-related utility functions -// for Clang. -// +/// +/// \file +/// \brief Defines version macros and version-related utility functions +/// for Clang. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_VERSION_H @@ -26,8 +27,7 @@ /// \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". +/// \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) @@ -35,8 +35,7 @@ /// \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". +/// \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 @@ -47,31 +46,34 @@ namespace clang { /// Clang was built. std::string getClangRepositoryPath(); - /// \brief Retrieves the repository path from which LLVM was built. Supports - /// LLVM residing in a separate repository from clang. + /// \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. + /// 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. + /// 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(). + /// 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. + /// which includes the clang version number, the repository version, + /// and the vendor tag. std::string getClangFullVersion(); /// \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. + /// for use in the CPP __VERSION__ macro, which includes the clang version + /// number, the repository version, and the vendor tag. std::string getClangFullCPPVersion(); } diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h index 30ef6641..a94f76c 100644 --- a/include/clang/Basic/VersionTuple.h +++ b/include/clang/Basic/VersionTuple.h @@ -6,10 +6,11 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This header defines the VersionTuple class, which represents a version in -// the form major[.minor[.subminor]]. -// +/// +/// \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 @@ -73,15 +74,18 @@ public: return X.Major == Y.Major && X.Minor == Y.Minor && X.Subminor == Y.Subminor; } - /// \brief Determine if two version numbers are not equivalent. If - /// not provided, minor and subminor version numbers are considered to be + /// \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. + /// \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) { if (X.Major != Y.Major) return X.Major < Y.Major; @@ -92,28 +96,39 @@ public: return X.Subminor < Y.Subminor; } - /// \brief Determine whether one version number follows another. If not - /// provided, minor and subminor version numbers are considered to be zero. + /// \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. + /// 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. + /// 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/ + /// \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-9]+)) + bool tryParse(StringRef string); }; /// \brief Print a version number. diff --git a/include/clang/Basic/Visibility.h b/include/clang/Basic/Visibility.h index 90e288a..e81ad91 100644 --- a/include/clang/Basic/Visibility.h +++ b/include/clang/Basic/Visibility.h @@ -6,20 +6,23 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Visibility enumeration and various utility -// functions. -// +/// +/// \file +/// \brief Defines the clang::Visibility enumeration and various utility +/// functions. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_VISIBILITY_H #define LLVM_CLANG_BASIC_VISIBILITY_H namespace clang { -/// \link 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. +/// \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 diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td index 71a0aa2..451d562 100644 --- a/include/clang/Basic/arm_neon.td +++ b/include/clang/Basic/arm_neon.td @@ -15,6 +15,7 @@ class Op; def OP_NONE : Op; +def OP_UNAVAILABLE : Op; def OP_ADD : Op; def OP_ADDL : Op; def OP_ADDW : Op; |