Vendor import of llvm-project main llvmorg-14-init-10186-gff7f2cfa959b.

This commit is contained in:
Dimitry Andric 2021-11-19 21:06:13 +01:00
parent 344a3780b2
commit c0981da47d
4447 changed files with 219505 additions and 110477 deletions

View File

@ -2592,7 +2592,15 @@ enum CXCursorKind {
*/
CXCursor_OMPUnrollDirective = 293,
CXCursor_LastStmt = CXCursor_OMPUnrollDirective,
/** OpenMP metadirective directive.
*/
CXCursor_OMPMetaDirective = 294,
/** OpenMP loop directive.
*/
CXCursor_OMPGenericLoopDirective = 295,
CXCursor_LastStmt = CXCursor_OMPGenericLoopDirective,
/**
* Cursor that represents the translation unit itself.
@ -3298,8 +3306,9 @@ enum CXTypeKind {
CXType_UAccum = 37,
CXType_ULongAccum = 38,
CXType_BFloat16 = 39,
CXType_Ibm128 = 40,
CXType_FirstBuiltin = CXType_Void,
CXType_LastBuiltin = CXType_BFloat16,
CXType_LastBuiltin = CXType_Ibm128,
CXType_Complex = 100,
CXType_Pointer = 101,

View File

@ -1,9 +1,8 @@
//===--- ASTConcept.h - Concepts Related AST Data Structures ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///

View File

@ -102,6 +102,7 @@ class ParentMapContext;
class DynTypedNode;
class DynTypedNodeList;
class Expr;
enum class FloatModeKind;
class GlobalDecl;
class ItaniumMangleContext;
class MangleContext;
@ -164,24 +165,46 @@ namespace serialization {
template <class> class AbstractTypeReader;
} // namespace serialization
enum class AlignRequirementKind {
/// The alignment was not explicit in code.
None,
/// The alignment comes from an alignment attribute on a typedef.
RequiredByTypedef,
/// The alignment comes from an alignment attribute on a record type.
RequiredByRecord,
/// The alignment comes from an alignment attribute on a enum type.
RequiredByEnum,
};
struct TypeInfo {
uint64_t Width = 0;
unsigned Align = 0;
bool AlignIsRequired : 1;
AlignRequirementKind AlignRequirement;
TypeInfo() : AlignIsRequired(false) {}
TypeInfo(uint64_t Width, unsigned Align, bool AlignIsRequired)
: Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
TypeInfo() : AlignRequirement(AlignRequirementKind::None) {}
TypeInfo(uint64_t Width, unsigned Align,
AlignRequirementKind AlignRequirement)
: Width(Width), Align(Align), AlignRequirement(AlignRequirement) {}
bool isAlignRequired() {
return AlignRequirement != AlignRequirementKind::None;
}
};
struct TypeInfoChars {
CharUnits Width;
CharUnits Align;
bool AlignIsRequired : 1;
AlignRequirementKind AlignRequirement;
TypeInfoChars() : AlignIsRequired(false) {}
TypeInfoChars(CharUnits Width, CharUnits Align, bool AlignIsRequired)
: Width(Width), Align(Align), AlignIsRequired(AlignIsRequired) {}
TypeInfoChars() : AlignRequirement(AlignRequirementKind::None) {}
TypeInfoChars(CharUnits Width, CharUnits Align,
AlignRequirementKind AlignRequirement)
: Width(Width), Align(Align), AlignRequirement(AlignRequirement) {}
bool isAlignRequired() {
return AlignRequirement != AlignRequirementKind::None;
}
};
/// Holds long-lived AST nodes (such as types and decls) that can be
@ -672,6 +695,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
SourceManager& getSourceManager() { return SourceMgr; }
const SourceManager& getSourceManager() const { return SourceMgr; }
// Cleans up some of the data structures. This allows us to do cleanup
// normally done in the destructor earlier. Renders much of the ASTContext
// unusable, mostly the actual AST nodes, so should be called when we no
// longer need access to the AST.
void cleanup();
llvm::BumpPtrAllocator &getAllocator() const {
return BumpAlloc;
}
@ -728,7 +757,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
/// getRealTypeForBitwidth -
/// sets floating point QualTy according to specified bitwidth.
/// Returns empty type if there is no appropriate target types.
QualType getRealTypeForBitwidth(unsigned DestWidth, bool ExplicitIEEE) const;
QualType getRealTypeForBitwidth(unsigned DestWidth,
FloatModeKind ExplicitType) const;
bool AtomicUsesUnsupportedLibcall(const AtomicExpr *E) const;
@ -1054,7 +1084,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
CanQualType SignedCharTy, ShortTy, IntTy, LongTy, LongLongTy, Int128Ty;
CanQualType UnsignedCharTy, UnsignedShortTy, UnsignedIntTy, UnsignedLongTy;
CanQualType UnsignedLongLongTy, UnsignedInt128Ty;
CanQualType FloatTy, DoubleTy, LongDoubleTy, Float128Ty;
CanQualType FloatTy, DoubleTy, LongDoubleTy, Float128Ty, Ibm128Ty;
CanQualType ShortAccumTy, AccumTy,
LongAccumTy; // ISO/IEC JTC1 SC22 WG14 N1169 Extension
CanQualType UnsignedShortAccumTy, UnsignedAccumTy, UnsignedLongAccumTy;
@ -1069,8 +1099,6 @@ class ASTContext : public RefCountedBase<ASTContext> {
CanQualType HalfTy; // [OpenCL 6.1.1.1], ARM NEON
CanQualType BFloat16Ty;
CanQualType Float16Ty; // C11 extension ISO/IEC TS 18661-3
CanQualType FloatComplexTy, DoubleComplexTy, LongDoubleComplexTy;
CanQualType Float128ComplexTy;
CanQualType VoidPtrTy, NullPtrTy;
CanQualType DependentTy, OverloadTy, BoundMemberTy, UnknownAnyTy;
CanQualType BuiltinFnTy;
@ -1340,6 +1368,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
/// Get address space for OpenCL type.
LangAS getOpenCLTypeAddrSpace(const Type *T) const;
/// Returns default address space based on OpenCL version and enabled features
inline LangAS getDefaultOpenCLPointeeAddrSpace() {
return LangOpts.OpenCLGenericAddressSpace ? LangAS::opencl_generic
: LangAS::opencl_private;
}
void setcudaConfigureCallDecl(FunctionDecl *FD) {
cudaConfigureCallDecl = FD;
}
@ -1497,6 +1531,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
QualType getFunctionTypeInternal(QualType ResultTy, ArrayRef<QualType> Args,
const FunctionProtoType::ExtProtoInfo &EPI,
bool OnlyWantCanonical) const;
QualType
getAutoTypeInternal(QualType DeducedType, AutoTypeKeyword Keyword,
bool IsDependent, bool IsPack = false,
ConceptDecl *TypeConstraintConcept = nullptr,
ArrayRef<TemplateArgument> TypeConstraintArgs = {},
bool IsCanon = false) const;
public:
/// Return the unique reference to the type for the specified type
@ -1631,6 +1671,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
QualType getTypeOfExprType(Expr *e) const;
QualType getTypeOfType(QualType t) const;
QualType getReferenceQualifiedType(const Expr *e) const;
/// C++11 decltype.
QualType getDecltypeType(Expr *e, QualType UnderlyingType) const;
@ -2505,8 +2547,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
bool ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl,
const ObjCMethodDecl *MethodImp);
bool UnwrapSimilarTypes(QualType &T1, QualType &T2);
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2);
bool UnwrapSimilarTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch = true);
void UnwrapSimilarArrayTypes(QualType &T1, QualType &T2,
bool AllowPiMismatch = true);
/// Determine if two types are similar, according to the C++ rules. That is,
/// determine if they are the same other than qualifiers on the initial
@ -3209,31 +3253,10 @@ OPT_LIST(V)
StringRef getCUIDHash() const;
void AddSYCLKernelNamingDecl(const CXXRecordDecl *RD);
bool IsSYCLKernelNamingDecl(const NamedDecl *RD) const;
unsigned GetSYCLKernelNamingIndex(const NamedDecl *RD);
/// A SourceLocation to store whether we have evaluated a kernel name already,
/// and where it happened. If so, we need to diagnose an illegal use of the
/// builtin.
llvm::MapVector<const SYCLUniqueStableNameExpr *, std::string>
SYCLUniqueStableNameEvaluatedValues;
private:
/// All OMPTraitInfo objects live in this collection, one per
/// `pragma omp [begin] declare variant` directive.
SmallVector<std::unique_ptr<OMPTraitInfo>, 4> OMPTraitInfoVector;
/// A list of the (right now just lambda decls) declarations required to
/// name all the SYCL kernels in the translation unit, so that we can get the
/// correct kernel name, as well as implement
/// __builtin_sycl_unique_stable_name.
llvm::DenseMap<const DeclContext *,
llvm::SmallPtrSet<const CXXRecordDecl *, 4>>
SYCLKernelNamingTypes;
std::unique_ptr<ItaniumMangleContext> SYCLKernelFilterContext;
void FilterSYCLKernelNamingDecls(
const CXXRecordDecl *RD,
llvm::SmallVectorImpl<const CXXRecordDecl *> &Decls);
};
/// Insertion operator for diagnostics.

View File

@ -30,6 +30,9 @@ class OMPClause;
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class) class Class;
#include "llvm/Frontend/OpenMP/OMP.inc"
class Attr;
#define ATTR(A) class A##Attr;
#include "clang/Basic/AttrList.inc"
} // end namespace clang

View File

@ -379,6 +379,9 @@ class TypeSourceInfo;
return Import(const_cast<Decl *>(FromD));
}
llvm::Expected<InheritedConstructor>
Import(const InheritedConstructor &From);
/// Return the copy of the given declaration in the "to" context if
/// it has already been imported from the "from" context. Otherwise return
/// nullptr.

View File

@ -1,9 +1,8 @@
//===- ASTImporterSharedState.h - ASTImporter specific state --*- C++ -*---===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//

View File

@ -117,7 +117,7 @@ struct StructuralEquivalenceContext {
static llvm::Optional<unsigned>
findUntaggedStructOrUnionIndex(RecordDecl *Anon);
// If ErrorOnTagTypeMismatch is set, return the the error, otherwise get the
// If ErrorOnTagTypeMismatch is set, return the error, otherwise get the
// relevant warning for the input error diagnostic.
unsigned getApplicableDiagnostic(unsigned ErrorDiagnostic);

View File

@ -17,6 +17,7 @@
#include "clang/AST/ASTFwd.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/LambdaCapture.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TypeLoc.h"
@ -25,10 +26,8 @@
#include "llvm/Support/AlignOf.h"
namespace llvm {
class raw_ostream;
}
} // namespace llvm
namespace clang {
@ -65,7 +64,10 @@ class ASTNodeKind {
static ASTNodeKind getFromNode(const Decl &D);
static ASTNodeKind getFromNode(const Stmt &S);
static ASTNodeKind getFromNode(const Type &T);
static ASTNodeKind getFromNode(const TypeLoc &T);
static ASTNodeKind getFromNode(const LambdaCapture &L);
static ASTNodeKind getFromNode(const OMPClause &C);
static ASTNodeKind getFromNode(const Attr &A);
/// \}
/// Returns \c true if \c this and \c Other represent the same kind.
@ -131,9 +133,12 @@ class ASTNodeKind {
NKI_None,
NKI_TemplateArgument,
NKI_TemplateArgumentLoc,
NKI_LambdaCapture,
NKI_TemplateName,
NKI_NestedNameSpecifierLoc,
NKI_QualType,
#define TYPELOC(CLASS, PARENT) NKI_##CLASS##TypeLoc,
#include "clang/AST/TypeLocNodes.def"
NKI_TypeLoc,
NKI_LastKindWithoutPointerIdentity = NKI_TypeLoc,
NKI_CXXBaseSpecifier,
@ -152,6 +157,9 @@ class ASTNodeKind {
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class) NKI_##Class,
#include "llvm/Frontend/OpenMP/OMP.inc"
NKI_Attr,
#define ATTR(A) NKI_##A##Attr,
#include "clang/Basic/AttrList.inc"
NKI_NumberOfKinds
};
@ -192,15 +200,19 @@ class ASTNodeKind {
KIND_TO_KIND_ID(CXXCtorInitializer)
KIND_TO_KIND_ID(TemplateArgument)
KIND_TO_KIND_ID(TemplateArgumentLoc)
KIND_TO_KIND_ID(LambdaCapture)
KIND_TO_KIND_ID(TemplateName)
KIND_TO_KIND_ID(NestedNameSpecifier)
KIND_TO_KIND_ID(NestedNameSpecifierLoc)
KIND_TO_KIND_ID(QualType)
#define TYPELOC(CLASS, PARENT) KIND_TO_KIND_ID(CLASS##TypeLoc)
#include "clang/AST/TypeLocNodes.def"
KIND_TO_KIND_ID(TypeLoc)
KIND_TO_KIND_ID(Decl)
KIND_TO_KIND_ID(Stmt)
KIND_TO_KIND_ID(Type)
KIND_TO_KIND_ID(OMPClause)
KIND_TO_KIND_ID(Attr)
KIND_TO_KIND_ID(CXXBaseSpecifier)
#define DECL(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Decl)
#include "clang/AST/DeclNodes.inc"
@ -211,6 +223,8 @@ KIND_TO_KIND_ID(CXXBaseSpecifier)
#define GEN_CLANG_CLAUSE_CLASS
#define CLAUSE_CLASS(Enum, Str, Class) KIND_TO_KIND_ID(Class)
#include "llvm/Frontend/OpenMP/OMP.inc"
#define ATTR(A) KIND_TO_KIND_ID(A##Attr)
#include "clang/Basic/AttrList.inc"
#undef KIND_TO_KIND_ID
inline raw_ostream &operator<<(raw_ostream &OS, ASTNodeKind K) {
@ -299,7 +313,7 @@ class DynTypedNode {
return getUnchecked<QualType>().getAsOpaquePtr() <
Other.getUnchecked<QualType>().getAsOpaquePtr();
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(NodeKind)) {
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isBaseOf(NodeKind)) {
auto TLA = getUnchecked<TypeLoc>();
auto TLB = Other.getUnchecked<TypeLoc>();
return std::make_pair(TLA.getType().getAsOpaquePtr(),
@ -331,7 +345,7 @@ class DynTypedNode {
if (ASTNodeKind::getFromNodeKind<QualType>().isSame(NodeKind))
return getUnchecked<QualType>() == Other.getUnchecked<QualType>();
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(NodeKind))
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isBaseOf(NodeKind))
return getUnchecked<TypeLoc>() == Other.getUnchecked<TypeLoc>();
if (ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>().isSame(NodeKind))
@ -360,7 +374,7 @@ class DynTypedNode {
}
static unsigned getHashValue(const DynTypedNode &Val) {
// FIXME: Add hashing support for the remaining types.
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(Val.NodeKind)) {
if (ASTNodeKind::getFromNodeKind<TypeLoc>().isBaseOf(Val.NodeKind)) {
auto TL = Val.getUnchecked<TypeLoc>();
return llvm::hash_combine(TL.getType().getAsOpaquePtr(),
TL.getOpaqueData());
@ -450,6 +464,29 @@ class DynTypedNode {
}
};
/// Converter that stores nodes by value. It must be possible to dynamically
/// cast the stored node within a type hierarchy without breaking (especially
/// through slicing).
template <typename T, typename BaseT,
typename = std::enable_if_t<(sizeof(T) == sizeof(BaseT))>>
struct DynCastValueConverter {
static const T *get(ASTNodeKind NodeKind, const void *Storage) {
if (ASTNodeKind::getFromNodeKind<T>().isBaseOf(NodeKind))
return &getUnchecked(NodeKind, Storage);
return nullptr;
}
static const T &getUnchecked(ASTNodeKind NodeKind, const void *Storage) {
assert(ASTNodeKind::getFromNodeKind<T>().isBaseOf(NodeKind));
return *static_cast<const T *>(reinterpret_cast<const BaseT *>(Storage));
}
static DynTypedNode create(const T &Node) {
DynTypedNode Result;
Result.NodeKind = ASTNodeKind::getFromNode(Node);
new (&Result.Storage) T(Node);
return Result;
}
};
ASTNodeKind NodeKind;
/// Stores the data of the node.
@ -486,6 +523,11 @@ struct DynTypedNode::BaseConverter<
T, std::enable_if_t<std::is_base_of<OMPClause, T>::value>>
: public DynCastPtrConverter<T, OMPClause> {};
template <typename T>
struct DynTypedNode::BaseConverter<
T, std::enable_if_t<std::is_base_of<Attr, T>::value>>
: public DynCastPtrConverter<T, Attr> {};
template <>
struct DynTypedNode::BaseConverter<
NestedNameSpecifier, void> : public PtrConverter<NestedNameSpecifier> {};
@ -502,6 +544,10 @@ template <>
struct DynTypedNode::BaseConverter<TemplateArgumentLoc, void>
: public ValueConverter<TemplateArgumentLoc> {};
template <>
struct DynTypedNode::BaseConverter<LambdaCapture, void>
: public ValueConverter<LambdaCapture> {};
template <>
struct DynTypedNode::BaseConverter<
TemplateName, void> : public ValueConverter<TemplateName> {};
@ -515,9 +561,10 @@ template <>
struct DynTypedNode::BaseConverter<QualType,
void> : public ValueConverter<QualType> {};
template <>
template <typename T>
struct DynTypedNode::BaseConverter<
TypeLoc, void> : public ValueConverter<TypeLoc> {};
T, std::enable_if_t<std::is_base_of<TypeLoc, T>::value>>
: public DynCastValueConverter<T, TypeLoc> {};
template <>
struct DynTypedNode::BaseConverter<CXXBaseSpecifier, void>

View File

@ -109,6 +109,8 @@ class Attr : public AttributeCommonInfo {
// Pretty print this attribute.
void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const;
static StringRef getDocumentation(attr::Kind);
};
class TypeAttr : public Attr {
@ -372,8 +374,7 @@ struct ParsedTargetAttr {
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
const Attr *At) {
DB.AddTaggedVal(reinterpret_cast<intptr_t>(At),
DiagnosticsEngine::ak_attr);
DB.AddTaggedVal(reinterpret_cast<uint64_t>(At), DiagnosticsEngine::ak_attr);
return DB;
}
} // end namespace clang

View File

@ -218,6 +218,9 @@ FLOATING_TYPE(BFloat16, BFloat16Ty)
// '__float128'
FLOATING_TYPE(Float128, Float128Ty)
// '__ibm128'
FLOATING_TYPE(Ibm128, Ibm128Ty)
//===- Language-specific types --------------------------------------------===//
// This is the type of C++0x 'nullptr'.

View File

@ -1019,8 +1019,6 @@ struct DeclInfo {
/// \li member function template,
/// \li member function template specialization,
/// \li ObjC method,
/// \li a typedef for a function pointer, member function pointer,
/// ObjC block.
FunctionKind,
/// Something that we consider a "class":
@ -1030,8 +1028,8 @@ struct DeclInfo {
ClassKind,
/// Something that we consider a "variable":
/// \li namespace scope variables;
/// \li static and non-static class data members;
/// \li namespace scope variables and variable templates;
/// \li static and non-static class data members and member templates;
/// \li enumerators.
VariableKind,
@ -1076,6 +1074,9 @@ struct DeclInfo {
/// Can be true only if \c IsFunctionDecl is true.
unsigned IsClassMethod : 1;
/// Is \c CommentDecl something we consider a "function" that's variadic.
unsigned IsVariadic : 1;
void fill();
DeclKind getKind() const LLVM_READONLY {
@ -1085,6 +1086,8 @@ struct DeclInfo {
TemplateDeclKind getTemplateKind() const LLVM_READONLY {
return static_cast<TemplateDeclKind>(TemplateKind);
}
bool involvesFunctionType() const { return !ReturnType.isNull(); }
};
/// A full comment attached to a declaration, contains block content.

View File

@ -87,8 +87,21 @@ def P : InlineCommand<"p">;
def A : InlineCommand<"a">;
def E : InlineCommand<"e">;
def Em : InlineCommand<"em">;
def Ref : InlineCommand<"ref">;
def Anchor : InlineCommand<"anchor">;
def Emoji : InlineCommand<"emoji">;
def Anchor : InlineCommand<"anchor">;
def Ref : InlineCommand<"ref">;
def RefItem : InlineCommand<"refitem">;
def Cite : InlineCommand<"cite">;
def CopyBrief : InlineCommand<"copybrief">;
def CopyDetails : InlineCommand<"copydetails">;
def CopyDoc : InlineCommand<"copydoc">;
// Typically not used inline, but they take a single word.
def Extends : InlineCommand<"extends">;
def Implements : InlineCommand<"implements">;
def MemberOf : InlineCommand<"memberof">;
//===----------------------------------------------------------------------===//
// BlockCommand
@ -145,9 +158,11 @@ def Retval : BlockCommand<"retval">;
def Sa : BlockCommand<"sa">;
def See : BlockCommand<"see">;
def Since : BlockCommand<"since">;
def Test : BlockCommand<"test">;
def Todo : BlockCommand<"todo">;
def Version : BlockCommand<"version">;
def Warning : BlockCommand<"warning">;
def XRefItem : BlockCommand<"xrefitem">;
// HeaderDoc commands
def Abstract : BlockCommand<"abstract"> { let IsBriefCommand = 1; }
def ClassDesign : RecordLikeDetailCommand<"classdesign">;
@ -170,6 +185,8 @@ def SuperClass : RecordLikeDetailCommand<"superclass">;
defm Code : VerbatimBlockCommand<"code", "endcode">;
defm Verbatim : VerbatimBlockCommand<"verbatim", "endverbatim">;
defm DocbookOnly : VerbatimBlockCommand<"docbookonly", "enddocbookonly">;
defm Htmlonly : VerbatimBlockCommand<"htmlonly", "endhtmlonly">;
defm Latexonly : VerbatimBlockCommand<"latexonly", "endlatexonly">;
defm Xmlonly : VerbatimBlockCommand<"xmlonly", "endxmlonly">;
@ -178,10 +195,19 @@ defm Rtfonly : VerbatimBlockCommand<"rtfonly", "endrtfonly">;
defm Dot : VerbatimBlockCommand<"dot", "enddot">;
defm Msc : VerbatimBlockCommand<"msc", "endmsc">;
defm Uml : VerbatimBlockCommand<"startuml", "enduml">;
// Actually not verbatim blocks, we should also parse commands within them.
defm Internal : VerbatimBlockCommand<"internal", "endinternal">;
// TODO: conflicts with HeaderDoc link, /link.
//defm Link : VerbatimBlockCommand<"link", "endlink">;
defm ParBlock : VerbatimBlockCommand<"parblock", "endparblock">;
defm SecRefList : VerbatimBlockCommand<"secreflist", "endsecreflist">;
// These three commands have special support in CommentLexer to recognize their
// names.
def FDollar : VerbatimBlockCommand<"f$">; // Inline LaTeX formula
defm FParen : VerbatimBlockCommand<"f(", "f)">; // Inline LaTeX text
defm FBracket : VerbatimBlockCommand<"f[", "f]">; // Displayed LaTeX formula
defm FBrace : VerbatimBlockCommand<"f{", "f}">; // LaTeX environment
@ -199,11 +225,18 @@ def Addtogroup : VerbatimLineCommand<"addtogroup">;
def Weakgroup : VerbatimLineCommand<"weakgroup">;
def Name : VerbatimLineCommand<"name">;
// These actually take a single word, but it's optional.
// And they're used on a separate line typically, not inline.
def Dir : VerbatimLineCommand<"dir">;
def File : VerbatimLineCommand<"file">;
def Section : VerbatimLineCommand<"section">;
def Subsection : VerbatimLineCommand<"subsection">;
def Subsubsection : VerbatimLineCommand<"subsubsection">;
def Paragraph : VerbatimLineCommand<"paragraph">;
def TableOfContents : VerbatimLineCommand<"tableofcontents">;
def Page : VerbatimLineCommand<"page">;
def Mainpage : VerbatimLineCommand<"mainpage">;
def Subpage : VerbatimLineCommand<"subpage">;
@ -212,13 +245,79 @@ def Related : VerbatimLineCommand<"related">;
def RelatesAlso : VerbatimLineCommand<"relatesalso">;
def RelatedAlso : VerbatimLineCommand<"relatedalso">;
def AddIndex : VerbatimLineCommand<"addindex">;
// These take a single argument mostly, but since they include a file they'll
// typically be on their own line.
def DocbookInclude : VerbatimLineCommand<"docbookinclude">;
def DontInclude : VerbatimLineCommand<"dontinclude">;
def Example : VerbatimLineCommand<"example">;
def HtmlInclude : VerbatimLineCommand<"htmlinclude">;
def Include : VerbatimLineCommand<"include">;
def ManInclude : VerbatimLineCommand<"maninclude">;
def LatexInclude : VerbatimLineCommand<"latexinclude">;
def RtfInclude : VerbatimLineCommand<"rtfinclude">;
def Snippet : VerbatimLineCommand<"snippet">;
def VerbInclude : VerbatimLineCommand<"verbinclude">;
def XmlInclude : VerbatimLineCommand<"xmlinclude">;
def Image : VerbatimLineCommand<"image">;
def DotFile : VerbatimLineCommand<"dotfile">;
def MscFile : VerbatimLineCommand<"mscfile">;
def DiaFile : VerbatimLineCommand<"diafile">;
def Line : VerbatimLineCommand<"line">;
def Skip : VerbatimLineCommand<"skip">;
def SkipLine : VerbatimLineCommand<"skipline">;
def Until : VerbatimLineCommand<"until">;
def NoOp : VerbatimLineCommand<"noop">;
// These have actually no arguments, but we can treat them as line commands.
def CallGraph : VerbatimLineCommand<"callgraph">;
def HideCallGraph : VerbatimLineCommand<"hidecallgraph">;
def CallerGraph : VerbatimLineCommand<"callergraph">;
def HideCallerGraph : VerbatimLineCommand<"hidecallergraph">;
def ShowInitializer : VerbatimLineCommand<"showinitializer">;
def HideInitializer : VerbatimLineCommand<"hideinitializer">;
def ShowRefBy : VerbatimLineCommand<"showrefby">;
def HideRefBy : VerbatimLineCommand<"hiderefby">;
def ShowRefs : VerbatimLineCommand<"showrefs">;
def HideRefs : VerbatimLineCommand<"hiderefs">;
// These also have no argument.
def Private : VerbatimLineCommand<"private">;
def Protected : VerbatimLineCommand<"protected">;
def Public : VerbatimLineCommand<"public">;
def Pure : VerbatimLineCommand<"pure">;
def Static : VerbatimLineCommand<"static">;
// These also have no argument.
def NoSubgrouping : VerbatimLineCommand<"nosubgrouping">;
def PrivateSection : VerbatimLineCommand<"privatesection">;
def ProtectedSection : VerbatimLineCommand<"protectedsection">;
def PublicSection : VerbatimLineCommand<"publicsection">;
// We might also build proper support for if/ifnot/else/elseif/endif.
def If : VerbatimLineCommand<"if">;
def IfNot : VerbatimLineCommand<"ifnot">;
def Else : VerbatimLineCommand<"else">;
def ElseIf : VerbatimLineCommand<"elseif">;
def Endif : VerbatimLineCommand<"endif">;
// Not treated as VerbatimBlockCommand because it spans multiple comments.
def Cond : VerbatimLineCommand<"cond">;
def EndCond : VerbatimLineCommand<"endcond">;
//===----------------------------------------------------------------------===//
// DeclarationVerbatimLineCommand
//===----------------------------------------------------------------------===//
// Doxygen commands.
def Concept : DeclarationVerbatimLineCommand<"concept">;
def Def : DeclarationVerbatimLineCommand<"def">;
def Fn : DeclarationVerbatimLineCommand<"fn">;
def IDLExcept : DeclarationVerbatimLineCommand<"idlexcept">;
def Namespace : DeclarationVerbatimLineCommand<"namespace">;
def Overload : DeclarationVerbatimLineCommand<"overload">;
def Property : DeclarationVerbatimLineCommand<"property">;

View File

@ -52,11 +52,11 @@ def Tr : Tag<"tr"> { let EndTagOptional = 1; }
def Th : Tag<"th"> { let EndTagOptional = 1; }
def Td : Tag<"td"> { let EndTagOptional = 1; }
// Define a blacklist of attributes that are not safe to pass through to HTML
// Define a list of attributes that are not safe to pass through to HTML
// output if the input is untrusted.
//
// FIXME: this should be a whitelist. When changing this to a whitelist, don't
// forget to change the default in the TableGen backend.
// FIXME: This should be a list of attributes that _are_ safe. When changing
// this change, don't forget to change the default in the TableGen backend.
class Attribute<string spelling> {
string Spelling = spelling;
bit IsSafeToPassThrough = 1;

View File

@ -181,6 +181,7 @@ class Sema {
FullComment *actOnFullComment(ArrayRef<BlockContentComment *> Blocks);
private:
void checkBlockCommandEmptyParagraph(BlockCommandComment *Command);
void checkReturnsCommand(const BlockCommandComment *Command);
@ -201,16 +202,16 @@ class Sema {
/// Emit diagnostics about unknown parametrs.
void resolveParamCommandIndexes(const FullComment *FC);
/// \returns \c true if the declaration that this comment is attached to
/// is a pointer to function/method/block type or has such a type.
bool involvesFunctionType();
bool isFunctionDecl();
bool isAnyFunctionDecl();
/// \returns \c true if declaration that this comment is attached to declares
/// a function pointer.
bool isFunctionPointerVarDecl();
/// \returns \c true if the declaration that this comment is attached to
/// declares a variable or a field whose type is a function or a block
/// pointer.
bool isFunctionOrBlockPointerVarLikeDecl();
bool isFunctionOrMethodVariadic();
bool isObjCMethodDecl();
bool isObjCPropertyDecl();

View File

@ -115,8 +115,7 @@ class ComparisonCategoryInfo {
public:
/// The declaration for the comparison category type from the
/// standard library.
// FIXME: Make this const
CXXRecordDecl *Record = nullptr;
const CXXRecordDecl *Record = nullptr;
/// The Kind of the comparison category type
ComparisonCategoryType Kind;
@ -146,7 +145,7 @@ class ComparisonCategoryInfo {
return Kind == CCK::PartialOrdering;
}
/// Converts the specified result kind into the the correct result kind
/// Converts the specified result kind into the correct result kind
/// for this category. Specifically it lowers strong equality results to
/// weak equivalence if needed.
ComparisonCategoryResult makeWeakResult(ComparisonCategoryResult Res) const {

View File

@ -1,9 +1,8 @@
//===--- CurrentSourceLocExprScope.h ----------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//

View File

@ -614,7 +614,9 @@ class NamespaceDecl : public NamedDecl, public DeclContext,
if (!isInline())
return false;
auto X = lookup(Name);
auto Y = getParent()->lookup(Name);
// We should not perform a lookup within a transparent context, so find a
// non-transparent parent context.
auto Y = getParent()->getNonTransparentContext()->lookup(Name);
return std::distance(X.begin(), X.end()) ==
std::distance(Y.begin(), Y.end());
}
@ -1990,8 +1992,8 @@ class FunctionDecl : public DeclaratorDecl,
protected:
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, StorageClass S, bool isInlineSpecified,
ConstexprSpecKind ConstexprKind,
TypeSourceInfo *TInfo, StorageClass S, bool UsesFPIntrin,
bool isInlineSpecified, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr);
using redeclarable_base = Redeclarable<FunctionDecl>;
@ -2025,23 +2027,23 @@ class FunctionDecl : public DeclaratorDecl,
static FunctionDecl *
Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
SourceLocation NLoc, DeclarationName N, QualType T,
TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified = false,
bool hasWrittenPrototype = true,
TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin = false,
bool isInlineSpecified = false, bool hasWrittenPrototype = true,
ConstexprSpecKind ConstexprKind = ConstexprSpecKind::Unspecified,
Expr *TrailingRequiresClause = nullptr) {
DeclarationNameInfo NameInfo(N, NLoc);
return FunctionDecl::Create(C, DC, StartLoc, NameInfo, T, TInfo, SC,
isInlineSpecified, hasWrittenPrototype,
ConstexprKind, TrailingRequiresClause);
UsesFPIntrin, isInlineSpecified,
hasWrittenPrototype, ConstexprKind,
TrailingRequiresClause);
}
static FunctionDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, StorageClass SC,
bool isInlineSpecified, bool hasWrittenPrototype,
ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause);
static FunctionDecl *
Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
StorageClass SC, bool UsesFPIntrin, bool isInlineSpecified,
bool hasWrittenPrototype, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause);
static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@ -2594,6 +2596,14 @@ class FunctionDecl : public DeclaratorDecl,
FunctionDeclBits.IsInline = I;
}
/// Determine whether the function was declared in source context
/// that requires constrained FP intrinsics
bool UsesFPIntrin() const { return FunctionDeclBits.UsesFPIntrin; }
/// Set whether the function was declared in source context
/// that requires constrained FP intrinsics
void setUsesFPIntrin(bool I) { FunctionDeclBits.UsesFPIntrin = I; }
/// Flag that this function is implicitly inline.
void setImplicitlyInline(bool I = true) { FunctionDeclBits.IsInline = I; }
@ -3691,6 +3701,10 @@ class EnumDecl : public TagDecl {
bool IsFixed);
static EnumDecl *CreateDeserialized(ASTContext &C, unsigned ID);
/// Overrides to provide correct range when there's an enum-base specifier
/// with forward declarations.
SourceRange getSourceRange() const override LLVM_READONLY;
/// When created, the EnumDecl corresponds to a
/// forward-declared enum. This method is used to mark the
/// declaration as being defined; its enumerators have already been
@ -4579,7 +4593,7 @@ class EmptyDecl : public Decl {
/// into a diagnostic with <<.
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
const NamedDecl *ND) {
PD.AddTaggedVal(reinterpret_cast<intptr_t>(ND),
PD.AddTaggedVal(reinterpret_cast<uint64_t>(ND),
DiagnosticsEngine::ak_nameddecl);
return PD;
}

View File

@ -1997,6 +1997,12 @@ class DeclContext {
return const_cast<DeclContext*>(this)->getNonClosureAncestor();
}
// Retrieve the nearest context that is not a transparent context.
DeclContext *getNonTransparentContext();
const DeclContext *getNonTransparentContext() const {
return const_cast<DeclContext *>(this)->getNonTransparentContext();
}
/// getPrimaryContext - There may be many different
/// declarations of the same entity (including forward declarations
/// of classes, multiple definitions of namespaces, etc.), each with

View File

@ -1857,7 +1857,7 @@ class CXXDeductionGuideDecl : public FunctionDecl {
TypeSourceInfo *TInfo, SourceLocation EndLocation,
CXXConstructorDecl *Ctor)
: FunctionDecl(CXXDeductionGuide, C, DC, StartLoc, NameInfo, T, TInfo,
SC_None, false, ConstexprSpecKind::Unspecified),
SC_None, false, false, ConstexprSpecKind::Unspecified),
Ctor(Ctor), ExplicitSpec(ES) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
@ -1952,23 +1952,22 @@ class CXXMethodDecl : public FunctionDecl {
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD,
SourceLocation StartLoc, const DeclarationNameInfo &NameInfo,
QualType T, TypeSourceInfo *TInfo, StorageClass SC,
bool isInline, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation,
bool UsesFPIntrin, bool isInline,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr)
: FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo, SC, isInline,
ConstexprKind, TrailingRequiresClause) {
: FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo, SC, UsesFPIntrin,
isInline, ConstexprKind, TrailingRequiresClause) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
}
public:
static CXXMethodDecl *Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, StorageClass SC,
bool isInline, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr);
static CXXMethodDecl *
Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
StorageClass SC, bool UsesFPIntrin, bool isInline,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr);
static CXXMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@ -2413,7 +2412,8 @@ class CXXConstructorDecl final
CXXConstructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, ExplicitSpecifier ES, bool isInline,
TypeSourceInfo *TInfo, ExplicitSpecifier ES,
bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited,
Expr *TrailingRequiresClause);
@ -2456,8 +2456,8 @@ class CXXConstructorDecl final
static CXXConstructorDecl *
Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
ExplicitSpecifier ES, bool isInline, bool isImplicitlyDeclared,
ConstexprSpecKind ConstexprKind,
ExplicitSpecifier ES, bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited = InheritedConstructor(),
Expr *TrailingRequiresClause = nullptr);
@ -2676,25 +2676,24 @@ class CXXDestructorDecl : public CXXMethodDecl {
CXXDestructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, bool isInline,
TypeSourceInfo *TInfo, bool UsesFPIntrin, bool isInline,
bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr)
: CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
SC_None, isInline, ConstexprKind, SourceLocation(),
TrailingRequiresClause) {
SC_None, UsesFPIntrin, isInline, ConstexprKind,
SourceLocation(), TrailingRequiresClause) {
setImplicit(isImplicitlyDeclared);
}
void anchor() override;
public:
static CXXDestructorDecl *Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo,
QualType T, TypeSourceInfo *TInfo,
bool isInline, bool isImplicitlyDeclared,
ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr);
static CXXDestructorDecl *
Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
bool UsesFPIntrin, bool isInline, bool isImplicitlyDeclared,
ConstexprSpecKind ConstexprKind,
Expr *TrailingRequiresClause = nullptr);
static CXXDestructorDecl *CreateDeserialized(ASTContext & C, unsigned ID);
void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg);
@ -2732,12 +2731,13 @@ class CXXDestructorDecl : public CXXMethodDecl {
class CXXConversionDecl : public CXXMethodDecl {
CXXConversionDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, bool isInline, ExplicitSpecifier ES,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
TypeSourceInfo *TInfo, bool UsesFPIntrin, bool isInline,
ExplicitSpecifier ES, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr)
: CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
SC_None, isInline, ConstexprKind, EndLocation,
TrailingRequiresClause),
SC_None, UsesFPIntrin, isInline, ConstexprKind,
EndLocation, TrailingRequiresClause),
ExplicitSpec(ES) {}
void anchor() override;
@ -2750,8 +2750,9 @@ class CXXConversionDecl : public CXXMethodDecl {
static CXXConversionDecl *
Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
bool isInline, ExplicitSpecifier ES, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation, Expr *TrailingRequiresClause = nullptr);
bool UsesFPIntrin, bool isInline, ExplicitSpecifier ES,
ConstexprSpecKind ConstexprKind, SourceLocation EndLocation,
Expr *TrailingRequiresClause = nullptr);
static CXXConversionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
ExplicitSpecifier getExplicitSpecifier() {

View File

@ -78,8 +78,7 @@ class StoredDeclsList {
}
Data.setPointer(NewHead);
assert(llvm::find_if(getLookupResult(), ShouldErase) ==
getLookupResult().end() && "Still exists!");
assert(llvm::none_of(getLookupResult(), ShouldErase) && "Still exists!");
}
void erase(NamedDecl *ND) {

View File

@ -487,6 +487,9 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext {
/// True if the method is tagged as objc_direct
bool isDirectMethod() const;
/// True if the method has a parameter that's destroyed in the callee.
bool hasParamDestroyedInCallee() const;
/// Returns the property associated with this method's selector.
///
/// Note that even if this particular method is not marked as a property
@ -1955,6 +1958,13 @@ class ObjCIvarDecl : public FieldDecl {
const ObjCIvarDecl *getNextIvar() const { return NextIvar; }
void setNextIvar(ObjCIvarDecl *ivar) { NextIvar = ivar; }
ObjCIvarDecl *getCanonicalDecl() override {
return cast<ObjCIvarDecl>(FieldDecl::getCanonicalDecl());
}
const ObjCIvarDecl *getCanonicalDecl() const {
return const_cast<ObjCIvarDecl *>(this)->getCanonicalDecl();
}
void setAccessControl(AccessControl ac) { DeclAccess = ac; }
AccessControl getAccessControl() const { return AccessControl(DeclAccess); }

View File

@ -203,7 +203,8 @@ class TemplateParameterList final
void print(raw_ostream &Out, const ASTContext &Context,
const PrintingPolicy &Policy, bool OmitTemplateKW = false) const;
static bool shouldIncludeTypeForArgument(const TemplateParameterList *TPL,
static bool shouldIncludeTypeForArgument(const PrintingPolicy &Policy,
const TemplateParameterList *TPL,
unsigned Idx);
};
@ -729,6 +730,10 @@ class DependentFunctionTemplateSpecializationInfo final
/// Returns the number of explicit template arguments that were given.
unsigned getNumTemplateArgs() const { return NumArgs; }
llvm::ArrayRef<TemplateArgumentLoc> arguments() const {
return llvm::makeArrayRef(getTemplateArgs(), getNumTemplateArgs());
}
/// Returns the nth template argument.
const TemplateArgumentLoc &getTemplateArg(unsigned I) const {
assert(I < getNumTemplateArgs() && "template arg index out of range");
@ -1189,7 +1194,7 @@ class TemplateTypeParmDecl final : public TypeDecl,
/// Whether the type constraint has been initialized. This can be false if the
/// constraint was not initialized yet or if there was an error forming the
/// type constriant.
/// type constraint.
bool TypeConstraintInitialized : 1;
/// Whether this non-type template parameter is an "expanded"

View File

@ -740,6 +740,12 @@ class Expr : public ValueStmt {
bool tryEvaluateObjectSize(uint64_t &Result, ASTContext &Ctx,
unsigned Type) const;
/// If the current Expr is a pointer, this will try to statically
/// determine the strlen of the string pointed to.
/// Returns true if all of the above holds and we were able to figure out the
/// strlen, false otherwise.
bool tryEvaluateStrLen(uint64_t &Result, ASTContext &Ctx) const;
/// Enumeration used to describe the kind of Null pointer constant
/// returned from \c isNullPointerConstant().
enum NullPointerConstantKind {

View File

@ -1,9 +1,8 @@
//===--- JSONNodeDumper.h - Printing of AST nodes to JSON -----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//

View File

@ -86,7 +86,7 @@ class LambdaCapture {
/// Determine whether this capture handles a variable.
bool capturesVariable() const {
return dyn_cast_or_null<VarDecl>(DeclAndBits.getPointer());
return isa_and_nonnull<VarDecl>(DeclAndBits.getPointer());
}
/// Determine whether this captures a variable length array bound

View File

@ -521,7 +521,7 @@ class NestedNameSpecifierLocBuilder {
/// NestedNameSpecifiers into a diagnostic with <<.
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
NestedNameSpecifier *NNS) {
DB.AddTaggedVal(reinterpret_cast<intptr_t>(NNS),
DB.AddTaggedVal(reinterpret_cast<uint64_t>(NNS),
DiagnosticsEngine::ak_nestednamespec);
return DB;
}

View File

@ -322,6 +322,81 @@ class OMPAllocatorClause : public OMPClause {
}
};
/// This represents the 'align' clause in the '#pragma omp allocate'
/// directive.
///
/// \code
/// #pragma omp allocate(a) allocator(omp_default_mem_alloc) align(8)
/// \endcode
/// In this example directive '#pragma omp allocate' has simple 'allocator'
/// clause with the allocator 'omp_default_mem_alloc' and align clause with
/// value of 8.
class OMPAlignClause final : public OMPClause {
friend class OMPClauseReader;
/// Location of '('.
SourceLocation LParenLoc;
/// Alignment specified with align clause.
Stmt *Alignment = nullptr;
/// Set alignment value.
void setAlignment(Expr *A) { Alignment = A; }
/// Sets the location of '('.
void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
/// Build 'align' clause with the given alignment
///
/// \param A Alignment value.
/// \param StartLoc Starting location of the clause.
/// \param LParenLoc Location of '('.
/// \param EndLoc Ending location of the clause.
OMPAlignClause(Expr *A, SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation EndLoc)
: OMPClause(llvm::omp::OMPC_align, StartLoc, EndLoc),
LParenLoc(LParenLoc), Alignment(A) {}
/// Build an empty clause.
OMPAlignClause()
: OMPClause(llvm::omp::OMPC_align, SourceLocation(), SourceLocation()) {}
public:
/// Build 'align' clause with the given alignment
///
/// \param A Alignment value.
/// \param StartLoc Starting location of the clause.
/// \param LParenLoc Location of '('.
/// \param EndLoc Ending location of the clause.
static OMPAlignClause *Create(const ASTContext &C, Expr *A,
SourceLocation StartLoc,
SourceLocation LParenLoc,
SourceLocation EndLoc);
/// Returns the location of '('.
SourceLocation getLParenLoc() const { return LParenLoc; }
/// Returns alignment
Expr *getAlignment() const { return cast_or_null<Expr>(Alignment); }
child_range children() { return child_range(&Alignment, &Alignment + 1); }
const_child_range children() const {
return const_child_range(&Alignment, &Alignment + 1);
}
child_range used_children() {
return child_range(child_iterator(), child_iterator());
}
const_child_range used_children() const {
return const_child_range(const_child_iterator(), const_child_iterator());
}
static bool classof(const OMPClause *T) {
return T->getClauseKind() == llvm::omp::OMPC_align;
}
};
/// This represents clause 'allocate' in the '#pragma omp ...' directives.
///
/// \code
@ -2005,13 +2080,13 @@ class OMPUpdateClause final
return IsExtended ? 2 : 0;
}
/// Sets the the location of '(' in clause for 'depobj' directive.
/// Sets the location of '(' in clause for 'depobj' directive.
void setLParenLoc(SourceLocation Loc) {
assert(IsExtended && "Expected extended clause.");
*getTrailingObjects<SourceLocation>() = Loc;
}
/// Sets the the location of '(' in clause for 'depobj' directive.
/// Sets the location of '(' in clause for 'depobj' directive.
void setArgumentLoc(SourceLocation Loc) {
assert(IsExtended && "Expected extended clause.");
*std::next(getTrailingObjects<SourceLocation>(), 1) = Loc;
@ -2085,13 +2160,13 @@ class OMPUpdateClause final
return const_child_range(const_child_iterator(), const_child_iterator());
}
/// Gets the the location of '(' in clause for 'depobj' directive.
/// Gets the location of '(' in clause for 'depobj' directive.
SourceLocation getLParenLoc() const {
assert(IsExtended && "Expected extended clause.");
return *getTrailingObjects<SourceLocation>();
}
/// Gets the the location of argument in clause for 'depobj' directive.
/// Gets the location of argument in clause for 'depobj' directive.
SourceLocation getArgumentLoc() const {
assert(IsExtended && "Expected extended clause.");
return *std::next(getTrailingObjects<SourceLocation>(), 1);
@ -5606,7 +5681,8 @@ class OMPMapClause final : public OMPMappableExprListClause<OMPMapClause>,
/// Map-type-modifiers for the 'map' clause.
OpenMPMapModifierKind MapTypeModifiers[NumberOfOMPMapClauseModifiers] = {
OMPC_MAP_MODIFIER_unknown, OMPC_MAP_MODIFIER_unknown,
OMPC_MAP_MODIFIER_unknown, OMPC_MAP_MODIFIER_unknown};
OMPC_MAP_MODIFIER_unknown, OMPC_MAP_MODIFIER_unknown,
OMPC_MAP_MODIFIER_unknown};
/// Location of map-type-modifiers for the 'map' clause.
SourceLocation MapTypeModifiersLoc[NumberOfOMPMapClauseModifiers];
@ -8404,6 +8480,96 @@ class OMPFilterClause final : public OMPClause, public OMPClauseWithPreInit {
}
};
/// This represents 'bind' clause in the '#pragma omp ...' directives.
///
/// \code
/// #pragma omp loop bind(parallel)
/// \endcode
class OMPBindClause final : public OMPClause {
friend class OMPClauseReader;
/// Location of '('.
SourceLocation LParenLoc;
/// The binding kind of 'bind' clause.
OpenMPBindClauseKind Kind = OMPC_BIND_unknown;
/// Start location of the kind in source code.
SourceLocation KindLoc;
/// Sets the location of '('.
void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
/// Set the binding kind.
void setBindKind(OpenMPBindClauseKind K) { Kind = K; }
/// Set the binding kind location.
void setBindKindLoc(SourceLocation KLoc) { KindLoc = KLoc; }
/// Build 'bind' clause with kind \a K ('teams', 'parallel', or 'thread').
///
/// \param K Binding kind of the clause ('teams', 'parallel' or 'thread').
/// \param KLoc Starting location of the binding kind.
/// \param StartLoc Starting location of the clause.
/// \param LParenLoc Location of '('.
/// \param EndLoc Ending location of the clause.
OMPBindClause(OpenMPBindClauseKind K, SourceLocation KLoc,
SourceLocation StartLoc, SourceLocation LParenLoc,
SourceLocation EndLoc)
: OMPClause(llvm::omp::OMPC_bind, StartLoc, EndLoc), LParenLoc(LParenLoc),
Kind(K), KindLoc(KLoc) {}
/// Build an empty clause.
OMPBindClause()
: OMPClause(llvm::omp::OMPC_bind, SourceLocation(), SourceLocation()) {}
public:
/// Build 'bind' clause with kind \a K ('teams', 'parallel', or 'thread').
///
/// \param C AST context
/// \param K Binding kind of the clause ('teams', 'parallel' or 'thread').
/// \param KLoc Starting location of the binding kind.
/// \param StartLoc Starting location of the clause.
/// \param LParenLoc Location of '('.
/// \param EndLoc Ending location of the clause.
static OMPBindClause *Create(const ASTContext &C, OpenMPBindClauseKind K,
SourceLocation KLoc, SourceLocation StartLoc,
SourceLocation LParenLoc, SourceLocation EndLoc);
/// Build an empty 'bind' clause.
///
/// \param C AST context
static OMPBindClause *CreateEmpty(const ASTContext &C);
/// Returns the location of '('.
SourceLocation getLParenLoc() const { return LParenLoc; }
/// Returns kind of the clause.
OpenMPBindClauseKind getBindKind() const { return Kind; }
/// Returns location of clause kind.
SourceLocation getBindKindLoc() const { return KindLoc; }
child_range children() {
return child_range(child_iterator(), child_iterator());
}
const_child_range children() const {
return const_child_range(const_child_iterator(), const_child_iterator());
}
child_range used_children() {
return child_range(child_iterator(), child_iterator());
}
const_child_range used_children() const {
return const_child_range(const_child_iterator(), const_child_iterator());
}
static bool classof(const OMPClause *T) {
return T->getClauseKind() == llvm::omp::OMPC_bind;
}
};
/// This class implements a simple visitor for OMPClause
/// subclasses.
template<class ImplClass, template <typename> class Ptr, typename RetTy>
@ -8546,10 +8712,11 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const OMPTraitInfo *TI);
/// Clang specific specialization of the OMPContext to lookup target features.
struct TargetOMPContext final : public llvm::omp::OMPContext {
TargetOMPContext(ASTContext &ASTCtx,
std::function<void(StringRef)> &&DiagUnknownTrait,
const FunctionDecl *CurrentFunctionDecl);
const FunctionDecl *CurrentFunctionDecl,
ArrayRef<llvm::omp::TraitProperty> ConstructTraits);
virtual ~TargetOMPContext() = default;
/// See llvm::omp::OMPContext::matchesISATrait

View File

@ -74,7 +74,8 @@ struct PrintingPolicy {
MSWChar(LO.MicrosoftExt && !LO.WChar), IncludeNewlines(true),
MSVCFormatting(false), ConstantsAsWritten(false),
SuppressImplicitBase(false), FullyQualifiedName(false),
PrintCanonicalTypes(false), PrintInjectedClassNameWithArguments(true) {}
PrintCanonicalTypes(false), PrintInjectedClassNameWithArguments(true),
UsePreferredNames(true), AlwaysIncludeTypeForTemplateArgument(false) {}
/// Adjust this printing policy for cases where it's known that we're
/// printing C++ code (for instance, if AST dumping reaches a C++-only
@ -273,6 +274,14 @@ struct PrintingPolicy {
/// invalid C++ code.
unsigned PrintInjectedClassNameWithArguments : 1;
/// Whether to use C++ template preferred_name attributes when printing
/// templates.
unsigned UsePreferredNames : 1;
/// Whether to use type suffixes (eg: 1U) on integral non-type template
/// parameters.
unsigned AlwaysIncludeTypeForTemplateArgument : 1;
/// Callbacks to use to allow the behavior of printing to be customized.
const PrintingCallbacks *Callbacks = nullptr;
};

View File

@ -1681,10 +1681,7 @@ bool RecursiveASTVisitor<Derived>::TraverseTemplateInstantiations(
ClassTemplateDecl *D) {
for (auto *SD : D->specializations()) {
for (auto *RD : SD->redecls()) {
// We don't want to visit injected-class-names in this traversal.
if (cast<CXXRecordDecl>(RD)->isInjectedClassName())
continue;
assert(!cast<CXXRecordDecl>(RD)->isInjectedClassName());
switch (
cast<ClassTemplateSpecializationDecl>(RD)->getSpecializationKind()) {
// Visit the implicit instantiations with the requested pattern.
@ -1863,10 +1860,9 @@ DEF_TRAVERSE_DECL(UnresolvedUsingIfExistsDecl, {})
DEF_TRAVERSE_DECL(EnumDecl, {
TRY_TO(TraverseDeclTemplateParameterLists(D));
if (D->getTypeForDecl())
TRY_TO(TraverseType(QualType(D->getTypeForDecl(), 0)));
TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
if (auto *TSI = D->getIntegerTypeSourceInfo())
TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
// The enumerators are already traversed by
// decls_begin()/decls_end().
})
@ -2842,6 +2838,9 @@ RecursiveASTVisitor<Derived>::TraverseOMPLoopDirective(OMPLoopDirective *S) {
return TraverseOMPExecutableDirective(S);
}
DEF_TRAVERSE_STMT(OMPMetaDirective,
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
DEF_TRAVERSE_STMT(OMPParallelDirective,
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
@ -3021,6 +3020,9 @@ DEF_TRAVERSE_STMT(OMPDispatchDirective,
DEF_TRAVERSE_STMT(OMPMaskedDirective,
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
DEF_TRAVERSE_STMT(OMPGenericLoopDirective,
{ TRY_TO(TraverseOMPExecutableDirective(S)); })
// OpenMP clauses.
template <typename Derived>
bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) {
@ -3091,6 +3093,12 @@ RecursiveASTVisitor<Derived>::VisitOMPNumThreadsClause(OMPNumThreadsClause *C) {
return true;
}
template <typename Derived>
bool RecursiveASTVisitor<Derived>::VisitOMPAlignClause(OMPAlignClause *C) {
TRY_TO(TraverseStmt(C->getAlignment()));
return true;
}
template <typename Derived>
bool RecursiveASTVisitor<Derived>::VisitOMPSafelenClause(OMPSafelenClause *C) {
TRY_TO(TraverseStmt(C->getSafelen()));
@ -3674,6 +3682,11 @@ bool RecursiveASTVisitor<Derived>::VisitOMPFilterClause(OMPFilterClause *C) {
return true;
}
template <typename Derived>
bool RecursiveASTVisitor<Derived>::VisitOMPBindClause(OMPBindClause *C) {
return true;
}
// FIXME: look at the following tricky-seeming exprs to see if we
// need to recurse on anything. These are ones that have methods
// returning decls or qualtypes or nestednamespecifier -- though I'm

View File

@ -20,6 +20,7 @@
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/ADT/PointerIntPair.h"
@ -160,8 +161,8 @@ class alignas(void *) Stmt {
unsigned : NumStmtBits;
/// True if this if statement is a constexpr if.
unsigned IsConstexpr : 1;
/// Whether this is a constexpr if, or a consteval if, or neither.
unsigned Kind : 3;
/// True if this if statement has storage for an else statement.
unsigned HasElse : 1;
@ -1215,6 +1216,11 @@ class alignas(void *) Stmt {
const PrintingPolicy &Policy, unsigned Indentation = 0,
StringRef NewlineSymbol = "\n",
const ASTContext *Context = nullptr) const;
void printPrettyControlled(raw_ostream &OS, PrinterHelper *Helper,
const PrintingPolicy &Policy,
unsigned Indentation = 0,
StringRef NewlineSymbol = "\n",
const ASTContext *Context = nullptr) const;
/// Pretty-prints in JSON format.
void printJson(raw_ostream &Out, PrinterHelper *Helper,
@ -1950,8 +1956,8 @@ class IfStmt final
unsigned elseOffset() const { return condOffset() + ElseOffsetFromCond; }
/// Build an if/then/else statement.
IfStmt(const ASTContext &Ctx, SourceLocation IL, bool IsConstexpr, Stmt *Init,
VarDecl *Var, Expr *Cond, SourceLocation LParenLoc,
IfStmt(const ASTContext &Ctx, SourceLocation IL, IfStatementKind Kind,
Stmt *Init, VarDecl *Var, Expr *Cond, SourceLocation LParenLoc,
SourceLocation RParenLoc, Stmt *Then, SourceLocation EL, Stmt *Else);
/// Build an empty if/then/else statement.
@ -1960,9 +1966,9 @@ class IfStmt final
public:
/// Create an IfStmt.
static IfStmt *Create(const ASTContext &Ctx, SourceLocation IL,
bool IsConstexpr, Stmt *Init, VarDecl *Var, Expr *Cond,
SourceLocation LPL, SourceLocation RPL, Stmt *Then,
SourceLocation EL = SourceLocation(),
IfStatementKind Kind, Stmt *Init, VarDecl *Var,
Expr *Cond, SourceLocation LPL, SourceLocation RPL,
Stmt *Then, SourceLocation EL = SourceLocation(),
Stmt *Else = nullptr);
/// Create an empty IfStmt optionally with storage for an else statement,
@ -2077,8 +2083,30 @@ class IfStmt final
*getTrailingObjects<SourceLocation>() = ElseLoc;
}
bool isConstexpr() const { return IfStmtBits.IsConstexpr; }
void setConstexpr(bool C) { IfStmtBits.IsConstexpr = C; }
bool isConsteval() const {
return getStatementKind() == IfStatementKind::ConstevalNonNegated ||
getStatementKind() == IfStatementKind::ConstevalNegated;
}
bool isNonNegatedConsteval() const {
return getStatementKind() == IfStatementKind::ConstevalNonNegated;
}
bool isNegatedConsteval() const {
return getStatementKind() == IfStatementKind::ConstevalNegated;
}
bool isConstexpr() const {
return getStatementKind() == IfStatementKind::Constexpr;
}
void setStatementKind(IfStatementKind Kind) {
IfStmtBits.Kind = static_cast<unsigned>(Kind);
}
IfStatementKind getStatementKind() const {
return static_cast<IfStatementKind>(IfStmtBits.Kind);
}
/// If this is an 'if constexpr', determine which substatement will be taken.
/// Otherwise, or if the condition is value-dependent, returns None.
@ -2101,13 +2129,19 @@ class IfStmt final
// Iterators over subexpressions. The iterators will include iterating
// over the initialization expression referenced by the condition variable.
child_range children() {
return child_range(getTrailingObjects<Stmt *>(),
// We always store a condition, but there is none for consteval if
// statements, so skip it.
return child_range(getTrailingObjects<Stmt *>() +
(isConsteval() ? thenOffset() : 0),
getTrailingObjects<Stmt *>() +
numTrailingObjects(OverloadToken<Stmt *>()));
}
const_child_range children() const {
return const_child_range(getTrailingObjects<Stmt *>(),
// We always store a condition, but there is none for consteval if
// statements, so skip it.
return const_child_range(getTrailingObjects<Stmt *>() +
(isConsteval() ? thenOffset() : 0),
getTrailingObjects<Stmt *>() +
numTrailingObjects(OverloadToken<Stmt *>()));
}

View File

@ -162,8 +162,14 @@ class ObjCAtFinallyStmt : public Stmt {
};
/// Represents Objective-C's \@try ... \@catch ... \@finally statement.
class ObjCAtTryStmt : public Stmt {
private:
class ObjCAtTryStmt final
: public Stmt,
private llvm::TrailingObjects<ObjCAtTryStmt, Stmt *> {
friend TrailingObjects;
size_t numTrailingObjects(OverloadToken<Stmt *>) const {
return 1 + NumCatchStmts + HasFinally;
}
// The location of the @ in the \@try.
SourceLocation AtTryLoc;
@ -178,10 +184,8 @@ class ObjCAtTryStmt : public Stmt {
/// The order of the statements in memory follows the order in the source,
/// with the \@try body first, followed by the \@catch statements (if any)
/// and, finally, the \@finally (if it exists).
Stmt **getStmts() { return reinterpret_cast<Stmt **> (this + 1); }
const Stmt* const *getStmts() const {
return reinterpret_cast<const Stmt * const*> (this + 1);
}
Stmt **getStmts() { return getTrailingObjects<Stmt *>(); }
Stmt *const *getStmts() const { return getTrailingObjects<Stmt *>(); }
ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
Stmt **CatchStmts, unsigned NumCatchStmts,
@ -257,13 +261,34 @@ class ObjCAtTryStmt : public Stmt {
}
child_range children() {
return child_range(getStmts(),
getStmts() + 1 + NumCatchStmts + HasFinally);
return child_range(
getStmts(), getStmts() + numTrailingObjects(OverloadToken<Stmt *>()));
}
const_child_range children() const {
return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children());
}
using catch_stmt_iterator = CastIterator<ObjCAtCatchStmt>;
using const_catch_stmt_iterator = ConstCastIterator<ObjCAtCatchStmt>;
using catch_range = llvm::iterator_range<catch_stmt_iterator>;
using catch_const_range = llvm::iterator_range<const_catch_stmt_iterator>;
catch_stmt_iterator catch_stmts_begin() { return getStmts() + 1; }
catch_stmt_iterator catch_stmts_end() {
return catch_stmts_begin() + NumCatchStmts;
}
catch_range catch_stmts() {
return catch_range(catch_stmts_begin(), catch_stmts_end());
}
const_catch_stmt_iterator catch_stmts_begin() const { return getStmts() + 1; }
const_catch_stmt_iterator catch_stmts_end() const {
return catch_stmts_begin() + NumCatchStmts;
}
catch_const_range catch_stmts() const {
return catch_const_range(catch_stmts_begin(), catch_stmts_end());
}
};
/// Represents Objective-C's \@synchronized statement.

View File

@ -889,22 +889,23 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
/// Calls the specified callback function for all the loops in \p CurStmt,
/// from the outermost to the innermost.
static bool doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
unsigned NumLoops,
llvm::function_ref<bool(unsigned, Stmt *)> Callback,
llvm::function_ref<void(OMPLoopBasedDirective *)>
OnTransformationCallback);
static bool
doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
unsigned NumLoops,
llvm::function_ref<bool(unsigned, Stmt *)> Callback,
llvm::function_ref<void(OMPLoopTransformationDirective *)>
OnTransformationCallback);
static bool
doForAllLoops(const Stmt *CurStmt, bool TryImperfectlyNestedLoops,
unsigned NumLoops,
llvm::function_ref<bool(unsigned, const Stmt *)> Callback,
llvm::function_ref<void(const OMPLoopBasedDirective *)>
llvm::function_ref<void(const OMPLoopTransformationDirective *)>
OnTransformationCallback) {
auto &&NewCallback = [Callback](unsigned Cnt, Stmt *CurStmt) {
return Callback(Cnt, CurStmt);
};
auto &&NewTransformCb =
[OnTransformationCallback](OMPLoopBasedDirective *A) {
[OnTransformationCallback](OMPLoopTransformationDirective *A) {
OnTransformationCallback(A);
};
return doForAllLoops(const_cast<Stmt *>(CurStmt), TryImperfectlyNestedLoops,
@ -917,7 +918,7 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
doForAllLoops(Stmt *CurStmt, bool TryImperfectlyNestedLoops,
unsigned NumLoops,
llvm::function_ref<bool(unsigned, Stmt *)> Callback) {
auto &&TransformCb = [](OMPLoopBasedDirective *) {};
auto &&TransformCb = [](OMPLoopTransformationDirective *) {};
return doForAllLoops(CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
TransformCb);
}
@ -954,6 +955,47 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
}
};
/// The base class for all loop transformation directives.
class OMPLoopTransformationDirective : public OMPLoopBasedDirective {
friend class ASTStmtReader;
/// Number of loops generated by this loop transformation.
unsigned NumGeneratedLoops = 0;
protected:
explicit OMPLoopTransformationDirective(StmtClass SC,
OpenMPDirectiveKind Kind,
SourceLocation StartLoc,
SourceLocation EndLoc,
unsigned NumAssociatedLoops)
: OMPLoopBasedDirective(SC, Kind, StartLoc, EndLoc, NumAssociatedLoops) {}
/// Set the number of loops generated by this loop transformation.
void setNumGeneratedLoops(unsigned Num) { NumGeneratedLoops = Num; }
public:
/// Return the number of associated (consumed) loops.
unsigned getNumAssociatedLoops() const { return getLoopsNumber(); }
/// Return the number of loops generated by this loop transformation.
unsigned getNumGeneratedLoops() { return NumGeneratedLoops; }
/// Get the de-sugared statements after after the loop transformation.
///
/// Might be nullptr if either the directive generates no loops and is handled
/// directly in CodeGen, or resolving a template-dependence context is
/// required.
Stmt *getTransformedStmt() const;
/// Return preinits statement.
Stmt *getPreInits() const;
static bool classof(const Stmt *T) {
return T->getStmtClass() == OMPTileDirectiveClass ||
T->getStmtClass() == OMPUnrollDirectiveClass;
}
};
/// This is a common base class for loop directives ('omp simd', 'omp
/// for', 'omp for simd' etc.). It is responsible for the loop code generation.
///
@ -1102,7 +1144,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
if (isOpenMPLoopBoundSharingDirective(Kind))
return CombinedDistributeEnd;
if (isOpenMPWorksharingDirective(Kind) || isOpenMPTaskLoopDirective(Kind) ||
isOpenMPDistributeDirective(Kind))
isOpenMPGenericLoopDirective(Kind) || isOpenMPDistributeDirective(Kind))
return WorksharingEnd;
return DefaultEnd;
}
@ -1134,6 +1176,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setIsLastIterVariable(Expr *IL) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1141,6 +1184,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setLowerBoundVariable(Expr *LB) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1148,6 +1192,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setUpperBoundVariable(Expr *UB) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1155,6 +1200,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setStrideVariable(Expr *ST) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1162,6 +1208,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setEnsureUpperBound(Expr *EUB) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1169,6 +1216,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setNextLowerBound(Expr *NLB) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1176,6 +1224,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setNextUpperBound(Expr *NUB) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1183,6 +1232,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
void setNumIterations(Expr *NI) {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1285,6 +1335,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
Stmt *getPreInits() { return Data->getChildren()[PreInitsOffset]; }
Expr *getIsLastIterVariable() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1292,6 +1343,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getLowerBoundVariable() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1299,6 +1351,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getUpperBoundVariable() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1306,6 +1359,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getStrideVariable() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1313,6 +1367,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getEnsureUpperBound() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1320,6 +1375,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getNextLowerBound() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1327,6 +1383,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getNextUpperBound() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1334,6 +1391,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
}
Expr *getNumIterations() const {
assert((isOpenMPWorksharingDirective(getDirectiveKind()) ||
isOpenMPGenericLoopDirective(getDirectiveKind()) ||
isOpenMPTaskLoopDirective(getDirectiveKind()) ||
isOpenMPDistributeDirective(getDirectiveKind())) &&
"expected worksharing loop directive");
@ -1467,6 +1525,7 @@ class OMPLoopDirective : public OMPLoopBasedDirective {
T->getStmtClass() == OMPTaskLoopSimdDirectiveClass ||
T->getStmtClass() == OMPMasterTaskLoopDirectiveClass ||
T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass ||
T->getStmtClass() == OMPGenericLoopDirectiveClass ||
T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass ||
T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass ||
T->getStmtClass() == OMPDistributeDirectiveClass ||
@ -2510,15 +2569,20 @@ class OMPTaskwaitDirective : public OMPExecutableDirective {
/// \param C AST context.
/// \param StartLoc Starting location of the directive kind.
/// \param EndLoc Ending Location of the directive.
/// \param Clauses List of clauses.
///
static OMPTaskwaitDirective *
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc);
static OMPTaskwaitDirective *Create(const ASTContext &C,
SourceLocation StartLoc,
SourceLocation EndLoc,
ArrayRef<OMPClause *> Clauses);
/// Creates an empty directive.
///
/// \param C AST context.
/// \param NumClauses Number of clauses.
///
static OMPTaskwaitDirective *CreateEmpty(const ASTContext &C, EmptyShell);
static OMPTaskwaitDirective *CreateEmpty(const ASTContext &C,
unsigned NumClauses, EmptyShell);
static bool classof(const Stmt *T) {
return T->getStmtClass() == OMPTaskwaitDirectiveClass;
@ -2794,16 +2858,25 @@ class OMPAtomicDirective : public OMPExecutableDirective {
: OMPExecutableDirective(OMPAtomicDirectiveClass, llvm::omp::OMPD_atomic,
SourceLocation(), SourceLocation()) {}
enum DataPositionTy : size_t {
POS_X = 0,
POS_V,
POS_E,
POS_UpdateExpr,
};
/// Set 'x' part of the associated expression/statement.
void setX(Expr *X) { Data->getChildren()[0] = X; }
void setX(Expr *X) { Data->getChildren()[DataPositionTy::POS_X] = X; }
/// Set helper expression of the form
/// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
/// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
void setUpdateExpr(Expr *UE) { Data->getChildren()[1] = UE; }
void setUpdateExpr(Expr *UE) {
Data->getChildren()[DataPositionTy::POS_UpdateExpr] = UE;
}
/// Set 'v' part of the associated expression/statement.
void setV(Expr *V) { Data->getChildren()[2] = V; }
void setV(Expr *V) { Data->getChildren()[DataPositionTy::POS_V] = V; }
/// Set 'expr' part of the associated expression/statement.
void setExpr(Expr *E) { Data->getChildren()[3] = E; }
void setExpr(Expr *E) { Data->getChildren()[DataPositionTy::POS_E] = E; }
public:
/// Creates directive with a list of \a Clauses and 'x', 'v' and 'expr'
@ -2840,16 +2913,22 @@ class OMPAtomicDirective : public OMPExecutableDirective {
unsigned NumClauses, EmptyShell);
/// Get 'x' part of the associated expression/statement.
Expr *getX() { return cast_or_null<Expr>(Data->getChildren()[0]); }
Expr *getX() {
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
}
const Expr *getX() const {
return cast_or_null<Expr>(Data->getChildren()[0]);
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_X]);
}
/// Get helper expression of the form
/// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or
/// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'.
Expr *getUpdateExpr() { return cast_or_null<Expr>(Data->getChildren()[1]); }
Expr *getUpdateExpr() {
return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
}
const Expr *getUpdateExpr() const {
return cast_or_null<Expr>(Data->getChildren()[1]);
return cast_or_null<Expr>(
Data->getChildren()[DataPositionTy::POS_UpdateExpr]);
}
/// Return true if helper update expression has form
/// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form
@ -2859,14 +2938,18 @@ class OMPAtomicDirective : public OMPExecutableDirective {
/// 'x', false if 'v' must be updated to the new value of 'x'.
bool isPostfixUpdate() const { return IsPostfixUpdate; }
/// Get 'v' part of the associated expression/statement.
Expr *getV() { return cast_or_null<Expr>(Data->getChildren()[2]); }
Expr *getV() {
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
}
const Expr *getV() const {
return cast_or_null<Expr>(Data->getChildren()[2]);
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_V]);
}
/// Get 'expr' part of the associated expression/statement.
Expr *getExpr() { return cast_or_null<Expr>(Data->getChildren()[3]); }
Expr *getExpr() {
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
}
const Expr *getExpr() const {
return cast_or_null<Expr>(Data->getChildren()[3]);
return cast_or_null<Expr>(Data->getChildren()[DataPositionTy::POS_E]);
}
static bool classof(const Stmt *T) {
@ -4992,7 +5075,7 @@ class OMPTargetTeamsDistributeSimdDirective final : public OMPLoopDirective {
};
/// This represents the '#pragma omp tile' loop transformation directive.
class OMPTileDirective final : public OMPLoopBasedDirective {
class OMPTileDirective final : public OMPLoopTransformationDirective {
friend class ASTStmtReader;
friend class OMPExecutableDirective;
@ -5004,8 +5087,11 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
explicit OMPTileDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned NumLoops)
: OMPLoopBasedDirective(OMPTileDirectiveClass, llvm::omp::OMPD_tile,
StartLoc, EndLoc, NumLoops) {}
: OMPLoopTransformationDirective(OMPTileDirectiveClass,
llvm::omp::OMPD_tile, StartLoc, EndLoc,
NumLoops) {
setNumGeneratedLoops(3 * NumLoops);
}
void setPreInits(Stmt *PreInits) {
Data->getChildren()[PreInitsOffset] = PreInits;
@ -5042,8 +5128,6 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
static OMPTileDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
unsigned NumLoops);
unsigned getNumAssociatedLoops() const { return getLoopsNumber(); }
/// Gets/sets the associated loops after tiling.
///
/// This is in de-sugared format stored as a CompoundStmt.
@ -5073,7 +5157,7 @@ class OMPTileDirective final : public OMPLoopBasedDirective {
/// #pragma omp unroll
/// for (int i = 0; i < 64; ++i)
/// \endcode
class OMPUnrollDirective final : public OMPLoopBasedDirective {
class OMPUnrollDirective final : public OMPLoopTransformationDirective {
friend class ASTStmtReader;
friend class OMPExecutableDirective;
@ -5084,8 +5168,9 @@ class OMPUnrollDirective final : public OMPLoopBasedDirective {
};
explicit OMPUnrollDirective(SourceLocation StartLoc, SourceLocation EndLoc)
: OMPLoopBasedDirective(OMPUnrollDirectiveClass, llvm::omp::OMPD_unroll,
StartLoc, EndLoc, 1) {}
: OMPLoopTransformationDirective(OMPUnrollDirectiveClass,
llvm::omp::OMPD_unroll, StartLoc, EndLoc,
1) {}
/// Set the pre-init statements.
void setPreInits(Stmt *PreInits) {
@ -5111,7 +5196,7 @@ class OMPUnrollDirective final : public OMPLoopBasedDirective {
static OMPUnrollDirective *
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
ArrayRef<OMPClause *> Clauses, Stmt *AssociatedStmt,
Stmt *TransformedStmt, Stmt *PreInits);
unsigned NumGeneratedLoops, Stmt *TransformedStmt, Stmt *PreInits);
/// Build an empty '#pragma omp unroll' AST node for deserialization.
///
@ -5360,6 +5445,107 @@ class OMPMaskedDirective final : public OMPExecutableDirective {
}
};
/// This represents '#pragma omp metadirective' directive.
///
/// \code
/// #pragma omp metadirective when(user={condition(N>10)}: parallel for)
/// \endcode
/// In this example directive '#pragma omp metadirective' has clauses 'when'
/// with a dynamic user condition to check if a variable 'N > 10'
///
class OMPMetaDirective final : public OMPExecutableDirective {
friend class ASTStmtReader;
friend class OMPExecutableDirective;
Stmt *IfStmt;
OMPMetaDirective(SourceLocation StartLoc, SourceLocation EndLoc)
: OMPExecutableDirective(OMPMetaDirectiveClass,
llvm::omp::OMPD_metadirective, StartLoc,
EndLoc) {}
explicit OMPMetaDirective()
: OMPExecutableDirective(OMPMetaDirectiveClass,
llvm::omp::OMPD_metadirective, SourceLocation(),
SourceLocation()) {}
void setIfStmt(Stmt *S) { IfStmt = S; }
public:
static OMPMetaDirective *Create(const ASTContext &C, SourceLocation StartLoc,
SourceLocation EndLoc,
ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt, Stmt *IfStmt);
static OMPMetaDirective *CreateEmpty(const ASTContext &C, unsigned NumClauses,
EmptyShell);
Stmt *getIfStmt() const { return IfStmt; }
static bool classof(const Stmt *T) {
return T->getStmtClass() == OMPMetaDirectiveClass;
}
};
/// This represents '#pragma omp loop' directive.
///
/// \code
/// #pragma omp loop private(a,b) binding(parallel) order(concurrent)
/// \endcode
/// In this example directive '#pragma omp loop' has
/// clauses 'private' with the variables 'a' and 'b', 'binding' with
/// modifier 'parallel' and 'order(concurrent).
///
class OMPGenericLoopDirective final : public OMPLoopDirective {
friend class ASTStmtReader;
friend class OMPExecutableDirective;
/// Build directive with the given start and end location.
///
/// \param StartLoc Starting location of the directive kind.
/// \param EndLoc Ending location of the directive.
/// \param CollapsedNum Number of collapsed nested loops.
///
OMPGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned CollapsedNum)
: OMPLoopDirective(OMPGenericLoopDirectiveClass, llvm::omp::OMPD_loop,
StartLoc, EndLoc, CollapsedNum) {}
/// Build an empty directive.
///
/// \param CollapsedNum Number of collapsed nested loops.
///
explicit OMPGenericLoopDirective(unsigned CollapsedNum)
: OMPLoopDirective(OMPGenericLoopDirectiveClass, llvm::omp::OMPD_loop,
SourceLocation(), SourceLocation(), CollapsedNum) {}
public:
/// Creates directive with a list of \p Clauses.
///
/// \param C AST context.
/// \param StartLoc Starting location of the directive kind.
/// \param EndLoc Ending Location of the directive.
/// \param CollapsedNum Number of collapsed loops.
/// \param Clauses List of clauses.
/// \param AssociatedStmt Statement, associated with the directive.
/// \param Exprs Helper expressions for CodeGen.
///
static OMPGenericLoopDirective *
Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc,
unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses,
Stmt *AssociatedStmt, const HelperExprs &Exprs);
/// Creates an empty directive with a place for \a NumClauses clauses.
///
/// \param C AST context.
/// \param NumClauses Number of clauses.
/// \param CollapsedNum Number of collapsed nested loops.
///
static OMPGenericLoopDirective *CreateEmpty(const ASTContext &C,
unsigned NumClauses,
unsigned CollapsedNum,
EmptyShell);
static bool classof(const Stmt *T) {
return T->getStmtClass() == OMPGenericLoopDirectiveClass;
}
};
} // end namespace clang
#endif

View File

@ -309,16 +309,17 @@ class TemplateName {
/// unexpanded parameter pack (for C++0x variadic templates).
bool containsUnexpandedParameterPack() const;
enum class Qualified { None, AsWritten, Fully };
/// Print the template name.
///
/// \param OS the output stream to which the template name will be
/// printed.
///
/// \param SuppressNNS if true, don't print the
/// nested-name-specifier that precedes the template name (if it has
/// one).
/// \param Qual print the (Qualified::None) simple name,
/// (Qualified::AsWritten) any written (possibly partial) qualifier, or
/// (Qualified::Fully) the fully qualified name.
void print(raw_ostream &OS, const PrintingPolicy &Policy,
bool SuppressNNS = false) const;
Qualified Qual = Qualified::AsWritten) const;
/// Debugging aid that dumps the template name.
void dump(raw_ostream &OS) const;

View File

@ -495,7 +495,12 @@ class Qualifiers {
(A == LangAS::Default &&
(B == LangAS::sycl_private || B == LangAS::sycl_local ||
B == LangAS::sycl_global || B == LangAS::sycl_global_device ||
B == LangAS::sycl_global_host));
B == LangAS::sycl_global_host)) ||
// In HIP device compilation, any cuda address space is allowed
// to implicitly cast into the default address space.
(A == LangAS::Default &&
(B == LangAS::cuda_constant || B == LangAS::cuda_device ||
B == LangAS::cuda_shared));
}
/// Returns true if the address space in these qualifiers is equal to or
@ -1998,6 +2003,7 @@ class alignas(8) Type : public ExtQualsTypeCommonBase {
bool isFloat16Type() const; // C11 extension ISO/IEC TS 18661
bool isBFloat16Type() const;
bool isFloat128Type() const;
bool isIbm128Type() const;
bool isRealType() const; // C99 6.2.5p17 (real floating + integer)
bool isArithmeticType() const; // C99 6.2.5p18 (integer + floating)
bool isVoidType() const; // C99 6.2.5p19
@ -2545,7 +2551,7 @@ class BuiltinType : public Type {
}
bool isFloatingPoint() const {
return getKind() >= Half && getKind() <= Float128;
return getKind() >= Half && getKind() <= Ibm128;
}
/// Determines whether the given kind corresponds to a placeholder type.
@ -3450,10 +3456,6 @@ class ConstantMatrixType final : public MatrixType {
protected:
friend class ASTContext;
/// The element type of the matrix.
// FIXME: Appears to be unused? There is also MatrixType::ElementType...
QualType ElementType;
/// Number of rows and columns.
unsigned NumRows;
unsigned NumColumns;
@ -3523,14 +3525,10 @@ class DependentSizedMatrixType final : public MatrixType {
Expr *ColumnExpr, SourceLocation loc);
public:
QualType getElementType() const { return ElementType; }
Expr *getRowExpr() const { return RowExpr; }
Expr *getColumnExpr() const { return ColumnExpr; }
SourceLocation getAttributeLoc() const { return loc; }
bool isSugared() const { return false; }
QualType desugar() const { return QualType(this, 0); }
static bool classof(const Type *T) {
return T->getTypeClass() == DependentSizedMatrix;
}
@ -4946,29 +4944,29 @@ class SubstTemplateTypeParmPackType : public Type, public llvm::FoldingSetNode {
/// type-dependent, there is no deduced type and the type is canonical. In
/// the latter case, it is also a dependent type.
class DeducedType : public Type {
QualType DeducedAsType;
protected:
DeducedType(TypeClass TC, QualType DeducedAsType,
TypeDependence ExtraDependence)
: Type(TC,
// FIXME: Retain the sugared deduced type?
DeducedAsType.isNull() ? QualType(this, 0)
: DeducedAsType.getCanonicalType(),
TypeDependence ExtraDependence, QualType Canon)
: Type(TC, Canon,
ExtraDependence | (DeducedAsType.isNull()
? TypeDependence::None
: DeducedAsType->getDependence() &
~TypeDependence::VariablyModified)) {}
~TypeDependence::VariablyModified)),
DeducedAsType(DeducedAsType) {}
public:
bool isSugared() const { return !isCanonicalUnqualified(); }
QualType desugar() const { return getCanonicalTypeInternal(); }
/// Get the type deduced for this placeholder type, or null if it's
/// either not been deduced or was deduced to a dependent type.
QualType getDeducedType() const {
return !isCanonicalUnqualified() ? getCanonicalTypeInternal() : QualType();
bool isSugared() const { return !DeducedAsType.isNull(); }
QualType desugar() const {
return isSugared() ? DeducedAsType : QualType(this, 0);
}
/// Get the type deduced for this placeholder type, or null if it
/// has not been deduced.
QualType getDeducedType() const { return DeducedAsType; }
bool isDeduced() const {
return !isCanonicalUnqualified() || isDependentType();
return !DeducedAsType.isNull() || isDependentType();
}
static bool classof(const Type *T) {
@ -4985,7 +4983,7 @@ class alignas(8) AutoType : public DeducedType, public llvm::FoldingSetNode {
ConceptDecl *TypeConstraintConcept;
AutoType(QualType DeducedAsType, AutoTypeKeyword Keyword,
TypeDependence ExtraDependence, ConceptDecl *CD,
TypeDependence ExtraDependence, QualType Canon, ConceptDecl *CD,
ArrayRef<TemplateArgument> TypeConstraintArgs);
const TemplateArgument *getArgBuffer() const {
@ -5059,7 +5057,9 @@ class DeducedTemplateSpecializationType : public DeducedType,
toTypeDependence(Template.getDependence()) |
(IsDeducedAsDependent
? TypeDependence::DependentInstantiation
: TypeDependence::None)),
: TypeDependence::None),
DeducedAsType.isNull() ? QualType(this, 0)
: DeducedAsType.getCanonicalType()),
Template(Template) {}
public:
@ -6018,10 +6018,9 @@ inline ObjCProtocolDecl **ObjCTypeParamType::getProtocolStorageImpl() {
class ObjCInterfaceType : public ObjCObjectType {
friend class ASTContext; // ASTContext creates these.
friend class ASTReader;
friend class ObjCInterfaceDecl;
template <class T> friend class serialization::AbstractTypeReader;
mutable ObjCInterfaceDecl *Decl;
ObjCInterfaceDecl *Decl;
ObjCInterfaceType(const ObjCInterfaceDecl *D)
: ObjCObjectType(Nonce_ObjCInterface),
@ -6029,7 +6028,7 @@ class ObjCInterfaceType : public ObjCObjectType {
public:
/// Get the declaration of this interface.
ObjCInterfaceDecl *getDecl() const { return Decl; }
ObjCInterfaceDecl *getDecl() const;
bool isSugared() const { return false; }
QualType desugar() const { return QualType(this, 0); }
@ -6976,6 +6975,10 @@ inline bool Type::isFloat128Type() const {
return isSpecificBuiltinType(BuiltinType::Float128);
}
inline bool Type::isIbm128Type() const {
return isSpecificBuiltinType(BuiltinType::Ibm128);
}
inline bool Type::isNullPtrType() const {
return isSpecificBuiltinType(BuiltinType::NullPtr);
}
@ -7144,7 +7147,7 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
/// into a diagnostic with <<.
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &PD,
QualType T) {
PD.AddTaggedVal(reinterpret_cast<intptr_t>(T.getAsOpaquePtr()),
PD.AddTaggedVal(reinterpret_cast<uint64_t>(T.getAsOpaquePtr()),
DiagnosticsEngine::ak_qualtype);
return PD;
}

View File

@ -581,10 +581,9 @@ class BuiltinTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
bool needsExtraLocalData() const {
BuiltinType::Kind bk = getTypePtr()->getKind();
return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128)
|| (bk >= BuiltinType::Short && bk <= BuiltinType::Float128)
|| bk == BuiltinType::UChar
|| bk == BuiltinType::SChar;
return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||
(bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||
bk == BuiltinType::UChar || bk == BuiltinType::SChar;
}
unsigned getExtraLocalDataSize() const {

View File

@ -34,7 +34,6 @@ struct QualTypeOrdering {
}
namespace llvm {
template<class> struct DenseMapInfo;
template<> struct DenseMapInfo<clang::QualType> {
static inline clang::QualType getEmptyKey() { return clang::QualType(); }

View File

@ -167,6 +167,7 @@ class MatchFinder {
MatchCallback *Action);
void addMatcher(const TemplateArgumentLocMatcher &NodeMatch,
MatchCallback *Action);
void addMatcher(const AttrMatcher &NodeMatch, MatchCallback *Action);
/// @}
/// Adds a matcher to execute when running over the AST.
@ -219,6 +220,7 @@ class MatchFinder {
std::vector<std::pair<CXXCtorInitializerMatcher, MatchCallback *>> CtorInit;
std::vector<std::pair<TemplateArgumentLocMatcher, MatchCallback *>>
TemplateArgumentLoc;
std::vector<std::pair<AttrMatcher, MatchCallback *>> Attr;
/// All the callbacks in one container to simplify iteration.
llvm::SmallPtrSet<MatchCallback *, 16> AllCallbacks;
};

View File

@ -148,6 +148,8 @@ using CXXBaseSpecifierMatcher = internal::Matcher<CXXBaseSpecifier>;
using CXXCtorInitializerMatcher = internal::Matcher<CXXCtorInitializer>;
using TemplateArgumentMatcher = internal::Matcher<TemplateArgument>;
using TemplateArgumentLocMatcher = internal::Matcher<TemplateArgumentLoc>;
using LambdaCaptureMatcher = internal::Matcher<LambdaCapture>;
using AttrMatcher = internal::Matcher<Attr>;
/// @}
/// Matches any node.
@ -307,7 +309,7 @@ AST_POLYMORPHIC_MATCHER_REGEX(isExpansionInFileMatching,
/// Matches statements that are (transitively) expanded from the named macro.
/// Does not match if only part of the statement is expanded from that macro or
/// if different parts of the the statement are expanded from different
/// if different parts of the statement are expanded from different
/// appearances of the macro.
AST_POLYMORPHIC_MATCHER_P(isExpandedFromMacro,
AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc),
@ -752,9 +754,11 @@ AST_MATCHER_P(ClassTemplateSpecializationDecl, hasSpecializedTemplate,
InnerMatcher.matches(*Decl, Finder, Builder));
}
/// Matches a declaration that has been implicitly added
/// by the compiler (eg. implicit default/copy constructors).
AST_MATCHER(Decl, isImplicit) {
/// Matches an entity that has been implicitly added by the compiler (e.g.
/// implicit default/copy constructors).
AST_POLYMORPHIC_MATCHER(isImplicit,
AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Attr,
LambdaCapture)) {
return Node.isImplicit();
}
@ -3489,8 +3493,8 @@ internal::Matcher<T> findAll(const internal::Matcher<T> &Matcher) {
/// Usable as: Any Matcher
extern const internal::ArgumentAdaptingMatcherFunc<
internal::HasParentMatcher,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr>,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr>>
hasParent;
/// Matches AST nodes that have an ancestor that matches the provided
@ -3506,8 +3510,8 @@ extern const internal::ArgumentAdaptingMatcherFunc<
/// Usable as: Any Matcher
extern const internal::ArgumentAdaptingMatcherFunc<
internal::HasAncestorMatcher,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr>,
internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, Attr>>
hasAncestor;
/// Matches if the provided matcher does not match.
@ -4201,6 +4205,45 @@ AST_MATCHER_P(
InnerMatcher.matches(*Initializer, Finder, Builder));
}
/// Matches a variable serving as the implicit variable for a lambda init-
/// capture.
///
/// Example matches x (matcher = varDecl(isInitCapture()))
/// \code
/// auto f = [x=3]() { return x; };
/// \endcode
AST_MATCHER(VarDecl, isInitCapture) { return Node.isInitCapture(); }
/// Matches each lambda capture in a lambda expression.
///
/// Given
/// \code
/// int main() {
/// int x, y;
/// float z;
/// auto f = [=]() { return x + y + z; };
/// }
/// \endcode
/// lambdaExpr(forEachLambdaCapture(
/// lambdaCapture(capturesVar(varDecl(hasType(isInteger()))))))
/// will trigger two matches, binding for 'x' and 'y' respectively.
AST_MATCHER_P(LambdaExpr, forEachLambdaCapture, LambdaCaptureMatcher,
InnerMatcher) {
BoundNodesTreeBuilder Result;
bool Matched = false;
for (const auto &Capture : Node.captures()) {
if (Finder->isTraversalIgnoringImplicitNodes() && Capture.isImplicit())
continue;
BoundNodesTreeBuilder CaptureBuilder(*Builder);
if (InnerMatcher.matches(Capture, Finder, &CaptureBuilder)) {
Matched = true;
Result.addMatch(CaptureBuilder);
}
}
*Builder = std::move(Result);
return Matched;
}
/// \brief Matches a static variable with local scope.
///
/// Example matches y (matcher = varDecl(isStaticLocal()))
@ -4586,49 +4629,79 @@ AST_POLYMORPHIC_MATCHER_P(hasAnyArgument,
return false;
}
/// Matches any capture of a lambda expression.
/// Matches lambda captures.
///
/// Given
/// \code
/// int main() {
/// int x;
/// auto f = [x](){};
/// auto g = [x = 1](){};
/// }
/// \endcode
/// In the matcher `lambdaExpr(hasAnyCapture(lambdaCapture()))`,
/// `lambdaCapture()` matches `x` and `x=1`.
extern const internal::VariadicAllOfMatcher<LambdaCapture> lambdaCapture;
/// Matches any capture in a lambda expression.
///
/// Given
/// \code
/// void foo() {
/// int t = 5;
/// auto f = [=](){ return t; };
/// }
/// \endcode
/// lambdaExpr(hasAnyCapture(lambdaCapture())) and
/// lambdaExpr(hasAnyCapture(lambdaCapture(refersToVarDecl(hasName("t")))))
/// both match `[=](){ return t; }`.
AST_MATCHER_P(LambdaExpr, hasAnyCapture, LambdaCaptureMatcher, InnerMatcher) {
for (const LambdaCapture &Capture : Node.captures()) {
clang::ast_matchers::internal::BoundNodesTreeBuilder Result(*Builder);
if (InnerMatcher.matches(Capture, Finder, &Result)) {
*Builder = std::move(Result);
return true;
}
}
return false;
}
/// Matches a `LambdaCapture` that refers to the specified `VarDecl`. The
/// `VarDecl` can be a separate variable that is captured by value or
/// reference, or a synthesized variable if the capture has an initializer.
///
/// Given
/// \code
/// void foo() {
/// int x;
/// auto f = [x](){};
/// auto g = [x = 1](){};
/// }
/// \endcode
/// lambdaExpr(hasAnyCapture(anything()))
/// matches [x](){};
AST_MATCHER_P_OVERLOAD(LambdaExpr, hasAnyCapture, internal::Matcher<VarDecl>,
InnerMatcher, 0) {
for (const LambdaCapture &Capture : Node.captures()) {
if (Capture.capturesVariable()) {
BoundNodesTreeBuilder Result(*Builder);
if (InnerMatcher.matches(*Capture.getCapturedVar(), Finder, &Result)) {
*Builder = std::move(Result);
return true;
}
}
}
return false;
/// In the matcher
/// lambdaExpr(hasAnyCapture(lambdaCapture(capturesVar(hasName("x")))),
/// capturesVar(hasName("x")) matches `x` and `x = 1`.
AST_MATCHER_P(LambdaCapture, capturesVar, internal::Matcher<VarDecl>,
InnerMatcher) {
auto *capturedVar = Node.getCapturedVar();
return capturedVar && InnerMatcher.matches(*capturedVar, Finder, Builder);
}
/// Matches any capture of 'this' in a lambda expression.
/// Matches a `LambdaCapture` that refers to 'this'.
///
/// Given
/// \code
/// struct foo {
/// void bar() {
/// auto f = [this](){};
/// }
/// class C {
/// int cc;
/// int f() {
/// auto l = [this]() { return cc; };
/// return l();
/// }
/// };
/// \endcode
/// lambdaExpr(hasAnyCapture(cxxThisExpr()))
/// matches [this](){};
AST_MATCHER_P_OVERLOAD(LambdaExpr, hasAnyCapture,
internal::Matcher<CXXThisExpr>, InnerMatcher, 1) {
return llvm::any_of(Node.captures(), [](const LambdaCapture &LC) {
return LC.capturesThis();
});
}
/// lambdaExpr(hasAnyCapture(lambdaCapture(capturesThis())))
/// matches `[this]() { return cc; }`.
AST_MATCHER(LambdaCapture, capturesThis) { return Node.capturesThis(); }
/// Matches a constructor call expression which uses list initialization.
AST_MATCHER(CXXConstructExpr, isListInitialization) {
@ -5875,6 +5948,10 @@ AST_MATCHER(CXXMethodDecl, isVirtualAsWritten) {
return Node.isVirtualAsWritten();
}
AST_MATCHER(CXXConstructorDecl, isInheritingConstructor) {
return Node.isInheritingConstructor();
}
/// Matches if the given method or class declaration is final.
///
/// Given:
@ -6333,6 +6410,187 @@ AST_MATCHER_FUNCTION_P_OVERLOAD(internal::BindableMatcher<TypeLoc>, loc,
new internal::TypeLocTypeMatcher(InnerMatcher));
}
/// Matches `QualifiedTypeLoc`s in the clang AST.
///
/// Given
/// \code
/// const int x = 0;
/// \endcode
/// qualifiedTypeLoc()
/// matches `const int`.
extern const internal::VariadicDynCastAllOfMatcher<TypeLoc, QualifiedTypeLoc>
qualifiedTypeLoc;
/// Matches `QualifiedTypeLoc`s that have an unqualified `TypeLoc` matching
/// `InnerMatcher`.
///
/// Given
/// \code
/// int* const x;
/// const int y;
/// \endcode
/// qualifiedTypeLoc(hasUnqualifiedLoc(pointerTypeLoc()))
/// matches the `TypeLoc` of the variable declaration of `x`, but not `y`.
AST_MATCHER_P(QualifiedTypeLoc, hasUnqualifiedLoc, internal::Matcher<TypeLoc>,
InnerMatcher) {
return InnerMatcher.matches(Node.getUnqualifiedLoc(), Finder, Builder);
}
/// Matches a function declared with the specified return `TypeLoc`.
///
/// Given
/// \code
/// int f() { return 5; }
/// void g() {}
/// \endcode
/// functionDecl(hasReturnTypeLoc(loc(asString("int"))))
/// matches the declaration of `f`, but not `g`.
AST_MATCHER_P(FunctionDecl, hasReturnTypeLoc, internal::Matcher<TypeLoc>,
ReturnMatcher) {
auto Loc = Node.getFunctionTypeLoc();
return Loc && ReturnMatcher.matches(Loc.getReturnLoc(), Finder, Builder);
}
/// Matches pointer `TypeLoc`s.
///
/// Given
/// \code
/// int* x;
/// \endcode
/// pointerTypeLoc()
/// matches `int*`.
extern const internal::VariadicDynCastAllOfMatcher<TypeLoc, PointerTypeLoc>
pointerTypeLoc;
/// Matches pointer `TypeLoc`s that have a pointee `TypeLoc` matching
/// `PointeeMatcher`.
///
/// Given
/// \code
/// int* x;
/// \endcode
/// pointerTypeLoc(hasPointeeLoc(loc(asString("int"))))
/// matches `int*`.
AST_MATCHER_P(PointerTypeLoc, hasPointeeLoc, internal::Matcher<TypeLoc>,
PointeeMatcher) {
return PointeeMatcher.matches(Node.getPointeeLoc(), Finder, Builder);
}
/// Matches reference `TypeLoc`s.
///
/// Given
/// \code
/// int x = 3;
/// int& l = x;
/// int&& r = 3;
/// \endcode
/// referenceTypeLoc()
/// matches `int&` and `int&&`.
extern const internal::VariadicDynCastAllOfMatcher<TypeLoc, ReferenceTypeLoc>
referenceTypeLoc;
/// Matches reference `TypeLoc`s that have a referent `TypeLoc` matching
/// `ReferentMatcher`.
///
/// Given
/// \code
/// int x = 3;
/// int& xx = x;
/// \endcode
/// referenceTypeLoc(hasReferentLoc(loc(asString("int"))))
/// matches `int&`.
AST_MATCHER_P(ReferenceTypeLoc, hasReferentLoc, internal::Matcher<TypeLoc>,
ReferentMatcher) {
return ReferentMatcher.matches(Node.getPointeeLoc(), Finder, Builder);
}
/// Matches template specialization `TypeLoc`s.
///
/// Given
/// \code
/// template <typename T> class C {};
/// C<char> var;
/// \endcode
/// varDecl(hasTypeLoc(templateSpecializationTypeLoc(typeLoc())))
/// matches `C<char> var`.
extern const internal::VariadicDynCastAllOfMatcher<
TypeLoc, TemplateSpecializationTypeLoc>
templateSpecializationTypeLoc;
/// Matches template specialization `TypeLoc`s that have at least one
/// `TemplateArgumentLoc` matching the given `InnerMatcher`.
///
/// Given
/// \code
/// template<typename T> class A {};
/// A<int> a;
/// \endcode
/// varDecl(hasTypeLoc(templateSpecializationTypeLoc(hasAnyTemplateArgumentLoc(
/// hasTypeLoc(loc(asString("int")))))))
/// matches `A<int> a`.
AST_MATCHER_P(TemplateSpecializationTypeLoc, hasAnyTemplateArgumentLoc,
internal::Matcher<TemplateArgumentLoc>, InnerMatcher) {
for (unsigned Index = 0, N = Node.getNumArgs(); Index < N; ++Index) {
clang::ast_matchers::internal::BoundNodesTreeBuilder Result(*Builder);
if (InnerMatcher.matches(Node.getArgLoc(Index), Finder, &Result)) {
*Builder = std::move(Result);
return true;
}
}
return false;
}
/// Matches template specialization `TypeLoc`s where the n'th
/// `TemplateArgumentLoc` matches the given `InnerMatcher`.
///
/// Given
/// \code
/// template<typename T, typename U> class A {};
/// A<double, int> b;
/// A<int, double> c;
/// \endcode
/// varDecl(hasTypeLoc(templateSpecializationTypeLoc(hasTemplateArgumentLoc(0,
/// hasTypeLoc(loc(asString("double")))))))
/// matches `A<double, int> b`, but not `A<int, double> c`.
AST_POLYMORPHIC_MATCHER_P2(
hasTemplateArgumentLoc,
AST_POLYMORPHIC_SUPPORTED_TYPES(DeclRefExpr, TemplateSpecializationTypeLoc),
unsigned, Index, internal::Matcher<TemplateArgumentLoc>, InnerMatcher) {
return internal::MatchTemplateArgLocAt(Node, Index, InnerMatcher, Finder,
Builder);
}
/// Matches C or C++ elaborated `TypeLoc`s.
///
/// Given
/// \code
/// struct s {};
/// struct s ss;
/// \endcode
/// elaboratedTypeLoc()
/// matches the `TypeLoc` of the variable declaration of `ss`.
extern const internal::VariadicDynCastAllOfMatcher<TypeLoc, ElaboratedTypeLoc>
elaboratedTypeLoc;
/// Matches elaborated `TypeLoc`s that have a named `TypeLoc` matching
/// `InnerMatcher`.
///
/// Given
/// \code
/// template <typename T>
/// class C {};
/// class C<int> c;
///
/// class D {};
/// class D d;
/// \endcode
/// elaboratedTypeLoc(hasNamedTypeLoc(templateSpecializationTypeLoc()));
/// matches the `TypeLoc` of the variable declaration of `c`, but not `d`.
AST_MATCHER_P(ElaboratedTypeLoc, hasNamedTypeLoc, internal::Matcher<TypeLoc>,
InnerMatcher) {
return InnerMatcher.matches(Node.getNamedTypeLoc(), Finder, Builder);
}
/// Matches type \c bool.
///
/// Given
@ -7133,6 +7391,24 @@ AST_MATCHER_P(NestedNameSpecifier, specifiesNamespace,
return InnerMatcher.matches(*Node.getAsNamespace(), Finder, Builder);
}
/// Matches attributes.
/// Attributes may be attached with a variety of different syntaxes (including
/// keywords, C++11 attributes, GNU ``__attribute``` and MSVC `__declspec``,
/// and ``#pragma``s). They may also be implicit.
///
/// Given
/// \code
/// struct [[nodiscard]] Foo{};
/// void bar(int * __attribute__((nonnull)) );
/// __declspec(noinline) void baz();
///
/// #pragma omp declare simd
/// int min();
/// \endcode
/// attr()
/// matches "nodiscard", "nonnull", "noinline", and the whole "#pragma" line.
extern const internal::VariadicAllOfMatcher<Attr> attr;
/// Overloads for the \c equalsNode matcher.
/// FIXME: Implement for other node types.
/// @{

View File

@ -312,8 +312,7 @@ class BoundNodesTreeBuilder {
template <typename ExcludePredicate>
bool removeBindings(const ExcludePredicate &Predicate) {
Bindings.erase(std::remove_if(Bindings.begin(), Bindings.end(), Predicate),
Bindings.end());
llvm::erase_if(Bindings, Predicate);
return !Bindings.empty();
}
@ -757,7 +756,8 @@ class ASTMatchFinder {
std::is_base_of<NestedNameSpecifier, T>::value ||
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
std::is_base_of<TypeLoc, T>::value ||
std::is_base_of<QualType, T>::value,
std::is_base_of<QualType, T>::value ||
std::is_base_of<Attr, T>::value,
"unsupported type for recursive matching");
return matchesChildOf(DynTypedNode::create(Node), getASTContext(), Matcher,
Builder, Bind);
@ -771,7 +771,8 @@ class ASTMatchFinder {
std::is_base_of<NestedNameSpecifier, T>::value ||
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
std::is_base_of<TypeLoc, T>::value ||
std::is_base_of<QualType, T>::value,
std::is_base_of<QualType, T>::value ||
std::is_base_of<Attr, T>::value,
"unsupported type for recursive matching");
return matchesDescendantOf(DynTypedNode::create(Node), getASTContext(),
Matcher, Builder, Bind);
@ -785,7 +786,8 @@ class ASTMatchFinder {
static_assert(std::is_base_of<Decl, T>::value ||
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
std::is_base_of<Stmt, T>::value ||
std::is_base_of<TypeLoc, T>::value,
std::is_base_of<TypeLoc, T>::value ||
std::is_base_of<Attr, T>::value,
"type not allowed for recursive matching");
return matchesAncestorOf(DynTypedNode::create(Node), getASTContext(),
Matcher, Builder, MatchMode);
@ -954,7 +956,7 @@ class HasNameMatcher : public SingleNodeMatcherInterface<NamedDecl> {
bool matchesNode(const NamedDecl &Node) const override;
private:
private:
/// Unqualified match routine.
///
/// It is much faster than the full match, but it only works for unqualified
@ -1025,31 +1027,29 @@ class HasDeclarationMatcher : public MatcherInterface<T> {
BoundNodesTreeBuilder *Builder) const {
// DeducedType does not have declarations of its own, so
// match the deduced type instead.
const Type *EffectiveType = &Node;
if (const auto *S = dyn_cast<DeducedType>(&Node)) {
EffectiveType = S->getDeducedType().getTypePtrOrNull();
if (!EffectiveType)
return false;
QualType DT = S->getDeducedType();
return !DT.isNull() ? matchesSpecialized(*DT, Finder, Builder) : false;
}
// First, for any types that have a declaration, extract the declaration and
// match on it.
if (const auto *S = dyn_cast<TagType>(EffectiveType)) {
if (const auto *S = dyn_cast<TagType>(&Node)) {
return matchesDecl(S->getDecl(), Finder, Builder);
}
if (const auto *S = dyn_cast<InjectedClassNameType>(EffectiveType)) {
if (const auto *S = dyn_cast<InjectedClassNameType>(&Node)) {
return matchesDecl(S->getDecl(), Finder, Builder);
}
if (const auto *S = dyn_cast<TemplateTypeParmType>(EffectiveType)) {
if (const auto *S = dyn_cast<TemplateTypeParmType>(&Node)) {
return matchesDecl(S->getDecl(), Finder, Builder);
}
if (const auto *S = dyn_cast<TypedefType>(EffectiveType)) {
if (const auto *S = dyn_cast<TypedefType>(&Node)) {
return matchesDecl(S->getDecl(), Finder, Builder);
}
if (const auto *S = dyn_cast<UnresolvedUsingType>(EffectiveType)) {
if (const auto *S = dyn_cast<UnresolvedUsingType>(&Node)) {
return matchesDecl(S->getDecl(), Finder, Builder);
}
if (const auto *S = dyn_cast<ObjCObjectType>(EffectiveType)) {
if (const auto *S = dyn_cast<ObjCObjectType>(&Node)) {
return matchesDecl(S->getInterface(), Finder, Builder);
}
@ -1061,14 +1061,14 @@ class HasDeclarationMatcher : public MatcherInterface<T> {
// template<typename T> struct X { T t; } class A {}; X<A> a;
// The following matcher will match, which otherwise would not:
// fieldDecl(hasType(pointerType())).
if (const auto *S = dyn_cast<SubstTemplateTypeParmType>(EffectiveType)) {
if (const auto *S = dyn_cast<SubstTemplateTypeParmType>(&Node)) {
return matchesSpecialized(S->getReplacementType(), Finder, Builder);
}
// For template specialization types, we want to match the template
// declaration, as long as the type is still dependent, and otherwise the
// declaration of the instantiated tag type.
if (const auto *S = dyn_cast<TemplateSpecializationType>(EffectiveType)) {
if (const auto *S = dyn_cast<TemplateSpecializationType>(&Node)) {
if (!S->isTypeAlias() && S->isSugared()) {
// If the template is non-dependent, we want to match the instantiated
// tag type.
@ -1087,7 +1087,7 @@ class HasDeclarationMatcher : public MatcherInterface<T> {
// FIXME: We desugar elaborated types. This makes the assumption that users
// do never want to match on whether a type is elaborated - there are
// arguments for both sides; for now, continue desugaring.
if (const auto *S = dyn_cast<ElaboratedType>(EffectiveType)) {
if (const auto *S = dyn_cast<ElaboratedType>(&Node)) {
return matchesSpecialized(S->desugar(), Finder, Builder);
}
return false;
@ -1175,7 +1175,8 @@ struct IsBaseType {
std::is_same<T, NestedNameSpecifier>::value ||
std::is_same<T, NestedNameSpecifierLoc>::value ||
std::is_same<T, CXXCtorInitializer>::value ||
std::is_same<T, TemplateArgumentLoc>::value;
std::is_same<T, TemplateArgumentLoc>::value ||
std::is_same<T, Attr>::value;
};
template <typename T>
const bool IsBaseType<T>::value;
@ -1185,7 +1186,7 @@ const bool IsBaseType<T>::value;
/// Useful for matchers like \c anything and \c unless.
using AllNodeBaseTypes =
TypeList<Decl, Stmt, NestedNameSpecifier, NestedNameSpecifierLoc, QualType,
Type, TypeLoc, CXXCtorInitializer>;
Type, TypeLoc, CXXCtorInitializer, Attr>;
/// Helper meta-function to extract the argument out of a function of
/// type void(Arg).
@ -1212,7 +1213,7 @@ template <class T, class Tuple> constexpr T *new_from_tuple(Tuple &&t) {
using AdaptativeDefaultFromTypes = AllNodeBaseTypes;
using AdaptativeDefaultToTypes =
TypeList<Decl, Stmt, NestedNameSpecifier, NestedNameSpecifierLoc, TypeLoc,
QualType>;
QualType, Attr>;
/// All types that are supported by HasDeclarationMatcher above.
using HasDeclarationSupportedTypes =
@ -2245,11 +2246,7 @@ class HasAnyOperatorNameMatcher : public SingleNodeMatcherInterface<T> {
bool matchesNode(const T &Node) const override {
Optional<StringRef> OptOpName = getOpName(Node);
if (!OptOpName)
return false;
return llvm::any_of(Names, [OpName = *OptOpName](const std::string &Name) {
return Name == OpName;
});
return OptOpName && llvm::is_contained(Names, *OptOpName);
}
private:
@ -2304,6 +2301,26 @@ std::shared_ptr<llvm::Regex> createAndVerifyRegex(StringRef Regex,
llvm::Regex::RegexFlags Flags,
StringRef MatcherID);
inline bool
MatchTemplateArgLocAt(const DeclRefExpr &Node, unsigned int Index,
internal::Matcher<TemplateArgumentLoc> InnerMatcher,
internal::ASTMatchFinder *Finder,
internal::BoundNodesTreeBuilder *Builder) {
llvm::ArrayRef<TemplateArgumentLoc> ArgLocs = Node.template_arguments();
return Index < ArgLocs.size() &&
InnerMatcher.matches(ArgLocs[Index], Finder, Builder);
}
inline bool
MatchTemplateArgLocAt(const TemplateSpecializationTypeLoc &Node,
unsigned int Index,
internal::Matcher<TemplateArgumentLoc> InnerMatcher,
internal::ASTMatchFinder *Finder,
internal::BoundNodesTreeBuilder *Builder) {
return !Node.isNull() && Index < Node.getNumArgs() &&
InnerMatcher.matches(Node.getArgLoc(Index), Finder, Builder);
}
} // namespace internal
} // namespace ast_matchers

View File

@ -202,7 +202,7 @@ struct ChildrenGetterTy<clang::CFGBlock, IsPostDom> {
auto Children = children<OrderedNodeTy>(N);
ChildrenTy Ret{Children.begin(), Children.end()};
Ret.erase(std::remove(Ret.begin(), Ret.end(), nullptr), Ret.end());
llvm::erase_value(Ret, nullptr);
return Ret;
}
};

View File

@ -1337,6 +1337,7 @@ class CFG {
const CFGBlock * getIndirectGotoBlock() const { return IndirectGotoBlock; }
using try_block_iterator = std::vector<const CFGBlock *>::const_iterator;
using try_block_range = llvm::iterator_range<try_block_iterator>;
try_block_iterator try_blocks_begin() const {
return TryDispatchBlocks.begin();
@ -1346,6 +1347,10 @@ class CFG {
return TryDispatchBlocks.end();
}
try_block_range try_blocks() const {
return try_block_range(try_blocks_begin(), try_blocks_end());
}
void addTryDispatchBlock(const CFGBlock *block) {
TryDispatchBlocks.push_back(block);
}

View File

@ -235,9 +235,7 @@ class CloneConstraint {
static void filterGroups(
std::vector<CloneDetector::CloneGroup> &CloneGroups,
llvm::function_ref<bool(const CloneDetector::CloneGroup &)> Filter) {
CloneGroups.erase(
std::remove_if(CloneGroups.begin(), CloneGroups.end(), Filter),
CloneGroups.end());
llvm::erase_if(CloneGroups, Filter);
}
/// Splits the given CloneGroups until the given Compare function returns true

View File

@ -75,14 +75,8 @@ struct PathDiagnosticConsumerOptions {
bool ShouldSerializeStats = false;
/// If the consumer intends to produce multiple output files, should it
/// use randomly generated file names for these files (with the tiny risk of
/// having random collisions) or deterministic human-readable file names
/// (with a larger risk of deterministic collisions or invalid characters
/// in the file name). We should not really give this choice to the users
/// because deterministic mode is always superior when done right, but
/// for some consumers this mode is experimental and needs to be
/// off by default.
bool ShouldWriteStableReportFilename = false;
/// use a pseudo-random file name name or a human-readable file name.
bool ShouldWriteVerboseReportFilename = false;
/// Whether the consumer should treat consumed diagnostics as hard errors.
/// Useful for breaking your build when issues are found.
@ -151,11 +145,14 @@ class PathDiagnosticConsumer {
/// Only runs visitors, no output generated.
None,
/// Used for HTML, SARIF, and text output.
/// Used for SARIF and text output.
Minimal,
/// Used for plist output, used for "arrows" generation.
Extensive,
/// Used for HTML, shows both "arrows" and control notes.
Everything
};
virtual PathGenerationScheme getGenerationScheme() const { return Minimal; }
@ -164,7 +161,11 @@ class PathDiagnosticConsumer {
return getGenerationScheme() != None;
}
bool shouldAddPathEdges() const { return getGenerationScheme() == Extensive; }
bool shouldAddPathEdges() const { return getGenerationScheme() >= Extensive; }
bool shouldAddControlNotes() const {
return getGenerationScheme() == Minimal ||
getGenerationScheme() == Everything;
}
virtual bool supportsLogicalOpControlFlow() const { return false; }
@ -552,7 +553,7 @@ class PathDiagnosticEventPiece : public PathDiagnosticSpotPiece {
/// Return true if the diagnostic piece is prunable.
bool isPrunable() const {
return IsPrunable.hasValue() ? IsPrunable.getValue() : false;
return IsPrunable.getValueOr(false);
}
void dump() const override;

View File

@ -848,6 +848,7 @@ def Availability : InheritableAttr {
[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
return llvm::StringSwitch<llvm::StringRef>(Platform)
.Case("android", "Android")
.Case("fuchsia", "Fuchsia")
.Case("ios", "iOS")
.Case("macos", "macOS")
.Case("tvos", "tvOS")
@ -1835,6 +1836,22 @@ def BPFPreserveAccessIndex : InheritableAttr,
let LangOpts = [COnly];
}
def BTFDeclTag : InheritableAttr {
let Spellings = [Clang<"btf_decl_tag">];
let Args = [StringArgument<"BTFDeclTag">];
let Subjects = SubjectList<[Var, Function, Record, Field, TypedefName],
ErrorDiag>;
let Documentation = [BTFDeclTagDocs];
let LangOpts = [COnly];
}
def BTFTypeTag : TypeAttr {
let Spellings = [Clang<"btf_type_tag">];
let Args = [StringArgument<"BTFTypeTag">];
let Documentation = [BTFTypeTagDocs];
let LangOpts = [COnly];
}
def WebAssemblyExportName : InheritableAttr,
TargetSpecificAttr<TargetWebAssembly> {
let Spellings = [Clang<"export_name">];
@ -1971,7 +1988,7 @@ def NoReturn : InheritableAttr {
def NoInstrumentFunction : InheritableAttr {
let Spellings = [GCC<"no_instrument_function">];
let Subjects = SubjectList<[Function]>;
let Subjects = SubjectList<[Function, ObjCMethod]>;
let Documentation = [Undocumented];
let SimpleHandler = 1;
}
@ -2940,6 +2957,13 @@ def NoSanitizeSpecific : InheritableAttr {
let ASTNode = 0;
}
def DisableSanitizerInstrumentation : InheritableAttr {
let Spellings = [Clang<"disable_sanitizer_instrumentation">];
let Subjects = SubjectList<[Function, ObjCMethod, GlobalVar]>;
let Documentation = [DisableSanitizerInstrumentationDocs];
let SimpleHandler = 1;
}
def CFICanonicalJumpTable : InheritableAttr {
let Spellings = [Clang<"cfi_canonical_jump_table">];
let Subjects = SubjectList<[Function], ErrorDiag>;
@ -3659,7 +3683,8 @@ def OMPAllocateDecl : InheritableAttr {
"OMPCGroupMemAlloc", "OMPPTeamMemAlloc", "OMPThreadMemAlloc",
"OMPUserDefinedMemAlloc"
]>,
ExprArgument<"Allocator">
ExprArgument<"Allocator">,
ExprArgument<"Alignment">
];
let Documentation = [Undocumented];
}
@ -3674,6 +3699,11 @@ def OMPDeclareVariant : InheritableAttr {
let Args = [
ExprArgument<"VariantFuncRef">,
OMPTraitInfoArgument<"TraitInfos">,
VariadicExprArgument<"AdjustArgsNothing">,
VariadicExprArgument<"AdjustArgsNeedDevicePtr">,
VariadicEnumArgument<"AppendArgs", "InteropType",
["target", "targetsync", "target,targetsync"],
["Target", "TargetSync", "Target_TargetSync"]>
];
let AdditionalMembers = [{
OMPTraitInfo &getTraitInfo() { return *traitInfos; }
@ -3823,3 +3853,12 @@ def EnforceTCBLeaf : InheritableAttr {
let Documentation = [EnforceTCBLeafDocs];
bit InheritEvenIfAlreadyPresent = 1;
}
def Error : InheritableAttr {
let Spellings = [GCC<"error">, GCC<"warning">];
let Accessors = [Accessor<"isError", [GCC<"error">]>,
Accessor<"isWarning", [GCC<"warning">]>];
let Args = [StringArgument<"UserDiagnostic">];
let Subjects = SubjectList<[Function], ErrorDiag>;
let Documentation = [ErrorAttrDocs];
}

View File

@ -22,7 +22,7 @@
// Windows (from within the clang\docs directory):
// make.bat html
// Non-Windows (from within the clang\docs directory):
// make -f Makefile.sphinx html
// sphinx-build -b html _build/html
def GlobalDocumentation {
code Intro =[{..
@ -2011,6 +2011,34 @@ preserving struct or union member access debuginfo indices of this
struct or union, similar to clang ``__builtin_preserve_access_index()``.
}];
}
def BTFDeclTagDocs : Documentation {
let Category = DocCatFunction;
let Content = [{
Clang supports the ``__attribute__((btf_decl_tag("ARGUMENT")))`` attribute for
all targets. This attribute may be attached to a struct/union, struct/union
field, function, function parameter, variable or typedef declaration. If -g is
specified, the ``ARGUMENT`` info will be preserved in IR and be emitted to
dwarf. For BPF targets, the ``ARGUMENT`` info will be emitted to .BTF ELF
section too.
}];
}
def BTFTypeTagDocs : Documentation {
let Category = DocCatType;
let Content = [{
Clang supports the ``__attribute__((btf_type_tag("ARGUMENT")))`` attribute for
all targets. It only has effect when ``-g`` is specified on the command line and
is currently silently ignored when not applied to a pointer type (note: this
scenario may be diagnosed in the future).
The ``ARGUMENT`` string will be preserved in IR and emitted to DWARF for the
types used in variable declarations, function declarations, or typedef
declarations.
For BPF targets, the ``ARGUMENT`` string will also be emitted to .BTF ELF
section.
}];
}
def MipsInterruptDocs : Documentation {
let Category = DocCatFunction;
@ -2592,6 +2620,18 @@ full list of supported sanitizer flags.
}];
}
def DisableSanitizerInstrumentationDocs : Documentation {
let Category = DocCatFunction;
let Content = [{
Use the ``disable_sanitizer_instrumentation`` attribute on a function,
Objective-C method, or global variable, to specify that no sanitizer
instrumentation should be applied.
This is not the same as ``__attribute__((no_sanitize(...)))``, which depending
on the tool may still insert instrumentation to prevent false positive reports.
}];
}
def NoSanitizeAddressDocs : Documentation {
let Category = DocCatFunction;
// This function has multiple distinct spellings, and so it requires a custom
@ -5859,19 +5899,21 @@ def AcquireHandleDocs : Documentation {
If this annotation is on a function or a function type it is assumed to return
a new handle. In case this annotation is on an output parameter,
the function is assumed to fill the corresponding argument with a new
handle.
handle. The attribute requires a string literal argument which used to
identify the handle with later uses of ``use_handle`` or
``release_handle``.
.. code-block:: c++
// Output arguments from Zircon.
zx_status_t zx_socket_create(uint32_t options,
zx_handle_t __attribute__((acquire_handle)) * out0,
zx_handle_t* out1 [[clang::acquire_handle]]);
zx_handle_t __attribute__((acquire_handle("zircon"))) * out0,
zx_handle_t* out1 [[clang::acquire_handle("zircon")]]);
// Returned handle.
[[clang::acquire_handle]] int open(const char *path, int oflag, ... );
int open(const char *path, int oflag, ... ) __attribute__((acquire_handle));
[[clang::acquire_handle("tag")]] int open(const char *path, int oflag, ... );
int open(const char *path, int oflag, ... ) __attribute__((acquire_handle("tag")));
}];
}
@ -5879,12 +5921,13 @@ def UseHandleDocs : Documentation {
let Category = HandleDocs;
let Content = [{
A function taking a handle by value might close the handle. If a function
parameter is annotated with ``use_handle`` it is assumed to not to change
parameter is annotated with ``use_handle(tag)`` it is assumed to not to change
the state of the handle. It is also assumed to require an open handle to work with.
The attribute requires a string literal argument to identify the handle being used.
.. code-block:: c++
zx_status_t zx_port_wait(zx_handle_t handle [[clang::use_handle]],
zx_status_t zx_port_wait(zx_handle_t handle [[clang::use_handle("zircon")]],
zx_time_t deadline,
zx_port_packet_t* packet);
}];
@ -5893,12 +5936,13 @@ the state of the handle. It is also assumed to require an open handle to work wi
def ReleaseHandleDocs : Documentation {
let Category = HandleDocs;
let Content = [{
If a function parameter is annotated with ``release_handle`` it is assumed to
close the handle. It is also assumed to require an open handle to work with.
If a function parameter is annotated with ``release_handle(tag)`` it is assumed to
close the handle. It is also assumed to require an open handle to work with. The
attribute requires a string literal argument to identify the handle being released.
.. code-block:: c++
zx_status_t zx_handle_close(zx_handle_t handle [[clang::release_handle]]);
zx_status_t zx_handle_close(zx_handle_t handle [[clang::release_handle("tag")]]);
}];
}
@ -6045,3 +6089,29 @@ def EnforceTCBLeafDocs : Documentation {
- ``enforce_tcb_leaf(Name)`` indicates that this function is a part of the TCB named ``Name``
}];
}
def ErrorAttrDocs : Documentation {
let Category = DocCatFunction;
let Heading = "error, warning";
let Content = [{
The ``error`` and ``warning`` function attributes can be used to specify a
custom diagnostic to be emitted when a call to such a function is not
eliminated via optimizations. This can be used to create compile time
assertions that depend on optimizations, while providing diagnostics
pointing to precise locations of the call site in the source.
.. code-block:: c++
__attribute__((warning("oh no"))) void dontcall();
void foo() {
if (someCompileTimeAssertionThatsTrue)
dontcall(); // Warning
dontcall(); // Warning
if (someCompileTimeAssertionThatsFalse)
dontcall(); // No Warning
sizeof(dontcall()); // No Warning
}
}];
}

View File

@ -80,9 +80,7 @@
// builtin even if type doesn't match signature, and don't warn if we
// can't be sure the type is right
// F -> this is a libc/libm function with a '__builtin_' prefix added.
// f -> this is a libc/libm function without the '__builtin_' prefix. It can
// be followed by ':headername:' to state which header this function
// comes from.
// f -> this is a libc/libm function without the '__builtin_' prefix.
// h -> this function requires a specific header or an explicit declaration.
// i -> this is a runtime library implemented function without the
// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
@ -645,6 +643,12 @@ BUILTIN(__builtin_alloca, "v*z" , "Fn")
BUILTIN(__builtin_alloca_with_align, "v*zIz", "Fn")
BUILTIN(__builtin_call_with_static_chain, "v.", "nt")
BUILTIN(__builtin_elementwise_abs, "v.", "nct")
BUILTIN(__builtin_elementwise_max, "v.", "nct")
BUILTIN(__builtin_elementwise_min, "v.", "nct")
BUILTIN(__builtin_reduce_max, "v.", "nct")
BUILTIN(__builtin_reduce_min, "v.", "nct")
BUILTIN(__builtin_matrix_transpose, "v.", "nFt")
BUILTIN(__builtin_matrix_column_major_load, "v.", "nFt")
BUILTIN(__builtin_matrix_column_major_store, "v.", "nFt")
@ -794,6 +798,7 @@ ATOMIC_BUILTIN(__c11_atomic_fetch_sub, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_and, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_or, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_xor, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_nand, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_max, "v.", "t")
ATOMIC_BUILTIN(__c11_atomic_fetch_min, "v.", "t")
BUILTIN(__c11_atomic_thread_fence, "vi", "n")

View File

@ -243,6 +243,9 @@ TARGET_HEADER_BUILTIN(_ReadStatusReg, "LLii", "nh", "intrin.h", ALL_MS_LANGUAG
TARGET_HEADER_BUILTIN(_WriteStatusReg, "viLLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
TARGET_HEADER_BUILTIN(_AddressOfReturnAddress, "v*", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
TARGET_HEADER_BUILTIN(__mulh, "SLLiSLLiSLLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
#undef BUILTIN
#undef LANGBUILTIN
#undef TARGET_HEADER_BUILTIN

View File

@ -196,6 +196,19 @@ TARGET_BUILTIN(__builtin_amdgcn_perm, "UiUiUiUi", "nc", "gfx8-insts")
TARGET_BUILTIN(__builtin_amdgcn_fmed3h, "hhhh", "nc", "gfx9-insts")
TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fadd_f64, "dd*1d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fadd_f32, "ff*1f", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fadd_v2f16, "V2hV2h*1V2h", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fmin_f64, "dd*1d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fmax_f64, "dd*1d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fadd_f64, "dd*0d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fmin_f64, "dd*0d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fmax_f64, "dd*0d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_f64, "dd*3d", "t", "gfx90a-insts")
TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_f32, "ff*3f", "t", "gfx8-insts")
//===----------------------------------------------------------------------===//
// Deep learning builtins.
//===----------------------------------------------------------------------===//

View File

@ -39,7 +39,13 @@
#pragma push_macro("PTX70")
#pragma push_macro("PTX71")
#pragma push_macro("PTX72")
#define PTX72 "ptx72"
#pragma push_macro("PTX73")
#pragma push_macro("PTX74")
#pragma push_macro("PTX75")
#define PTX75 "ptx75"
#define PTX74 "ptx74|" PTX75
#define PTX73 "ptx73|" PTX74
#define PTX72 "ptx72|" PTX73
#define PTX71 "ptx71|" PTX72
#define PTX70 "ptx70|" PTX71
#define PTX65 "ptx65|" PTX70
@ -683,6 +689,12 @@ BUILTIN(__nvvm_ldg_f2, "E2fE2fC*", "")
BUILTIN(__nvvm_ldg_f4, "E4fE4fC*", "")
BUILTIN(__nvvm_ldg_d2, "E2dE2dC*", "")
// Address space predicates.
BUILTIN(__nvvm_isspacep_const, "bvC*", "nc")
BUILTIN(__nvvm_isspacep_global, "bvC*", "nc")
BUILTIN(__nvvm_isspacep_local, "bvC*", "nc")
BUILTIN(__nvvm_isspacep_shared, "bvC*", "nc")
// Builtins to support WMMA instructions on sm_70
TARGET_BUILTIN(__hmma_m16n16k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX60))
TARGET_BUILTIN(__hmma_m16n16k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX60))
@ -815,3 +827,6 @@ TARGET_BUILTIN(__nvvm_cp_async_wait_all, "v", "", AND(SM_80,PTX70))
#pragma pop_macro("PTX70")
#pragma pop_macro("PTX71")
#pragma pop_macro("PTX72")
#pragma pop_macro("PTX73")
#pragma pop_macro("PTX74")
#pragma pop_macro("PTX75")

View File

@ -74,8 +74,8 @@ BUILTIN(__builtin_ppc_fetch_and_swap, "UiUiD*Ui", "")
BUILTIN(__builtin_ppc_fetch_and_swaplp, "ULiULiD*ULi", "")
BUILTIN(__builtin_ppc_ldarx, "LiLiD*", "")
BUILTIN(__builtin_ppc_lwarx, "iiD*", "")
BUILTIN(__builtin_ppc_lharx, "isD*", "")
BUILTIN(__builtin_ppc_lbarx, "UiUcD*", "")
BUILTIN(__builtin_ppc_lharx, "ssD*", "")
BUILTIN(__builtin_ppc_lbarx, "ccD*", "")
BUILTIN(__builtin_ppc_stdcx, "iLiD*Li", "")
BUILTIN(__builtin_ppc_stwcx, "iiD*i", "")
BUILTIN(__builtin_ppc_sthcx, "isD*s", "")
@ -96,6 +96,13 @@ BUILTIN(__builtin_ppc_swdiv_nochk, "ddd", "")
BUILTIN(__builtin_ppc_swdivs_nochk, "fff", "")
BUILTIN(__builtin_ppc_alignx, "vIivC*", "nc")
BUILTIN(__builtin_ppc_rdlam, "UWiUWiUWiUWIi", "nc")
BUILTIN(__builtin_ppc_compare_exp_uo, "idd", "")
BUILTIN(__builtin_ppc_compare_exp_lt, "idd", "")
BUILTIN(__builtin_ppc_compare_exp_gt, "idd", "")
BUILTIN(__builtin_ppc_compare_exp_eq, "idd", "")
BUILTIN(__builtin_ppc_test_data_class, "idIi", "t")
BUILTIN(__builtin_ppc_swdiv, "ddd", "")
BUILTIN(__builtin_ppc_swdivs, "fff", "")
// Compare
BUILTIN(__builtin_ppc_cmpeqb, "LLiLLiLLi", "")
BUILTIN(__builtin_ppc_cmprb, "iCIiii", "")
@ -110,11 +117,11 @@ BUILTIN(__builtin_ppc_maddhd, "LLiLLiLLiLLi", "")
BUILTIN(__builtin_ppc_maddhdu, "ULLiULLiULLiULLi", "")
BUILTIN(__builtin_ppc_maddld, "LLiLLiLLiLLi", "")
// Rotate
BUILTIN(__builtin_ppc_rlwnm, "UiUiIUiIUi", "")
BUILTIN(__builtin_ppc_rlwnm, "UiUiUiIUi", "")
BUILTIN(__builtin_ppc_rlwimi, "UiUiUiIUiIUi", "")
BUILTIN(__builtin_ppc_rldimi, "ULLiULLiULLiIUiIULLi", "")
// load
BUILTIN(__builtin_ppc_load2r, "UiUs*", "")
BUILTIN(__builtin_ppc_load2r, "UsUs*", "")
BUILTIN(__builtin_ppc_load4r, "UiUi*", "")
BUILTIN(__builtin_ppc_load8r, "ULLiULLi*", "")
// store
@ -144,6 +151,7 @@ BUILTIN(__builtin_ppc_mfspr, "ULiIi", "")
BUILTIN(__builtin_ppc_mtmsr, "vUi", "")
BUILTIN(__builtin_ppc_mtspr, "vIiULi", "")
BUILTIN(__builtin_ppc_stfiw, "viC*d", "")
BUILTIN(__builtin_ppc_addex, "LLiLLiLLiCIi", "")
BUILTIN(__builtin_ppc_get_timebase, "ULLi", "n")
@ -391,6 +399,7 @@ BUILTIN(__builtin_altivec_vcmpgtfp_p, "iiV4fV4f", "")
BUILTIN(__builtin_altivec_vgbbd, "V16UcV16Uc", "")
BUILTIN(__builtin_altivec_vbpermq, "V2ULLiV16UcV16Uc", "")
BUILTIN(__builtin_altivec_vbpermd, "V2ULLiV2ULLiV16Uc", "")
// P8 Crypto built-ins.
BUILTIN(__builtin_altivec_crypto_vsbox, "V2ULLiV2ULLi", "")
@ -771,6 +780,10 @@ BUILTIN(__builtin_cfuged, "ULLiULLiULLi", "")
BUILTIN(__builtin_cntlzdm, "ULLiULLiULLi", "")
BUILTIN(__builtin_cnttzdm, "ULLiULLiULLi", "")
// Double-double (un)pack
BUILTIN(__builtin_unpack_longdouble, "dLdIi", "")
BUILTIN(__builtin_pack_longdouble, "Lddd", "")
// Generate random number
BUILTIN(__builtin_darn, "LLi", "")
BUILTIN(__builtin_darn_raw, "LLi", "")
@ -812,18 +825,20 @@ BUILTIN(__builtin_dcbf, "vvC*", "")
// its given accumulator.
// Provided builtins with _mma_ prefix for compatibility.
CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLLiW256C*", false)
CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLLiW256C*", false)
CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLiW256C*", false)
CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256C*", false)
CUSTOM_BUILTIN(mma_assemble_pair, vsx_assemble_pair, "vW256*VV", false)
CUSTOM_BUILTIN(mma_disassemble_pair, vsx_disassemble_pair, "vv*W256*", false)
CUSTOM_BUILTIN(vsx_build_pair, vsx_assemble_pair, "vW256*VV", false)
CUSTOM_BUILTIN(mma_build_acc, mma_assemble_acc, "vW512*VVVV", false)
// UNALIASED_CUSTOM_BUILTIN macro is used for built-ins that have
// the same name as that of the intrinsic they generate, i.e. the
// ID and INTR are the same.
// This avoids repeating the ID and INTR in the macro expression.
UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLLiW256C*", false)
UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLLiW256C*", false)
UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLiW256C*", false)
UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256C*", false)
UNALIASED_CUSTOM_BUILTIN(vsx_assemble_pair, "vW256*VV", false)
UNALIASED_CUSTOM_BUILTIN(vsx_disassemble_pair, "vv*W256*", false)

View File

@ -15,8 +15,6 @@
# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS)
#endif
#include "clang/Basic/riscv_vector_builtins.inc"
// Zbb extension
TARGET_BUILTIN(__builtin_riscv_orc_b_32, "ZiZi", "nc", "experimental-zbb")
TARGET_BUILTIN(__builtin_riscv_orc_b_64, "WiWi", "nc", "experimental-zbb,64bit")

View File

@ -0,0 +1,21 @@
//==- BuiltinsRISCVVector.def - RISC-V Vector Builtin Database ---*- C++ -*-==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the RISC-V-specific builtin function database. Users of
// this file must define the BUILTIN macro to make use of this information.
//
//===----------------------------------------------------------------------===//
#if defined(BUILTIN) && !defined(TARGET_BUILTIN)
# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS)
#endif
#include "clang/Basic/riscv_vector_builtins.inc"
#undef BUILTIN
#undef TARGET_BUILTIN

View File

@ -119,18 +119,22 @@ TARGET_BUILTIN(__builtin_wasm_all_true_i16x8, "iV8s", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_all_true_i32x4, "iV4i", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_all_true_i64x2, "iV2LLi", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i8x16, "iV16Sc", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i16x8, "iV8s", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i32x4, "iV4i", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i64x2, "iV2LLi", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i8x16, "UiV16Sc", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i16x8, "UiV8s", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i32x4, "UiV4i", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_bitmask_i64x2, "UiV2LLi", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_abs_f32x4, "V4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_abs_f64x2, "V2dV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_min_f32x4, "V4fV4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_max_f32x4, "V4fV4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_pmin_f32x4, "V4fV4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_pmax_f32x4, "V4fV4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_min_f64x2, "V2dV2dV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_max_f64x2, "V2dV2dV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_pmin_f64x2, "V2dV2dV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_pmax_f64x2, "V2dV2dV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_ceil_f32x4, "V4fV4f", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_floor_f32x4, "V4fV4f", "nc", "simd128")
@ -157,5 +161,28 @@ TARGET_BUILTIN(__builtin_wasm_narrow_u_i16x8_i32x4, "V8UsV4iV4i", "nc", "simd128
TARGET_BUILTIN(__builtin_wasm_trunc_sat_zero_s_f64x2_i32x4, "V4iV2d", "nc", "simd128")
TARGET_BUILTIN(__builtin_wasm_trunc_sat_zero_u_f64x2_i32x4, "V4UiV2d", "nc", "simd128")
// Relaxed SIMD builtins (experimental)
TARGET_BUILTIN(__builtin_wasm_fma_f32x4, "V4fV4fV4fV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_fms_f32x4, "V4fV4fV4fV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_fma_f64x2, "V2dV2dV2dV2d", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_fms_f64x2, "V2dV2dV2dV2d", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_laneselect_i8x16, "V16ScV16ScV16ScV16Sc", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_laneselect_i16x8, "V8sV8sV8sV8s", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_laneselect_i32x4, "V4iV4iV4iV4i", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_laneselect_i64x2, "V2LLiV2LLiV2LLiV2LLi", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_swizzle_i8x16, "V16ScV16ScV16Sc", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_min_f32x4, "V4fV4fV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_max_f32x4, "V4fV4fV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_min_f64x2, "V2dV2dV2d", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_max_f64x2, "V2dV2dV2d", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_s_i32x4_f32x4, "V4iV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_u_i32x4_f32x4, "V4UiV4f", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_zero_s_i32x4_f64x2, "V4iV2d", "nc", "relaxed-simd")
TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_zero_u_i32x4_f64x2, "V4UiV2d", "nc", "relaxed-simd")
#undef BUILTIN
#undef TARGET_BUILTIN

View File

@ -421,9 +421,9 @@ TARGET_BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciIc","ncV:128:", "sse4.2
TARGET_BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","ncV:128:", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","ncV:128:", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "nc", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "nc", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "nc", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "nc", "crc32")
TARGET_BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "nc", "crc32")
TARGET_BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "nc", "crc32")
// SSE4a
TARGET_BUILTIN(__builtin_ia32_extrqi, "V2OiV2OiIcIc", "ncV:128:", "sse4a")
@ -1849,6 +1849,203 @@ TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_512, "vV16iV16iUs*Us*", "nV:512:",
TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_256, "vV8iV8iUc*Uc*", "nV:256:", "avx512vp2intersect,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vp2intersect_d_128, "vV4iV4iUc*Uc*", "nV:128:", "avx512vp2intersect,avx512vl")
// AVX512 fp16 intrinsics
TARGET_BUILTIN(__builtin_ia32_vcomish, "iV8xV8xIiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_addph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_subph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_mulph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_divph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_maxph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_minph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_minph256, "V16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_minph128, "V8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_maxph256, "V16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_maxph128, "V8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_addsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_divsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_mulsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_subsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_maxsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_minsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_cmpph512_mask, "UiV32xV32xIiUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_cmpph256_mask, "UsV16xV16xIiUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_cmpph128_mask, "UcV8xV8xIiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_cmpsh_mask, "UcV8xV8xIiUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_loadsh128_mask, "V8xV8x*V8xUc", "nV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_storesh128_mask, "vV8x*V8xUc", "nV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rcpph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rcpph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rcpph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rsqrtph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rsqrtph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rsqrtph512_mask, "V32xV32xV32xUi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_getmantph128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_getmantph256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_getmantph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_getexpph128_mask, "V8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_getexpph256_mask, "V16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_getexpph512_mask, "V32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_scalefph128_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_scalefph256_mask, "V16xV16xV16xV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_scalefph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rndscaleph_128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rndscaleph_256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_rndscaleph_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reduceph128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduceph256_mask, "V16xV16xIiV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduceph512_mask, "V32xV32xIiV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rcpsh_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rsqrtsh_mask, "V8xV8xV8xV8xUc", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_getmantsh_round_mask, "V8xV8xV8xIiV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_getexpsh128_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_scalefsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_rndscalesh_round_mask, "V8xV8xV8xV8xUcIiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reducesh_mask, "V8xV8xV8xV8xUcIiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_sqrtph, "V8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_sqrtph256, "V16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_sqrtph512, "V32xV32xIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_sqrtsh_round_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_fpclassph128_mask, "UcV8xIiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_fpclassph256_mask, "UsV16xIiUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_fpclassph512_mask, "UiV32xIiUi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_fpclasssh_mask, "UcV8xIiUc", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph128_mask, "V8xV2dV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph256_mask, "V8xV4dV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtpd2ph512_mask, "V8xV8dV8xUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2pd128_mask, "V2dV8xV2dUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2pd256_mask, "V4dV8xV4dUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2pd512_mask, "V8dV8xV8dUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2ss_round_mask, "V4fV4fV8xV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtss2sh_round_mask, "V8xV8xV4fV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsd2sh_round_mask, "V8xV8xV2dV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2sd_round_mask, "V2dV2dV8xV2dUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2w128_mask, "V8sV8xV8sUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2w256_mask, "V16sV16xV16sUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2w128_mask, "V8sV8xV8sUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2w256_mask, "V16sV16xV16sUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2w512_mask, "V32sV32xV32sUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtw2ph128_mask, "V8xV8sV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtw2ph256_mask, "V16xV16sV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtw2ph512_mask, "V32xV32sV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uw128_mask, "V8UsV8xV8UsUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uw256_mask, "V16UsV16xV16UsUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uw128_mask, "V8UsV8xV8UsUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uw256_mask, "V16UsV16xV16UsUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uw512_mask, "V32UsV32xV32UsUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph128_mask, "V8xV8UsV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph256_mask, "V16xV16UsV16xUs", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtuw2ph512_mask, "V32xV32UsV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2dq128_mask, "V4iV8xV4iUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2dq256_mask, "V8iV8xV8iUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2udq128_mask, "V4UiV8xV4UiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2udq256_mask, "V8UiV8xV8UiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph128_mask, "V8xV4iV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph256_mask, "V8xV8iV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtdq2ph512_mask, "V16xV16iV16xUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph128_mask, "V8xV4UiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph256_mask, "V8xV8UiV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtudq2ph512_mask, "V16xV16UiV16xUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2dq128_mask, "V4iV8xV4iUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2dq256_mask, "V8iV8xV8iUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2dq512_mask, "V16iV16xV16iUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2udq128_mask, "V4UiV8xV4UiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2udq256_mask, "V8UiV8xV8UiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2udq512_mask, "V16UiV16xV16UiUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph128_mask, "V8xV2OiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph256_mask, "V8xV4OiV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtqq2ph512_mask, "V8xV8OiV8xUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2qq128_mask, "V2OiV8xV2OiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2qq256_mask, "V4OiV8xV4OiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph128_mask, "V8xV2UOiV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph256_mask, "V8xV4UOiV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtuqq2ph512_mask, "V8xV8UOiV8xUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq128_mask, "V2UOiV8xV2UOiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq256_mask, "V4UOiV8xV4UOiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2qq128_mask, "V2OiV8xV2OiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2qq256_mask, "V4OiV8xV4OiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2qq512_mask, "V8OiV8xV8OiUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq128_mask, "V2UOiV8xV2UOiUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq256_mask, "V4UOiV8xV4UOiUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvttph2uqq512_mask, "V8UOiV8xV8UOiUcIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2si32, "iV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2usi32, "UiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtusi2sh, "V8xV8xUiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsi2sh, "V8xV8xiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttsh2si32, "iV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttsh2usi32, "UiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtph2psx128_mask, "V4fV8xV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2psx256_mask, "V8fV8xV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtph2psx512_mask, "V16fV16xV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtps2phx128_mask, "V8xV4fV8xUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtps2phx256_mask, "V8xV8fV8xUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vcvtps2phx512_mask, "V16xV16fV16xUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddph, "V8xV8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddph256, "V16xV16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsubph, "V8xV8xV8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddsubph256, "V16xV16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_maskz, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmsubaddph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmsubph512_mask3, "V32xV32xV32xV32xUiIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_mask, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_maskz, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddsh3_mask3, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmsubsh3_mask3, "V8xV8xV8xV8xUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph128_maskz, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcph512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmaddcsh_round_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmaddcsh_round_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmulcsh_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vfcmulcph128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmulcph256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_vfcmulcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512fp16")
// generic select intrinsics
TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "ncV:128:", "avx512bw,avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectb_256, "V32cUiV32cV32c", "ncV:256:", "avx512bw,avx512vl")
@ -1859,6 +2056,9 @@ TARGET_BUILTIN(__builtin_ia32_selectw_512, "V32sUiV32sV32s", "ncV:512:", "avx512
TARGET_BUILTIN(__builtin_ia32_selectd_128, "V4iUcV4iV4i", "ncV:128:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectd_256, "V8iUcV8iV8i", "ncV:256:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectd_512, "V16iUsV16iV16i", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_selectph_128, "V8xUcV8xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectph_256, "V16xUsV16xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectph_512, "V32xUiV32xV32x", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_selectq_128, "V2OiUcV2OiV2Oi", "ncV:128:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectq_256, "V4OiUcV4OiV4Oi", "ncV:256:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectq_512, "V8OiUcV8OiV8Oi", "ncV:512:", "avx512f")
@ -1868,6 +2068,7 @@ TARGET_BUILTIN(__builtin_ia32_selectps_512, "V16fUsV16fV16f", "ncV:512:", "avx51
TARGET_BUILTIN(__builtin_ia32_selectpd_128, "V2dUcV2dV2d", "ncV:128:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectpd_256, "V4dUcV4dV4d", "ncV:256:", "avx512vl")
TARGET_BUILTIN(__builtin_ia32_selectpd_512, "V8dUcV8dV8d", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_selectsh_128, "V8xUcV8xV8x", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_selectss_128, "V4fUcV4fV4f", "ncV:128:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_selectsd_128, "V2dUcV2dV2d", "ncV:128:", "avx512f")
@ -1878,12 +2079,24 @@ TARGET_BUILTIN(__builtin_ia32_reduce_and_d512, "iV16i", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_and_q512, "OiV8Oi", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fadd_pd512, "ddV8d", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ps512, "ffV16f", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph512, "xxV32x", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph256, "xxV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph128, "xxV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmax_pd512, "dV8d", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ps512, "fV16f", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph512, "xV32x", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph256, "xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmax_ph128, "xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmin_pd512, "dV8d", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ps512, "fV16f", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph512, "xV32x", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph256, "xV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmin_ph128, "xV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmul_pd512, "ddV8d", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ps512, "ffV16f", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph512, "xxV32x", "ncV:512:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph256, "xxV16x", "ncV:256:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph128, "xxV8x", "ncV:128:", "avx512fp16,avx512vl")
TARGET_BUILTIN(__builtin_ia32_reduce_mul_d512, "iV16i", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_mul_q512, "OiV8Oi", "ncV:512:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_reduce_or_d512, "iV16i", "ncV:512:", "avx512f")

View File

@ -44,7 +44,7 @@ TARGET_BUILTIN(__builtin_ia32_cvttsd2si64, "OiV2d", "ncV:128:", "sse2")
TARGET_BUILTIN(__builtin_ia32_movnti64, "vOi*Oi", "n", "sse2")
TARGET_BUILTIN(__builtin_ia32_vec_ext_v2di, "OiV2OiIi", "ncV:128:", "sse2")
TARGET_BUILTIN(__builtin_ia32_vec_set_v2di, "V2OiV2OiOiIi", "ncV:128:", "sse4.1")
TARGET_BUILTIN(__builtin_ia32_crc32di, "UOiUOiUOi", "nc", "sse4.2")
TARGET_BUILTIN(__builtin_ia32_crc32di, "UOiUOiUOi", "nc", "crc32")
TARGET_BUILTIN(__builtin_ia32_vec_ext_v4di, "OiV4OiIi", "ncV:256:", "avx")
TARGET_BUILTIN(__builtin_ia32_vec_set_v4di, "V4OiV4OiOiIi", "ncV:256:", "avx")
TARGET_BUILTIN(__builtin_ia32_rdfsbase32, "Ui", "n", "fsgsbase")
@ -92,6 +92,12 @@ TARGET_BUILTIN(__builtin_ia32_cvtsi2sd64, "V2dV2dOiIi", "ncV:128:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtsi2ss64, "V4fV4fOiIi", "ncV:128:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dUOiIi", "ncV:128:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fUOiIi", "ncV:128:", "avx512f")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2si64, "OiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsh2usi64, "UOiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtusi642sh, "V8xV8xUOiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvtsi642sh, "V8xV8xOiIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttsh2si64, "OiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_vcvttsh2usi64, "UOiV8xIi", "ncV:128:", "avx512fp16")
TARGET_BUILTIN(__builtin_ia32_directstore_u64, "vULi*ULi", "n", "movdiri")
// UINTR

View File

@ -0,0 +1,26 @@
//===--- CLWarnings.h - Maps some cl.exe warning ids -----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_BASIC_CLWARNINGS_H
#define LLVM_CLANG_BASIC_CLWARNINGS_H
#include "llvm/ADT/Optional.h"
namespace clang {
namespace diag {
enum class Group;
}
/// For cl.exe warning IDs that cleany map to clang diagnostic groups,
/// returns the corresponding group. Else, returns an empty Optional.
llvm::Optional<diag::Group> diagGroupFromCLWarningID(unsigned);
} // end namespace clang
#endif // LLVM_CLANG_BASIC_CLWARNINGS_H

View File

@ -43,10 +43,15 @@ LLVM_READNONE inline bool isASCII(char c) {
return static_cast<unsigned char>(c) <= 127;
}
LLVM_READNONE inline bool isASCII(unsigned char c) { return c <= 127; }
/// Returns true if this is an ASCII character.
LLVM_READNONE inline bool isASCII(uint32_t c) { return c <= 127; }
/// Returns true if this is a valid first character of a C identifier,
/// which is [a-zA-Z_].
LLVM_READONLY inline bool isIdentifierHead(unsigned char c,
bool AllowDollar = false) {
LLVM_READONLY inline bool isAsciiIdentifierStart(unsigned char c,
bool AllowDollar = false) {
using namespace charinfo;
if (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_UNDER))
return true;
@ -55,8 +60,8 @@ LLVM_READONLY inline bool isIdentifierHead(unsigned char c,
/// Returns true if this is a body character of a C identifier,
/// which is [a-zA-Z0-9_].
LLVM_READONLY inline bool isIdentifierBody(unsigned char c,
bool AllowDollar = false) {
LLVM_READONLY inline bool isAsciiIdentifierContinue(unsigned char c,
bool AllowDollar = false) {
using namespace charinfo;
if (InfoTable[c] & (CHAR_UPPER|CHAR_LOWER|CHAR_DIGIT|CHAR_UNDER))
return true;
@ -181,13 +186,13 @@ LLVM_READONLY inline char toUppercase(char c) {
///
/// Note that this is a very simple check; it does not accept UCNs as valid
/// identifier characters.
LLVM_READONLY inline bool isValidIdentifier(StringRef S,
bool AllowDollar = false) {
if (S.empty() || !isIdentifierHead(S[0], AllowDollar))
LLVM_READONLY inline bool isValidAsciiIdentifier(StringRef S,
bool AllowDollar = false) {
if (S.empty() || !isAsciiIdentifierStart(S[0], AllowDollar))
return false;
for (StringRef::iterator I = S.begin(), E = S.end(); I != E; ++I)
if (!isIdentifierBody(*I, AllowDollar))
if (!isAsciiIdentifierContinue(*I, AllowDollar))
return false;
return true;

View File

@ -54,6 +54,7 @@ CODEGENOPT(UniqueBasicBlockSectionNames, 1, 1) ///< Set for -funique-basic-block
CODEGENOPT(EnableAIXExtendedAltivecABI, 1, 0) ///< Set for -mabi=vec-extabi. Enables the extended Altivec ABI on AIX.
ENUM_CODEGENOPT(FramePointer, FramePointerKind, 2, FramePointerKind::None) /// frame-pointer: all,non-leaf,none
CODEGENOPT(ClearASTBeforeBackend , 1, 0) ///< Free the AST before running backend code generation. Only works with -disable-free.
CODEGENOPT(DisableFree , 1, 0) ///< Don't free memory.
CODEGENOPT(DiscardValueNames , 1, 0) ///< Discard Value Names from the IR (LLVMContext flag)
CODEGENOPT(DisableLLVMPasses , 1, 0) ///< Don't run any LLVM IR passes to get
@ -91,6 +92,8 @@ CODEGENOPT(EmulatedTLS , 1, 0) ///< Set by default or -f[no-]emulated-tls.
CODEGENOPT(ExplicitEmulatedTLS , 1, 0) ///< Set if -f[no-]emulated-tls is used.
/// Embed Bitcode mode (off/all/bitcode/marker).
ENUM_CODEGENOPT(EmbedBitcode, EmbedBitcodeKind, 2, Embed_Off)
/// Inline asm dialect, -masm=(att|intel)
ENUM_CODEGENOPT(InlineAsmDialect, InlineAsmDialectKind, 1, IAD_ATT)
CODEGENOPT(ForbidGuardVariables , 1, 0) ///< Issue errors if C++ guard variables
///< are required.
CODEGENOPT(FunctionSections , 1, 0) ///< Set when -ffunction-sections is enabled.
@ -188,6 +191,7 @@ CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-zero-initialized-in-bss.
ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy)
/// Replace certain message sends with calls to ObjC runtime entrypoints
CODEGENOPT(ObjCConvertMessagesToRuntimeCalls , 1, 1)
CODEGENOPT(ObjCAvoidHeapifyLocalBlocks, 1, 0)
VALUE_CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified.
VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified.
@ -259,6 +263,8 @@ CODEGENOPT(SanitizeCoverageInlineBoolFlag, 1, 0) ///< Use inline bool flag.
CODEGENOPT(SanitizeCoveragePCTable, 1, 0) ///< Create a PC Table.
CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning.
CODEGENOPT(SanitizeCoverageStackDepth, 1, 0) ///< Enable max stack depth tracing
CODEGENOPT(SanitizeCoverageTraceLoads, 1, 0) ///< Enable tracing of loads.
CODEGENOPT(SanitizeCoverageTraceStores, 1, 0) ///< Enable tracing of stores.
CODEGENOPT(SanitizeStats , 1, 0) ///< Collect statistics for sanitizers.
CODEGENOPT(SimplifyLibCalls , 1, 1) ///< Set when -fbuiltin is enabled.
CODEGENOPT(SoftFloat , 1, 0) ///< -soft-float.
@ -274,7 +280,7 @@ VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500) ///< Minimum time granularity (i
CODEGENOPT(UnrollLoops , 1, 0) ///< Control whether loops are unrolled.
CODEGENOPT(RerollLoops , 1, 0) ///< Control whether loops are rerolled.
CODEGENOPT(NoUseJumpTables , 1, 0) ///< Set when -fno-jump-tables is enabled.
CODEGENOPT(UnwindTables , 1, 0) ///< Emit unwind tables.
VALUE_CODEGENOPT(UnwindTables, 2, 0) ///< Unwind tables (1) or asynchronous unwind tables (2)
CODEGENOPT(VectorizeLoop , 1, 0) ///< Run loop vectorizer.
CODEGENOPT(VectorizeSLP , 1, 0) ///< Run SLP vectorizer.
CODEGENOPT(ProfileSampleAccurate, 1, 0) ///< Sample profile is accurate.
@ -293,6 +299,8 @@ CODEGENOPT(StackRealignment , 1, 0) ///< Control whether to force stack
///< realignment.
CODEGENOPT(UseInitArray , 1, 0) ///< Control whether to use .init_array or
///< .ctors.
VALUE_CODEGENOPT(LoopAlignment , 32, 0) ///< Overrides default loop
///< alignment, if not 0.
VALUE_CODEGENOPT(StackAlignment , 32, 0) ///< Overrides default stack
///< alignment, if not 0.
VALUE_CODEGENOPT(StackProbeSize , 32, 4096) ///< Overrides default stack
@ -317,6 +325,12 @@ CODEGENOPT(DebugFwdTemplateParams, 1, 0) ///< Whether to emit complete
///< template parameter descriptions in
///< forward declarations (versus just
///< including them in the name).
ENUM_CODEGENOPT(DebugSimpleTemplateNames, codegenoptions::DebugTemplateNamesKind, 2, codegenoptions::DebugTemplateNamesKind::Full) ///< Whether to emit template parameters
///< in the textual names of template
///< specializations.
///< Implies DebugFwdTemplateNames to
///< allow decorated names to be
///< reconstructed when needed.
CODEGENOPT(EmitLLVMUseLists, 1, 0) ///< Control whether to serialize use-lists.
CODEGENOPT(WholeProgramVTables, 1, 0) ///< Whether to apply whole-program
@ -437,6 +451,14 @@ CODEGENOPT(AAPCSBitfieldWidth, 1, 1)
/// propagate signaling NaN inputs per IEEE 754-2008 (AMDGPU Only)
CODEGENOPT(EmitIEEENaNCompliantInsts, 1, 1)
// Whether to emit Swift Async function extended frame information: auto,
// never, always.
ENUM_CODEGENOPT(SwiftAsyncFramePointer, SwiftAsyncFramePointerKind, 2,
SwiftAsyncFramePointerKind::Always)
/// Whether to skip RAX setup when passing variable arguments (x86 only).
CODEGENOPT(SkipRaxSetup, 1, 0)
#undef CODEGENOPT
#undef ENUM_CODEGENOPT
#undef VALUE_CODEGENOPT

View File

@ -97,6 +97,11 @@ class CodeGenOptions : public CodeGenOptionsBase {
Embed_Marker // Embed a marker as a placeholder for bitcode.
};
enum InlineAsmDialectKind {
IAD_ATT,
IAD_Intel,
};
// This field stores one of the allowed values for the option
// -fbasic-block-sections=. The allowed values with this option are:
// {"labels", "all", "list=<file>", "none"}.
@ -125,6 +130,13 @@ class CodeGenOptions : public CodeGenOptionsBase {
All, // Keep all frame pointers.
};
enum class SwiftAsyncFramePointerKind {
Auto, // Choose Swift async extended frame info based on deployment target.
Always, // Unconditionally emit Swift async extended frame info.
Never, // Don't emit Swift async extended frame info.
Default = Always,
};
enum FiniteLoopsKind {
Language, // Not specified, use language standard.
Always, // All loops are assumed to be finite.
@ -456,7 +468,8 @@ class CodeGenOptions : public CodeGenOptionsBase {
// Check if any one of SanitizeCoverage* is enabled.
bool hasSanitizeCoverage() const {
return SanitizeCoverageType || SanitizeCoverageIndirectCalls ||
SanitizeCoverageTraceCmp;
SanitizeCoverageTraceCmp || SanitizeCoverageTraceLoads ||
SanitizeCoverageTraceStores;
}
};

View File

@ -31,8 +31,13 @@ enum class CudaVersion {
CUDA_110,
CUDA_111,
CUDA_112,
LATEST = CUDA_112,
LATEST_SUPPORTED = CUDA_101,
CUDA_113,
CUDA_114,
CUDA_115,
FULLY_SUPPORTED = CUDA_115,
PARTIALLY_SUPPORTED =
CUDA_115, // Partially supported. Proceed with a warning.
NEW = 10000, // Too new. Issue a warning, but allow using it.
};
const char *CudaVersionToString(CudaVersion V);
// Input is "Major.Minor"

View File

@ -54,6 +54,12 @@ enum DebugInfoKind {
UnusedTypeInfo,
};
enum class DebugTemplateNamesKind {
Full,
Simple,
Mangled
};
} // end namespace codegenoptions
} // end namespace clang

View File

@ -164,9 +164,9 @@ struct DiagnosticStorage {
/// 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
/// is mangled into an uint64_t and the interpretation depends on exactly
/// what sort of argument kind it is.
intptr_t DiagArgumentsVal[MaxArguments];
uint64_t DiagArgumentsVal[MaxArguments];
/// The values for the various substitution positions that have
/// string arguments.
@ -807,6 +807,9 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
bool setSeverityForGroup(diag::Flavor Flavor, StringRef Group,
diag::Severity Map,
SourceLocation Loc = SourceLocation());
bool setSeverityForGroup(diag::Flavor Flavor, diag::Group Group,
diag::Severity Map,
SourceLocation Loc = SourceLocation());
/// Set the warning-as-error flag for the given diagnostic group.
///
@ -1176,7 +1179,7 @@ class StreamingDiagnostic {
DiagStorage = nullptr;
}
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const {
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const {
if (!DiagStorage)
DiagStorage = getStorage();
@ -1399,6 +1402,12 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
return DB;
}
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
int64_t I) {
DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint);
return DB;
}
// We use enable_if here to prevent that this overload is selected for
// pointers or other arguments that are implicitly convertible to bool.
template <typename T>
@ -1415,6 +1424,12 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
return DB;
}
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
uint64_t I) {
DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint);
return DB;
}
inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB,
tok::TokenKind I) {
DB.AddTaggedVal(static_cast<unsigned>(I), DiagnosticsEngine::ak_tokenkind);
@ -1577,18 +1592,18 @@ class Diagnostic {
/// Return the specified signed integer argument.
/// \pre getArgKind(Idx) == DiagnosticsEngine::ak_sint
int getArgSInt(unsigned Idx) const {
int64_t getArgSInt(unsigned Idx) const {
assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint &&
"invalid argument accessor!");
return (int)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
return (int64_t)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
}
/// Return the specified unsigned integer argument.
/// \pre getArgKind(Idx) == DiagnosticsEngine::ak_uint
unsigned getArgUInt(unsigned Idx) const {
uint64_t getArgUInt(unsigned Idx) const {
assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint &&
"invalid argument accessor!");
return (unsigned)DiagObj->DiagStorage.DiagArgumentsVal[Idx];
return DiagObj->DiagStorage.DiagArgumentsVal[Idx];
}
/// Return the specified IdentifierInfo argument.
@ -1602,7 +1617,7 @@ class Diagnostic {
/// Return the specified non-string argument in an opaque form.
/// \pre getArgKind(Idx) != DiagnosticsEngine::ak_std_string
intptr_t getRawArg(unsigned Idx) const {
uint64_t getRawArg(unsigned Idx) const {
assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string &&
"invalid argument accessor!");
return DiagObj->DiagStorage.DiagArgumentsVal[Idx];

View File

@ -567,8 +567,8 @@ def remark_sanitize_address_insert_extra_padding_accepted : Remark<
def remark_sanitize_address_insert_extra_padding_rejected : Remark<
"-fsanitize-address-field-padding ignored for %0 because it "
"%select{is not C++|is packed|is a union|is trivially copyable|"
"has trivial destructor|is standard layout|is in a blacklisted file|"
"is blacklisted}1">, ShowInSystemHeader,
"has trivial destructor|is standard layout|is in a ignorelisted file|"
"is ignorelisted}1">, ShowInSystemHeader,
InGroup<SanitizeAddressRemarks>;
def warn_npot_ms_struct : Warning<

View File

@ -19,6 +19,13 @@ namespace clang {
#undef GET_CATEGORY_TABLE
DiagCat_NUM_CATEGORIES
};
enum class Group {
#define DIAG_ENTRY(GroupName, FlagNameOffset, Members, SubGroups) GroupName,
#include "clang/Basic/DiagnosticGroups.inc"
#undef CATEGORY
#undef DIAG_ENTRY
};
} // end namespace diag
} // end namespace clang

View File

@ -149,8 +149,8 @@ def err_nullability_conflicting : Error<
// OpenCL Section 6.8.g
def err_opencl_unknown_type_specifier : Error<
"%select{OpenCL C|C++ for OpenCL}0 version %1 does not support the "
"'%2' %select{type qualifier|storage class specifier}3">;
"%0 does not support the '%1' "
"%select{type qualifier|storage class specifier}2">;
def warn_unknown_attribute_ignored : Warning<
"unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
@ -298,6 +298,8 @@ def err_target_unsupported_unaligned : Error<
"the %0 sub-architecture does not support unaligned accesses">;
def err_target_unsupported_execute_only : Error<
"execute only is not supported for the %0 sub-architecture">;
def err_target_unsupported_tp_hard : Error<
"hardware TLS register is not supported for the %0 sub-architecture">;
def err_target_unsupported_mcmse : Error<
"-mcmse is not supported for %0">;
def err_opt_not_valid_with_opt : Error<
@ -306,6 +308,8 @@ def err_opt_not_valid_without_opt : Error<
"option '%0' cannot be specified without '%1'">;
def err_opt_not_valid_on_target : Error<
"option '%0' cannot be specified on this target">;
def err_invalid_feature_combination : Error<
"invalid feature combination: %0">;
// Source manager
def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal;

View File

@ -16,6 +16,8 @@ def err_drv_unsupported_opt_with_suggestion : Error<
"unsupported option '%0'; did you mean '%1'?">;
def err_drv_unsupported_opt_for_target : Error<
"unsupported option '%0' for target '%1'">;
def err_drv_unsupported_opt_for_language_mode : Error<
"unsupported option '%0' for language mode '%1'">;
def err_drv_unsupported_option_argument : Error<
"unsupported argument '%1' to option '%0'">;
def err_drv_unknown_stdin_type : Error<
@ -29,6 +31,9 @@ def err_drv_invalid_riscv_arch_name : Error<
"invalid arch name '%0', %1">;
def err_drv_invalid_riscv_ext_arch_name : Error<
"invalid arch name '%0', %1 '%2'">;
def warn_drv_invalid_arch_name_with_suggestion : Warning<
"ignoring invalid /arch: argument '%0'; for %select{64|32}1-bit expected one of %2">,
InGroup<UnusedCommandLineArgument>;
def warn_drv_avr_mcu_not_specified : Warning<
"no target microcontroller specified on command line, cannot "
"link standard libraries, please pass -mmcu=<mcu name>">,
@ -52,38 +57,57 @@ def warn_drv_avr_stdlib_not_linked: Warning<
"standard library not linked and so no interrupt vector table or "
"compiler runtime routines will be linked">,
InGroup<AVRRtlibLinkingQuirks>;
def err_drv_cuda_bad_gpu_arch : Error<"Unsupported CUDA gpu architecture: %0">;
def err_drv_cuda_bad_gpu_arch : Error<"unsupported CUDA gpu architecture: %0">;
def err_drv_no_cuda_installation : Error<
"cannot find CUDA installation. Provide its path via --cuda-path, or pass "
"-nocudainc to build without CUDA includes.">;
"cannot find CUDA installation; provide its path via '--cuda-path', or pass "
"'-nocudainc' to build without CUDA includes">;
def err_drv_no_cuda_libdevice : Error<
"cannot find libdevice for %0. Provide path to different CUDA installation "
"via --cuda-path, or pass -nocudalib to build without linking with libdevice.">;
"cannot find libdevice for %0; provide path to different CUDA installation "
"via '--cuda-path', or pass '-nocudalib' to build without linking with "
"libdevice">;
def err_drv_no_rocm_device_lib : Error<
"cannot find ROCm device library%select{| for %1}0. Provide its path via --rocm-path or "
"--rocm-device-lib-path, or pass -nogpulib to build without ROCm device library.">;
"cannot find ROCm device library%select{| for %1}0; provide its path via "
"'--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build "
"without ROCm device library">;
def err_drv_no_hip_runtime : Error<
"cannot find HIP runtime. Provide its path via --rocm-path, or pass "
"-nogpuinc to build without HIP runtime.">;
"cannot find HIP runtime; provide its path via '--rocm-path', or pass "
"'-nogpuinc' to build without HIP runtime">;
def err_drv_undetermined_amdgpu_arch : Error<
"Cannot determine AMDGPU architecture: %0. Consider passing it via --march.">;
"cannot determine AMDGPU architecture: %0; consider passing it via "
"'--march'">;
def err_drv_cuda_version_unsupported : Error<
"GPU arch %0 is supported by CUDA versions between %1 and %2 (inclusive), "
"but installation at %3 is %4. Use --cuda-path to specify a different CUDA "
"install, pass a different GPU arch with --cuda-gpu-arch, or pass "
"--no-cuda-version-check.">;
def warn_drv_unknown_cuda_version: Warning<
"Unknown CUDA version. %0 Assuming the latest supported version %1">,
"but installation at %3 is %4; use '--cuda-path' to specify a different CUDA "
"install, pass a different GPU arch with '--cuda-gpu-arch', or pass "
"'--no-cuda-version-check'">;
def warn_drv_new_cuda_version: Warning<
"CUDA version%0 is newer than the latest%select{| partially}1 supported version %2">,
InGroup<CudaUnknownVersion>;
def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compilation.">;
def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">;
def err_drv_bad_target_id : Error<"Invalid target ID: %0 (A target ID is a processor name "
"followed by an optional list of predefined features post-fixed by a plus or minus sign deliminated "
"by colon, e.g. 'gfx908:sramecc+:xnack-')">;
def err_drv_bad_offload_arch_combo : Error<"Invalid offload arch combinations: %0 and %1 (For a specific "
"processor, a feature should either exist in all offload archs, or not exist in any offload archs)">;
def warn_drv_partially_supported_cuda_version: Warning<
"CUDA version %0 is only partially supported">,
InGroup<CudaUnknownVersion>;
def err_drv_cuda_host_arch : Error<
"unsupported architecture '%0' for host compilation">;
def err_drv_mix_cuda_hip : Error<
"mixed CUDA and HIP compilation is not supported">;
def err_drv_bad_target_id : Error<
"invalid target ID '%0'; format is a processor name followed by an optional "
"colon-delimited list of features followed by an enable/disable sign (e.g., "
"'gfx908:sramecc+:xnack-')">;
def err_drv_bad_offload_arch_combo : Error<
"invalid offload arch combinations: '%0' and '%1' (for a specific processor, "
"a feature should either exist in all offload archs, or not exist in any "
"offload archs)">;
def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning<
"ignoring '%0' option as it is not currently supported for "
"offload arch '%1'. Use it with an offload arch containing '%2' instead">,
InGroup<OptionIgnored>;
def warn_drv_unsupported_option_for_target : Warning<
"ignoring '%0' option as it is not currently supported for target '%1'">,
InGroup<OptionIgnored>;
def err_drv_invalid_thread_model_for_target : Error<
"invalid thread model '%0' in '%1' for this target">;
def err_drv_invalid_linker_name : Error<
@ -171,8 +195,8 @@ def err_drv_invalid_argument_to_option : Error<
"invalid argument '%0' to -%1">;
def err_drv_malformed_sanitizer_ignorelist : Error<
"malformed sanitizer ignorelist: '%0'">;
def err_drv_malformed_sanitizer_coverage_whitelist : Error<
"malformed sanitizer coverage whitelist: '%0'">;
def err_drv_malformed_sanitizer_coverage_allowlist : Error<
"malformed sanitizer coverage allowlist: '%0'">;
def err_drv_malformed_sanitizer_coverage_ignorelist : Error<
"malformed sanitizer coverage ignorelist: '%0'">;
def err_drv_duplicate_config : Error<
@ -195,7 +219,7 @@ def err_target_unsupported_arch
def err_cpu_unsupported_isa
: Error<"CPU '%0' does not support '%1' execution mode">;
def err_arch_unsupported_isa
: Error<"Architecture '%0' does not support '%1' execution mode">;
: Error<"architecture '%0' does not support '%1' execution mode">;
def err_drv_I_dash_not_supported : Error<
"'%0' not supported, please use -iquote instead">;
@ -220,6 +244,7 @@ def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
def err_drv_invalid_value_with_suggestion : Error<
"invalid value '%1' in '%0', expected one of: %2">;
def err_drv_alignment_not_power_of_two : Error<"alignment is not a power of 2 in '%0'">;
def err_drv_invalid_remap_file : Error<
"invalid option '%0' not of the form <from-file>;<to-file>">;
def err_drv_invalid_gcc_output_type : Error<
@ -235,6 +260,7 @@ def warn_invalid_ios_deployment_target : Warning<
DefaultError;
def err_invalid_macos_32bit_deployment_target : Error<
"32-bit targets are not supported when building for Mac Catalyst">;
def err_drv_invalid_os_in_arg : Error<"invalid OS value '%0' in '%1'">;
def err_drv_conflicting_deployment_targets : Error<
"conflicting deployment targets, both '%0' and '%1' are present in environment">;
def err_arc_unsupported_on_runtime : Error<
@ -262,20 +288,26 @@ def err_drv_optimization_remark_format : Error<
"unknown remark serializer format: '%0'">;
def err_drv_no_neon_modifier : Error<"[no]neon is not accepted as modifier, please use [no]simd instead">;
def err_drv_invalid_omp_target : Error<"OpenMP target is invalid: '%0'">;
def err_drv_debug_no_new_runtime : Error<"OpenMP target device debugging enabled with incompatible runtime">;
def err_drv_incompatible_omp_arch : Error<"OpenMP target architecture '%0' pointer size is incompatible with host '%1'">;
def err_drv_omp_host_ir_file_not_found : Error<
"The provided host compiler IR file '%0' is required to generate code for OpenMP target regions but cannot be found.">;
"provided host compiler IR file '%0' is required to generate code for OpenMP "
"target regions but cannot be found">;
def err_drv_omp_host_target_not_supported : Error<
"The target '%0' is not a supported OpenMP host target.">;
"target '%0' is not a supported OpenMP host target">;
def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
"The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">;
"'-fopenmp-targets' must be used in conjunction with a '-fopenmp' option "
"compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'">;
def err_drv_omp_offload_target_missingbcruntime : Error<
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Please use --libomptarget-%1-bc-path to specify %1 bitcode library.">;
def err_drv_omp_offload_target_bcruntime_not_found : Error<"Bitcode library '%0' does not exist.">;
def err_drv_omp_offload_target_cuda_version_not_support : Error<"NVPTX target requires CUDA 9.2 or above. CUDA %0 is detected.">;
"no library '%0' found in the default clang lib directory or in LIBRARY_PATH"
"; use '--libomptarget-%1-bc-path' to specify %1 bitcode library">;
def err_drv_omp_offload_target_bcruntime_not_found : Error<
"bitcode library '%0' does not exist">;
def err_drv_omp_offload_target_cuda_version_not_support : Error<
"NVPTX target requires CUDA 9.2 or above; CUDA %0 detected">;
def warn_drv_omp_offload_target_duplicate : Warning<
"The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
InGroup<OpenMPTarget>;
"OpenMP offloading target '%0' is similar to target '%1' already specified; "
"will be ignored">, InGroup<OpenMPTarget>;
def err_drv_unsupported_embed_bitcode
: Error<"%0 is not supported with -fembed-bitcode">;
def err_drv_bitcode_unsupported_on_toolchain : Error<
@ -302,7 +334,8 @@ def warn_drv_unsupported_debug_info_opt_for_target : Warning<
"debug information option '%0' is not supported for target '%1'">,
InGroup<UnsupportedTargetOpt>;
def warn_drv_dwarf_version_limited_by_target : Warning<
"debug information option '%0' is not supported. It needs DWARF-%2 but target '%1' only provides DWARF-%3.">,
"debug information option '%0' is not supported; requires DWARF-%2 but "
"target '%1' only provides DWARF-%3">,
InGroup<UnsupportedTargetOpt>;
def warn_c_kext : Warning<
"ignoring -fapple-kext which is valid for C++ and Objective-C++ only">;
@ -369,7 +402,7 @@ def err_sls_hardening_arm_not_supported : Error<
def note_drv_command_failed_diag_msg : Note<
"diagnostic msg: %0">;
def note_drv_t_option_is_global : Note<
"The last /TC or /TP option takes precedence over earlier instances">;
"the last '/TC' or '/TP' option takes precedence over earlier instances">;
def note_drv_address_sanitizer_debug_runtime : Note<
"AddressSanitizer doesn't support linking with debug runtime libraries yet">;
def note_drv_use_standard : Note<"use '%0'"
@ -409,7 +442,8 @@ def err_test_module_file_extension_format : Error<
def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">,
InGroup<DiagGroup<"slash-u-filename">>;
def note_use_dashdash : Note<"Use '--' to treat subsequent arguments as filenames">;
def note_use_dashdash : Note<
"use '--' to treat subsequent arguments as filenames">;
def err_drv_ropi_rwpi_incompatible_with_pic : Error<
"embedded and GOT-based position independence are incompatible">;
@ -478,14 +512,14 @@ def warn_drv_ps4_sdk_dir : Warning<
def err_drv_unsupported_linker : Error<"unsupported value '%0' for -linker option">;
def err_drv_defsym_invalid_format : Error<"defsym must be of the form: sym=value: %0">;
def err_drv_defsym_invalid_symval : Error<"Value is not an integer: %0">;
def err_drv_defsym_invalid_symval : Error<"value is not an integer: %0">;
def warn_drv_msvc_not_found : Warning<
"unable to find a Visual Studio installation; "
"try running Clang from a developer command prompt">,
InGroup<DiagGroup<"msvc-not-found">>;
def warn_drv_fuse_ld_path : Warning<
"'-fuse-ld=' taking a path is deprecated. Use '--ld-path=' instead">,
"'-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead">,
InGroup<FUseLdPath>, DefaultIgnore;
def warn_drv_fine_grained_bitfield_accesses_ignored : Warning<
@ -505,11 +539,11 @@ def warn_drv_global_isel_incomplete_opt : Warning<
InGroup<GlobalISel>;
def warn_drv_moutline_unsupported_opt : Warning<
"The '%0' architecture does not support -moutline; flag ignored">,
"'%0' does not support '-moutline'; flag ignored">,
InGroup<OptionIgnored>;
def warn_drv_moutline_atomics_unsupported_opt : Warning<
"The '%0' architecture does not support -moutline-atomics; flag ignored">,
"'%0' does not support '-moutline-atomics'; flag ignored">,
InGroup<OptionIgnored>;
def warn_drv_darwin_sdk_invalid_settings : Warning<
@ -517,25 +551,28 @@ def warn_drv_darwin_sdk_invalid_settings : Warning<
InGroup<DiagGroup<"darwin-sdk-settings">>;
def err_drv_trivial_auto_var_init_zero_disabled : Error<
"-ftrivial-auto-var-init=zero hasn't been enabled. Enable it at your own peril for benchmarking purpose only with "
"-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">;
"'-ftrivial-auto-var-init=zero' hasn't been enabled; enable it at your own "
"peril for benchmarking purpose only with "
"'-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang'">;
def err_drv_trivial_auto_var_init_stop_after_missing_dependency : Error<
"-ftrivial-auto-var-init-stop-after=* is used without -ftrivial-auto-var-init=zero or -ftrivial-auto-var-init=pattern.">;
"'-ftrivial-auto-var-init-stop-after=*' is used without "
"'-ftrivial-auto-var-init=zero' or '-ftrivial-auto-var-init=pattern'">;
def err_drv_trivial_auto_var_init_stop_after_invalid_value : Error<
"-ftrivial-auto-var-init-stop-after=* only accepts positive integers.">;
"'-ftrivial-auto-var-init-stop-after=*' only accepts positive integers">;
def warn_drv_msp430_hwmult_unsupported : Warning<"the given MCU does not "
"support hardware multiply, but -mhwmult is set to %0.">,
def warn_drv_msp430_hwmult_unsupported : Warning<
"the given MCU does not support hardware multiply, but '-mhwmult' is set to "
"%0">, InGroup<InvalidCommandLineArgument>;
def warn_drv_msp430_hwmult_mismatch : Warning<
"the given MCU supports %0 hardware multiply, but '-mhwmult' is set to %1">,
InGroup<InvalidCommandLineArgument>;
def warn_drv_msp430_hwmult_mismatch : Warning<"the given MCU supports %0 "
"hardware multiply, but -mhwmult is set to %1.">,
InGroup<InvalidCommandLineArgument>;
def warn_drv_msp430_hwmult_no_device : Warning<"no MCU device specified, but "
"'-mhwmult' is set to 'auto', assuming no hardware multiply. Use -mmcu to "
"specify a MSP430 device, or -mhwmult to set hardware multiply type "
"explicitly.">, InGroup<InvalidCommandLineArgument>;
def warn_drv_msp430_hwmult_no_device : Warning<
"no MCU device specified, but '-mhwmult' is set to 'auto', assuming no "
"hardware multiply; use '-mmcu' to specify an MSP430 device, or '-mhwmult' "
"to set the hardware multiply type explicitly">,
InGroup<InvalidCommandLineArgument>;
def warn_drv_libstdcxx_not_found : Warning<
"include path for libstdc++ headers not found; pass '-stdlib=libc++' on the "
@ -544,17 +581,26 @@ def warn_drv_libstdcxx_not_found : Warning<
def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">;
def err_drv_invalid_object_mode : Error<"OBJECT_MODE setting %0 is not recognized and is not a valid setting.">;
def err_drv_invalid_object_mode : Error<
"OBJECT_MODE setting %0 is not recognized and is not a valid setting">;
def err_aix_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">;
def err_invalid_cxx_abi : Error<"Invalid C++ ABI name '%0'">;
def err_invalid_cxx_abi : Error<"invalid C++ ABI name '%0'">;
def err_unsupported_cxx_abi : Error<"C++ ABI '%0' is not supported on target triple '%1'">;
def note_cc1_round_trip_original : Note<"Original arguments in round-trip: %0">;
def note_cc1_round_trip_generated : Note<"Generated arguments #%0 in round-trip: %1">;
def remark_cc1_round_trip_generated : Remark<"Generated arguments #%0 in round-trip: %1">, InGroup<RoundTripCC1Args>;
def err_cc1_round_trip_fail_then_ok : Error<"Original arguments parse failed, then succeeded in round-trip">;
def err_cc1_round_trip_ok_then_fail : Error<"Generated arguments parse failed in round-trip">;
def err_cc1_round_trip_mismatch : Error<"Generated arguments do not match in round-trip">;
def note_cc1_round_trip_original : Note<"original arguments in round-trip: %0">;
def note_cc1_round_trip_generated : Note<
"generated arguments #%0 in round-trip: %1">;
def remark_cc1_round_trip_generated : Remark<
"generated arguments #%0 in round-trip: %1">, InGroup<RoundTripCC1Args>;
def err_cc1_round_trip_fail_then_ok : Error<
"original arguments parse failed, then succeeded in round-trip">;
def err_cc1_round_trip_ok_then_fail : Error<
"generated arguments parse failed in round-trip">;
def err_cc1_round_trip_mismatch : Error<
"generated arguments do not match in round-trip">;
def err_drv_ssp_missing_offset_argument : Error<
"'%0' is used without '-mstack-protector-guard-offset', and there is no default">;
}

View File

@ -22,10 +22,11 @@ def note_fe_inline_asm_here : Note<"instantiated into assembly here">;
def err_fe_source_mgr : Error<"%0">, CatSourceMgr;
def warn_fe_source_mgr : Warning<"%0">, CatSourceMgr, InGroup<BackendSourceMgr>;
def note_fe_source_mgr : Note<"%0">, CatSourceMgr;
def err_fe_cannot_link_module : Error<"cannot link module '%0': %1">,
DefaultFatal;
def err_fe_linking_module : Error<"cannot link module '%0': %1">, DefaultFatal;
def warn_fe_linking_module : Warning<"linking module '%0': %1">, InGroup<LinkerWarnings>;
def note_fe_linking_module : Note<"linking module '%0': %1">;
def warn_fe_frame_larger_than : Warning<"stack frame size (%0) exceeds limit (%1) in %q2">,
def warn_fe_frame_larger_than : Warning<"stack frame size (%0) exceeds limit (%1) in '%2'">,
BackendInfo, InGroup<BackendFrameLargerThan>;
def warn_fe_backend_frame_larger_than: Warning<"%0">,
BackendInfo, InGroup<BackendFrameLargerThan>;
@ -72,6 +73,12 @@ def note_fe_backend_invalid_loc : Note<"could "
def err_fe_backend_unsupported : Error<"%0">, BackendInfo;
def warn_fe_backend_unsupported : Warning<"%0">, BackendInfo;
def err_fe_backend_error_attr :
Error<"call to %0 declared with 'error' attribute: %1">, BackendInfo;
def warn_fe_backend_warning_attr :
Warning<"call to %0 declared with 'warning' attribute: %1">, BackendInfo,
InGroup<BackendWarningAttributes>;
def err_fe_invalid_code_complete_file : Error<
"cannot locate code-completion file %0">, DefaultFatal;
def err_fe_dependency_file_requires_MT : Error<
@ -229,6 +236,8 @@ def remark_module_build : Remark<"building module '%0' as '%1'">,
InGroup<ModuleBuild>;
def remark_module_build_done : Remark<"finished building module '%0'">,
InGroup<ModuleBuild>;
def remark_module_lock : Remark<"locking '%0' to build module '%1'">,
InGroup<ModuleLock>;
def err_modules_embed_file_not_found :
Error<"file '%0' specified by '-fmodules-embed-file=' not found">,
DefaultFatal;
@ -245,7 +254,7 @@ def err_invalid_vfs_overlay : Error<
"invalid virtual filesystem overlay file '%0'">, DefaultFatal;
def warn_option_invalid_ocl_version : Warning<
"OpenCL version %0 does not support the option '%1'">, InGroup<Deprecated>;
"%0 does not support the option '%1'">, InGroup<Deprecated>;
def err_builtin_needs_feature : Error<"%0 needs target feature %1">;
def err_function_needs_feature : Error<

View File

@ -54,7 +54,9 @@ def CompoundTokenSplit : DiagGroup<"compound-token-split",
CompoundTokenSplitBySpace]>;
def CoroutineMissingUnhandledException :
DiagGroup<"coroutine-missing-unhandled-exception">;
def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException]>;
def DeprecatedExperimentalCoroutine :
DiagGroup<"deprecated-experimental-coroutine">;
def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException, DeprecatedExperimentalCoroutine]>;
def ObjCBoolConstantConversion : DiagGroup<"objc-bool-constant-conversion">;
def ConstantConversion : DiagGroup<"constant-conversion",
[BitFieldConstantConversion,
@ -64,6 +66,8 @@ def StringConversion : DiagGroup<"string-conversion">;
def SignConversion : DiagGroup<"sign-conversion">;
def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">;
def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">;
def BitwiseInsteadOfLogical : DiagGroup<"bitwise-instead-of-logical">;
def BoolOperation : DiagGroup<"bool-operation", [BitwiseInsteadOfLogical]>;
def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion,
UndefinedBoolConversion]>;
def IntConversion : DiagGroup<"int-conversion">;
@ -184,6 +188,7 @@ def DeprecatedThisCapture : DiagGroup<"deprecated-this-capture">;
def DeprecatedVolatile : DiagGroup<"deprecated-volatile">;
def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
[CXX11CompatDeprecatedWritableStr]>;
def DeprecatedPragma : DiagGroup<"deprecated-pragma">;
// FIXME: Why is DeprecatedImplementations not in this group?
def Deprecated : DiagGroup<"deprecated", [DeprecatedAnonEnumEnumConversion,
DeprecatedArrayCompare,
@ -198,6 +203,7 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAnonEnumEnumConversion,
DeprecatedEnumEnumConversion,
DeprecatedEnumFloatConversion,
DeprecatedIncrementBool,
DeprecatedPragma,
DeprecatedRegister,
DeprecatedThisCapture,
DeprecatedVolatile,
@ -393,6 +399,7 @@ def Dangling : DiagGroup<"dangling", [DanglingField,
DanglingGsl,
ReturnStackAddress]>;
def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
def DllexportExplicitInstantiationDecl : DiagGroup<"dllexport-explicit-instantiation-decl">;
def ExcessInitializers : DiagGroup<"excess-initializers">;
def ExpansionToDefined : DiagGroup<"expansion-to-defined">;
def FlagEnum : DiagGroup<"flag-enum">;
@ -400,7 +407,8 @@ def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>;
def InfiniteRecursion : DiagGroup<"infinite-recursion">;
def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">;
def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
def IgnoredReferenceQualifiers : DiagGroup<"ignored-reference-qualifiers">;
def IgnoredQualifiers : DiagGroup<"ignored-qualifiers", [IgnoredReferenceQualifiers]>;
def : DiagGroup<"import">;
def GNUIncludeNext : DiagGroup<"gnu-include-next">;
def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
@ -462,6 +470,7 @@ def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
def MismatchedTags : DiagGroup<"mismatched-tags">;
def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
def ModuleLock : DiagGroup<"module-lock">;
def ModuleBuild : DiagGroup<"module-build">;
def ModuleImport : DiagGroup<"module-import">;
def ModuleConflict : DiagGroup<"module-conflict">;
@ -642,6 +651,8 @@ def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
def KeywordAsMacro : DiagGroup<"keyword-macro">;
def ReservedIdAsMacro : DiagGroup<"reserved-macro-identifier">;
def ReservedIdAsMacroAlias : DiagGroup<"reserved-id-macro", [ReservedIdAsMacro]>;
def RestrictExpansionMacro : DiagGroup<"restrict-expansion">;
def FinalMacro : DiagGroup<"final-macro">;
// Just silence warnings about -Wstrict-aliasing for now.
def : DiagGroup<"strict-aliasing=0">;
@ -742,6 +753,7 @@ def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
def UnusedPropertyIvar : DiagGroup<"unused-property-ivar">;
def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
def UsedSearchPath : DiagGroup<"search-path-usage">;
def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;
def ReorderCtor : DiagGroup<"reorder-ctor">;
@ -816,8 +828,10 @@ def ReservedIdentifier : DiagGroup<"reserved-identifier",
// under separate flags.
//
def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
def UnreachableCodeFallthrough : DiagGroup<"unreachable-code-fallthrough">;
def UnreachableCode : DiagGroup<"unreachable-code",
[UnreachableCodeLoopIncrement]>;
[UnreachableCodeLoopIncrement,
UnreachableCodeFallthrough]>;
def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
@ -940,6 +954,7 @@ def Extra : DiagGroup<"extra", [
]>;
def Most : DiagGroup<"most", [
BoolOperation,
CharSubscript,
Comment,
DeleteNonVirtualDtor,
@ -1185,6 +1200,9 @@ def ASM : DiagGroup<"asm", [
ASMOperandWidths
]>;
// Linker warnings.
def LinkerWarnings : DiagGroup<"linker-warnings">;
// OpenMP warnings.
def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
def OpenMPClauses : DiagGroup<"openmp-clauses">;
@ -1210,6 +1228,7 @@ def BackendOptimizationRemark : DiagGroup<"pass">;
def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
def BackendOptimizationFailure : DiagGroup<"pass-failed">;
def BackendWarningAttributes : DiagGroup<"attribute-warning">;
// Instrumentation based profiling warnings.
def ProfileInstrMissing : DiagGroup<"profile-instr-missing">;
@ -1247,8 +1266,9 @@ def OptionIgnored : DiagGroup<"option-ignored">;
def UnknownArgument : DiagGroup<"unknown-argument">;
// A warning group for warnings about code that clang accepts when
// compiling OpenCL C/C++ but which is not compatible with the SPIR spec.
// compiling OpenCL C/C++ but which is not compatible with the SPIR(-V) spec.
def SpirCompat : DiagGroup<"spir-compat">;
def : DiagGroup<"spirv-compat", [SpirCompat]>; // Alias.
// Warning for the GlobalISel options.
def GlobalISel : DiagGroup<"global-isel">;
@ -1303,3 +1323,11 @@ def WebAssemblyExceptionSpec : DiagGroup<"wasm-exception-spec">;
def RTTI : DiagGroup<"rtti">;
def OpenCLCoreFeaturesDiagGroup : DiagGroup<"pedantic-core-features">;
// Warnings and extensions to make preprocessor macro usage pedantic.
def PedanticMacros : DiagGroup<"pedantic-macros",
[DeprecatedPragma,
MacroRedefined,
BuiltinMacroRedefined,
RestrictExpansionMacro,
FinalMacro]>;

View File

@ -25,6 +25,8 @@ namespace clang {
// Import the diagnostic enums themselves.
namespace diag {
enum class Group;
// Size of each of the diagnostic categories.
enum {
DIAG_SIZE_COMMON = 300,
@ -224,6 +226,10 @@ class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
///
static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault);
/// Given a group ID, returns the flag that toggles the group.
/// For example, for Group::DeprecatedDeclarations, returns
/// "deprecated-declarations".
static StringRef getWarningOptionForGroup(diag::Group);
/// Return the lowest-level warning option that enables the specified
/// diagnostic.

View File

@ -113,8 +113,10 @@ def warn_four_char_character_literal : Warning<
// Unicode and UCNs
def err_invalid_utf8 : Error<
"source file is not valid UTF-8">;
def err_non_ascii : Error<
"non-ASCII characters are not allowed outside of literals and identifiers">;
def err_character_not_allowed : Error<
"unexpected character <U+%0>">;
def err_character_not_allowed_identifier : Error<
"character <U+%0> not allowed %select{in|at the start of}1 an identifier">;
def ext_unicode_whitespace : ExtWarn<
"treating Unicode character as whitespace">,
InGroup<DiagGroup<"unicode-whitespace">>;
@ -125,6 +127,15 @@ def warn_utf8_symbol_zero_width : Warning<
"identifier contains Unicode character <U+%0> that is invisible in "
"some environments">, InGroup<DiagGroup<"unicode-zero-width">>;
def ext_delimited_escape_sequence : Extension<
"delimited escape sequences are a Clang extension">,
InGroup<DiagGroup<"delimited-escape-sequence-extension">>;
def err_delimited_escape_empty : Error<
"delimited escape sequence cannot be empty">;
def err_delimited_escape_missing_brace: Error<
"expected '{' after '\\%0' escape sequence">;
def err_delimited_escape_invalid : Error<
"invalid digit '%0' in escape sequence">;
def err_hex_escape_no_digits : Error<
"\\%0 used with no following hex digits">;
def warn_ucn_escape_no_digits : Warning<
@ -132,6 +143,12 @@ def warn_ucn_escape_no_digits : Warning<
"treating as '\\' followed by identifier">, InGroup<Unicode>;
def err_ucn_escape_incomplete : Error<
"incomplete universal character name">;
def warn_delimited_ucn_incomplete : Warning<
"incomplete delimited universal character name; "
"treating as '\\' 'u' '{' identifier">, InGroup<Unicode>;
def warn_delimited_ucn_empty : Warning<
"empty delimited universal character name; "
"treating as '\\' 'u' '{' '}'">, InGroup<Unicode>;
def warn_ucn_escape_incomplete : Warning<
"incomplete universal character name; "
"treating as '\\' followed by identifier">, InGroup<Unicode>;
@ -150,9 +167,6 @@ def warn_c99_compat_unicode_id : Warning<
"%select{using this character in an identifier|starting an identifier with "
"this character}0 is incompatible with C99">,
InGroup<C99Compat>, DefaultIgnore;
def warn_cxx98_compat_unicode_id : Warning<
"using this character in an identifier is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning<
"specifying character '%0' with a universal character name "
@ -184,12 +198,10 @@ def warn_c2x_compat_digit_separator : Warning<
InGroup<CPre2xCompat>, DefaultIgnore;
def err_digit_separator_not_between_digits : Error<
"digit separator cannot appear at %select{start|end}0 of digit sequence">;
def warn_extraneous_char_constant : Warning<
"extraneous characters in character constant ignored">;
def warn_char_constant_too_large : Warning<
"character constant too long for its type">;
def err_multichar_utf_character_literal : Error<
"Unicode character literals may not contain multiple characters">;
def err_multichar_character_literal : Error<
"%select{wide|Unicode}0 character literals may not contain multiple characters">;
def err_exponent_has_no_digits : Error<"exponent has no digits">;
def err_hex_constant_requires : Error<
"hexadecimal floating %select{constant|literal}0 requires "
@ -257,7 +269,9 @@ def err_bad_character_encoding : Error<
def warn_bad_character_encoding : ExtWarn<
"illegal character encoding in character literal">,
InGroup<InvalidSourceEncoding>;
def err_lexing_string : Error<"failure when lexing a string">;
def err_lexing_string : Error<"failure when lexing a string literal">;
def err_lexing_char : Error<"failure when lexing a character literal">;
def err_lexing_numeric : Error<"failure when lexing a numeric literal">;
def err_placeholder_in_source : Error<"editor placeholder in source file">;
//===----------------------------------------------------------------------===//
@ -300,6 +314,13 @@ def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
def pp_pragma_sysheader_in_main_file : Warning<
"#pragma system_header ignored in main file">,
InGroup<DiagGroup<"pragma-system-header-outside-header">>;
def err_pragma_include_instead_not_sysheader : Error<
"'#pragma clang include_instead' cannot be used outside of system headers">;
def err_pragma_include_instead_system_reserved : Error<
"header '%0' is an implementation detail; #include %select{'%2'|either '%2' "
"or '%3'|one of %2}1 instead">;
def pp_poisoning_existing_macro : Warning<"poisoning existing macro">;
def pp_out_of_date_dependency : Warning<
"current file is older than dependency %0">;
@ -393,6 +414,10 @@ def ext_embedded_directive : Extension<
def ext_missing_varargs_arg : Extension<
"must specify at least one argument for '...' parameter of variadic macro">,
InGroup<GNUZeroVariadicMacroArguments>;
def warn_cxx17_compat_missing_varargs_arg : Warning<
"passing no argument for the '...' parameter of a variadic macro is "
"incompatible with C++ standards before C++20">,
InGroup<CXXPre20Compat>, DefaultIgnore;
def ext_empty_fnmacro_arg : Extension<
"empty macro arguments are a C99 feature">, InGroup<C99>;
def warn_cxx98_compat_empty_fnmacro_arg : Warning<
@ -423,6 +448,9 @@ def warn_pp_hdrstop_filename_ignored : Warning<
"#pragma hdrstop filename not supported, "
"/Fp can be used to specify precompiled header filename">,
InGroup<ClangClPch>;
def remark_pp_search_path_usage : Remark<
"search path used: '%0'">,
InGroup<UsedSearchPath>;
def err_pp_file_not_found_angled_include_not_fatal : Error<
"'%0' file not found with <angled> %select{include|import}1; "
"use \"quotes\" instead">;
@ -519,6 +547,27 @@ def warn_pragma_warning_expected_number :
ExtWarn<"#pragma warning expected a warning number">,
InGroup<UnknownPragmas>;
// - #pragma deprecated(...)
def warn_pragma_deprecated_macro_use :
ExtWarn<"macro %0 has been marked as deprecated%select{|: %2}1">,
InGroup<DeprecatedPragma>;
// - #pragma clang restrict_expansion(...)
def warn_pragma_restrict_expansion_macro_use :
ExtWarn<"macro %0 has been marked as unsafe for use in headers"
"%select{|: %2}1">,
InGroup<RestrictExpansionMacro>;
// - Note for macro annotations.
def note_pp_macro_annotation :
Note<"macro marked '%select{deprecated|restrict_expansion|final}0' here">;
// - #pragma clang final(...)
def warn_pragma_final_macro :
ExtWarn<"macro %0 has been marked as final and should not be "
"%select{undefined|redefined}1">,
InGroup<FinalMacro>, ShowInSystemHeader;
// - #pragma execution_character_set(...)
def warn_pragma_exec_charset_expected :
ExtWarn<"#pragma execution_character_set expected '%0'">,

View File

@ -549,6 +549,12 @@ def err_expected_init_in_condition_lparen : Error<
"variable declaration in condition cannot have a parenthesized initializer">;
def err_extraneous_rparen_in_condition : Error<
"extraneous ')' after condition, expected a statement">;
def ext_alias_in_init_statement : ExtWarn<
"alias declaration in this context is a C++2b extension">,
InGroup<CXX2b>;
def warn_cxx20_alias_in_init_statement : Warning<
"alias declaration in this context is incompatible with C++ standards before C++2b">,
DefaultIgnore, InGroup<CXXPre2bCompat>;
def warn_dangling_else : Warning<
"add explicit braces to avoid dangling else">,
InGroup<DanglingElse>;
@ -626,6 +632,13 @@ def ext_constexpr_if : ExtWarn<
def warn_cxx14_compat_constexpr_if : Warning<
"constexpr if is incompatible with C++ standards before C++17">,
DefaultIgnore, InGroup<CXXPre17Compat>;
def ext_consteval_if : ExtWarn<
"consteval if is a C++2b extension">,
InGroup<CXX2b>;
def warn_cxx20_compat_consteval_if : Warning<
"consteval if is incompatible with C++ standards before C++2b">,
InGroup<CXXPre2bCompat>, DefaultIgnore;
def ext_init_statement : ExtWarn<
"'%select{if|switch}0' initialization statements are a C++17 extension">,
InGroup<CXX17>;
@ -742,8 +755,9 @@ def err_unknown_template_name : Error<
"unknown template name %0">;
def err_expected_comma_greater : Error<
"expected ',' or '>' in template-parameter-list">;
def err_class_on_template_template_param : Error<
"template template parameter requires 'class' after the parameter list">;
def err_class_on_template_template_param
: Error<"template template parameter requires 'class'%select{| or "
"'typename'}0 after the parameter list">;
def ext_template_template_param_typename : ExtWarn<
"template template parameter using 'typename' is a C++17 extension">,
InGroup<CXX17>;
@ -806,10 +820,10 @@ def err_requires_expr_expected_type_constraint : Error<
def err_requires_expr_simple_requirement_noexcept : Error<
"'noexcept' can only be used in a compound requirement (with '{' '}' around "
"the expression)">;
def warn_requires_expr_in_simple_requirement : Warning<
"this requires expression will only be checked for syntactic validity; did "
def err_requires_expr_in_simple_requirement : Error<
"requires expression in requirement body; did "
"you intend to place it in a nested requirement? (add another 'requires' "
"before the expression)">, InGroup<DiagGroup<"requires-expression">>;
"before the expression)">;
def err_missing_dependent_template_keyword : Error<
"use 'template' keyword to treat '%0' as a dependent template name">;
@ -944,6 +958,9 @@ def err_duplicate_class_virt_specifier : Error<
def err_duplicate_virt_specifier : Error<
"class member already marked '%0'">;
def err_virt_specifier_outside_class : Error<
"'%0' specifier is not allowed outside a class definition">;
def err_expected_parameter_pack : Error<
"expected the name of a parameter pack">;
def err_paren_sizeof_parameter_pack : Error<
@ -1102,6 +1119,9 @@ def warn_pragma_expected_integer : Warning<
def warn_pragma_ms_struct : Warning<
"incorrect use of '#pragma ms_struct on|off' - ignored">,
InGroup<IgnoredPragmas>;
def warn_pragma_ms_fenv_access : Warning<
"incorrect use of '#pragma fenv_access (on|off)' - ignored">,
InGroup<IgnoredPragmas>;
def warn_pragma_extra_tokens_at_eol : Warning<
"extra tokens at end of '#pragma %0' - ignored">,
InGroup<IgnoredPragmas>;
@ -1167,9 +1187,6 @@ def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
// The C standard 7.6.1p2 says "The [FENV_ACCESS] pragma shall occur either
// outside external declarations or preceding all explicit declarations and
// statements inside a compound statement.
def err_pragma_stdc_fenv_access_scope : Error<
"'#pragma STDC FENV_ACCESS' can only appear at file scope or at the start of"
" a compound statement">;
def warn_stdc_fenv_round_not_supported :
Warning<"pragma STDC FENV_ROUND is not supported">,
InGroup<UnknownPragmas>;
@ -1303,8 +1320,8 @@ def err_omp_decl_in_declare_simd_variant : Error<
def err_omp_unknown_map_type : Error<
"incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'">;
def err_omp_unknown_map_type_modifier : Error<
"incorrect map type modifier, expected 'always', 'close', "
"%select{or 'mapper'|'mapper', or 'present'}0">;
"incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
"%select{|, 'present'}0%select{|, 'ompx_hold'}1">;
def err_omp_map_type_missing : Error<
"missing map type">;
def err_omp_map_type_modifier_missing : Error<
@ -1342,8 +1359,11 @@ def err_omp_mapper_illegal_identifier : Error<
"illegal OpenMP user-defined mapper identifier">;
def err_omp_mapper_expected_declarator : Error<
"expected declarator on 'omp declare mapper' directive">;
def err_omp_unexpected_append_op : Error<
"unexpected operation specified in 'append_args' clause, expected 'interop'">;
def err_omp_declare_variant_wrong_clause : Error<
"expected '%0' clause on 'omp declare variant' directive">;
"expected %select{'match'|'match', 'adjust_args', or 'append_args'}0 clause "
"on 'omp declare variant' directive">;
def err_omp_declare_variant_duplicate_nested_trait : Error<
"nested OpenMP context selector contains duplicated trait '%0'"
" in selector '%1' and set '%2' with different score">;
@ -1436,6 +1456,9 @@ def warn_omp51_compat_attributes : Warning<
"specifying OpenMP directives with [[]] is incompatible with OpenMP "
"standards before OpenMP 5.1">,
InGroup<OpenMPPre51Compat>, DefaultIgnore;
def err_omp_expected_colon : Error<"missing ':' in %0">;
def err_omp_expected_context_selector
: Error<"expected valid context selector in %0">;
// Pragma loop support.
def err_pragma_loop_missing_argument : Error<
@ -1472,7 +1495,7 @@ def warn_pragma_unroll_cuda_value_in_parens : Warning<
InGroup<CudaCompat>;
def warn_cuda_attr_lambda_position : Warning<
"nvcc does not allow '__%0__' to appear after '()' in lambdas">,
"nvcc does not allow '__%0__' to appear after the parameter list in lambdas">,
InGroup<CudaCompat>;
def warn_pragma_force_cuda_host_device_bad_arg : Warning<
"incorrect use of #pragma clang force_cuda_host_device begin|end">,

View File

@ -66,6 +66,7 @@ def warn_infinite_recursive_function : Warning<
def warn_comma_operator : Warning<"possible misuse of comma operator here">,
InGroup<DiagGroup<"comma">>, DefaultIgnore;
def note_cast_to_void : Note<"cast expression to void to silence warning">;
def note_cast_operand_to_int : Note<"cast one or both operands to int to silence this warning">;
// Constant expressions
def err_expr_not_ice : Error<
@ -82,11 +83,11 @@ def err_typecheck_converted_constant_expression_indirect : Error<
"bind reference to a temporary">;
def err_expr_not_cce : Error<
"%select{case value|enumerator value|non-type template argument|"
"array size|explicit specifier argument}0 "
"array size|explicit specifier argument|noexcept specifier argument}0 "
"is not a constant expression">;
def ext_cce_narrowing : ExtWarn<
"%select{case value|enumerator value|non-type template argument|"
"array size|explicit specifier argument}0 "
"array size|explicit specifier argument|noexcept specifier argument}0 "
"%select{cannot be narrowed from type %2 to %3|"
"evaluates to %2, which cannot be narrowed to type %3}1">,
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
@ -267,10 +268,12 @@ def err_invalid_vector_double_decl_spec : Error <
def err_invalid_vector_bool_int128_decl_spec : Error <
"use of '__int128' with '__vector bool' requires VSX support enabled (on "
"POWER10 or later)">;
def err_invalid_vector_int128_decl_spec : Error<
"use of '__int128' with '__vector' requires extended Altivec support"
" (available on POWER8 or later)">;
def err_invalid_vector_long_long_decl_spec : Error <
"use of 'long long' with '__vector bool' requires VSX support (available on "
"POWER7 or later) or extended Altivec support (available on POWER8 or later) "
"to be enabled">;
"use of 'long long' with '__vector' requires VSX support (available on "
"POWER7 or later) to be enabled">;
def err_invalid_vector_long_double_decl_spec : Error<
"cannot use 'long double' with '__vector'">;
def warn_vector_long_decl_spec_combination : Warning<
@ -388,6 +391,7 @@ def warn_reserved_extern_symbol: Warning<
"identifier %0 is reserved because %select{"
"<ERROR>|" // ReservedIdentifierStatus::NotReserved
"it starts with '_' at global scope|"
"it starts with '_' and has C language linkage|"
"it starts with '__'|"
"it starts with '_' followed by a capital letter|"
"it contains '__'}1">,
@ -682,6 +686,9 @@ def warn_unreachable_return : Warning<
def warn_unreachable_loop_increment : Warning<
"loop will run at most once (loop increment never executed)">,
InGroup<UnreachableCodeLoopIncrement>, DefaultIgnore;
def warn_unreachable_fallthrough_attr : Warning<
"fallthrough annotation in unreachable code">,
InGroup<UnreachableCodeFallthrough>, DefaultIgnore;
def note_unreachable_silence : Note<
"silence by adding parentheses to mark code as explicitly dead">;
@ -816,11 +823,20 @@ def warn_fortify_source_size_mismatch : Warning<
"'%0' size argument is too large; destination buffer has size %1,"
" but size argument is %2">, InGroup<FortifySource>;
def warn_fortify_strlen_overflow: Warning<
"'%0' will always overflow; destination buffer has size %1,"
" but the source string has length %2 (including NUL byte)">,
InGroup<FortifySource>;
def warn_fortify_source_format_overflow : Warning<
"'%0' will always overflow; destination buffer has size %1,"
" but format string expands to at least %2">,
InGroup<FortifySource>;
def warn_fortify_scanf_overflow : Warning<
"'%0' may overflow; destination buffer in argument %1 has size "
"%2, but the corresponding specifier may require size %3">,
InGroup<FortifySource>;
/// main()
// static main() is not an error in C, just in C++.
@ -908,6 +924,9 @@ def warn_pragma_options_align_reset_failed : Warning<
InGroup<IgnoredPragmas>;
def err_pragma_options_align_mac68k_target_unsupported : Error<
"mac68k alignment pragma is not supported on this target">;
def warn_pragma_align_not_xl_compatible : Warning<
"#pragma align(packed) may not be compatible with objects generated with AIX XL C/C++">,
InGroup<AIXCompat>;
def warn_pragma_pack_invalid_alignment : Warning<
"expected #pragma pack parameter to be '1', '2', '4', '8', or '16'">,
InGroup<IgnoredPragmas>;
@ -933,7 +952,8 @@ def warn_pragma_pack_pop_identifier_and_alignment : Warning<
def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">,
InGroup<IgnoredPragmas>;
def err_pragma_fc_pp_scope : Error<
"'#pragma float_control push/pop' can only appear at file scope or namespace scope">;
"'#pragma float_control push/pop' can only appear at file or namespace scope "
"or within a language linkage specification">;
def err_pragma_fc_noprecise_requires_nofenv : Error<
"'#pragma float_control(precise, off)' is illegal when fenv_access is enabled">;
def err_pragma_fc_except_requires_precise : Error<
@ -1493,6 +1513,10 @@ def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">;
def err_static_assert_requirement_failed : Error<
"static_assert failed due to requirement '%0'%select{ %2|}1">;
def warn_consteval_if_always_true : Warning<
"consteval if is always true in an %select{unevaluated|immediate}0 context">,
InGroup<DiagGroup<"redundant-consteval-if">>;
def ext_inline_variable : ExtWarn<
"inline variables are a C++17 extension">, InGroup<CXX17>;
def warn_cxx14_compat_inline_variable : Warning<
@ -1624,8 +1648,7 @@ def warn_weak_vtable : Warning<
"emitted in every translation unit">,
InGroup<DiagGroup<"weak-vtables">>, DefaultIgnore;
def warn_weak_template_vtable : Warning<
"explicit template instantiation %0 will emit a vtable in every "
"translation unit">,
"this warning is no longer in use and will be removed in the next release">,
InGroup<DiagGroup<"weak-template-vtables">>, DefaultIgnore;
def ext_using_undefined_std : ExtWarn<
@ -2953,7 +2976,7 @@ def err_attribute_requires_positive_integer : Error<
"%0 attribute requires a %select{positive|non-negative}1 "
"integral compile time constant expression">;
def err_attribute_requires_opencl_version : Error<
"%0 attribute requires OpenCL version %1%select{| or above}2">;
"attribute %0 is supported in the OpenCL version %1%select{| onwards}2">;
def err_invalid_branch_protection_spec : Error<
"invalid or misplaced branch protection specification '%0'">;
def warn_unsupported_target_attribute
@ -2980,6 +3003,8 @@ def err_alignas_mismatch : Error<
"redeclaration has different alignment requirement (%1 vs %0)">;
def err_alignas_underaligned : Error<
"requested alignment is less than minimum alignment of %1 for type %0">;
def warn_aligned_attr_underaligned : Warning<err_alignas_underaligned.Text>,
InGroup<IgnoredAttributes>;
def err_attribute_sizeless_type : Error<
"%0 attribute cannot be applied to sizeless type %1">;
def err_attribute_argument_n_type : Error<
@ -3256,7 +3281,8 @@ def warn_assume_aligned_too_great
InGroup<DiagGroup<"builtin-assume-aligned-alignment">>;
def warn_not_xl_compatible
: Warning<"requesting an alignment of 16 bytes or greater for struct"
" members is not binary compatible with AIX XL 16.1 and older">,
" members is not binary compatible with IBM XL C/C++ for AIX"
" 16.1.0 and older">,
InGroup<AIXCompat>;
def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
"%q0 redeclared without %1 attribute: previous %1 ignored">,
@ -3298,11 +3324,11 @@ def warn_attribute_has_no_effect_on_infinite_loop : Warning<
InGroup<IgnoredAttributes>;
def note_attribute_has_no_effect_on_infinite_loop_here : Note<
"annotating the infinite loop here">;
def warn_attribute_has_no_effect_on_if_constexpr : Warning<
"attribute %0 has no effect when annotating an 'if constexpr' statement">,
def warn_attribute_has_no_effect_on_compile_time_if : Warning<
"attribute %0 has no effect when annotating an 'if %select{constexpr|consteval}1' statement">,
InGroup<IgnoredAttributes>;
def note_attribute_has_no_effect_on_if_constexpr_here : Note<
"annotating the 'if constexpr' statement here">;
def note_attribute_has_no_effect_on_compile_time_if_here : Note<
"annotating the 'if %select{constexpr|consteval}0' statement here">;
def err_decl_attribute_invalid_on_stmt : Error<
"%0 attribute cannot be applied to a statement">;
def err_stmt_attribute_invalid_on_decl : Error<
@ -3382,7 +3408,7 @@ def warn_attribute_dllimport_static_field_definition : Warning<
InGroup<DiagGroup<"dllimport-static-field-def">>;
def warn_attribute_dllexport_explicit_instantiation_decl : Warning<
"explicit instantiation declaration should not be 'dllexport'">,
InGroup<DiagGroup<"dllexport-explicit-instantiation-decl">>;
InGroup<DllexportExplicitInstantiationDecl>;
def warn_attribute_dllexport_explicit_instantiation_def : Warning<
"'dllexport' attribute ignored on explicit instantiation definition">,
InGroup<IgnoredAttributes>;
@ -3532,6 +3558,9 @@ def warn_availability_swift_unavailable_deprecated_only : Warning<
InGroup<Availability>;
def note_protocol_method : Note<
"protocol method is here">;
def warn_availability_fuchsia_unavailable_minor : Warning<
"Fuchsia API Level prohibits specifying a minor or sub-minor version">,
InGroup<Availability>;
def warn_unguarded_availability :
Warning<"%0 is only available on %1 %2 or newer">,
@ -4472,7 +4501,8 @@ def note_ovl_candidate_bad_conv_incomplete : Note<
"; remove &}7">;
def note_ovl_candidate_bad_list_argument : Note<
"candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
"cannot convert initializer list argument to %4">;
"%select{cannot convert initializer list|too few initializers in list"
"|too many initializers in list}7 argument to %4">;
def note_ovl_candidate_bad_overload : Note<
"candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: "
"no overload of %4 matching %3 for %ordinal5 argument">;
@ -5563,8 +5593,8 @@ def warn_undefined_inline : Warning<"inline function %q0 is not defined">,
def err_undefined_inline_var : Error<"inline variable %q0 is not defined">;
def note_used_here : Note<"used here">;
def err_internal_linkage_redeclaration : Error<
"'internal_linkage' attribute does not appear on the first declaration of %0">;
def err_attribute_missing_on_first_decl : Error<
"%0 attribute does not appear on the first declaration">;
def warn_internal_linkage_local_storage : Warning<
"'internal_linkage' attribute on a non-static local variable is ignored">,
InGroup<IgnoredAttributes>;
@ -5727,7 +5757,7 @@ def warn_typecheck_function_qualifiers_unspecified : Warning<
"'%0' qualifier on function type %1 has unspecified behavior">;
def warn_typecheck_reference_qualifiers : Warning<
"'%0' qualifier on reference type %1 has no effect">,
InGroup<IgnoredQualifiers>;
InGroup<IgnoredReferenceQualifiers>;
def err_typecheck_invalid_restrict_not_pointer : Error<
"restrict requires a pointer or reference (%0 is invalid)">;
def err_typecheck_invalid_restrict_not_pointer_noarg : Error<
@ -5926,6 +5956,8 @@ def note_protected_by_vla_type_alias : Note<
"jump bypasses initialization of VLA type alias">;
def note_protected_by_constexpr_if : Note<
"jump enters controlled statement of constexpr if">;
def note_protected_by_consteval_if : Note<
"jump enters controlled statement of consteval if">;
def note_protected_by_if_available : Note<
"jump enters controlled statement of if available">;
def note_protected_by_vla : Note<
@ -6397,11 +6429,6 @@ def warn_gnu_null_ptr_arith : Warning<
def warn_pointer_sub_null_ptr : Warning<
"performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">,
InGroup<NullPointerSubtraction>, DefaultIgnore;
def err_kernel_invalidates_sycl_unique_stable_name
: Error<"kernel instantiation changes the result of an evaluated "
"'__builtin_sycl_unique_stable_name'">;
def note_sycl_unique_stable_name_evaluated_here
: Note<"'__builtin_sycl_unique_stable_name' evaluated here">;
def warn_floatingpoint_eq : Warning<
"comparing floating point with == or != is unsafe">,
@ -6770,7 +6797,7 @@ def warn_taking_address_of_packed_member : Warning<
"taking address of packed member %0 of class or structure %q1 may result in an unaligned pointer value">,
InGroup<DiagGroup<"address-of-packed-member">>;
def warn_param_mismatched_alignment : Warning<
"passing %0-byte aligned argument to %1-byte aligned parameter %2 of %3 may result in an unaligned pointer access">,
"passing %0-byte aligned argument to %1-byte aligned parameter %2%select{| of %4}3 may result in an unaligned pointer access">,
InGroup<DiagGroup<"align-mismatch">>;
def err_objc_object_assignment : Error<
@ -7413,10 +7440,13 @@ def note_member_declared_here : Note<
"member %0 declared here">;
def note_member_first_declared_here : Note<
"member %0 first declared here">;
def warn_bitwise_instead_of_logical : Warning<
"use of bitwise '%0' with boolean operands">,
InGroup<BitwiseInsteadOfLogical>, DefaultIgnore;
def warn_bitwise_negation_bool : Warning<
"bitwise negation of a boolean expression%select{;| always evaluates to 'true';}0 "
"did you mean logical negation?">,
InGroup<DiagGroup<"bool-operation">>;
InGroup<BoolOperation>, DefaultIgnore;
def err_decrement_bool : Error<"cannot decrement expression of type bool">;
def warn_increment_bool : Warning<
"incrementing expression of type bool is deprecated and "
@ -7490,7 +7520,8 @@ def note_throw_in_function : Note<"function declared non-throwing here">;
def err_seh_try_outside_functions : Error<
"cannot use SEH '__try' in blocks, captured regions, or Obj-C method decls">;
def err_mixing_cxx_try_seh_try : Error<
"cannot use C++ 'try' in the same function as SEH '__try'">;
"cannot use %select{C++ 'try'|Objective-C '@try'}0 "
"in the same function as SEH '__try'">;
def err_seh_try_unsupported : Error<
"SEH '__try' is not supported on this target">;
def note_conflicting_try_here : Note<
@ -8380,8 +8411,10 @@ def err_ref_bad_target_global_initializer : Error<
"function %1 in global initializer">;
def err_capture_bad_target : Error<
"capture host variable %0 by reference in device or host device lambda function">;
def err_capture_bad_target_this_ptr : Error<
"capture host side class data member by this pointer in device or host device lambda function">;
def warn_maybe_capture_bad_target_this_ptr : Warning<
"capture host side class data member by this pointer in device or host device lambda function "
"may result in invalid memory access if this pointer is not accessible on device side">,
InGroup<DiagGroup<"gpu-maybe-wrong-side">>;
def warn_kern_is_method : Extension<
"kernel function %0 is a member function; this may not be accepted by nvcc">,
InGroup<CudaCompat>;
@ -8551,6 +8584,9 @@ def err_typecheck_choose_expr_requires_constant : Error<
"'__builtin_choose_expr' requires a constant expression">;
def warn_unused_expr : Warning<"expression result unused">,
InGroup<UnusedValue>;
def warn_unused_comma_left_operand : Warning<
"left operand of comma operator has no effect">,
InGroup<UnusedValue>;
def warn_unused_voidptr : Warning<
"expression result unused; should this cast be to 'void'?">,
InGroup<UnusedValue>;
@ -9142,14 +9178,18 @@ def note_defaulted_comparison_calls_deleted : Note<
"defaulted %0 is implicitly deleted because it would invoke a deleted "
"comparison function%select{| for member %2| for base class %2}1">;
def note_defaulted_comparison_no_viable_function : Note<
"defaulted %0 is implicitly deleted because there is no viable three-way "
"comparison function for%select{| member| base class}1 %2">;
"defaulted %0 is implicitly deleted because there is no viable "
"%select{three-way comparison function|'operator=='}1 for "
"%select{|member |base class }2%3">;
def note_defaulted_comparison_no_viable_function_synthesized : Note<
"three-way comparison cannot be synthesized because there is no viable "
"function for %select{'=='|'<'}0 comparison">;
def note_defaulted_comparison_not_rewritten_callee : Note<
"defaulted %0 is implicitly deleted because this non-rewritten comparison "
"function would be the best match for the comparison">;
def note_defaulted_comparison_not_rewritten_conversion : Note<
"defaulted %0 is implicitly deleted because a builtin comparison function "
"using this conversion would be the best match for the comparison">;
def note_defaulted_comparison_cannot_deduce : Note<
"return type of defaulted 'operator<=>' cannot be deduced because "
"return type %2 of three-way comparison for %select{|member|base class}0 %1 "
@ -9570,9 +9610,6 @@ def err_fallthrough_attr_outside_switch : Error<
"fallthrough annotation is outside switch statement">;
def err_fallthrough_attr_invalid_placement : Error<
"fallthrough annotation does not directly precede switch label">;
def warn_fallthrough_attr_unreachable : Warning<
"fallthrough annotation in unreachable code">,
InGroup<ImplicitFallthrough>, DefaultIgnore;
def warn_unreachable_default : Warning<
"default label in switch which covers all enumeration values">,
@ -9668,10 +9705,6 @@ def warn_falloff_noreturn_function : Warning<
InGroup<InvalidNoreturn>;
def err_noreturn_block_has_return_expr : Error<
"block declared 'noreturn' should not return">;
def err_noreturn_missing_on_first_decl : Error<
"function declared '[[noreturn]]' after its first declaration">;
def note_noreturn_missing_first_decl : Note<
"declaration missing '[[noreturn]]' attribute is here">;
def err_carries_dependency_missing_on_first_decl : Error<
"%select{function|parameter}0 declared '[[carries_dependency]]' "
"after its first declaration">;
@ -9729,6 +9762,9 @@ def err_argument_invalid_range : Error<
def warn_argument_invalid_range : Warning<
"argument value %0 is outside the valid range [%1, %2]">, DefaultError,
InGroup<DiagGroup<"argument-outside-range">>;
def warn_argument_undefined_behaviour : Warning<
"argument value %0 will result in undefined behaviour">,
InGroup<DiagGroup<"argument-undefined-behaviour">>;
def err_argument_not_multiple : Error<
"argument should be a multiple of %0">;
def err_argument_not_power_of_2 : Error<
@ -9769,8 +9805,14 @@ def err_mips_builtin_requires_msa : Error<
"this builtin requires 'msa' ASE, please use -mmsa">;
def err_ppc_builtin_only_on_arch : Error<
"this builtin is only valid on POWER%0 or later CPUs">;
def err_ppc_builtin_requires_vsx : Error<
"this builtin requires VSX to be enabled">;
def err_ppc_builtin_requires_abi : Error<
"this builtin requires ABI -mabi=%0">;
def err_ppc_invalid_use_mma_type : Error<
"invalid use of PPC MMA type">;
def err_ppc_invalid_test_data_class_type : Error<
"expected a 'float' or 'double' for the first argument">;
def err_x86_builtin_invalid_rounding : Error<
"invalid rounding argument">;
def err_x86_builtin_invalid_scale : Error<
@ -10091,8 +10133,7 @@ def err_opencl_type_can_only_be_used_as_function_parameter : Error <
def err_opencl_type_not_found : Error<
"%0 type %1 not found; include the base header with -finclude-default-header">;
def warn_opencl_attr_deprecated_ignored : Warning <
"%0 attribute is deprecated and ignored in OpenCL version %1">,
InGroup<IgnoredAttributes>;
"%0 attribute is deprecated and ignored in %1">, InGroup<IgnoredAttributes>;
def err_opencl_variadic_function : Error<
"invalid prototype, variadic arguments are not allowed in OpenCL">;
def err_opencl_requires_extension : Error<
@ -10100,8 +10141,6 @@ def err_opencl_requires_extension : Error<
def ext_opencl_double_without_pragma : Extension<
"Clang permits use of type 'double' regardless pragma if 'cl_khr_fp64' is"
" supported">;
def err_opencl_double_requires_extension : Error<
"use of type 'double' requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0 support">;
def warn_opencl_generic_address_space_arg : Warning<
"passing non-generic address space pointer to %0"
" may cause dynamic conversion affecting performance">,
@ -10159,7 +10198,7 @@ def err_opencl_builtin_expected_type : Error<
// OpenCL v3.0 s6.3.7 - Vector Components
def ext_opencl_ext_vector_type_rgba_selector: ExtWarn<
"vector component name '%0' is an OpenCL C version 3.0 feature">,
"vector component name '%0' is a feature from OpenCL version 3.0 onwards">,
InGroup<OpenCLUnsupportedRGBA>;
def err_openclcxx_placement_new : Error<
@ -10530,6 +10569,8 @@ def err_omp_map_shared_storage : Error<
"variable already marked as mapped in current construct">;
def err_omp_invalid_map_type_for_directive : Error<
"%select{map type '%1' is not allowed|map type must be specified}0 for '#pragma omp %2'">;
def err_omp_invalid_map_type_modifier_for_directive : Error<
"map type modifier '%0' is not allowed for '#pragma omp %1'">;
def err_omp_no_clause_for_directive : Error<
"expected at least one %0 clause for '#pragma omp %1'">;
def err_omp_threadprivate_in_clause : Error<
@ -10558,6 +10599,8 @@ def err_omp_depend_sink_unexpected_expr : Error<
"unexpected expression: number of expressions is larger than the number of associated loops">;
def err_omp_depend_sink_expected_plus_minus : Error<
"expected '+' or '-' operation">;
def err_omp_taskwait_depend_mutexinoutset_not_allowed : Error<
"'mutexinoutset' modifier not allowed in 'depend' clause on 'taskwait' directive">;
def err_omp_depend_sink_source_not_allowed : Error<
"'depend(%select{source|sink:vec}0)' clause%select{|s}0 cannot be mixed with 'depend(%select{sink:vec|source}0)' clause%select{s|}0">;
def err_omp_depend_zero_length_array_section_not_allowed : Error<
@ -10679,9 +10722,9 @@ def err_omp_invariant_or_linear_dependency : Error<
"expected loop invariant expression or '<invariant1> * %0 + <invariant2>' kind of expression">;
def err_omp_wrong_dependency_iterator_type : Error<
"expected an integer or a pointer type of the outer loop counter '%0' for non-rectangular nests">;
def err_device_unsupported_type
: Error<"%0 requires %select{|%2 bit size}1 %3 type support, but device "
"'%4' does not support it">;
def err_target_unsupported_type
: Error<"%0 requires %select{|%2 bit size}1 %3 %select{|return }4type support,"
" but target '%5' does not support it">;
def err_omp_lambda_capture_in_declare_target_not_to : Error<
"variable captured in declare target region must appear in a to clause">;
def err_omp_device_type_mismatch : Error<
@ -10716,9 +10759,14 @@ def err_omp_declare_variant_diff : Error<
"function with '#pragma omp declare variant' has a different %select{calling convention"
"|return type|constexpr specification|inline specification|storage class|"
"linkage}0">;
def err_omp_declare_variant_prototype_required : Error<
"function with '#pragma omp declare variant' must have a prototype when "
"'append_args' is used">;
def err_omp_interop_type_not_found : Error<
"'omp_interop_t' must be defined when 'append_args' clause is used; include <omp.h>">;
def err_omp_declare_variant_incompat_types : Error<
"variant in '#pragma omp declare variant' with type %0 is incompatible with type %1"
>;
"variant in '#pragma omp declare variant' with type %0 is incompatible with"
" type %1%select{| with appended arguments}2">;
def warn_omp_declare_variant_marked_as_declare_variant : Warning<
"variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'"
>, InGroup<SourceUsesOpenMP>;
@ -10764,6 +10812,9 @@ def note_omp_protected_structured_block
: Note<"jump bypasses OpenMP structured block">;
def note_omp_exits_structured_block
: Note<"jump exits scope of OpenMP structured block">;
def err_omp_lastprivate_loop_var_non_loop_iteration : Error<
"only loop iteration variables are allowed in 'lastprivate' clause in "
"'omp loop' directives">;
def err_omp_interop_variable_expected : Error<
"expected%select{| non-const}0 variable of type 'omp_interop_t'">;
def err_omp_interop_variable_wrong_type : Error<
@ -10781,6 +10832,14 @@ def err_omp_dispatch_statement_call
def err_omp_unroll_full_variable_trip_count : Error<
"loop to be fully unrolled must have a constant trip count">;
def note_omp_directive_here : Note<"'%0' directive found here">;
def err_omp_instantiation_not_supported
: Error<"instantiation of '%0' not supported yet">;
def err_omp_adjust_arg_multiple_clauses : Error<
"'adjust_arg' argument %0 used in multiple clauses">;
def err_omp_clause_requires_dispatch_construct : Error<
"'%0' clause requires 'dispatch' context selector">;
def err_omp_append_args_with_varargs : Error<
"'append_args' is not allowed with varargs functions">;
} // end of OpenMP category
let CategoryName = "Related Result Type Issue" in {
@ -10951,19 +11010,29 @@ def err_coroutine_invalid_func_context : Error<
"|a function with a deduced return type|a varargs function"
"|a consteval function}0">;
def err_implied_coroutine_type_not_found : Error<
"%0 type was not found; include <experimental/coroutine> before defining "
"a coroutine">;
"%0 type was not found; include <coroutine> before defining "
"a coroutine; include <experimental/coroutine> if your version "
"of libcxx is less than 14.0">;
def warn_deprecated_coroutine_namespace : Warning<
"Please move from std::experimental::%0 to std::%0. "
"Support for std::experimental::%0 will be removed in LLVM 15.">,
InGroup<DeprecatedExperimentalCoroutine>;
def err_mixed_use_std_and_experimental_namespace_for_coroutine : Error <
"Found mixed use of std namespace and std::experimental namespace for "
"coroutine, which is disallowed. The coroutine components in "
"std::experimental namespace is deprecated. Please use coroutine components "
"under std namespace.">;
def err_implicit_coroutine_std_nothrow_type_not_found : Error<
"std::nothrow was not found; include <new> before defining a coroutine which "
"uses get_return_object_on_allocation_failure()">;
def err_malformed_std_nothrow : Error<
"std::nothrow must be a valid variable declaration">;
def err_malformed_std_coroutine_handle : Error<
"std::experimental::coroutine_handle must be a class template">;
"std::coroutine_handle isn't a class template">;
def err_coroutine_handle_missing_member : Error<
"std::experimental::coroutine_handle missing a member named '%0'">;
"std::coroutine_handle must have a member named '%0'">;
def err_malformed_std_coroutine_traits : Error<
"'std::experimental::coroutine_traits' must be a class template">;
"std::coroutine_traits isn't a class template">;
def err_implied_std_coroutine_traits_promise_type_not_found : Error<
"this function cannot be a coroutine: %q0 has no member named 'promise_type'">;
def err_implied_std_coroutine_traits_promise_type_not_class : Error<
@ -11193,8 +11262,8 @@ def err_multiversion_mismatched_attrs
"%0 %select{is missing|has different arguments}1">;
def err_multiversion_diff : Error<
"multiversioned function declaration has a different %select{calling convention"
"|return type|constexpr specification|inline specification|storage class|"
"linkage}0">;
"|return type|constexpr specification|inline specification|linkage|"
"language linkage}0">;
def err_multiversion_doesnt_support : Error<
"attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not "
"yet support %select{function templates|virtual functions|"
@ -11259,6 +11328,12 @@ def err_builtin_launder_invalid_arg : Error<
"%select{non-pointer|function pointer|void pointer}0 argument to "
"'__builtin_launder' is not allowed">;
def err_builtin_invalid_arg_type: Error <
"%ordinal0 argument must be a "
"%select{vector, integer or floating point type|matrix|"
"pointer to a valid matrix element type|"
"signed integer or floating point type|vector type}1 (was %2)">;
def err_builtin_matrix_disabled: Error<
"matrix types extension is disabled. Pass -fenable-matrix to enable it">;
def err_matrix_index_not_integer: Error<
@ -11271,11 +11346,8 @@ def err_matrix_separate_incomplete_index: Error<
"matrix row and column subscripts cannot be separated by any expression">;
def err_matrix_subscript_comma: Error<
"comma expressions are not allowed as indices in matrix subscript expressions">;
def err_builtin_matrix_arg: Error<"1st argument must be a matrix">;
def err_builtin_matrix_scalar_unsigned_arg: Error<
"%0 argument must be a constant unsigned integer expression">;
def err_builtin_matrix_pointer_arg: Error<
"%ordinal0 argument must be a pointer to a valid matrix element type">;
def err_builtin_matrix_pointer_arg_mismatch: Error<
"the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
def err_builtin_matrix_store_to_const: Error<

View File

@ -20,7 +20,7 @@ def err_fe_pch_malformed_block : Error<
def err_fe_ast_file_modified : Error<
"file '%0' has been modified since the "
"%select{precompiled header|module file|AST file}1 '%2' was built"
": %select{size|mtime|content}3 changed">,
": %select{size|mtime|content}3 changed%select{| (was %5, now %6)}4">,
DefaultFatal;
def err_fe_pch_file_overridden : Error<
"file '%0' from the precompiled header has been overridden">;

View File

@ -43,11 +43,28 @@ class SourceLocation;
enum class ReservedIdentifierStatus {
NotReserved = 0,
StartsWithUnderscoreAtGlobalScope,
StartsWithUnderscoreAndIsExternC,
StartsWithDoubleUnderscore,
StartsWithUnderscoreFollowedByCapitalLetter,
ContainsDoubleUnderscore,
};
/// Determine whether an identifier is reserved for use as a name at global
/// scope. Such identifiers might be implementation-specific global functions
/// or variables.
inline bool isReservedAtGlobalScope(ReservedIdentifierStatus Status) {
return Status != ReservedIdentifierStatus::NotReserved;
}
/// Determine whether an identifier is reserved in all contexts. Such
/// identifiers might be implementation-specific keywords or macros, for
/// example.
inline bool isReservedInAllContexts(ReservedIdentifierStatus Status) {
return Status != ReservedIdentifierStatus::NotReserved &&
Status != ReservedIdentifierStatus::StartsWithUnderscoreAtGlobalScope &&
Status != ReservedIdentifierStatus::StartsWithUnderscoreAndIsExternC;
}
/// A simple pair of identifier info and location.
using IdentifierLocPair = std::pair<IdentifierInfo *, SourceLocation>;
@ -121,7 +138,16 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
// True if this is a mangled OpenMP variant name.
unsigned IsMangledOpenMPVariantName : 1;
// 28 bits left in a 64-bit word.
// True if this is a deprecated macro.
unsigned IsDeprecatedMacro : 1;
// True if this macro is unsafe in headers.
unsigned IsRestrictExpansion : 1;
// True if this macro is final.
unsigned IsFinal : 1;
// 22 bits left in a 64-bit word.
// Managed by the language front-end.
void *FETokenInfo = nullptr;
@ -134,7 +160,8 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
IsPoisoned(false), IsCPPOperatorKeyword(false),
NeedsHandleIdentifier(false), IsFromAST(false), ChangedAfterLoad(false),
FEChangedAfterLoad(false), RevertedTokenID(false), OutOfDate(false),
IsModulesImport(false), IsMangledOpenMPVariantName(false) {}
IsModulesImport(false), IsMangledOpenMPVariantName(false),
IsDeprecatedMacro(false), IsRestrictExpansion(false), IsFinal(false) {}
public:
IdentifierInfo(const IdentifierInfo &) = delete;
@ -182,6 +209,14 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
NeedsHandleIdentifier = true;
HadMacro = true;
} else {
// If this is a final macro, make the deprecation and header unsafe bits
// stick around after the undefinition so they apply to any redefinitions.
if (!IsFinal) {
// Because calling the setters of these calls recomputes, just set them
// manually to avoid recomputing a bunch of times.
IsDeprecatedMacro = false;
IsRestrictExpansion = false;
}
RecomputeNeedsHandleIdentifier();
}
}
@ -192,6 +227,34 @@ class alignas(IdentifierInfoAlignment) IdentifierInfo {
return HadMacro;
}
bool isDeprecatedMacro() const { return IsDeprecatedMacro; }
void setIsDeprecatedMacro(bool Val) {
if (IsDeprecatedMacro == Val)
return;
IsDeprecatedMacro = Val;
if (Val)
NeedsHandleIdentifier = true;
else
RecomputeNeedsHandleIdentifier();
}
bool isRestrictExpansion() const { return IsRestrictExpansion; }
void setIsRestrictExpansion(bool Val) {
if (IsRestrictExpansion == Val)
return;
IsRestrictExpansion = Val;
if (Val)
NeedsHandleIdentifier = true;
else
RecomputeNeedsHandleIdentifier();
}
bool isFinal() const { return IsFinal; }
void setIsFinal(bool Val) { IsFinal = Val; }
/// If this is a source-language token (e.g. 'for'), this API
/// can be used to cause the lexer to map identifiers to source-language
/// tokens.

View File

@ -12,6 +12,7 @@
#include "clang/Basic/LLVM.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <iterator>
@ -70,7 +71,7 @@ inline std::string JsonFormat(StringRef RawSR, bool AddQuotes) {
}
// Remove new-lines.
Str.erase(std::remove(Str.begin(), Str.end(), '\n'), Str.end());
llvm::erase_value(Str, '\n');
if (!AddQuotes)
return Str;
@ -98,18 +99,19 @@ inline void printSourceLocationAsJson(raw_ostream &Out, SourceLocation Loc,
if (AddBraces)
Out << "{ ";
std::string filename(PLoc.getFilename());
#ifdef _WIN32
// Remove forbidden Windows path characters
auto RemoveIt =
std::remove_if(filename.begin(), filename.end(), [](auto Char) {
static const char ForbiddenChars[] = "<>*?\"|";
return std::find(std::begin(ForbiddenChars), std::end(ForbiddenChars),
Char) != std::end(ForbiddenChars);
});
filename.erase(RemoveIt, filename.end());
// Handle windows-specific path delimiters.
std::replace(filename.begin(), filename.end(), '\\', '/');
#endif
if (is_style_windows(llvm::sys::path::Style::native)) {
// Remove forbidden Windows path characters
auto RemoveIt =
std::remove_if(filename.begin(), filename.end(), [](auto Char) {
static const char ForbiddenChars[] = "<>*?\"|";
return std::find(std::begin(ForbiddenChars),
std::end(ForbiddenChars),
Char) != std::end(ForbiddenChars);
});
filename.erase(RemoveIt, filename.end());
// Handle windows-specific path delimiters.
std::replace(filename.begin(), filename.end(), '\\', '/');
}
Out << "\"line\": " << PLoc.getLine()
<< ", \"column\": " << PLoc.getColumn()
<< ", \"file\": \"" << filename << "\"";

View File

@ -224,13 +224,14 @@ LANGOPT(OpenCLVersion , 32, 0, "OpenCL C version")
LANGOPT(OpenCLCPlusPlus , 1, 0, "C++ for OpenCL")
LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "C++ for OpenCL version")
LANGOPT(OpenCLGenericAddressSpace, 1, 0, "OpenCL generic keyword")
LANGOPT(OpenCLPipe , 1, 0, "OpenCL pipe keyword")
LANGOPT(OpenCLPipes , 1, 0, "OpenCL pipes language constructs and built-ins")
LANGOPT(NativeHalfType , 1, 0, "Native half type support")
LANGOPT(NativeHalfArgsAndReturns, 1, 0, "Native half args and returns")
LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns")
LANGOPT(CUDA , 1, 0, "CUDA")
LANGOPT(HIP , 1, 0, "HIP")
LANGOPT(OpenMP , 32, 0, "OpenMP support and version of OpenMP (31, 40 or 45)")
LANGOPT(OpenMPExtensions , 1, 1, "Enable all Clang extensions for OpenMP directives and clauses")
LANGOPT(OpenMPSimd , 1, 0, "Use SIMD only OpenMP support.")
LANGOPT(OpenMPUseTLS , 1, 0, "Use TLS for threadprivates or runtime calls")
LANGOPT(OpenMPIsDevice , 1, 0, "Generate code only for OpenMP target device")
@ -241,7 +242,10 @@ LANGOPT(OpenMPCUDANumSMs , 32, 0, "Number of SMs for CUDA devices.")
LANGOPT(OpenMPCUDABlocksPerSM , 32, 0, "Number of blocks per SM for CUDA devices.")
LANGOPT(OpenMPCUDAReductionBufNum , 32, 1024, "Number of the reduction records in the intermediate reduction buffer used for the teams reductions.")
LANGOPT(OpenMPTargetNewRuntime , 1, 0, "Use the new bitcode library for OpenMP offloading")
LANGOPT(OpenMPTargetDebug , 32, 0, "Enable debugging in the OpenMP offloading device RTL")
LANGOPT(OpenMPOptimisticCollapse , 1, 0, "Use at most 32 bits to represent the collapsed loop nest counter.")
LANGOPT(OpenMPThreadSubscription , 1, 0, "Assume work-shared loops do not have more iterations than participating threads.")
LANGOPT(OpenMPTeamSubscription , 1, 0, "Assume distributed loops do not have more iterations than participating teams.")
LANGOPT(RenderScript , 1, 0, "RenderScript")
LANGOPT(CUDAIsDevice , 1, 0, "compiling for CUDA device")
@ -280,6 +284,7 @@ BENIGN_LANGOPT(VisibilityInlinesHiddenStaticLocalVar, 1, 0,
"hidden visibility for static local variables in inline C++ "
"methods when -fvisibility-inlines hidden is enabled")
LANGOPT(GlobalAllocationFunctionVisibilityHidden , 1, 0, "hidden visibility for global operator new and delete declaration")
LANGOPT(NewInfallible , 1, 0, "Treats throwing global C++ operator new as always returning valid memory (annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.")
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")
@ -397,6 +402,7 @@ ENUM_LANGOPT(ClangABICompat, ClangABI, 4, ClangABI::Latest,
"with")
COMPATIBLE_VALUE_LANGOPT(FunctionAlignment, 5, 0, "Default alignment for functions")
COMPATIBLE_VALUE_LANGOPT(LoopAlignment, 32, 0, "Default alignment for loops")
LANGOPT(FixedPoint, 1, 0, "fixed point types")
LANGOPT(PaddingOnUnsignedFixedPoint, 1, 0,
@ -419,12 +425,15 @@ LANGOPT(SpeculativeLoadHardening, 1, 0, "Speculative load hardening enabled")
LANGOPT(RelativeCXXABIVTables, 1, 0,
"Use an ABI-incompatible v-table layout that uses relative references")
LANGOPT(ArmSveVectorBits, 32, 0, "SVE vector size in bits")
LANGOPT(VScaleMin, 32, 0, "Minimum vscale value")
LANGOPT(VScaleMax, 32, 0, "Maximum vscale value")
ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32,
ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32,
"Controls how scalar integer arguments are extended in calls "
"to unprototyped and varargs functions")
VALUE_LANGOPT(FuchsiaAPILevel, 32, 0, "Fuchsia API level")
#undef LANGOPT
#undef COMPATIBLE_LANGOPT
#undef BENIGN_LANGOPT

View File

@ -354,6 +354,9 @@ class LangOptions : public LangOptionsBase {
/// A list of all -fno-builtin-* function names (e.g., memset).
std::vector<std::string> NoBuiltinFuncs;
/// A prefix map for __FILE__, __BASE_FILE__ and __builtin_FILE().
std::map<std::string, std::string, std::greater<std::string>> MacroPrefixMap;
/// Triples of the OpenMP targets that the host code codegen should
/// take into account in order to generate accurate offloading descriptors.
std::vector<llvm::Triple> OMPTargetTriples;
@ -428,6 +431,13 @@ class LangOptions : public LangOptionsBase {
/// Return the OpenCL C or C++ version as a VersionTuple.
VersionTuple getOpenCLVersionTuple() const;
/// Return the OpenCL version that kernel language is compatible with
unsigned getOpenCLCompatibleVersion() const;
/// Return the OpenCL C or C++ for OpenCL language name and version
/// as a string.
std::string getOpenCLVersionString() const;
/// Check if return address signing is enabled.
bool hasSignReturnAddress() const {
return getSignReturnAddressScope() != SignReturnAddressScopeKind::None;
@ -460,6 +470,9 @@ class LangOptions : public LangOptionsBase {
}
bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; }
/// Remap path prefix according to -fmacro-prefix-path option.
void remapPathPrefix(SmallString<256> &Path) const;
};
/// Floating point control options

View File

@ -180,8 +180,15 @@ LANGSTANDARD(opencl20, "cl2.0",
LANGSTANDARD(opencl30, "cl3.0",
OpenCL, "OpenCL 3.0",
LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD(openclcpp, "clc++",
OpenCL, "C++ for OpenCL",
LANGSTANDARD(openclcpp10, "clc++1.0",
OpenCL, "C++ for OpenCL 1.0",
LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
Digraphs | HexFloat | OpenCL)
LANGSTANDARD_ALIAS(openclcpp10, "clc++")
LANGSTANDARD(openclcpp2021, "clc++2021",
OpenCL, "C++ for OpenCL 2021",
LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
Digraphs | HexFloat | OpenCL)
@ -190,7 +197,9 @@ LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0")
LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++")
LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++1.0")
LANGSTANDARD_ALIAS_DEPR(openclcpp2021, "CLC++2021")
// CUDA
LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",

View File

@ -238,8 +238,7 @@ MSP430_MCU_FEAT("msp430f4793", "32bit")
MSP430_MCU_FEAT("msp430f4784", "32bit")
MSP430_MCU_FEAT("msp430f4794", "32bit")
// Generic MSUs
MSP430_MCU("msp430")
// Generic MCUs
MSP430_MCU("msp430i2xxgeneric")
#undef MSP430_MCU

View File

@ -18,6 +18,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/HashBuilder.h"
#include "llvm/Support/VersionTuple.h"
#include <string>
@ -480,6 +481,12 @@ class ObjCRuntime {
friend llvm::hash_code hash_value(const ObjCRuntime &OCR) {
return llvm::hash_combine(OCR.getKind(), OCR.getVersion());
}
template <typename HasherT, llvm::support::endianness Endianness>
friend void addHash(llvm::HashBuilderImpl<HasherT, Endianness> &HBuilder,
const ObjCRuntime &OCR) {
HBuilder.add(OCR.getKind(), OCR.getVersion());
}
};
raw_ostream &operator<<(raw_ostream &out, const ObjCRuntime &value);

View File

@ -58,7 +58,7 @@ static inline OpenCLVersionID encodeOpenCLVersion(unsigned OpenCLVersion) {
// mask.
static inline bool isOpenCLVersionContainedInMask(const LangOptions &LO,
unsigned Mask) {
auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
auto CLVer = LO.getOpenCLCompatibleVersion();
OpenCLVersionID Code = encodeOpenCLVersion(CLVer);
return Mask & Code;
}
@ -79,8 +79,8 @@ class OpenCLOptions {
// the __opencl_c_program_scope_global_variables feature is supported
// C++ for OpenCL inherits rule from OpenCL C v2.0.
bool areProgramScopeVariablesSupported(const LangOptions &Opts) const {
return Opts.OpenCLCPlusPlus || Opts.OpenCLVersion == 200 ||
(Opts.OpenCLVersion == 300 &&
return Opts.getOpenCLCompatibleVersion() == 200 ||
(Opts.getOpenCLCompatibleVersion() == 300 &&
isSupported("__opencl_c_program_scope_global_variables", Opts));
}
@ -115,8 +115,7 @@ class OpenCLOptions {
// Is option available in OpenCL version \p LO.
bool isAvailableIn(const LangOptions &LO) const {
// In C++ mode all extensions should work at least as in v2.0.
auto CLVer = LO.OpenCLCPlusPlus ? 200 : LO.OpenCLVersion;
return CLVer >= Avail;
return LO.getOpenCLCompatibleVersion() >= Avail;
}
// Is core option in OpenCL version \p LO.

View File

@ -59,6 +59,12 @@
#ifndef OPENMP_REDUCTION_MODIFIER
#define OPENMP_REDUCTION_MODIFIER(Name)
#endif
#ifndef OPENMP_ADJUST_ARGS_KIND
#define OPENMP_ADJUST_ARGS_KIND(Name)
#endif
#ifndef OPENMP_BIND_KIND
#define OPENMP_BIND_KIND(Name)
#endif
// Static attributes for 'schedule' clause.
OPENMP_SCHEDULE_KIND(static)
@ -123,6 +129,8 @@ OPENMP_MAP_MODIFIER_KIND(always)
OPENMP_MAP_MODIFIER_KIND(close)
OPENMP_MAP_MODIFIER_KIND(mapper)
OPENMP_MAP_MODIFIER_KIND(present)
// This is an OpenMP extension for the sake of OpenACC support.
OPENMP_MAP_MODIFIER_KIND(ompx_hold)
// Modifiers for 'to' or 'from' clause.
OPENMP_MOTION_MODIFIER_KIND(mapper)
@ -147,6 +155,17 @@ OPENMP_REDUCTION_MODIFIER(default)
OPENMP_REDUCTION_MODIFIER(inscan)
OPENMP_REDUCTION_MODIFIER(task)
// Adjust-op kinds for the 'adjust_args' clause.
OPENMP_ADJUST_ARGS_KIND(nothing)
OPENMP_ADJUST_ARGS_KIND(need_device_ptr)
// Binding kinds for the 'bind' clause.
OPENMP_BIND_KIND(teams)
OPENMP_BIND_KIND(parallel)
OPENMP_BIND_KIND(thread)
#undef OPENMP_BIND_KIND
#undef OPENMP_ADJUST_ARGS_KIND
#undef OPENMP_REDUCTION_MODIFIER
#undef OPENMP_DEVICE_MODIFIER
#undef OPENMP_ORDER_KIND

View File

@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_BASIC_OPENMPKINDS_H
#define LLVM_CLANG_BASIC_OPENMPKINDS_H
#include "clang/Basic/LangOptions.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Frontend/OpenMP/OMPConstants.h"
@ -166,8 +167,22 @@ enum OpenMPReductionClauseModifier {
OMPC_REDUCTION_unknown,
};
/// OpenMP adjust-op kinds for 'adjust_args' clause.
enum OpenMPAdjustArgsOpKind {
#define OPENMP_ADJUST_ARGS_KIND(Name) OMPC_ADJUST_ARGS_##Name,
#include "clang/Basic/OpenMPKinds.def"
OMPC_ADJUST_ARGS_unknown,
};
/// OpenMP bindings for the 'bind' clause.
enum OpenMPBindClauseKind {
#define OPENMP_BIND_KIND(Name) OMPC_BIND_##Name,
#include "clang/Basic/OpenMPKinds.def"
OMPC_BIND_unknown
};
unsigned getOpenMPSimpleClauseType(OpenMPClauseKind Kind, llvm::StringRef Str,
unsigned OpenMPVersion);
const LangOptions &LangOpts);
const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type);
/// Checks if the specified directive is a directive with an associated
@ -245,6 +260,13 @@ bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind);
/// otherwise - false.
bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind);
/// Checks if the specified directive constitutes a 'loop' directive in the
/// outermost nest. For example, 'omp teams loop' or 'omp loop'.
/// \param DKind Specified directive.
/// \return true - the directive has loop on the outermost nest.
/// otherwise - false.
bool isOpenMPGenericLoopDirective(OpenMPDirectiveKind DKind);
/// Checks if the specified clause is one of private clauses like
/// 'private', 'firstprivate', 'reduction' etc..
/// \param Kind Clause kind.

View File

@ -16,6 +16,7 @@
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/HashBuilder.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
#include <cassert>
#include <cstdint>
@ -72,6 +73,12 @@ class SanitizerMask {
llvm::hash_code hash_value() const;
template <typename HasherT, llvm::support::endianness Endianness>
friend void addHash(llvm::HashBuilderImpl<HasherT, Endianness> &HBuilder,
const SanitizerMask &SM) {
HBuilder.addRange(&SM.maskLoToHigh[0], &SM.maskLoToHigh[kNumElem]);
}
constexpr explicit operator bool() const {
return maskLoToHigh[0] || maskLoToHigh[1];
}

View File

@ -23,8 +23,6 @@
namespace llvm {
template <typename T> struct DenseMapInfo;
class FoldingSetNodeID;
template <typename T> struct FoldingSetTrait;
@ -363,6 +361,10 @@ class FileEntry;
/// A SourceLocation and its associated SourceManager.
///
/// This is useful for argument passing to functions that expect both objects.
///
/// This class does not guarantee the presence of either the SourceManager or
/// a valid SourceLocation. Clients should use `isValid()` and `hasManager()`
/// before calling the member functions.
class FullSourceLoc : public SourceLocation {
const SourceManager *SrcMgr = nullptr;
@ -373,13 +375,10 @@ class FullSourceLoc : public SourceLocation {
explicit FullSourceLoc(SourceLocation Loc, const SourceManager &SM)
: SourceLocation(Loc), SrcMgr(&SM) {}
bool hasManager() const {
bool hasSrcMgr = SrcMgr != nullptr;
assert(hasSrcMgr == isValid() && "FullSourceLoc has location but no manager");
return hasSrcMgr;
}
/// Checks whether the SourceManager is present.
bool hasManager() const { return SrcMgr != nullptr; }
/// \pre This FullSourceLoc has an associated SourceManager.
/// \pre hasManager()
const SourceManager &getManager() const {
assert(SrcMgr && "SourceManager is NULL.");
return *SrcMgr;
@ -466,7 +465,7 @@ namespace llvm {
/// Define DenseMapInfo so that FileID's can be used as keys in DenseMap and
/// DenseSets.
template <>
struct DenseMapInfo<clang::FileID> {
struct DenseMapInfo<clang::FileID, void> {
static clang::FileID getEmptyKey() {
return {};
}
@ -487,7 +486,7 @@ namespace llvm {
/// Define DenseMapInfo so that SourceLocation's can be used as keys in
/// DenseMap and DenseSet. This trait class is eqivalent to
/// DenseMapInfo<unsigned> which uses SourceLocation::ID is used as a key.
template <> struct DenseMapInfo<clang::SourceLocation> {
template <> struct DenseMapInfo<clang::SourceLocation, void> {
static clang::SourceLocation getEmptyKey() {
constexpr clang::SourceLocation::UIntTy Zero = 0;
return clang::SourceLocation::getFromRawEncoding(~Zero);

View File

@ -31,6 +31,15 @@ namespace clang {
/// Define the kind of constexpr specifier.
enum class ConstexprSpecKind { Unspecified, Constexpr, Consteval, Constinit };
/// In an if statement, this denotes whether the the statement is
/// a constexpr or consteval if statement.
enum class IfStatementKind : unsigned {
Ordinary,
Constexpr,
ConstevalNonNegated,
ConstevalNegated
};
/// Specifies the width of a type, e.g., short, long, or long long.
enum class TypeSpecifierWidth { Unspecified, Short, Long, LongLong };
@ -59,6 +68,7 @@ namespace clang {
TST_float,
TST_double,
TST_float128,
TST_ibm128,
TST_bool, // _Bool
TST_decimal32, // _Decimal32
TST_decimal64, // _Decimal64

View File

@ -39,7 +39,7 @@ namespace clang {
/// is insufficient, calls Diag to emit a diagnostic before calling Fn.
inline void runWithSufficientStackSpace(llvm::function_ref<void()> Diag,
llvm::function_ref<void()> Fn) {
#ifdef LLVM_ENABLE_THREADS
#if LLVM_ENABLE_THREADS
if (LLVM_UNLIKELY(isStackNearlyExhausted()))
runWithSufficientStackSpaceSlow(Diag, Fn);
else

View File

@ -219,12 +219,14 @@ def AsTypeExpr : StmtNode<Expr>;
// OpenMP Directives.
def OMPCanonicalLoop : StmtNode<Stmt>;
def OMPExecutableDirective : StmtNode<Stmt, 1>;
def OMPMetaDirective : StmtNode<OMPExecutableDirective>;
def OMPLoopBasedDirective : StmtNode<OMPExecutableDirective, 1>;
def OMPLoopDirective : StmtNode<OMPLoopBasedDirective, 1>;
def OMPParallelDirective : StmtNode<OMPExecutableDirective>;
def OMPSimdDirective : StmtNode<OMPLoopDirective>;
def OMPTileDirective : StmtNode<OMPLoopBasedDirective>;
def OMPUnrollDirective : StmtNode<OMPLoopBasedDirective>;
def OMPLoopTransformationDirective : StmtNode<OMPLoopBasedDirective, 1>;
def OMPTileDirective : StmtNode<OMPLoopTransformationDirective>;
def OMPUnrollDirective : StmtNode<OMPLoopTransformationDirective>;
def OMPForDirective : StmtNode<OMPLoopDirective>;
def OMPForSimdDirective : StmtNode<OMPLoopDirective>;
def OMPSectionsDirective : StmtNode<OMPExecutableDirective>;
@ -280,3 +282,4 @@ def OMPTargetTeamsDistributeSimdDirective : StmtNode<OMPLoopDirective>;
def OMPInteropDirective : StmtNode<OMPExecutableDirective>;
def OMPDispatchDirective : StmtNode<OMPExecutableDirective>;
def OMPMaskedDirective : StmtNode<OMPExecutableDirective>;
def OMPGenericLoopDirective : StmtNode<OMPLoopDirective>;

View File

@ -124,10 +124,21 @@ namespace clang {
enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, LastTSBuiltin };
}
namespace RISCVVector {
enum {
LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
#include "clang/Basic/BuiltinsRISCVVector.def"
FirstTSBuiltin,
};
}
/// RISCV builtins
namespace RISCV {
enum {
LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1,
FirstRVVBuiltin = clang::Builtin::FirstTSBuiltin,
LastRVVBuiltin = RISCVVector::FirstTSBuiltin - 1,
#define BUILTIN(ID, TYPE, ATTRS) BI##ID,
#include "clang/Basic/BuiltinsRISCV.def"
LastTSBuiltin

View File

@ -53,6 +53,15 @@ class SourceManager;
namespace Builtin { struct Info; }
enum class FloatModeKind {
NoFloat = 255,
Float = 0,
Double,
LongDouble,
Float128,
Ibm128
};
/// Fields controlling how types are laid out in memory; these may need to
/// be copied for targets like AMDGPU that base their ABIs on an auxiliary
/// CPU target.
@ -64,7 +73,7 @@ struct TransferrableTargetInfo {
unsigned char BFloat16Width, BFloat16Align;
unsigned char FloatWidth, FloatAlign;
unsigned char DoubleWidth, DoubleAlign;
unsigned char LongDoubleWidth, LongDoubleAlign, Float128Align;
unsigned char LongDoubleWidth, LongDoubleAlign, Float128Align, Ibm128Align;
unsigned char LargeArrayMinWidth, LargeArrayAlign;
unsigned char LongWidth, LongAlign;
unsigned char LongLongWidth, LongLongAlign;
@ -104,7 +113,7 @@ struct TransferrableTargetInfo {
unsigned MaxTLSAlign;
const llvm::fltSemantics *HalfFormat, *BFloat16Format, *FloatFormat,
*DoubleFormat, *LongDoubleFormat, *Float128Format;
*DoubleFormat, *LongDoubleFormat, *Float128Format, *Ibm128Format;
///===---- Target Data Type Query Methods -------------------------------===//
enum IntType {
@ -121,13 +130,6 @@ struct TransferrableTargetInfo {
UnsignedLongLong
};
enum RealType {
NoFloat = 255,
Float = 0,
Double,
LongDouble,
Float128
};
protected:
IntType SizeType, IntMaxType, PtrDiffType, IntPtrType, WCharType, WIntType,
Char16Type, Char32Type, Int64Type, Int16Type, SigAtomicType,
@ -200,6 +202,9 @@ class TargetInfo : public virtual TransferrableTargetInfo,
bool HasFloat128;
bool HasFloat16;
bool HasBFloat16;
bool HasIbm128;
bool HasLongDouble;
bool HasFPReturn;
bool HasStrictFP;
unsigned char MaxAtomicPromoteWidth, MaxAtomicInlineWidth;
@ -210,9 +215,6 @@ class TargetInfo : public virtual TransferrableTargetInfo,
unsigned char RegParmMax, SSERegParmMax;
TargetCXXABI TheCXXABI;
const LangASMap *AddrSpaceMap;
const unsigned *GridValues =
nullptr; // Array of target-specific GPU grid values that must be
// consistent between host RTL (plugin), device RTL, and clang.
mutable StringRef PlatformName;
mutable VersionTuple PlatformMinVersion;
@ -401,7 +403,8 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// is represented as one of those two). At this time, there is no support
/// for an explicit "PPC double-double" type (i.e. __ibm128) so we only
/// need to differentiate between "long double" and IEEE quad precision.
RealType getRealTypeByWidth(unsigned BitWidth, bool ExplicitIEEE) const;
FloatModeKind getRealTypeByWidth(unsigned BitWidth,
FloatModeKind ExplicitType) const;
/// Return the alignment (in bits) of the specified integer type enum.
///
@ -597,6 +600,16 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// Determine whether the _BFloat16 type is supported on this target.
virtual bool hasBFloat16Type() const { return HasBFloat16; }
/// Determine whether the __ibm128 type is supported on this target.
virtual bool hasIbm128Type() const { return HasIbm128; }
/// Determine whether the long double type is supported on this target.
virtual bool hasLongDoubleType() const { return HasLongDouble; }
/// Determine whether return of a floating point value is supported
/// on this target.
virtual bool hasFPReturn() const { return HasFPReturn; }
/// Determine whether constrained floating point is supported on this target.
virtual bool hasStrictFP() const { return HasStrictFP; }
@ -675,12 +688,23 @@ class TargetInfo : public virtual TransferrableTargetInfo,
return *Float128Format;
}
/// getIbm128Width/Align/Format - Return the size/align/format of
/// '__ibm128'.
unsigned getIbm128Width() const { return 128; }
unsigned getIbm128Align() const { return Ibm128Align; }
const llvm::fltSemantics &getIbm128Format() const { return *Ibm128Format; }
/// Return the mangled code of long double.
virtual const char *getLongDoubleMangling() const { return "e"; }
/// Return the mangled code of __float128.
virtual const char *getFloat128Mangling() const { return "g"; }
/// Return the mangled code of __ibm128.
virtual const char *getIbm128Mangling() const {
llvm_unreachable("ibm128 not implemented on this target");
}
/// Return the mangled code of bfloat.
virtual const char *getBFloat16Mangling() const {
llvm_unreachable("bfloat not implemented on this target");
@ -833,8 +857,8 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// Check whether the given real type should use the "fpret" flavor of
/// Objective-C message passing on this target.
bool useObjCFPRetForRealType(RealType T) const {
return RealTypeUsesObjCFPRet & (1 << T);
bool useObjCFPRetForRealType(FloatModeKind T) const {
return RealTypeUsesObjCFPRet & (1 << (int)T);
}
/// Check whether _Complex long double should use the "fp2ret" flavor
@ -870,6 +894,11 @@ class TargetInfo : public virtual TransferrableTargetInfo,
/// across the current set of primary and secondary targets.
virtual ArrayRef<Builtin::Info> getTargetBuiltins() const = 0;
/// Returns target-specific min and max values VScale_Range.
virtual Optional<std::pair<unsigned, unsigned>>
getVScaleRange(const LangOptions &LangOpts) const {
return None;
}
/// 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
@ -993,8 +1022,7 @@ class TargetInfo : public virtual TransferrableTargetInfo,
}
bool isValidAsmImmediate(const llvm::APInt &Value) const {
if (!ImmSet.empty())
return Value.isSignedIntN(32) &&
ImmSet.count(Value.getZExtValue()) != 0;
return Value.isSignedIntN(32) && ImmSet.contains(Value.getZExtValue());
return !ImmRange.isConstrained ||
(Value.sge(ImmRange.Min) && Value.sle(ImmRange.Max));
}
@ -1404,10 +1432,10 @@ class TargetInfo : public virtual TransferrableTargetInfo,
return LangAS::Default;
}
/// Return a target-specific GPU grid value based on the GVIDX enum \p gv
unsigned getGridValue(llvm::omp::GVIDX gv) const {
assert(GridValues != nullptr && "GridValues not initialized");
return GridValues[gv];
// access target-specific GPU grid values that must be consistent between
// host RTL (plugin), deviceRTL and clang.
virtual const llvm::omp::GV &getGridValue() const {
llvm_unreachable("getGridValue not implemented on this target");
}
/// Retrieve the name of the platform as it is used in the

View File

@ -438,6 +438,7 @@ TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompatible, KEYNOCXX)
KEYWORD(__builtin_va_arg , KEYALL)
KEYWORD(__extension__ , KEYALL)
KEYWORD(__float128 , KEYALL)
KEYWORD(__ibm128 , KEYALL)
KEYWORD(__imag , KEYALL)
KEYWORD(__int128 , KEYALL)
KEYWORD(__label__ , KEYALL)
@ -827,10 +828,11 @@ PRAGMA_ANNOTATION(pragma_redefine_extname)
// handles them.
PRAGMA_ANNOTATION(pragma_fp_contract)
// Annotation for #pragma STDC FENV_ACCESS
// Annotations for #pragma STDC FENV_ACCESS and #pragma fenv_access (MS compat)
// The lexer produces these so that they only take effect when the parser
// handles them.
PRAGMA_ANNOTATION(pragma_fenv_access)
PRAGMA_ANNOTATION(pragma_fenv_access_ms)
// Annotation for #pragma STDC FENV_ROUND
// The lexer produces these so that they only take effect when the parser

View File

@ -1,110 +0,0 @@
//===--- X86Target.def - X86 Feature/Processor Database ---------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the X86-specific Features and Processors, as used by
// the X86 Targets.
//
//===----------------------------------------------------------------------===//
#ifndef FEATURE
#define FEATURE(ENUM)
#endif
#ifndef CPU_SPECIFIC
#define CPU_SPECIFIC(NAME, MANGLING, FEATURES)
#endif
#ifndef CPU_SPECIFIC_ALIAS
#define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME)
#endif
// List of CPU Supports features in order. These need to remain in the order
// required by attribute 'target' checking. Note that not all are supported/
// prioritized by GCC, so synchronization with GCC's implementation may require
// changing some existing values.
FEATURE(FEATURE_CMOV)
FEATURE(FEATURE_MMX)
FEATURE(FEATURE_SSE)
FEATURE(FEATURE_SSE2)
FEATURE(FEATURE_SSE3)
FEATURE(FEATURE_SSSE3)
FEATURE(FEATURE_SSE4_A)
FEATURE(FEATURE_SSE4_1)
FEATURE(FEATURE_SSE4_2)
FEATURE(FEATURE_POPCNT)
FEATURE(FEATURE_AES)
FEATURE(FEATURE_PCLMUL)
FEATURE(FEATURE_AVX)
FEATURE(FEATURE_BMI)
FEATURE(FEATURE_FMA4)
FEATURE(FEATURE_XOP)
FEATURE(FEATURE_FMA)
FEATURE(FEATURE_BMI2)
FEATURE(FEATURE_AVX2)
FEATURE(FEATURE_AVX512F)
FEATURE(FEATURE_AVX512VL)
FEATURE(FEATURE_AVX512BW)
FEATURE(FEATURE_AVX512DQ)
FEATURE(FEATURE_AVX512CD)
FEATURE(FEATURE_AVX512ER)
FEATURE(FEATURE_AVX512PF)
FEATURE(FEATURE_AVX512VBMI)
FEATURE(FEATURE_AVX512IFMA)
FEATURE(FEATURE_AVX5124VNNIW)
FEATURE(FEATURE_AVX5124FMAPS)
FEATURE(FEATURE_AVX512VPOPCNTDQ)
FEATURE(FEATURE_AVX512VBMI2)
FEATURE(FEATURE_GFNI)
FEATURE(FEATURE_VPCLMULQDQ)
FEATURE(FEATURE_AVX512VNNI)
FEATURE(FEATURE_AVX512BITALG)
FEATURE(FEATURE_AVX512BF16)
FEATURE(FEATURE_AVX512VP2INTERSECT)
// FIXME: When commented out features are supported in LLVM, enable them here.
CPU_SPECIFIC("generic", 'A', "")
CPU_SPECIFIC("pentium", 'B', "")
CPU_SPECIFIC("pentium_pro", 'C', "+cmov")
CPU_SPECIFIC("pentium_mmx", 'D', "+mmx")
CPU_SPECIFIC("pentium_ii", 'E', "+cmov,+mmx")
CPU_SPECIFIC("pentium_iii", 'H', "+cmov,+mmx,+sse")
CPU_SPECIFIC_ALIAS("pentium_iii_no_xmm_regs", "pentium_iii")
CPU_SPECIFIC("pentium_4", 'J', "+cmov,+mmx,+sse,+sse2")
CPU_SPECIFIC("pentium_m", 'K', "+cmov,+mmx,+sse,+sse2")
CPU_SPECIFIC("pentium_4_sse3", 'L', "+cmov,+mmx,+sse,+sse2,+sse3")
CPU_SPECIFIC("core_2_duo_ssse3", 'M', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3")
CPU_SPECIFIC("core_2_duo_sse4_1", 'N', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1")
CPU_SPECIFIC("atom", 'O', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+movbe")
CPU_SPECIFIC("atom_sse4_2", 'c', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
CPU_SPECIFIC("core_i7_sse4_2", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
CPU_SPECIFIC("core_aes_pclmulqdq", 'Q', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
CPU_SPECIFIC("atom_sse4_2_movbe", 'd', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt")
CPU_SPECIFIC("goldmont", 'i', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt")
CPU_SPECIFIC("sandybridge", 'R', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx")
CPU_SPECIFIC_ALIAS("core_2nd_gen_avx", "sandybridge")
CPU_SPECIFIC("ivybridge", 'S', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+f16c,+avx")
CPU_SPECIFIC_ALIAS("core_3rd_gen_avx", "ivybridge")
CPU_SPECIFIC("haswell", 'V', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2")
CPU_SPECIFIC_ALIAS("core_4th_gen_avx", "haswell")
CPU_SPECIFIC("core_4th_gen_avx_tsx", 'W', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2")
CPU_SPECIFIC("broadwell", 'X', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx")
CPU_SPECIFIC_ALIAS("core_5th_gen_avx", "broadwell")
CPU_SPECIFIC("core_5th_gen_avx_tsx", 'Y', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx")
CPU_SPECIFIC("knl", 'Z', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd")
CPU_SPECIFIC_ALIAS("mic_avx512", "knl")
CPU_SPECIFIC("skylake", 'b', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx,+mpx")
CPU_SPECIFIC( "skylake_avx512", 'a', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512cd,+avx512bw,+avx512vl,+clwb")
CPU_SPECIFIC("cannonlake", 'e', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512ifma,+avx512cd,+avx512bw,+avx512vl,+avx512vbmi")
CPU_SPECIFIC("knm", 'j', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd,+avx5124fmaps,+avx5124vnniw,+avx512vpopcntdq")
#undef CPU_SPECIFIC_ALIAS
#undef CPU_SPECIFIC
#undef PROC_64_BIT
#undef PROC_32_BIT
#undef FEATURE

View File

@ -170,16 +170,27 @@ class RVVBuiltin<string suffix, string prototype, string type_range,
// is always the first operand in builtin and IR intrinsic.
bit HasMaskedOffOperand = true;
// This builtin has a granted vector length parameter in the last position.
// This builtin has a granted vector length parameter.
bit HasVL = true;
// There are several cases for specifying tail policy.
// 1. Add tail policy argument to masked intrinsics. It may have the maskedoff
// argument or not.
// * Have the maskedoff argument: (HasPolicy = true, HasMaskedOffOperand = true)
// Ex: vadd_vv_i8m1_mt(mask, maskedoff, op1, op2, vl, ta);
// * Do not have the maskedoff argument: (HasPolicy = true, HasMaskedOffOperand = false)
// Ex: vmacc_vv_i8m1_mt(mask, vd, vs1, vs2, vl, ta);
// 2. Add dest argument for no mask intrinsics. (TODO)
// Ex: vmv_v_x_i8m1_t(dest, src, vl);
// 3. Always tail agnostic. (HasPolicy = false)
// Ex: vmseq_vv_i8m1_b8_m(mask, maskedoff, op1, op2, vl);
// The tail policy argument is located at the last position.
bit HasPolicy = true;
// This builtin supports non-masked function overloading api.
// All masked operations support overloading api.
bit HasNoMaskedOverloaded = true;
// Reads or writes "memory" or has other side-effects.
bit HasSideEffects = false;
// This builtin is valid for the given Log2LMULs.
list<int> Log2LMUL = [0, 1, 2, 3, -1, -2, -3];
@ -204,13 +215,18 @@ class RVVBuiltin<string suffix, string prototype, string type_range,
// an automatic definition in header is emitted.
string HeaderCode = "";
// Sub extension of vector spec. Currently only support Zvamo or Zvlsseg.
// Sub extension of vector spec. Currently only support Zvlsseg.
string RequiredExtension = "";
// Number of fields for Zvlsseg.
int NF = 1;
}
class RVVHeader
{
code HeaderCode;
}
//===----------------------------------------------------------------------===//
// Basic classes with automatic codegen.
//===----------------------------------------------------------------------===//
@ -557,6 +573,7 @@ class IsFloat<string type> {
}
let HasNoMaskedOverloaded = false,
HasPolicy = false,
ManualCodegen = [{
IntrinsicTypes = {ResultType, Ops[1]->getType()};
Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo());
@ -568,10 +585,24 @@ let HasNoMaskedOverloaded = false,
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
}] in {
class RVVVLEMaskBuiltin : RVVBuiltin<"m", "mPCUe", "c"> {
let Name = "vle1_v";
let IRName = "vle1";
let Name = "vlm_v";
let IRName = "vlm";
let HasMask = false;
}
}
let HasNoMaskedOverloaded = false,
ManualCodegen = [{
IntrinsicTypes = {ResultType, Ops[1]->getType()};
Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo());
}],
ManualCodegenMask= [{
// Move mask to right before vl.
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
IntrinsicTypes = {ResultType, Ops[3]->getType()};
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
}] in {
multiclass RVVVLEBuiltin<list<string> types> {
let Name = NAME # "_v",
IRName = "vle",
@ -602,7 +633,7 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0});
// Store new_vl.
clang::CharUnits Align =
CGM.getNaturalTypeAlignment(getContext().getSizeType());
CGM.getNaturalPointeeTypeAlignment(E->getArg(1)->getType());
Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}),
Address(NewVL, Align));
return V;
@ -612,6 +643,7 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
{
// Move mask to right before vl.
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
IntrinsicTypes = {ResultType, Ops[4]->getType()};
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
Value *NewVL = Ops[2];
@ -621,7 +653,7 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0});
// Store new_vl.
clang::CharUnits Align =
CGM.getNaturalTypeAlignment(getContext().getSizeType());
CGM.getNaturalPointeeTypeAlignment(E->getArg(3)->getType());
Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}),
Address(NewVL, Align));
return V;
@ -649,6 +681,7 @@ multiclass RVVVLSEBuiltin<list<string> types> {
ManualCodegenMask= [{
// Move mask to right before vl.
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
IntrinsicTypes = {ResultType, Ops[4]->getType()};
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
}] in {
@ -669,6 +702,7 @@ multiclass RVVIndexedLoad<string op> {
ManualCodegenMask = [{
// Move mask to right before vl.
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops[4]->getType()};
Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo());
}] in {
@ -688,6 +722,7 @@ multiclass RVVIndexedLoad<string op> {
}
let HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
// Builtin: (ptr, value, vl). Intrinsic: (value, ptr, vl)
std::swap(Ops[0], Ops[1]);
@ -701,8 +736,8 @@ let HasMaskedOffOperand = false,
IntrinsicTypes = {Ops[0]->getType(), Ops[3]->getType()};
}] in {
class RVVVSEMaskBuiltin : RVVBuiltin<"m", "0PUem", "c"> {
let Name = "vse1_v";
let IRName = "vse1";
let Name = "vsm_v";
let IRName = "vsm";
let HasMask = false;
}
multiclass RVVVSEBuiltin<list<string> types> {
@ -724,6 +759,7 @@ multiclass RVVVSSEBuiltin<list<string> types> {
IRName = "vsse",
IRNameMask = "vsse_mask",
HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
// Builtin: (ptr, stride, value, vl). Intrinsic: (value, ptr, stride, vl)
std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3);
@ -747,6 +783,7 @@ multiclass RVVVSSEBuiltin<list<string> types> {
multiclass RVVIndexedStore<string op> {
let HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
// Builtin: (ptr, index, value, vl). Intrinsic: (value, ptr, index, vl)
std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3);
@ -805,14 +842,14 @@ multiclass RVVUnitStridedSegLoad<string op> {
ManualCodegen = [{
{
// builtin: (val0 address, val1 address, ..., ptr, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[NF + 1]->getType()};
// intrinsic: (ptr, vl)
llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1]};
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -825,7 +862,7 @@ multiclass RVVUnitStridedSegLoad<string op> {
{
// builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl)
// intrinsic: (maskedoff0, ..., ptr, mask, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[2 * NF + 2]->getType()};
SmallVector<llvm::Value*, 12> Operands;
for (unsigned I = 0; I < NF; ++I)
@ -833,11 +870,12 @@ multiclass RVVUnitStridedSegLoad<string op> {
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 2]);
assert(Operands.size() == NF + 3);
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
assert(Operands.size() == NF + 4);
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -875,15 +913,15 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
ManualCodegen = [{
{
// builtin: (val0 address, val1 address, ..., ptr, new_vl, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[NF + 2]->getType()};
// intrinsic: (ptr, vl)
llvm::Value *Operands[] = {Ops[NF], Ops[NF + 2]};
Value *NewVL = Ops[NF + 1];
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
for (unsigned I = 0; I < NF; ++I) {
Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
Address(Ops[I], Align));
@ -897,7 +935,7 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
{
// builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl)
// intrinsic: (maskedoff0, ..., ptr, mask, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[2 * NF + 3]->getType()};
SmallVector<llvm::Value*, 12> Operands;
for (unsigned I = 0; I < NF; ++I)
@ -905,12 +943,13 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 3]);
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
Value *NewVL = Ops[2 * NF + 2];
assert(Operands.size() == NF + 3);
assert(Operands.size() == NF + 4);
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
for (unsigned I = 0; I < NF; ++I) {
Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
Address(Ops[I], Align));
@ -949,14 +988,14 @@ multiclass RVVStridedSegLoad<string op> {
ManualCodegen = [{
{
// builtin: (val0 address, val1 address, ..., ptr, stride, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[NF + 2]->getType()};
// intrinsic: (ptr, stride, vl)
llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1], Ops[NF + 2]};
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -969,7 +1008,7 @@ multiclass RVVStridedSegLoad<string op> {
{
// builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl)
// intrinsic: (maskedoff0, ..., ptr, stride, mask, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[2 * NF + 3]->getType()};
SmallVector<llvm::Value*, 12> Operands;
for (unsigned I = 0; I < NF; ++I)
@ -978,11 +1017,12 @@ multiclass RVVStridedSegLoad<string op> {
Operands.push_back(Ops[2 * NF + 2]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 3]);
assert(Operands.size() == NF + 4);
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
assert(Operands.size() == NF + 5);
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -1015,14 +1055,14 @@ multiclass RVVIndexedSegLoad<string op> {
ManualCodegen = [{
{
// builtin: (val0 address, val1 address, ..., ptr, index, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[NF + 1]->getType(), Ops[NF + 2]->getType()};
// intrinsic: (ptr, index, vl)
llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1], Ops[NF + 2]};
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -1034,7 +1074,7 @@ multiclass RVVIndexedSegLoad<string op> {
ManualCodegenMask = [{
{
// builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl)
IntrinsicTypes = {Ops[0]->getType()->getPointerElementType(),
IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()),
Ops[2 * NF + 2]->getType(), Ops[2 * NF + 3]->getType()};
// intrinsic: (maskedoff0, ..., ptr, index, mask, vl)
SmallVector<llvm::Value*, 12> Operands;
@ -1044,11 +1084,12 @@ multiclass RVVIndexedSegLoad<string op> {
Operands.push_back(Ops[2 * NF + 2]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 3]);
assert(Operands.size() == NF + 4);
Operands.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
assert(Operands.size() == NF + 5);
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
llvm::Value *LoadValue = Builder.CreateCall(F, Operands, "");
clang::CharUnits Align = CharUnits::fromQuantity(
IntrinsicTypes[0]->getScalarSizeInBits() / 8);
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
@ -1094,6 +1135,7 @@ multiclass RVVUnitStridedSegStore<string op> {
IRNameMask = op # nf # "_mask",
NF = nf,
HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
{
// Builtin: (ptr, val0, val1, ..., vl)
@ -1139,6 +1181,7 @@ multiclass RVVStridedSegStore<string op> {
IRNameMask = op # nf # "_mask",
NF = nf,
HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
{
// Builtin: (ptr, stride, val0, val1, ..., vl).
@ -1180,6 +1223,7 @@ multiclass RVVIndexedSegStore<string op> {
IRNameMask = op # nf # "_mask",
NF = nf,
HasMaskedOffOperand = false,
HasPolicy = false,
ManualCodegen = [{
{
// Builtin: (ptr, index, val0, val1, ..., vl)
@ -1213,35 +1257,6 @@ multiclass RVVIndexedSegStore<string op> {
}
}
multiclass RVVAMOBuiltinSet<bit has_signed = false, bit has_unsigned = false,
bit has_fp = false> {
defvar type_list = !if(has_fp, ["i","l","f","d"], ["i","l"]);
foreach type = type_list in
foreach eew_list = EEWList in {
defvar eew = eew_list[0];
defvar eew_index = eew_list[1];
let Name = NAME # "ei" # eew # "_" # "v",
IRName = NAME,
IRNameMask = NAME # "_mask",
HasMaskedOffOperand = false,
ManualCodegen = [{
// base, bindex, value, vl
IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[3]->getType()};
Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo());
}],
ManualCodegenMask = [{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[4]->getType()};
Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo());
}] in {
if has_signed then
def : RVVBuiltin<"v", "vPe" # eew_index # "Uvv", type>;
if !and(!not(IsFloat<type>.val), has_unsigned) then
def : RVVBuiltin<"Uv", "UvPUe" # eew_index # "UvUv", type>;
}
}
}
multiclass RVVPseudoUnaryBuiltin<string IR, string type_range> {
let Name = NAME,
IRName = IR,
@ -1259,6 +1274,7 @@ multiclass RVVPseudoUnaryBuiltin<string IR, string type_range> {
ManualCodegenMask = [{
{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
// maskedoff, op1, mask, vl
IntrinsicTypes = {ResultType,
cast<llvm::VectorType>(ResultType)->getElementType(),
@ -1289,6 +1305,7 @@ multiclass RVVPseudoVNotBuiltin<string IR, string type_range> {
ManualCodegenMask = [{
{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
// maskedoff, op1, mask, vl
IntrinsicTypes = {ResultType,
cast<llvm::VectorType>(ResultType)->getElementType(),
@ -1336,6 +1353,7 @@ multiclass RVVPseudoVFUnaryBuiltin<string IR, string type_range> {
ManualCodegenMask = [{
{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
// maskedoff, op1, mask, vl
IntrinsicTypes = {ResultType,
Ops[1]->getType(),
@ -1368,6 +1386,7 @@ multiclass RVVPseudoVWCVTBuiltin<string IR, string MName, string type_range,
ManualCodegenMask = [{
{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
// maskedoff, op1, mask, vl
IntrinsicTypes = {ResultType,
Ops[1]->getType(),
@ -1403,6 +1422,7 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range,
ManualCodegenMask = [{
{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);
Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED));
// maskedoff, op1, mask, vl
IntrinsicTypes = {ResultType,
Ops[1]->getType(),
@ -1422,7 +1442,7 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range,
// 6.1. vsetvli/vsetvl instructions
let HasVL = false,
HasMask = false,
HasSideEffects = true,
HasPolicy = false,
Log2LMUL = [0],
ManualCodegen = [{IntrinsicTypes = {ResultType};}] in // Set XLEN type
{
@ -1492,13 +1512,13 @@ let HasVL = false,
// 7. Vector Loads and Stores
// 7.4. Vector Unit-Stride Instructions
def vle1: RVVVLEMaskBuiltin;
def vlm: RVVVLEMaskBuiltin;
defm vle8: RVVVLEBuiltin<["c"]>;
defm vle16: RVVVLEBuiltin<["s","x"]>;
defm vle32: RVVVLEBuiltin<["i","f"]>;
defm vle64: RVVVLEBuiltin<["l","d"]>;
def vse1 : RVVVSEMaskBuiltin;
def vsm : RVVVSEMaskBuiltin;
defm vse8 : RVVVSEBuiltin<["c"]>;
defm vse16: RVVVSEBuiltin<["s","x"]>;
defm vse32: RVVVSEBuiltin<["i","f"]>;
@ -1541,19 +1561,6 @@ defm : RVVIndexedSegStore<"vsuxseg">;
defm : RVVIndexedSegStore<"vsoxseg">;
}
// 8. Vector AMO Operations
let RequiredExtension = "Zvamo" in {
defm vamoswap : RVVAMOBuiltinSet< /* hasSigned */ true, /* hasUnsigned */ true, /* hasFP */ true>;
defm vamoadd : RVVAMOBuiltinSet< /* hasSigned */ true, /* hasUnsigned */ true>;
defm vamoxor : RVVAMOBuiltinSet< /* hasSigned */ true, /* hasUnsigned */ true>;
defm vamoand : RVVAMOBuiltinSet< /* hasSigned */ true, /* hasUnsigned */ true>;
defm vamoor : RVVAMOBuiltinSet< /* hasSigned */ true, /* hasUnsigned */ true>;
defm vamomin : RVVAMOBuiltinSet< /* hasSigned */ true>;
defm vamomax : RVVAMOBuiltinSet< /* hasSigned */ true>;
defm vamominu : RVVAMOBuiltinSet< /* hasSigned */ false, /* hasUnsigned */ true>;
defm vamomaxu : RVVAMOBuiltinSet< /* hasSigned */ false, /* hasUnsigned */ true>;
}
// 12. Vector Integer Arithmetic Instructions
// 12.1. Vector Single-Width Integer Add and Subtract
defm vadd : RVVIntBinBuiltinSet;
@ -1596,7 +1603,7 @@ let Log2LMUL = [-3, -2, -1, 0] in {
}
// 12.4. Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions
let HasMask = false in {
let HasMask = false, HasPolicy = false in {
defm vadc : RVVCarryinBuiltinSet;
defm vmadc : RVVCarryOutInBuiltinSet<"vmadc_carry_in">;
defm vmadc : RVVIntMaskOutBuiltinSet;
@ -1624,6 +1631,7 @@ defm vncvt_x_x_w : RVVPseudoVNCVTBuiltin<"vnsrl", "vncvt_x", "csi",
["Uv", "UvUw"]]>;
// 12.8. Vector Integer Comparison Instructions
let HasPolicy = false in {
defm vmseq : RVVIntMaskOutBuiltinSet;
defm vmsne : RVVIntMaskOutBuiltinSet;
defm vmsltu : RVVUnsignedMaskOutBuiltinSet;
@ -1634,6 +1642,7 @@ defm vmsgtu : RVVUnsignedMaskOutBuiltinSet;
defm vmsgt : RVVSignedMaskOutBuiltinSet;
defm vmsgeu : RVVUnsignedMaskOutBuiltinSet;
defm vmsge : RVVSignedMaskOutBuiltinSet;
}
// 12.9. Vector Integer Min/Max Instructions
defm vminu : RVVUnsignedBinBuiltinSet;
@ -1669,6 +1678,7 @@ defm vwmulsu : RVVOutOp0Op1BuiltinSet<"vwmulsu", "csi",
}
// 12.13. Vector Single-Width Integer Multiply-Add Instructions
let HasPolicy = false in {
defm vmacc : RVVIntTerBuiltinSet;
defm vnmsac : RVVIntTerBuiltinSet;
defm vmadd : RVVIntTerBuiltinSet;
@ -1689,10 +1699,11 @@ defm vwmaccsu : RVVOutOp1Op2BuiltinSet<"vwmaccsu", "csi",
defm vwmaccus : RVVOutOp1Op2BuiltinSet<"vwmaccus", "csi",
[["vx", "w", "wwUev"]]>;
}
}
// 12.15. Vector Integer Merge Instructions
// C/C++ Operand: (mask, op1, op2, vl), Intrinsic: (op1, op2, mask, vl)
let HasMask = false,
let HasMask = false, HasPolicy = false,
ManualCodegen = [{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3);
IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[3]->getType()};
@ -1705,7 +1716,7 @@ let HasMask = false,
}
// 12.16. Vector Integer Move Instructions
let HasMask = false in {
let HasMask = false, HasPolicy = false in {
let MangledName = "vmv_v" in {
defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csil",
[["v", "Uv", "UvUv"]]>;
@ -1769,6 +1780,7 @@ let Log2LMUL = [-2, -1, 0, 1, 2] in {
}
// 14.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions
let HasPolicy = false in {
defm vfmacc : RVVFloatingTerBuiltinSet;
defm vfnmacc : RVVFloatingTerBuiltinSet;
defm vfmsac : RVVFloatingTerBuiltinSet;
@ -1783,6 +1795,7 @@ defm vfwmacc : RVVFloatingWidenTerBuiltinSet;
defm vfwnmacc : RVVFloatingWidenTerBuiltinSet;
defm vfwmsac : RVVFloatingWidenTerBuiltinSet;
defm vfwnmsac : RVVFloatingWidenTerBuiltinSet;
}
// 14.8. Vector Floating-Point Square-Root Instruction
def vfsqrt : RVVFloatingUnaryVVBuiltin;
@ -1805,32 +1818,34 @@ defm vfneg_v : RVVPseudoVFUnaryBuiltin<"vfsgnjn", "xfd">;
defm vfabs_v : RVVPseudoVFUnaryBuiltin<"vfsgnjx", "xfd">;
// 14.13. Vector Floating-Point Compare Instructions
let HasPolicy = false in {
defm vmfeq : RVVFloatingMaskOutBuiltinSet;
defm vmfne : RVVFloatingMaskOutBuiltinSet;
defm vmflt : RVVFloatingMaskOutBuiltinSet;
defm vmfle : RVVFloatingMaskOutBuiltinSet;
defm vmfgt : RVVFloatingMaskOutBuiltinSet;
defm vmfge : RVVFloatingMaskOutBuiltinSet;
}
// 14.14. Vector Floating-Point Classify Instruction
let Name = "vfclass_v" in
let Name = "vfclass_v", HasPolicy = false in
def vfclass : RVVOp0Builtin<"Uv", "Uvv", "xfd">;
// 14.15. Vector Floating-Point Merge Instructio
// C/C++ Operand: (mask, op1, op2, vl), Builtin: (op1, op2, mask, vl)
let HasMask = false,
let HasMask = false, HasPolicy = false,
ManualCodegen = [{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3);
IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[3]->getType()};
}] in {
defm vmerge : RVVOutOp1BuiltinSet<"vfmerge", "xfd",
defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "xfd",
[["vvm", "v", "vmvv"]]>;
defm vfmerge : RVVOutOp1BuiltinSet<"vfmerge", "xfd",
[["vfm", "v", "vmve"]]>;
}
// 14.16. Vector Floating-Point Move Instruction
let HasMask = false, HasNoMaskedOverloaded = false in
let HasMask = false, HasNoMaskedOverloaded = false, HasPolicy = false in
defm vfmv_v : RVVOutBuiltinSet<"vfmv_v_f", "xfd",
[["f", "v", "ve"]]>;
@ -1867,6 +1882,7 @@ let Log2LMUL = [-3, -2, -1, 0, 1, 2] in {
// 15. Vector Reduction Operations
// 15.1. Vector Single-Width Integer Reduction Instructions
let HasPolicy = false in {
defm vredsum : RVVIntReductionBuiltinSet;
defm vredmaxu : RVVUnsignedReductionBuiltin;
defm vredmax : RVVSignedReductionBuiltin;
@ -1888,22 +1904,23 @@ let HasMaskedOffOperand = false in {
// 15.3. Vector Single-Width Floating-Point Reduction Instructions
defm vfredmax : RVVFloatingReductionBuiltin;
defm vfredmin : RVVFloatingReductionBuiltin;
defm vfredsum : RVVFloatingReductionBuiltin;
defm vfredusum : RVVFloatingReductionBuiltin;
defm vfredosum : RVVFloatingReductionBuiltin;
// 15.4. Vector Widening Floating-Point Reduction Instructions
defm vfwredsum : RVVFloatingWidenReductionBuiltin;
defm vfwredusum : RVVFloatingWidenReductionBuiltin;
defm vfwredosum : RVVFloatingWidenReductionBuiltin;
}
// 16. Vector Mask Instructions
// 16.1. Vector Mask-Register Logical Instructions
def vmand : RVVMaskBinBuiltin;
def vmnand : RVVMaskBinBuiltin;
def vmandnot : RVVMaskBinBuiltin;
def vmandn : RVVMaskBinBuiltin;
def vmxor : RVVMaskBinBuiltin;
def vmor : RVVMaskBinBuiltin;
def vmnor : RVVMaskBinBuiltin;
def vmornot : RVVMaskBinBuiltin;
def vmorn : RVVMaskBinBuiltin;
def vmxnor : RVVMaskBinBuiltin;
// pseudoinstructions
def vmclr : RVVMaskNullaryBuiltin;
@ -1911,8 +1928,9 @@ def vmset : RVVMaskNullaryBuiltin;
defm vmmv_m : RVVPseudoMaskBuiltin<"vmand", "c">;
defm vmnot_m : RVVPseudoMaskBuiltin<"vmnand", "c">;
// 16.2. Vector mask population count vpopc
def vpopc : RVVMaskOp0Builtin<"um">;
let HasPolicy = false in {
// 16.2. Vector count population in mask vcpop.m
def vcpop : RVVMaskOp0Builtin<"um">;
// 16.3. vfirst find-first-set mask bit
def vfirst : RVVMaskOp0Builtin<"lm">;
@ -1934,10 +1952,11 @@ let HasNoMaskedOverloaded = false in {
defm vid : RVVOutBuiltinSet<"vid", "csil", [["v", "v", "v"],
["v", "Uv", "Uv"]]>;
}
}
// 17. Vector Permutation Instructions
// 17.1. Integer Scalar Move Instructions
let HasMask = false in {
let HasMask = false, HasPolicy = false in {
let HasVL = false, MangledName = "vmv_x" in
defm vmv_x : RVVOp0BuiltinSet<"vmv_x_s", "csil",
[["s", "ve", "ev"],
@ -1949,7 +1968,7 @@ let HasMask = false in {
}
// 17.2. Floating-Point Scalar Move Instructions
let HasMask = false in {
let HasMask = false, HasPolicy = false in {
let HasVL = false, MangledName = "vfmv_f" in
defm vfmv_f : RVVOp0BuiltinSet<"vfmv_f_s", "xfd",
[["s", "ve", "ev"]]>;
@ -1960,10 +1979,12 @@ let HasMask = false in {
}
// 17.3. Vector Slide Instructions
let HasPolicy = false in {
// 17.3.1. Vector Slideup Instructions
defm vslideup : RVVSlideBuiltinSet;
// 17.3.2. Vector Slidedown Instructions
defm vslidedown : RVVSlideBuiltinSet;
}
// 17.3.3. Vector Slide1up Instructions
defm vslide1up : RVVSlideOneBuiltinSet;
@ -1990,7 +2011,7 @@ defm vrgatherei16 : RVVOutBuiltinSet<"vrgatherei16_vv", "csil",
[["vv", "Uv", "UvUv(Log2EEW:4)Uv"]]>;
// 17.5. Vector Compress Instruction
let HasMask = false,
let HasMask = false, HasPolicy = false,
ManualCodegen = [{
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3);
IntrinsicTypes = {ResultType, Ops[3]->getType()};
@ -2005,7 +2026,7 @@ let HasMask = false,
// Miscellaneous
let HasMask = false, HasVL = false, IRName = "" in {
let Name = "vreinterpret_v",
let Name = "vreinterpret_v", HasPolicy = false,
ManualCodegen = [{
return Builder.CreateBitCast(Ops[0], ResultType);
}] in {
@ -2027,7 +2048,7 @@ let HasMask = false, HasVL = false, IRName = "" in {
}
}
let Name = "vundefined", HasNoMaskedOverloaded = false,
let Name = "vundefined", HasNoMaskedOverloaded = false, HasPolicy = false,
ManualCodegen = [{
return llvm::UndefValue::get(ResultType);
}] in {
@ -2037,7 +2058,7 @@ let HasMask = false, HasVL = false, IRName = "" in {
// LMUL truncation
// C/C++ Operand: VecTy, IR Operand: VecTy, Index
let Name = "vlmul_trunc_v", MangledName = "vlmul_trunc",
let Name = "vlmul_trunc_v", MangledName = "vlmul_trunc", HasPolicy = false,
ManualCodegen = [{ {
ID = Intrinsic::experimental_vector_extract;
IntrinsicTypes = {ResultType, Ops[0]->getType()};
@ -2055,7 +2076,7 @@ let HasMask = false, HasVL = false, IRName = "" in {
// LMUL extension
// C/C++ Operand: SubVecTy, IR Operand: VecTy, SubVecTy, Index
let Name = "vlmul_ext_v", MangledName = "vlmul_ext",
let Name = "vlmul_ext_v", MangledName = "vlmul_ext", HasPolicy = false,
ManualCodegen = [{
ID = Intrinsic::experimental_vector_insert;
IntrinsicTypes = {ResultType, Ops[0]->getType()};
@ -2073,11 +2094,16 @@ let HasMask = false, HasVL = false, IRName = "" in {
}
}
let Name = "vget_v",
let Name = "vget_v", HasPolicy = false,
ManualCodegen = [{
{
ID = Intrinsic::experimental_vector_extract;
ScalableVectorType *VecTy = cast<ScalableVectorType>(ResultType);
auto *VecTy = cast<ScalableVectorType>(ResultType);
auto *OpVecTy = cast<ScalableVectorType>(Ops[0]->getType());
// Mask to only valid indices.
unsigned MaxIndex = OpVecTy->getMinNumElements() / VecTy->getMinNumElements();
assert(isPowerOf2_32(MaxIndex));
Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1);
Ops[1] = Builder.CreateMul(Ops[1],
ConstantInt::get(Ops[1]->getType(),
VecTy->getMinNumElements()));
@ -2086,17 +2112,22 @@ let HasMask = false, HasVL = false, IRName = "" in {
}
}] in {
foreach dst_lmul = ["(SFixedLog2LMUL:0)", "(SFixedLog2LMUL:1)", "(SFixedLog2LMUL:2)"] in {
def : RVVBuiltin<"v" # dst_lmul # "v", dst_lmul # "vvKz", "csilfd", dst_lmul # "v">;
def : RVVBuiltin<"v" # dst_lmul # "v", dst_lmul # "vvKz", "csilxfd", dst_lmul # "v">;
def : RVVBuiltin<"Uv" # dst_lmul # "Uv", dst_lmul # "UvUvKz", "csil", dst_lmul # "Uv">;
}
}
let Name = "vset_v", Log2LMUL = [0, 1, 2],
let Name = "vset_v", Log2LMUL = [0, 1, 2], HasPolicy = false,
ManualCodegen = [{
{
ID = Intrinsic::experimental_vector_insert;
IntrinsicTypes = {ResultType, Ops[2]->getType()};
ScalableVectorType *VecTy = cast<ScalableVectorType>(Ops[2]->getType());
auto *ResVecTy = cast<ScalableVectorType>(ResultType);
auto *VecTy = cast<ScalableVectorType>(Ops[2]->getType());
// Mask to only valid indices.
unsigned MaxIndex = ResVecTy->getMinNumElements() / VecTy->getMinNumElements();
assert(isPowerOf2_32(MaxIndex));
Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1);
Ops[1] = Builder.CreateMul(Ops[1],
ConstantInt::get(Ops[1]->getType(),
VecTy->getMinNumElements()));
@ -2105,8 +2136,14 @@ let HasMask = false, HasVL = false, IRName = "" in {
}
}] in {
foreach dst_lmul = ["(LFixedLog2LMUL:1)", "(LFixedLog2LMUL:2)", "(LFixedLog2LMUL:3)"] in {
def : RVVBuiltin<"v" # dst_lmul # "v", dst_lmul # "v" # dst_lmul # "vKzv", "csilfd">;
def : RVVBuiltin<"v" # dst_lmul # "v", dst_lmul # "v" # dst_lmul # "vKzv", "csilxfd">;
def : RVVBuiltin<"Uv" # dst_lmul # "Uv", dst_lmul # "Uv" # dst_lmul #"UvKzUv", "csil">;
}
}
}
let HeaderCode = [{
#define VE_TAIL_UNDISTURBED 0
#define VE_TAIL_AGNOSTIC 1
}] in
def policy : RVVHeader;

View File

@ -74,6 +74,10 @@ class CodeGenerator : public ASTConsumer {
/// This may return null if there was no matching declaration.
const Decl *GetDeclForMangledName(llvm::StringRef MangledName);
/// Given a global declaration, return a mangled name for this declaration
/// which has been added to this code generator via a Handle method.
llvm::StringRef GetMangledName(GlobalDecl GD);
/// Return the LLVM address of the given global entity.
///
/// \param isForDefinition If true, the caller intends to define the

View File

@ -20,7 +20,7 @@ namespace clang {
/// Provides notifications for file changes in a directory.
///
/// Invokes client-provided function on every filesystem event in the watched
/// directory. Initially the the watched directory is scanned and for every file
/// directory. Initially the watched directory is scanned and for every file
/// found, an event is synthesized as if the file was added.
///
/// This is not a general purpose directory monitoring tool - list of

View File

@ -37,6 +37,7 @@ class Distro {
DebianStretch,
DebianBuster,
DebianBullseye,
DebianBookworm,
Exherbo,
RHEL5,
RHEL6,
@ -72,6 +73,7 @@ class Distro {
UbuntuGroovy,
UbuntuHirsute,
UbuntuImpish,
UbuntuJammy,
UnknownDistro
};
@ -119,11 +121,11 @@ class Distro {
bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
bool IsDebian() const {
return DistroVal >= DebianLenny && DistroVal <= DebianBullseye;
return DistroVal >= DebianLenny && DistroVal <= DebianBookworm;
}
bool IsUbuntu() const {
return DistroVal >= UbuntuHardy && DistroVal <= UbuntuImpish;
return DistroVal >= UbuntuHardy && DistroVal <= UbuntuJammy;
}
bool IsAlpineLinux() const { return DistroVal == AlpineLinux; }

View File

@ -253,6 +253,14 @@ class Driver {
/// or when using the -gen-reproducer driver flag.
unsigned GenReproducer : 1;
// getFinalPhase - Determine which compilation mode we are in and record
// which option we used to determine the final phase.
// TODO: Much of what getFinalPhase returns are not actually true compiler
// modes. Fold this functionality into Types::getCompilationPhases and
// handleArguments.
phases::ID getFinalPhase(const llvm::opt::DerivedArgList &DAL,
llvm::opt::Arg **FinalPhaseArg = nullptr) const;
private:
/// Certain options suppress the 'no input files' warning.
unsigned SuppressMissingInputWarning : 1;
@ -270,14 +278,6 @@ class Driver {
llvm::opt::DerivedArgList *
TranslateInputArgs(const llvm::opt::InputArgList &Args) const;
// getFinalPhase - Determine which compilation mode we are in and record
// which option we used to determine the final phase.
// TODO: Much of what getFinalPhase returns are not actually true compiler
// modes. Fold this functionality into Types::getCompilationPhases and
// handleArguments.
phases::ID getFinalPhase(const llvm::opt::DerivedArgList &DAL,
llvm::opt::Arg **FinalPhaseArg = nullptr) const;
// handleArguments - All code related to claiming and printing diagnostics
// related to arguments to the driver are done here.
void handleArguments(Compilation &C, llvm::opt::DerivedArgList &Args,

View File

@ -272,7 +272,7 @@ class MigratorOpts<string base>
// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
// This is useful if the option is usually disabled.
// Use this only when the option cannot be declared via BoolFOption.
multiclass OptInFFlag<string name, string pos_prefix, string neg_prefix="",
multiclass OptInCC1FFlag<string name, string pos_prefix, string neg_prefix="",
string help="", list<OptionFlag> flags=[]> {
def f#NAME : Flag<["-"], "f"#name>, Flags<[CC1Option] # flags>,
Group<f_Group>, HelpText<pos_prefix # help>;
@ -283,7 +283,7 @@ multiclass OptInFFlag<string name, string pos_prefix, string neg_prefix="",
// A boolean option which is opt-out in CC1. The negative option exists in CC1 and
// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
// Use this only when the option cannot be declared via BoolFOption.
multiclass OptOutFFlag<string name, string pos_prefix, string neg_prefix,
multiclass OptOutCC1FFlag<string name, string pos_prefix, string neg_prefix,
string help="", list<OptionFlag> flags=[]> {
def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
Group<f_Group>, HelpText<pos_prefix # help>;
@ -291,6 +291,27 @@ multiclass OptOutFFlag<string name, string pos_prefix, string neg_prefix,
Group<f_Group>, HelpText<neg_prefix # help>;
}
// A boolean option which is opt-in in FC1. The positive option exists in FC1 and
// Args.hasArg(OPT_ffoo) can be used to check that the flag is enabled.
// This is useful if the option is usually disabled.
multiclass OptInFC1FFlag<string name, string pos_prefix, string neg_prefix="",
string help="", list<OptionFlag> flags=[]> {
def f#NAME : Flag<["-"], "f"#name>, Flags<[FC1Option] # flags>,
Group<f_Group>, HelpText<pos_prefix # help>;
def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<flags>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
// A boolean option which is opt-out in FC1. The negative option exists in FC1 and
// Args.hasArg(OPT_fno_foo) can be used to check that the flag is disabled.
multiclass OptOutFC1FFlag<string name, string pos_prefix, string neg_prefix,
string help="", list<OptionFlag> flags=[]> {
def f#NAME : Flag<["-"], "f"#name>, Flags<flags>,
Group<f_Group>, HelpText<pos_prefix # help>;
def fno_#NAME : Flag<["-"], "fno-"#name>, Flags<[FC1Option] # flags>,
Group<f_Group>, HelpText<neg_prefix # help>;
}
// Creates a positive and negative flags where both of them are prefixed with
// "m", have help text specified for positive and negative option, and a Group
// optionally specified by the opt_group argument, otherwise Group<m_Group>.
@ -386,8 +407,7 @@ class MarshalledFlagRec<FlagDefExpanded flag, FlagDefExpanded other,
Default default>
: Flag<["-"], flag.Spelling>, Flags<flag.OptionFlags>, HelpText<flag.Help>,
MarshallingInfoBooleanFlag<kpm, default.Value, flag.ValueAsCode,
flag.RecordName, other.ValueAsCode,
other.RecordName>,
other.ValueAsCode, other.RecordName>,
ImpliedByAnyOf<implied.ImpliedBy, implied.ValueAsCode> {}
// Generates TableGen records for two command line flags that control the same
@ -467,7 +487,6 @@ defvar render_script = LangOpts<"RenderScript">;
defvar hip = LangOpts<"HIP">;
defvar gnu_mode = LangOpts<"GNUMode">;
defvar asm_preprocessor = LangOpts<"AsmPreprocessor">;
defvar cpp_modules = LangOpts<"CPlusPlusModules">;
defvar std = !strconcat("LangStandard::getLangStandardForKind(", lang_std.KeyPath, ")");
@ -598,12 +617,15 @@ def objcmt_migrate_designated_init : Flag<["-"], "objcmt-migrate-designated-init
HelpText<"Enable migration to infer NS_DESIGNATED_INITIALIZER for initializer methods">,
MarshallingInfoBitfieldFlag<FrontendOpts<"ObjCMTAction">, "FrontendOptions::ObjCMT_DesignatedInitializer">;
def objcmt_whitelist_dir_path: Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
def objcmt_allowlist_dir_path: Joined<["-"], "objcmt-allowlist-dir-path=">, Flags<[CC1Option]>,
HelpText<"Only modify files with a filename contained in the provided directory path">,
MarshallingInfoString<FrontendOpts<"ObjCMTWhiteListPath">>;
MarshallingInfoString<FrontendOpts<"ObjCMTAllowListPath">>;
def : Joined<["-"], "objcmt-whitelist-dir-path=">, Flags<[CC1Option]>,
HelpText<"Alias for -objcmt-allowlist-dir-path">,
Alias<objcmt_allowlist_dir_path>;
// The misspelt "white-list" [sic] alias is due for removal.
def : Joined<["-"], "objcmt-white-list-dir-path=">, Flags<[CC1Option]>,
Alias<objcmt_whitelist_dir_path>;
Alias<objcmt_allowlist_dir_path>;
// Make sure all other -ccc- options are rejected.
def ccc_ : Joined<["-"], "ccc-">, Group<internal_Group>, Flags<[Unsupported]>;
@ -701,7 +723,7 @@ def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>,
def O : Joined<["-"], "O">, Group<O_Group>, Flags<[CC1Option]>;
def O_flag : Flag<["-"], "O">, Flags<[CC1Option]>, Alias<O>, AliasArgs<["1"]>;
def Ofast : Joined<["-"], "Ofast">, Group<O_Group>, Flags<[CC1Option]>;
def P : Flag<["-"], "P">, Flags<[CC1Option]>, Group<Preprocessor_Group>,
def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group<Preprocessor_Group>,
HelpText<"Disable linemarker output in -E mode">,
MarshallingInfoNegativeFlag<PreprocessorOutputOpts<"ShowLineMarkers">>;
def Qy : Flag<["-"], "Qy">, Flags<[CC1Option]>,
@ -815,7 +837,9 @@ def autocomplete : Joined<["--"], "autocomplete=">;
def bind__at__load : Flag<["-"], "bind_at_load">;
def bundle__loader : Separate<["-"], "bundle_loader">;
def bundle : Flag<["-"], "bundle">;
def b : JoinedOrSeparate<["-"], "b">, Flags<[Unsupported]>;
def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput, RenderAsInput]>,
HelpText<"Pass -b <arg> to the linker on AIX (only).">, MetaVarName<"<arg>">,
Group<Link_Group>;
def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group<opencl_Group>, Flags<[CC1Option]>,
HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">;
def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group<opencl_Group>, Flags<[CC1Option]>,
@ -843,7 +867,8 @@ def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>,
HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">,
MarshallingInfoFlag<LangOpts<"CLNoSignedZero">>;
def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.0,CL1.0,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++">;
HelpText<"OpenCL language standard to compile for.">,
Values<"cl,CL,cl1.0,CL1.0,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,cl3.0,CL3.0,clc++,CLC++,clc++1.0,CLC++1.0,clc++2021,CLC++2021">;
def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>,
HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,
@ -1004,7 +1029,7 @@ def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">,
"offloading languages CUDA and HIP: 'hash' (ID's generated by hashing "
"file path and command line options) | 'random' (ID's generated as "
"random numbers) | 'none' (disabled). Default is 'hash'. This option "
"will be overriden by option '-cuid=[ID]' if it is specified." >;
"will be overridden by option '-cuid=[ID]' if it is specified." >;
def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group<i_Group>,
HelpText<"Path to libomptarget-amdgcn bitcode library">;
def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group<i_Group>,
@ -1064,6 +1089,9 @@ defm access_control : BoolFOption<"access-control",
PosFlag<SetTrue>>;
def falign_functions : Flag<["-"], "falign-functions">, Group<f_Group>;
def falign_functions_EQ : Joined<["-"], "falign-functions=">, Group<f_Group>;
def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<N>">,
HelpText<"N must be a power of two. Align loops to the boundary">,
MarshallingInfoInt<CodeGenOpts<"LoopAlignment">>;
def fno_align_functions: Flag<["-"], "fno-align-functions">, Group<f_Group>;
defm allow_editor_placeholders : BoolFOption<"allow-editor-placeholders",
LangOpts<"AllowEditorPlaceholders">, DefaultFalse,
@ -1250,12 +1278,19 @@ def fprofile_list_EQ : Joined<["-"], "fprofile-list=">,
Group<f_Group>, Flags<[CC1Option, CoreOption]>,
HelpText<"Filename defining the list of functions/files to instrument">,
MarshallingInfoStringVector<LangOpts<"ProfileListFiles">>;
def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">,
Group<f_Group>, Flags<[CC1Option, CC1AsOption, CoreOption]>, MetaVarName<"<option>">,
HelpText<"Control emission of Swift async extended frame info (option: auto, always, never)">,
Values<"auto,always,never">,
NormalizedValuesScope<"CodeGenOptions::SwiftAsyncFramePointerKind">,
NormalizedValues<["Auto", "Always", "Never"]>,
MarshallingInfoEnum<CodeGenOpts<"SwiftAsyncFramePointer">, "Always">;
defm addrsig : BoolFOption<"addrsig",
CodeGenOpts<"Addrsig">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Emit">, NegFlag<SetFalse, [], "Don't emit">,
BothFlags<[CoreOption], " an address-significance table">>;
defm blocks : OptInFFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>;
defm blocks : OptInCC1FFlag<"blocks", "Enable the 'blocks' language feature", "", "", [CoreOption]>;
def fbootclasspath_EQ : Joined<["-"], "fbootclasspath=">, Group<f_Group>;
defm borland_extensions : BoolFOption<"borland-extensions",
LangOpts<"Borland">, DefaultFalse,
@ -1271,7 +1306,7 @@ def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Gr
Flags<[CC1Option]>, MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
HelpText<"Attempt to match the ABI of Clang <version>">;
def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
defm color_diagnostics : OptInFFlag<"color-diagnostics", "Enable", "Disable", " colors in diagnostics",
defm color_diagnostics : OptInCC1FFlag<"color-diagnostics", "Enable", "Disable", " colors in diagnostics",
[CoreOption, FlangOption]>;
def fdiagnostics_color : Flag<["-"], "fdiagnostics-color">, Group<f_Group>,
Flags<[CoreOption, NoXarchOption]>;
@ -1329,8 +1364,11 @@ defm cxx_exceptions: BoolFOption<"cxx-exceptions",
defm async_exceptions: BoolFOption<"async-exceptions",
LangOpts<"EHAsynch">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Enable EH Asynchronous exceptions">, NegFlag<SetFalse>>;
def fcxx_modules : Flag <["-"], "fcxx-modules">, Group<f_Group>,
Flags<[NoXarchOption]>;
defm cxx_modules : BoolFOption<"cxx-modules",
LangOpts<"CPlusPlusModules">, Default<cpp20.KeyPath>,
NegFlag<SetFalse, [CC1Option], "Disable">, PosFlag<SetTrue, [], "Enable">,
BothFlags<[NoXarchOption], " modules for C++">>,
ShouldParseIf<cplusplus.KeyPath>;
def fdebug_pass_arguments : Flag<["-"], "fdebug-pass-arguments">, Group<f_Group>;
def fdebug_pass_structure : Flag<["-"], "fdebug-pass-structure">, Group<f_Group>;
def fdepfile_entry : Joined<["-"], "fdepfile-entry=">,
@ -1389,7 +1427,7 @@ def fno_elide_type : Flag<["-"], "fno-elide-type">, Group<f_Group>,
HelpText<"Do not elide types when printing diagnostics">,
MarshallingInfoNegativeFlag<DiagnosticOpts<"ElideType">>;
def feliminate_unused_debug_symbols : Flag<["-"], "feliminate-unused-debug-symbols">, Group<f_Group>;
defm eliminate_unused_debug_types : OptOutFFlag<"eliminate-unused-debug-types",
defm eliminate_unused_debug_types : OptOutCC1FFlag<"eliminate-unused-debug-types",
"Do not emit ", "Emit ", " debug info for defined but unused types">;
def femit_all_decls : Flag<["-"], "femit-all-decls">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Emit all declarations, even if unused">,
@ -1489,7 +1527,7 @@ defm cxx_static_destructors : BoolFOption<"c++-static-destructors",
def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group<f_Group>,
Flags<[CC1Option]>, MarshallingInfoString<CodeGenOpts<"SymbolPartition">>;
defm memory_profile : OptInFFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
defm memory_profile : OptInCC1FFlag<"memory-profile", "Enable", "Disable", " heap memory profiling">;
def fmemory_profile_EQ : Joined<["-"], "fmemory-profile=">,
Group<f_Group>, Flags<[CC1Option]>, MetaVarName<"<directory>">,
HelpText<"Enable heap memory profiling and dump results into <directory>">;
@ -1729,8 +1767,11 @@ defm reciprocal_math : BoolFOption<"reciprocal-math",
PosFlag<SetTrue, [CC1Option], "Allow division operations to be reassociated",
[menable_unsafe_fp_math.KeyPath]>,
NegFlag<SetFalse>>;
def fapprox_func : Flag<["-"], "fapprox-func">, Group<f_Group>, Flags<[CC1Option, NoDriverOption]>,
MarshallingInfoFlag<LangOpts<"ApproxFunc">>, ImpliedByAnyOf<[menable_unsafe_fp_math.KeyPath]>;
defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Allow certain math function calls to be replaced "
"with an approximately equivalent calculation",
[menable_unsafe_fp_math.KeyPath]>,
NegFlag<SetFalse>>;
defm finite_math_only : BoolFOption<"finite-math-only",
LangOpts<"FiniteMathOnly">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "", [cl_finite_math_only.KeyPath, ffast_math.KeyPath]>,
@ -1770,7 +1811,7 @@ defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
defm protect_parens : BoolFOption<"protect-parens",
LangOpts<"ProtectParens">, DefaultFalse,
PosFlag<SetTrue, [CoreOption, CC1Option],
PosFlag<SetTrue, [CoreOption, CC1Option],
"Determines whether the optimizer honors parentheses when "
"floating-point expressions are evaluated">,
NegFlag<SetFalse>>;
@ -1840,7 +1881,7 @@ def fexperimental_isel : Flag<["-"], "fexperimental-isel">, Group<f_clang_Group>
Alias<fglobal_isel>;
defm legacy_pass_manager : BoolOption<"f", "legacy-pass-manager",
CodeGenOpts<"LegacyPassManager">, Default<"!static_cast<unsigned>(LLVM_ENABLE_NEW_PASS_MANAGER)">,
PosFlag<SetTrue, [], "Use the legacy pass manager in LLVM">,
PosFlag<SetTrue, [], "Use the legacy pass manager in LLVM (deprecated, to be removed in a future release)">,
NegFlag<SetFalse, [], "Use the new pass manager in LLVM">,
BothFlags<[CC1Option]>>, Group<f_clang_Group>;
def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager">,
@ -1988,16 +2029,18 @@ def fapple_link_rtlib : Flag<["-"], "fapple-link-rtlib">, Group<f_Group>,
HelpText<"Force linking the clang builtins runtime library">;
def flto_EQ : Joined<["-"], "flto=">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
HelpText<"Set LTO mode to either 'full' or 'thin'">, Values<"thin,full">;
def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group<f_Group>;
def flto_EQ_auto : Flag<["-"], "flto=auto">, Group<f_Group>;
def flto_EQ_jobserver : Flag<["-"], "flto=jobserver">, Group<f_Group>,
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
def flto_EQ_auto : Flag<["-"], "flto=auto">, Group<f_Group>,
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
def flto : Flag<["-"], "flto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
HelpText<"Enable LTO in 'full' mode">;
Alias<flto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode">;
def fno_lto : Flag<["-"], "fno-lto">, Flags<[CoreOption, CC1Option]>, Group<f_Group>,
HelpText<"Disable LTO mode (default)">;
def foffload_lto_EQ : Joined<["-"], "foffload-lto=">, Flags<[CoreOption]>, Group<f_Group>,
HelpText<"Set LTO mode to either 'full' or 'thin' for offload compilation">, Values<"thin,full">;
def foffload_lto : Flag<["-"], "foffload-lto">, Flags<[CoreOption]>, Group<f_Group>,
HelpText<"Enable LTO in 'full' mode for offload compilation">;
Alias<foffload_lto_EQ>, AliasArgs<["full"]>, HelpText<"Enable LTO in 'full' mode for offload compilation">;
def fno_offload_lto : Flag<["-"], "fno-offload-lto">, Flags<[CoreOption]>, Group<f_Group>,
HelpText<"Disable LTO mode (default) for offload compilation">;
def flto_jobs_EQ : Joined<["-"], "flto-jobs=">,
@ -2133,9 +2176,9 @@ defm pch_instantiate_templates : BoolFOption<"pch-instantiate-templates",
LangOpts<"PCHInstantiateTemplates">, DefaultFalse,
PosFlag<SetTrue, [], "Instantiate templates already while building a PCH">,
NegFlag<SetFalse>, BothFlags<[CC1Option, CoreOption]>>;
defm pch_codegen: OptInFFlag<"pch-codegen", "Generate ", "Do not generate ",
defm pch_codegen: OptInCC1FFlag<"pch-codegen", "Generate ", "Do not generate ",
"code for uses of this PCH that assumes an explicit object file will be built for the PCH">;
defm pch_debuginfo: OptInFFlag<"pch-debuginfo", "Generate ", "Do not generate ",
defm pch_debuginfo: OptInCC1FFlag<"pch-debuginfo", "Generate ", "Do not generate ",
"debug info for types in an object file built from this PCH and do not generate them elsewhere">;
def fimplicit_module_maps : Flag <["-"], "fimplicit-module-maps">, Group<f_Group>,
@ -2146,7 +2189,7 @@ def fmodules_ts : Flag <["-"], "fmodules-ts">, Group<f_Group>,
Flags<[CC1Option]>, HelpText<"Enable support for the C++ Modules TS">,
MarshallingInfoFlag<LangOpts<"ModulesTS">>;
defm modules : BoolFOption<"modules",
LangOpts<"Modules">, Default<!strconcat(fmodules_ts.KeyPath, "||", cpp_modules.KeyPath)>,
LangOpts<"Modules">, Default<!strconcat(fmodules_ts.KeyPath, "||", fcxx_modules.KeyPath)>,
PosFlag<SetTrue, [CC1Option], "Enable the 'modules' language feature">,
NegFlag<SetFalse>, BothFlags<[NoXarchOption, CoreOption]>>;
def fmodule_maps : Flag <["-"], "fmodule-maps">, Flags<[CoreOption]>, Alias<fimplicit_module_maps>;
@ -2205,8 +2248,6 @@ def fno_diagnostics_color : Flag<["-"], "fno-diagnostics-color">, Group<f_Group>
Flags<[CoreOption, NoXarchOption]>;
def fno_common : Flag<["-"], "fno-common">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Compile common globals like normal definitions">;
def fno_cxx_modules : Flag <["-"], "fno-cxx-modules">, Group<f_Group>,
Flags<[NoXarchOption]>;
defm digraphs : BoolFOption<"digraphs",
LangOpts<"Digraphs">, Default<std#".hasDigraphs()">,
PosFlag<SetTrue, [], "Enable alternative token representations '<:', ':>', '<%', '%>', '%:', '%:%:' (default)">,
@ -2341,12 +2382,23 @@ def fobjc_disable_direct_methods_for_testing :
Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
defm objc_avoid_heapify_local_blocks : BoolFOption<"objc-avoid-heapify-local-blocks",
CodeGenOpts<"ObjCAvoidHeapifyLocalBlocks">, DefaultFalse,
PosFlag<SetTrue, [], "Try">,
NegFlag<SetFalse, [], "Don't try">,
BothFlags<[CC1Option, NoDriverOption], " to avoid heapifying local blocks">>;
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>;
def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
HelpText<"Parse OpenMP pragmas and generate parallel code.">;
def fno_openmp : Flag<["-"], "fno-openmp">, Group<f_Group>, Flags<[NoArgumentUnused]>;
def fopenmp_version_EQ : Joined<["-"], "fopenmp-version=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>;
defm openmp_extensions: BoolFOption<"openmp-extensions",
LangOpts<"OpenMPExtensions">, DefaultTrue,
PosFlag<SetTrue, [CC1Option, NoArgumentUnused],
"Enable all Clang extensions for OpenMP directives and clauses">,
NegFlag<SetFalse, [CC1Option, NoArgumentUnused],
"Disable all Clang extensions for OpenMP directives and clauses">>;
def fopenmp_EQ : Joined<["-"], "fopenmp=">, Group<f_Group>;
def fopenmp_use_tls : Flag<["-"], "fopenmp-use-tls">, Group<f_Group>,
Flags<[NoArgumentUnused, HelpHidden]>;
@ -2377,6 +2429,18 @@ def fopenmp_cuda_blocks_per_sm_EQ : Joined<["-"], "fopenmp-cuda-blocks-per-sm=">
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fopenmp_cuda_teams_reduction_recs_num_EQ : Joined<["-"], "fopenmp-cuda-teams-reduction-recs-num=">, Group<f_Group>,
Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fopenmp_target_debug : Flag<["-"], "fopenmp-target-debug">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused]>,
HelpText<"Enable debugging in the OpenMP offloading device RTL">;
def fno_openmp_target_debug : Flag<["-"], "fno-openmp-target-debug">, Group<f_Group>, Flags<[NoArgumentUnused]>;
def fopenmp_target_debug_EQ : Joined<["-"], "fopenmp-target-debug=">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fopenmp_assume_teams_oversubscription : Flag<["-"], "fopenmp-assume-teams-oversubscription">,
Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fopenmp_assume_threads_oversubscription : Flag<["-"], "fopenmp-assume-threads-oversubscription">,
Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fno_openmp_assume_teams_oversubscription : Flag<["-"], "fno-openmp-assume-teams-oversubscription">,
Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
def fno_openmp_assume_threads_oversubscription : Flag<["-"], "fno-openmp-assume-threads-oversubscription">,
Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
defm openmp_target_new_runtime: BoolFOption<"openmp-target-new-runtime",
LangOpts<"OpenMPTargetNewRuntime">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Use the new bitcode library for OpenMP offloading">,
@ -2498,7 +2562,7 @@ defm signed_char : BoolFOption<"signed-char",
ShouldParseIf<!strconcat("!", open_cl.KeyPath)>;
defm split_stack : BoolFOption<"split-stack",
CodeGenOpts<"EnableSegmentedStacks">, DefaultFalse,
NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
NegFlag<SetFalse, [], "Wouldn't use segmented stack">,
PosFlag<SetTrue, [CC1Option], "Use segmented stack">>;
def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
HelpText<"Enable stack protectors for all functions">;
@ -2529,7 +2593,7 @@ def ftrivial_auto_var_init : Joined<["-"], "ftrivial-auto-var-init=">, Group<f_G
NormalizedValues<["Uninitialized", "Zero", "Pattern"]>,
MarshallingInfoEnum<LangOpts<"TrivialAutoVarInit">, "Uninitialized">;
def enable_trivial_var_init_zero : Flag<["-"], "enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang">,
Flags<[CC1Option, CoreOption]>,
Flags<[CC1Option, CoreOption, NoArgumentUnused]>,
HelpText<"Trivial automatic variable initialization to zero is only here for benchmarks, it'll eventually be removed, and I'm OK with that because I'm only using it to benchmark">;
def ftrivial_auto_var_init_stop_after : Joined<["-"], "ftrivial-auto-var-init-stop-after=">, Group<f_Group>,
Flags<[CC1Option, CoreOption]>, HelpText<"Stop initializing trivial automatic stack variables after the specified number of instances">,
@ -2686,10 +2750,10 @@ def fverbose_asm : Flag<["-"], "fverbose-asm">, Group<f_Group>,
def dA : Flag<["-"], "dA">, Alias<fverbose_asm>;
defm visibility_from_dllstorageclass : BoolFOption<"visibility-from-dllstorageclass",
LangOpts<"VisibilityFromDLLStorageClass">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Set the visiblity of symbols in the generated code from their DLL storage class">,
PosFlag<SetTrue, [CC1Option], "Set the visibility of symbols in the generated code from their DLL storage class">,
NegFlag<SetFalse>>;
def fvisibility_dllexport_EQ : Joined<["-"], "fvisibility-dllexport=">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"The visibility for dllexport defintions [-fvisibility-from-dllstorageclass]">,
HelpText<"The visibility for dllexport definitions [-fvisibility-from-dllstorageclass]">,
MarshallingInfoVisibility<LangOpts<"DLLExportVisibility">, "DefaultVisibility">,
ShouldParseIf<fvisibility_from_dllstorageclass.KeyPath>;
def fvisibility_nodllstorageclass_EQ : Joined<["-"], "fvisibility-nodllstorageclass=">, Group<f_Group>, Flags<[CC1Option]>,
@ -2722,6 +2786,10 @@ def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group<f_Group>
def fvisibility_global_new_delete_hidden : Flag<["-"], "fvisibility-global-new-delete-hidden">, Group<f_Group>,
HelpText<"Give global C++ operator new and delete declarations hidden visibility">, Flags<[CC1Option]>,
MarshallingInfoFlag<LangOpts<"GlobalAllocationFunctionVisibilityHidden">>;
def fnew_infallible : Flag<["-"], "fnew-infallible">, Group<f_Group>,
HelpText<"Treats throwing global C++ operator new as always returning valid memory "
"(annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.">,
Flags<[CC1Option]>, MarshallingInfoFlag<LangOpts<"NewInfallible">>;
defm whole_program_vtables : BoolFOption<"whole-program-vtables",
CodeGenOpts<"WholeProgramVTables">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Enables whole-program vtable optimization. Requires -flto">,
@ -2828,10 +2896,10 @@ def fcoverage_prefix_map_EQ
HelpText<"remap file source paths in coverage mapping">;
def ffile_prefix_map_EQ
: Joined<["-"], "ffile-prefix-map=">, Group<f_Group>,
HelpText<"remap file source paths in debug info and predefined preprocessor macros">;
HelpText<"remap file source paths in debug info, predefined preprocessor macros and __builtin_FILE()">;
def fmacro_prefix_map_EQ
: Joined<["-"], "fmacro-prefix-map=">, Group<Preprocessor_Group>, Flags<[CC1Option]>,
HelpText<"remap file source paths in predefined preprocessor macros">;
: Joined<["-"], "fmacro-prefix-map=">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"remap file source paths in predefined preprocessor macros and __builtin_FILE()">;
defm force_dwarf_frame : BoolFOption<"force-dwarf-frame",
CodeGenOpts<"ForceDwarfFrameSection">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Always emit a debug frame section">, NegFlag<SetFalse>>;
@ -2913,6 +2981,14 @@ def gsplit_dwarf_EQ : Joined<["-"], "gsplit-dwarf=">, Group<g_flags_Group>,
HelpText<"Set DWARF fission mode to either 'split' or 'single'">,
Values<"split,single">;
def gno_split_dwarf : Flag<["-"], "gno-split-dwarf">, Group<g_flags_Group>;
def gsimple_template_names : Flag<["-"], "gsimple-template-names">, Group<g_flags_Group>;
def gsimple_template_names_EQ
: Joined<["-"], "gsimple-template-names=">,
HelpText<"Use simple template names in DWARF, or include the full "
"template name with a modified prefix for validation">,
Values<"simple,mangled">, Flags<[CC1Option, NoDriverOption]>;
def gno_simple_template_names : Flag<["-"], "gno-simple-template-names">,
Group<g_flags_Group>;
def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>;
def gpubnames : Flag<["-"], "gpubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
@ -3055,6 +3131,10 @@ def mwatchos_simulator_version_min_EQ : Joined<["-"], "mwatchos-simulator-versio
def mwatchsimulator_version_min_EQ : Joined<["-"], "mwatchsimulator-version-min=">, Alias<mwatchos_simulator_version_min_EQ>;
def march_EQ : Joined<["-"], "march=">, Group<m_Group>, Flags<[CoreOption]>;
def masm_EQ : Joined<["-"], "masm=">, Group<m_Group>, Flags<[NoXarchOption]>;
def inline_asm_EQ : Joined<["-"], "inline-asm=">, Group<m_Group>, Flags<[CC1Option]>,
Values<"att,intel">,
NormalizedValuesScope<"CodeGenOptions">, NormalizedValues<["IAD_ATT", "IAD_Intel"]>,
MarshallingInfoEnum<CodeGenOpts<"InlineAsmDialect">, "IAD_ATT">;
def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>, Flags<[CC1Option]>,
MarshallingInfoString<TargetOpts<"CodeModel">, [{"default"}]>;
def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>, Flags<[NoXarchOption, CC1Option]>,
@ -3100,6 +3180,9 @@ def mlinker_version_EQ : Joined<["-"], "mlinker-version=">,
def mllvm : Separate<["-"], "mllvm">, Flags<[CC1Option,CC1AsOption,CoreOption]>,
HelpText<"Additional arguments to forward to LLVM's option processing">,
MarshallingInfoStringVector<FrontendOpts<"LLVMArgs">>;
def ffuchsia_api_level_EQ : Joined<["-"], "ffuchsia-api-level=">,
Group<m_Group>, Flags<[CC1Option]>, HelpText<"Set Fuchsia API level">,
MarshallingInfoInt<LangOpts<"FuchsiaAPILevel">>;
def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
@ -3113,6 +3196,10 @@ def mno_outline : Flag<["-"], "mno-outline">, Group<f_clang_Group>, Flags<[CC1Op
HelpText<"Disable function outlining (AArch64 only)">;
def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
HelpText<"Do not set the default structure layout to be compatible with the Microsoft compiler standard">;
def mskip_rax_setup : Flag<["-"], "mskip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Skip setting up RAX register when passing variable arguments (x86 only)">,
MarshallingInfoFlag<CodeGenOpts<"SkipRaxSetup">>;
def mno_skip_rax_setup : Flag<["-"], "mno-skip-rax-setup">, Group<m_Group>, Flags<[CC1Option]>;
def mstackrealign : Flag<["-"], "mstackrealign">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Force realign the stack at entry to every function">,
MarshallingInfoFlag<CodeGenOpts<"StackRealignment">>;
@ -3136,6 +3223,8 @@ def meabi : Separate<["-"], "meabi">, Group<m_Group>, Flags<[CC1Option]>,
MarshallingInfoEnum<TargetOpts<"EABIVersion">, "Default">,
NormalizedValuesScope<"llvm::EABI">,
NormalizedValues<["Default", "EABI4", "EABI5", "GNU"]>;
def mtargetos_EQ : Joined<["-"], "mtargetos=">, Group<m_Group>,
HelpText<"Set the deployment target to be the specified OS and OS version">;
def mno_constant_cfstrings : Flag<["-"], "mno-constant-cfstrings">, Group<m_Group>;
def mno_global_merge : Flag<["-"], "mno-global-merge">, Group<m_Group>, Flags<[CC1Option]>,
@ -3230,6 +3319,12 @@ defm aapcs_bitfield_width : BoolOption<"f", "aapcs-bitfield-width",
def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group<m_Group>,
HelpText<"Generate code which only uses the general purpose registers (AArch64/x86 only)">;
def mfix_cmse_cve_2021_35465 : Flag<["-"], "mfix-cmse-cve-2021-35465">,
Group<m_arm_Features_Group>,
HelpText<"Work around VLLDM erratum CVE-2021-35465 (ARM only)">;
def mno_fix_cmse_cve_2021_35465 : Flag<["-"], "mno-fix-cmse-cve-2021-35465">,
Group<m_arm_Features_Group>,
HelpText<"Don't work around VLLDM erratum CVE-2021-35465 (ARM only)">;
def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cortex-a53-835769">,
Group<m_aarch64_Features_Group>,
HelpText<"Workaround Cortex-A53 erratum 835769 (AArch64 only)">;
@ -3247,13 +3342,20 @@ foreach i = {8-15,18} in
def fcall_saved_x#i : Flag<["-"], "fcall-saved-x"#i>, Group<m_aarch64_Features_Group>,
HelpText<"Make the x"#i#" register call-saved (AArch64 only)">;
def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">,
Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
def msve_vector_bits_EQ : Joined<["-"], "msve-vector-bits=">, Group<m_aarch64_Features_Group>,
HelpText<"Specify the size in bits of an SVE vector register. Defaults to the"
" vector length agnostic value of \"scalable\". (AArch64 only)">,
Values<"128,256,512,1024,2048,scalable">,
NormalizedValues<["128", "256", "512", "1024", "2048", "0"]>,
MarshallingInfoEnum<LangOpts<"ArmSveVectorBits">, "0">;
" vector length agnostic value of \"scalable\". (AArch64 only)">;
def mvscale_min_EQ : Joined<["-"], "mvscale-min=">,
Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
HelpText<"Specify the vscale minimum. Defaults to the"
" vector length agnostic value of \"0\". (AArch64 only)">,
MarshallingInfoInt<LangOpts<"VScaleMin">>;
def mvscale_max_EQ : Joined<["-"], "mvscale-max=">,
Group<m_aarch64_Features_Group>, Flags<[NoXarchOption,CC1Option]>,
HelpText<"Specify the vscale maximum. Defaults to the"
" vector length agnostic value of \"0\". (AArch64 only)">,
MarshallingInfoInt<LangOpts<"VScaleMax">>;
def msign_return_address_EQ : Joined<["-"], "msign-return-address=">,
Flags<[CC1Option]>, Group<m_Group>, Values<"none,all,non-leaf">,
@ -3266,6 +3368,8 @@ def mharden_sls_EQ : Joined<["-"], "mharden-sls=">,
def msimd128 : Flag<["-"], "msimd128">, Group<m_wasm_Features_Group>;
def mno_simd128 : Flag<["-"], "mno-simd128">, Group<m_wasm_Features_Group>;
def mrelaxed_simd : Flag<["-"], "mrelaxed-simd">, Group<m_wasm_Features_Group>;
def mno_relaxed_simd : Flag<["-"], "mno-relaxed-simd">, Group<m_wasm_Features_Group>;
def mnontrapping_fptoint : Flag<["-"], "mnontrapping-fptoint">, Group<m_wasm_Features_Group>;
def mno_nontrapping_fptoint : Flag<["-"], "mno-nontrapping-fptoint">, Group<m_wasm_Features_Group>;
def msign_ext : Flag<["-"], "msign-ext">, Group<m_wasm_Features_Group>;
@ -3638,8 +3742,10 @@ def multi__module : Flag<["-"], "multi_module">;
def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
def multiply__defined : Separate<["-"], "multiply_defined">;
def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
HelpText<"Use absolute paths for invoking subcommands (default)">;
def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
HelpText<"Use relative instead of canonical paths">;
HelpText<"Use relative paths for invoking subcommands">;
def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;
@ -4078,6 +4184,7 @@ def mx87 : Flag<["-"], "mx87">, Group<m_x86_Features_Group>;
def mno_x87 : Flag<["-"], "mno-x87">, Group<m_x86_Features_Group>;
def m80387 : Flag<["-"], "m80387">, Alias<mx87>;
def mno_80387 : Flag<["-"], "mno-80387">, Alias<mno_x87>;
def mno_fp_ret_in_387 : Flag<["-"], "mno-fp-ret-in-387">, Alias<mno_x87>;
def mmmx : Flag<["-"], "mmmx">, Group<m_x86_Features_Group>;
def mno_mmx : Flag<["-"], "mno-mmx">, Group<m_x86_Features_Group>;
def m3dnow : Flag<["-"], "m3dnow">, Group<m_x86_Features_Group>;
@ -4127,6 +4234,8 @@ def mavx512dq : Flag<["-"], "mavx512dq">, Group<m_x86_Features_Group>;
def mno_avx512dq : Flag<["-"], "mno-avx512dq">, Group<m_x86_Features_Group>;
def mavx512er : Flag<["-"], "mavx512er">, Group<m_x86_Features_Group>;
def mno_avx512er : Flag<["-"], "mno-avx512er">, Group<m_x86_Features_Group>;
def mavx512fp16 : Flag<["-"], "mavx512fp16">, Group<m_x86_Features_Group>;
def mno_avx512fp16 : Flag<["-"], "mno-avx512fp16">, Group<m_x86_Features_Group>;
def mavx512ifma : Flag<["-"], "mavx512ifma">, Group<m_x86_Features_Group>;
def mno_avx512ifma : Flag<["-"], "mno-avx512ifma">, Group<m_x86_Features_Group>;
def mavx512pf : Flag<["-"], "mavx512pf">, Group<m_x86_Features_Group>;
@ -4163,6 +4272,8 @@ def mwbnoinvd : Flag<["-"], "mwbnoinvd">, Group<m_x86_Features_Group>;
def mno_wbnoinvd : Flag<["-"], "mno-wbnoinvd">, Group<m_x86_Features_Group>;
def mclzero : Flag<["-"], "mclzero">, Group<m_x86_Features_Group>;
def mno_clzero : Flag<["-"], "mno-clzero">, Group<m_x86_Features_Group>;
def mcrc32 : Flag<["-"], "mcrc32">, Group<m_x86_Features_Group>;
def mno_crc32 : Flag<["-"], "mno-crc32">, Group<m_x86_Features_Group>;
def mcx16 : Flag<["-"], "mcx16">, Group<m_x86_Features_Group>;
def mno_cx16 : Flag<["-"], "mno-cx16">, Group<m_x86_Features_Group>;
def menqcmd : Flag<["-"], "menqcmd">, Group<m_x86_Features_Group>;
@ -4261,7 +4372,6 @@ def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
// These are legacy user-facing driver-level option spellings. They are always
// aliases for options that are spelled using the more common Unix / GNU flag
// style of double-dash and equals-joined flags.
def gcc_toolchain_legacy_spelling : Separate<["-"], "gcc-toolchain">, Alias<gcc_toolchain>;
def target_legacy_spelling : Separate<["-"], "target">, Alias<target>;
// Special internal option to handle -Xlinker --no-demangle.
@ -4301,7 +4411,6 @@ def ld_path_EQ : Joined<["--"], "ld-path=">, Group<Link_Group>;
defm align_labels : BooleanFFlag<"align-labels">, Group<clang_ignored_gcc_optimization_f_Group>;
def falign_labels_EQ : Joined<["-"], "falign-labels=">, Group<clang_ignored_gcc_optimization_f_Group>;
defm align_loops : BooleanFFlag<"align-loops">, Group<clang_ignored_gcc_optimization_f_Group>;
def falign_loops_EQ : Joined<["-"], "falign-loops=">, Group<clang_ignored_gcc_optimization_f_Group>;
defm align_jumps : BooleanFFlag<"align-jumps">, Group<clang_ignored_gcc_optimization_f_Group>;
def falign_jumps_EQ : Joined<["-"], "falign-jumps=">, Group<clang_ignored_gcc_optimization_f_Group>;
@ -4495,26 +4604,18 @@ def fdefault_real_8 : Flag<["-"],"fdefault-real-8">, Group<f_Group>,
HelpText<"Set the default real kind to an 8 byte wide type">;
def flarge_sizes : Flag<["-"],"flarge-sizes">, Group<f_Group>,
HelpText<"Use INTEGER(KIND=8) for the result type in size-related intrinsics">;
def fbackslash : Flag<["-"], "fbackslash">, Group<f_Group>,
HelpText<"Specify that backslash in string introduces an escape character">,
DocBrief<[{Change the interpretation of backslashes in string literals from
a single backslash character to "C-style" escape characters.}]>;
def fno_backslash : Flag<["-"], "fno-backslash">, Group<f_Group>;
def fxor_operator : Flag<["-"], "fxor-operator">, Group<f_Group>,
HelpText<"Enable .XOR. as a synonym of .NEQV.">;
def fno_xor_operator : Flag<["-"], "fno-xor-operator">, Group<f_Group>;
def flogical_abbreviations : Flag<["-"], "flogical-abbreviations">, Group<f_Group>,
HelpText<"Enable logical abbreviations">;
def fno_logical_abbreviations : Flag<["-"], "fno-logical-abbreviations">, Group<f_Group>;
def fimplicit_none : Flag<["-"], "fimplicit-none">, Group<f_Group>,
HelpText<"No implicit typing allowed unless overridden by IMPLICIT statements">;
def fno_implicit_none : Flag<["-"], "fno-implicit-none">, Group<f_Group>;
def falternative_parameter_statement : Flag<["-"], "falternative-parameter-statement">, Group<f_Group>,
HelpText<"Enable the old style PARAMETER statement">;
def fintrinsic_modules_path : Separate<["-"], "fintrinsic-modules-path">, Group<f_Group>, MetaVarName<"<dir>">,
HelpText<"Specify where to find the compiled intrinsic modules">,
DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
DocBrief<[{This option specifies the location of pre-compiled intrinsic modules,
if they are not in the default location expected by the compiler.}]>;
defm backslash : OptInFC1FFlag<"backslash", "Specify that backslash in string introduces an escape character">;
defm xor_operator : OptInFC1FFlag<"xor-operator", "Enable .XOR. as a synonym of .NEQV.">;
defm logical_abbreviations : OptInFC1FFlag<"logical-abbreviations", "Enable logical abbreviations">;
defm implicit_none : OptInFC1FFlag<"implicit-none", "No implicit typing allowed unless overridden by IMPLICIT statements">;
}
def J : JoinedOrSeparate<["-"], "J">,
@ -4562,18 +4663,16 @@ def fdebug_measure_parse_tree : Flag<["-"], "fdebug-measure-parse-tree">, Group<
HelpText<"Measure the parse tree">;
def fdebug_pre_fir_tree : Flag<["-"], "fdebug-pre-fir-tree">, Group<Action_Group>,
HelpText<"Dump the pre-FIR tree">;
def fdebug_module_writer : Flag<["-"],"fdebug-module-writer">,
def fdebug_module_writer : Flag<["-"],"fdebug-module-writer">,
HelpText<"Enable debug messages while writing module files">;
def fget_symbols_sources : Flag<["-"], "fget-symbols-sources">, Group<Action_Group>,
HelpText<"Dump symbols and their source code locations">;
def module_suffix : Separate<["-"], "module-suffix">, Group<f_Group>, MetaVarName<"<suffix>">,
HelpText<"Use <suffix> as the suffix for module files (the default value is `.mod`)">;
def fanalyzed_objects_for_unparse : Flag<["-"],
"fanalyzed-objects-for-unparse">, Group<f_Group>;
def fno_analyzed_objects_for_unparse : Flag<["-"],
"fno-analyzed-objects-for-unparse">, Group<f_Group>,
HelpText<"Do not use the analyzed objects when unparsing">;
def fno_reformat : Flag<["-"], "fno-reformat">, Group<Preprocessor_Group>,
HelpText<"Dump the cooked character stream in -E mode">;
defm analyzed_objects_for_unparse : OptOutFC1FFlag<"analyzed-objects-for-unparse", "", "Do not use the analyzed objects when unparsing">;
}
@ -4957,9 +5056,9 @@ def mregparm : Separate<["-"], "mregparm">,
def msmall_data_limit : Separate<["-"], "msmall-data-limit">,
HelpText<"Put global and static data smaller than the limit into a special section">,
MarshallingInfoInt<CodeGenOpts<"SmallDataLimit">>;
def munwind_tables : Flag<["-"], "munwind-tables">,
def funwind_tables_EQ : Joined<["-"], "funwind-tables=">,
HelpText<"Generate unwinding tables for all functions">,
MarshallingInfoFlag<CodeGenOpts<"UnwindTables">>;
MarshallingInfoInt<CodeGenOpts<"UnwindTables">>;
def mconstructor_aliases : Flag<["-"], "mconstructor-aliases">,
HelpText<"Emit complete constructors and destructors as aliases when possible">,
MarshallingInfoFlag<CodeGenOpts<"CXXCtorDtorAliases">>;
@ -5037,6 +5136,14 @@ def fsanitize_coverage_stack_depth
: Flag<["-"], "fsanitize-coverage-stack-depth">,
HelpText<"Enable max stack depth tracing">,
MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageStackDepth">>;
def fsanitize_coverage_trace_loads
: Flag<["-"], "fsanitize-coverage-trace-loads">,
HelpText<"Enable tracing of loads">,
MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceLoads">>;
def fsanitize_coverage_trace_stores
: Flag<["-"], "fsanitize-coverage-trace-stores">,
HelpText<"Enable tracing of stores">,
MarshallingInfoFlag<CodeGenOpts<"SanitizeCoverageTraceStores">>;
def fpatchable_function_entry_offset_EQ
: Joined<["-"], "fpatchable-function-entry-offset=">, MetaVarName<"<M>">,
HelpText<"Generate M NOPs before function entry">,
@ -5231,16 +5338,19 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
def disable_free : Flag<["-"], "disable-free">,
HelpText<"Disable freeing of memory on exit">,
MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
defm clear_ast_before_backend : BoolOption<"",
"clear-ast-before-backend",
CodeGenOpts<"ClearASTBeforeBackend">,
DefaultFalse,
PosFlag<SetTrue, [], "Clear">,
NegFlag<SetFalse, [], "Don't clear">,
BothFlags<[], " the Clang AST before running backend code generation">>;
def enable_noundef_analysis : Flag<["-"], "enable-noundef-analysis">, Group<f_Group>,
HelpText<"Enable analyzing function argument and return types for mandatory definedness">,
MarshallingInfoFlag<CodeGenOpts<"EnableNoundefAttrs">>;
def discard_value_names : Flag<["-"], "discard-value-names">,
HelpText<"Discard value names in LLVM IR">,
MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;
def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
HelpText<"Load the named plugin (dynamic shared object)">;
def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
def plugin_arg : JoinedAndSeparate<["-"], "plugin-arg-">,
MetaVarName<"<name> <arg>">,
HelpText<"Pass <arg> to plugin <name>">;
@ -5253,6 +5363,8 @@ def ast_dump_filter : Separate<["-"], "ast-dump-filter">,
" nodes having a certain substring in a qualified name. Use"
" -ast-list to list all filterable declaration node names.">,
MarshallingInfoString<FrontendOpts<"ASTDumpFilter">>;
def ast_dump_filter_EQ : Joined<["-"], "ast-dump-filter=">,
Alias<ast_dump_filter>;
def fno_modules_global_index : Flag<["-"], "fno-modules-global-index">,
HelpText<"Do not automatically generate or update the global module index">,
MarshallingInfoNegativeFlag<FrontendOpts<"UseGlobalModuleIndex">>;
@ -5276,6 +5388,12 @@ def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">,
HelpText<"Embed the contents of all files read by this compilation into "
"the produced module file.">,
MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>;
defm fimplicit_modules_use_lock : BoolOption<"f", "implicit-modules-use-lock",
FrontendOpts<"BuildingImplicitModuleUsesLock">, DefaultTrue,
NegFlag<SetFalse>,
PosFlag<SetTrue, [],
"Use filesystem locks for implicit modules builds to avoid "
"duplicating work in competing clang invocations.">>;
// FIXME: We only need this in C++ modules / Modules TS if we might textually
// enter a different module (eg, when building a header unit).
def fmodules_local_submodule_visibility :
@ -5283,7 +5401,7 @@ def fmodules_local_submodule_visibility :
HelpText<"Enforce name visibility rules across submodules of the same "
"top-level module.">,
MarshallingInfoFlag<LangOpts<"ModulesLocalVisibility">>,
ImpliedByAnyOf<[fmodules_ts.KeyPath, cpp_modules.KeyPath]>;
ImpliedByAnyOf<[fmodules_ts.KeyPath, fcxx_modules.KeyPath]>;
def fmodules_codegen :
Flag<["-"], "fmodules-codegen">,
HelpText<"Generate code for uses of this module that assumes an explicit "
@ -5807,6 +5925,12 @@ def init_only : Flag<["-"], "init-only">,
HelpText<"Only execute frontend initialization">;
} // let Group = Action_Group
def load : Separate<["-"], "load">, MetaVarName<"<dsopath>">,
HelpText<"Load the named plugin (dynamic shared object)">;
def plugin : Separate<["-"], "plugin">, MetaVarName<"<name>">,
HelpText<"Use the named plugin action instead of the default action (use \"help\" to list available options)">;
} // let Flags = [CC1Option, FC1Option, NoDriverOption]
//===----------------------------------------------------------------------===//
@ -6030,16 +6154,7 @@ def _SLASH_WX_ : CLFlag<"WX-">,
HelpText<"Do not treat warnings as errors (default)">,
Alias<W_Joined>, AliasArgs<["no-error"]>;
def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
def _SLASH_wd4005 : CLFlag<"wd4005">, Alias<W_Joined>,
AliasArgs<["no-macro-redefined"]>;
def _SLASH_wd4018 : CLFlag<"wd4018">, Alias<W_Joined>,
AliasArgs<["no-sign-compare"]>;
def _SLASH_wd4100 : CLFlag<"wd4100">, Alias<W_Joined>,
AliasArgs<["no-unused-parameter"]>;
def _SLASH_wd4910 : CLFlag<"wd4910">, Alias<W_Joined>,
AliasArgs<["no-dllexport-explicit-instantiation-decl"]>;
def _SLASH_wd4996 : CLFlag<"wd4996">, Alias<W_Joined>,
AliasArgs<["no-deprecated-declarations"]>;
def _SLASH_wd : CLCompileJoined<"wd">;
def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
Alias<vtordisp_mode_EQ>;
def _SLASH_X : CLFlag<"X">,
@ -6175,6 +6290,8 @@ def _SLASH_TC : CLCompileFlag<"TC">, HelpText<"Treat all source files as C">;
def _SLASH_Tp : CLCompileJoinedOrSeparate<"Tp">,
HelpText<"Treat <file> as C++ source file">, MetaVarName<"<file>">;
def _SLASH_TP : CLCompileFlag<"TP">, HelpText<"Treat all source files as C++">;
def _SLASH_diasdkdir : CLJoinedOrSeparate<"diasdkdir">,
HelpText<"Path to the DIA SDK">, MetaVarName<"<dir>">;
def _SLASH_vctoolsdir : CLJoinedOrSeparate<"vctoolsdir">,
HelpText<"Path to the VCToolChain">, MetaVarName<"<dir>">;
def _SLASH_vctoolsversion : CLJoinedOrSeparate<"vctoolsversion">,
@ -6184,7 +6301,7 @@ def _SLASH_winsdkdir : CLJoinedOrSeparate<"winsdkdir">,
def _SLASH_winsdkversion : CLJoinedOrSeparate<"winsdkversion">,
HelpText<"Full version of the Windows SDK, defaults to newest found">;
def _SLASH_winsysroot : CLJoinedOrSeparate<"winsysroot">,
HelpText<"Same as /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> /winsdkdir <dir>/Windows Kits/10">,
HelpText<"Same as \"/diasdkdir <dir>/DIA SDK\" /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsversion> \"/winsdkdir <dir>/Windows Kits/10\"">,
MetaVarName<"<dir>">;
def _SLASH_volatile_iso : Option<["/", "-"], "volatile:iso", KIND_FLAG>,
Group<_SLASH_volatile_Group>, Flags<[CLOption, NoXarchOption]>,

View File

@ -22,11 +22,10 @@ namespace phases {
Assemble,
Link,
IfsMerge,
LastPhase = IfsMerge,
};
enum {
MaxNumberOfPhases = LastPhase + 1
MaxNumberOfPhases = IfsMerge + 1
};
const char *getPhaseName(ID Id);

View File

@ -65,7 +65,8 @@ class SanitizerArgs {
public:
/// Parses the sanitizer arguments from an argument list.
SanitizerArgs(const ToolChain &TC, const llvm::opt::ArgList &Args);
SanitizerArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
bool DiagnoseErrors = true);
bool needsSharedRt() const { return SharedRuntime; }

Some files were not shown because too many files have changed in this diff Show More