aboutsummaryrefslogtreecommitdiff
path: root/clang/include
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/AST/DeclTemplate.h7
-rw-r--r--clang/include/clang/AST/HLSLResource.h13
-rw-r--r--clang/include/clang/AST/OpenACCClause.h24
-rw-r--r--clang/include/clang/AST/TypeBase.h4
-rw-r--r--clang/include/clang/ASTMatchers/GtestMatchers.h87
-rw-r--r--clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h7
-rw-r--r--clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def1
-rw-r--r--clang/include/clang/Basic/Attr.td12
-rw-r--r--clang/include/clang/Basic/Builtins.td6
-rw-r--r--clang/include/clang/Basic/CodeGenOptions.def2
-rw-r--r--clang/include/clang/Basic/CodeGenOptions.h4
-rw-r--r--clang/include/clang/Basic/DiagnosticGroups.td3
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td2
-rw-r--r--clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h6
-rw-r--r--clang/include/clang/CIR/Dialect/IR/CIRAttrs.td45
-rw-r--r--clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h13
-rw-r--r--clang/include/clang/CIR/Dialect/IR/CIRDialect.td1
-rw-r--r--clang/include/clang/CIR/MissingFeatures.h8
-rw-r--r--clang/include/clang/Driver/Options.td21
-rw-r--r--clang/include/clang/Driver/SanitizerArgs.h2
-rw-r--r--clang/include/clang/Sema/Sema.h15
21 files changed, 172 insertions, 111 deletions
diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h
index a3c67a6..a4a1bb9 100644
--- a/clang/include/clang/AST/DeclTemplate.h
+++ b/clang/include/clang/AST/DeclTemplate.h
@@ -3395,9 +3395,10 @@ inline UnsignedOrNone getExpandedPackSize(const NamedDecl *Param) {
return std::nullopt;
}
-/// Internal helper used by Subst* nodes to retrieve the parameter list
-/// for their AssociatedDecl.
-TemplateParameterList *getReplacedTemplateParameterList(const Decl *D);
+/// Internal helper used by Subst* nodes to retrieve a parameter from the
+/// AssociatedDecl, and the template argument substituted into it, if any.
+std::tuple<NamedDecl *, TemplateArgument>
+getReplacedTemplateParameter(Decl *D, unsigned Index);
/// If we have a 'templated' declaration for a template, adjust 'D' to
/// refer to the actual template.
diff --git a/clang/include/clang/AST/HLSLResource.h b/clang/include/clang/AST/HLSLResource.h
index 7440050..1be1e42 100644
--- a/clang/include/clang/AST/HLSLResource.h
+++ b/clang/include/clang/AST/HLSLResource.h
@@ -74,6 +74,19 @@ struct ResourceBindingAttrs {
assert(hasBinding() && !isExplicit() && !hasImplicitOrderID());
RegBinding->setImplicitBindingOrderID(Value);
}
+ void setCounterImplicitOrderID(unsigned Value) const {
+ assert(hasBinding() && !hasCounterImplicitOrderID());
+ RegBinding->setImplicitCounterBindingOrderID(Value);
+ }
+
+ bool hasCounterImplicitOrderID() const {
+ return RegBinding && RegBinding->hasImplicitCounterBindingOrderID();
+ }
+
+ unsigned getCounterImplicitOrderID() const {
+ assert(hasCounterImplicitOrderID());
+ return RegBinding->getImplicitCounterBindingOrderID();
+ }
};
} // namespace hlsl
diff --git a/clang/include/clang/AST/OpenACCClause.h b/clang/include/clang/AST/OpenACCClause.h
index 58ba8d91..79cffeb 100644
--- a/clang/include/clang/AST/OpenACCClause.h
+++ b/clang/include/clang/AST/OpenACCClause.h
@@ -1280,13 +1280,31 @@ public:
// 'main' declaration used for initializaiton, which is fixed.
struct OpenACCReductionRecipe {
VarDecl *AllocaDecl;
- // TODO: OpenACC: this should eventually have the operations here too.
- OpenACCReductionRecipe(VarDecl *A) : AllocaDecl(A) {}
+ // A combiner recipe is represented by an operation expression. However, in
+ // order to generate these properly, we have to make up a LHS and a RHS
+ // expression for the purposes of generation.
+ struct CombinerRecipe {
+ VarDecl *LHS;
+ VarDecl *RHS;
+ Expr *Op;
+ };
+
+ // Contains a collection of the recipe elements we need for the combiner:
+ // -For Scalars, there will be 1 element, just the combiner for that scalar.
+ // -For a struct with a valid operator, this will be 1 element, just that
+ // call.
+ // -For a struct without the operator, this will be 1 element per field, which
+ // should be the combiner for that element.
+ // -For an array of any of the above, it will be the above for the element.
+ llvm::SmallVector<CombinerRecipe, 1> CombinerRecipes;
+
+ OpenACCReductionRecipe(VarDecl *A, llvm::ArrayRef<CombinerRecipe> Combiners)
+ : AllocaDecl(A), CombinerRecipes(Combiners) {}
bool isSet() const { return AllocaDecl; }
static OpenACCReductionRecipe Empty() {
- return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr);
+ return OpenACCReductionRecipe(/*AllocaDecl=*/nullptr, {});
}
};
diff --git a/clang/include/clang/AST/TypeBase.h b/clang/include/clang/AST/TypeBase.h
index 6786b2f..625cc77 100644
--- a/clang/include/clang/AST/TypeBase.h
+++ b/clang/include/clang/AST/TypeBase.h
@@ -7082,10 +7082,6 @@ public:
class SubstTemplateTypeParmPackType : public SubstPackType {
friend class ASTContext;
- /// A pointer to the set of template arguments that this
- /// parameter pack is instantiated with.
- const TemplateArgument *Arguments;
-
llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndFinal;
SubstTemplateTypeParmPackType(QualType Canon, Decl *AssociatedDecl,
diff --git a/clang/include/clang/ASTMatchers/GtestMatchers.h b/clang/include/clang/ASTMatchers/GtestMatchers.h
deleted file mode 100644
index e19d91a..0000000
--- a/clang/include/clang/ASTMatchers/GtestMatchers.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//===- GtestMatchers.h - AST Matchers for GTest -----------------*- 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 implements matchers specific to structures in the Googletest
-// (gtest) framework.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
-#define LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
-
-#include "clang/AST/Stmt.h"
-#include "clang/ASTMatchers/ASTMatchers.h"
-#include "llvm/ADT/StringRef.h"
-
-namespace clang {
-namespace ast_matchers {
-
-/// Gtest's comparison operations.
-enum class GtestCmp {
- Eq,
- Ne,
- Ge,
- Gt,
- Le,
- Lt,
-};
-
-/// This enum indicates whether the mock method in the matched ON_CALL or
-/// EXPECT_CALL macro has arguments. For example, `None` can be used to match
-/// `ON_CALL(mock, TwoParamMethod)` whereas `Some` can be used to match
-/// `ON_CALL(mock, TwoParamMethod(m1, m2))`.
-enum class MockArgs {
- None,
- Some,
-};
-
-/// Matcher for gtest's ASSERT comparison macros including ASSERT_EQ, ASSERT_NE,
-/// ASSERT_GE, ASSERT_GT, ASSERT_LE and ASSERT_LT.
-internal::BindableMatcher<Stmt> gtestAssert(GtestCmp Cmp, StatementMatcher Left,
- StatementMatcher Right);
-
-/// Matcher for gtest's ASSERT_THAT macro.
-internal::BindableMatcher<Stmt> gtestAssertThat(StatementMatcher Actual,
- StatementMatcher Matcher);
-
-/// Matcher for gtest's EXPECT comparison macros including EXPECT_EQ, EXPECT_NE,
-/// EXPECT_GE, EXPECT_GT, EXPECT_LE and EXPECT_LT.
-internal::BindableMatcher<Stmt> gtestExpect(GtestCmp Cmp, StatementMatcher Left,
- StatementMatcher Right);
-
-/// Matcher for gtest's EXPECT_THAT macro.
-internal::BindableMatcher<Stmt> gtestExpectThat(StatementMatcher Actual,
- StatementMatcher Matcher);
-
-/// Matcher for gtest's EXPECT_CALL macro. `MockObject` matches the mock
-/// object and `MockMethodName` is the name of the method invoked on the mock
-/// object.
-internal::BindableMatcher<Stmt> gtestExpectCall(StatementMatcher MockObject,
- llvm::StringRef MockMethodName,
- MockArgs Args);
-
-/// Matcher for gtest's EXPECT_CALL macro. `MockCall` matches the whole mock
-/// member method call. This API is more flexible but requires more knowledge of
-/// the AST structure of EXPECT_CALL macros.
-internal::BindableMatcher<Stmt> gtestExpectCall(StatementMatcher MockCall,
- MockArgs Args);
-
-/// Like the first `gtestExpectCall` overload but for `ON_CALL`.
-internal::BindableMatcher<Stmt> gtestOnCall(StatementMatcher MockObject,
- llvm::StringRef MockMethodName,
- MockArgs Args);
-
-/// Like the second `gtestExpectCall` overload but for `ON_CALL`.
-internal::BindableMatcher<Stmt> gtestOnCall(StatementMatcher MockCall,
- MockArgs Args);
-
-} // namespace ast_matchers
-} // namespace clang
-
-#endif // LLVM_CLANG_ASTMATCHERS_GTESTMATCHERS_H
-
diff --git a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
index 9b53f1d..ea41eb3 100644
--- a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
+++ b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h
@@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_UNSAFEBUFFERUSAGE_H
#define LLVM_CLANG_ANALYSIS_ANALYSES_UNSAFEBUFFERUSAGE_H
+#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Stmt.h"
@@ -139,6 +140,12 @@ public:
FixItList &&Fixes, const Decl *D,
const FixitStrategy &VarTargetTypes) = 0;
+ // Invoked when an array subscript operator[] is used on a
+ // std::unique_ptr<T[]>.
+ virtual void handleUnsafeUniquePtrArrayAccess(const DynTypedNode &Node,
+ bool IsRelatedToDecl,
+ ASTContext &Ctx) = 0;
+
#ifndef NDEBUG
public:
bool areDebugNotesRequested() {
diff --git a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
index 09fa510..fae5f8b 100644
--- a/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
+++ b/clang/include/clang/Analysis/Analyses/UnsafeBufferUsageGadgets.def
@@ -38,6 +38,7 @@ WARNING_GADGET(PointerArithmetic)
WARNING_GADGET(UnsafeBufferUsageAttr)
WARNING_GADGET(UnsafeBufferUsageCtorAttr)
WARNING_GADGET(DataInvocation)
+WARNING_GADGET(UniquePtrArrayAccess)
WARNING_OPTIONAL_GADGET(UnsafeLibcFunctionCall)
WARNING_OPTIONAL_GADGET(SpanTwoParamConstructor) // Uses of `std::span(arg0, arg1)`
FIXABLE_GADGET(ULCArraySubscript) // `DRE[any]` in an Unspecified Lvalue Context
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 3c697ed..3cde249 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -4944,6 +4944,7 @@ def HLSLResourceBinding: InheritableAttr {
std::optional<unsigned> SlotNumber;
unsigned SpaceNumber;
std::optional<unsigned> ImplicitBindingOrderID;
+ std::optional<unsigned> ImplicitCounterBindingOrderID;
public:
void setBinding(RegisterType RT, std::optional<unsigned> SlotNum, unsigned SpaceNum) {
@@ -4976,6 +4977,17 @@ def HLSLResourceBinding: InheritableAttr {
assert(hasImplicitBindingOrderID() && "attribute does not have implicit binding order id");
return ImplicitBindingOrderID.value();
}
+ void setImplicitCounterBindingOrderID(uint32_t Value) {
+ assert(!hasImplicitCounterBindingOrderID() && "attribute already has implicit counter binding order id");
+ ImplicitCounterBindingOrderID = Value;
+ }
+ bool hasImplicitCounterBindingOrderID() const {
+ return ImplicitCounterBindingOrderID.has_value();
+ }
+ uint32_t getImplicitCounterBindingOrderID() const {
+ assert(hasImplicitCounterBindingOrderID() && "attribute does not have implicit counter binding order id");
+ return ImplicitCounterBindingOrderID.value();
+ }
}];
}
diff --git a/clang/include/clang/Basic/Builtins.td b/clang/include/clang/Basic/Builtins.td
index 468121f..792e2e0 100644
--- a/clang/include/clang/Basic/Builtins.td
+++ b/clang/include/clang/Basic/Builtins.td
@@ -4945,6 +4945,12 @@ def HLSLResourceHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLResourceCounterHandleFromImplicitBinding : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_resource_counterhandlefromimplicitbinding"];
+ let Attributes = [NoThrow, CustomTypeChecking];
+ let Prototype = "void(...)";
+}
+
def HLSLResourceNonUniformIndex : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_resource_nonuniformindex"];
let Attributes = [NoThrow];
diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
index 872f73e..d924cb4 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -306,6 +306,8 @@ CODEGENOPT(SanitizeBinaryMetadataCovered, 1, 0, Benign) ///< Emit PCs for covere
CODEGENOPT(SanitizeBinaryMetadataAtomics, 1, 0, Benign) ///< Emit PCs for atomic operations.
CODEGENOPT(SanitizeBinaryMetadataUAR, 1, 0, Benign) ///< Emit PCs for start of functions
///< that are subject for use-after-return checking.
+CODEGENOPT(SanitizeAllocTokenFastABI, 1, 0, Benign) ///< Use the AllocToken fast ABI.
+CODEGENOPT(SanitizeAllocTokenExtended, 1, 0, Benign) ///< Extend coverage to custom allocation functions.
CODEGENOPT(SanitizeStats , 1, 0, Benign) ///< Collect statistics for sanitizers.
ENUM_CODEGENOPT(SanitizeDebugTrapReasons, SanitizeDebugTrapReasonKind, 2, SanitizeDebugTrapReasonKind::Detailed, Benign) ///< Control how "trap reasons" are emitted in debug info
CODEGENOPT(SimplifyLibCalls , 1, 1, Benign) ///< Set when -fbuiltin is enabled.
diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index 5d5cf25..cae06c3 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -447,6 +447,10 @@ public:
std::optional<double> AllowRuntimeCheckSkipHotCutoff;
+ /// Maximum number of allocation tokens (0 = no max), nullopt if none set (use
+ /// pass default).
+ std::optional<uint64_t> AllocTokenMax;
+
/// List of backend command-line options for -fembed-bitcode.
std::vector<uint8_t> CmdArgs;
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index 0c994e0..4b27a42 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -1750,7 +1750,8 @@ def ReadOnlyPlacementChecks : DiagGroup<"read-only-types">;
// Warnings and fixes to support the "safe buffers" programming model.
def UnsafeBufferUsageInContainer : DiagGroup<"unsafe-buffer-usage-in-container">;
def UnsafeBufferUsageInLibcCall : DiagGroup<"unsafe-buffer-usage-in-libc-call">;
-def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage", [UnsafeBufferUsageInContainer, UnsafeBufferUsageInLibcCall]>;
+def UnsafeBufferUsageInUniquePtrArrayAccess : DiagGroup<"unsafe-buffer-usage-in-unique-ptr-array-access">;
+def UnsafeBufferUsage : DiagGroup<"unsafe-buffer-usage", [UnsafeBufferUsageInContainer, UnsafeBufferUsageInLibcCall, UnsafeBufferUsageInUniquePtrArrayAccess]>;
// Warnings and notes InstallAPI verification.
def InstallAPIViolation : DiagGroup<"installapi-violation">;
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index b157cbb..5be63c0 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -13295,6 +13295,8 @@ def note_safe_buffer_usage_suggestions_disabled : Note<
def warn_unsafe_buffer_usage_in_container : Warning<
"the two-parameter std::span construction is unsafe as it can introduce mismatch between buffer size and the bound information">,
InGroup<UnsafeBufferUsageInContainer>, DefaultIgnore;
+def warn_unsafe_buffer_usage_unique_ptr_array_access : Warning<"direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking">,
+ InGroup<UnsafeBufferUsageInUniquePtrArrayAccess>, DefaultIgnore;
#ifndef NDEBUG
// Not a user-facing diagnostic. Useful for debugging false negatives in
// -fsafe-buffer-usage-suggestions (i.e. lack of -Wunsafe-buffer-usage fixits).
diff --git a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
index 89b519e..11ad61f 100644
--- a/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+++ b/clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
@@ -374,6 +374,12 @@ public:
resOperands, attrs);
}
+ cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee,
+ mlir::ValueRange operands = mlir::ValueRange(),
+ llvm::ArrayRef<mlir::NamedAttribute> attrs = {}) {
+ return createCallOp(loc, callee, cir::VoidType(), operands, attrs);
+ }
+
cir::CallOp createTryCallOp(
mlir::Location loc, mlir::SymbolRefAttr callee = mlir::SymbolRefAttr(),
mlir::Type returnType = cir::VoidType(),
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
index 43832b7..bb62223 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
@@ -770,6 +770,51 @@ def CIR_VisibilityAttr : CIR_EnumAttr<CIR_VisibilityKind, "visibility"> {
}
//===----------------------------------------------------------------------===//
+// GloblCtorAttr
+//===----------------------------------------------------------------------===//
+
+class CIR_GlobalCtorDtor<string name, string attrMnemonic>
+ : CIR_Attr<"Global" # name, "global_" # attrMnemonic> {
+ let parameters = (ins "mlir::StringAttr":$name, "int":$priority);
+
+ let skipDefaultBuilders = 1;
+ let builders = [
+ AttrBuilder<(ins
+ "llvm::StringRef":$name,
+ CArg<"int", "65535">:$priority), [{
+ return $_get($_ctxt, mlir::StringAttr::get($_ctxt, name), priority);
+ }]>,
+ AttrBuilderWithInferredContext<(ins
+ "mlir::StringAttr":$name,
+ CArg<"int", "65535">:$priority), [{
+ return $_get(name.getContext(), name, priority);
+ }]>
+ ];
+
+ let assemblyFormat = [{
+ `<` $name `,` $priority `>`
+ }];
+
+ let extraClassDeclaration = [{
+ bool isDefaultPriority() const {
+ return getPriority() == getDefaultPriority();
+ };
+
+ static int getDefaultPriority() {
+ return 65535;
+ }
+ }];
+}
+
+def CIR_GlobalCtorAttr : CIR_GlobalCtorDtor<"Ctor", "ctor"> {
+ let summary = "Marks a function as a global constructor";
+ let description = [{
+ Marks the function as a global constructor in the module's constructor list.
+ It will be executed before main() is called.
+ }];
+}
+
+//===----------------------------------------------------------------------===//
// BitfieldInfoAttr
//===----------------------------------------------------------------------===//
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h b/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h
index 417a226..5c6ce7a 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h
+++ b/clang/include/clang/CIR/Dialect/IR/CIRDataLayout.h
@@ -14,6 +14,7 @@
#include "mlir/Dialect/DLTI/DLTI.h"
#include "mlir/IR/BuiltinOps.h"
+#include "clang/CIR/Dialect/IR/CIRTypes.h"
namespace cir {
@@ -81,6 +82,18 @@ public:
}
llvm::TypeSize getTypeSizeInBits(mlir::Type ty) const;
+
+ llvm::TypeSize getPointerTypeSizeInBits(mlir::Type ty) const {
+ assert(mlir::isa<cir::PointerType>(ty) &&
+ "This should only be called with a pointer type");
+ return layout.getTypeSizeInBits(ty);
+ }
+
+ mlir::Type getIntPtrType(mlir::Type ty) const {
+ assert(mlir::isa<cir::PointerType>(ty) && "Expected pointer type");
+ return cir::IntType::get(ty.getContext(), getPointerTypeSizeInBits(ty),
+ false);
+ }
};
} // namespace cir
diff --git a/clang/include/clang/CIR/Dialect/IR/CIRDialect.td b/clang/include/clang/CIR/Dialect/IR/CIRDialect.td
index 15d5fa0..feb08d60 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIRDialect.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIRDialect.td
@@ -42,6 +42,7 @@ def CIR_Dialect : Dialect {
static llvm::StringRef getNoThrowAttrName() { return "nothrow"; }
static llvm::StringRef getSideEffectAttrName() { return "side_effect"; }
static llvm::StringRef getModuleLevelAsmAttrName() { return "cir.module_asm"; }
+ static llvm::StringRef getGlobalCtorsAttrName() { return "cir.global_ctors"; }
void registerAttributes();
void registerTypes();
diff --git a/clang/include/clang/CIR/MissingFeatures.h b/clang/include/clang/CIR/MissingFeatures.h
index f795800..ace2086 100644
--- a/clang/include/clang/CIR/MissingFeatures.h
+++ b/clang/include/clang/CIR/MissingFeatures.h
@@ -38,10 +38,8 @@ struct MissingFeatures {
static bool opGlobalPartition() { return false; }
static bool opGlobalUsedOrCompilerUsed() { return false; }
static bool opGlobalAnnotations() { return false; }
- static bool opGlobalDtorLowering() { return false; }
- static bool opGlobalCtorAttr() { return false; }
static bool opGlobalCtorPriority() { return false; }
- static bool opGlobalCtorList() { return false; }
+ static bool opGlobalDtorList() { return false; }
static bool setDSOLocal() { return false; }
static bool setComdat() { return false; }
@@ -81,9 +79,12 @@ struct MissingFeatures {
static bool opFuncExtraAttrs() { return false; }
static bool opFuncMaybeHandleStaticInExternC() { return false; }
static bool opFuncMultipleReturnVals() { return false; }
+ static bool opFuncNoUnwind() { return false; }
static bool opFuncOperandBundles() { return false; }
static bool opFuncParameterAttributes() { return false; }
+ static bool opFuncReadOnly() { return false; }
static bool opFuncSection() { return false; }
+ static bool opFuncWillReturn() { return false; }
static bool setLLVMFunctionFEnvAttributes() { return false; }
static bool setFunctionAttributes() { return false; }
@@ -138,7 +139,6 @@ struct MissingFeatures {
// RecordType
static bool skippedLayout() { return false; }
static bool astRecordDeclAttr() { return false; }
- static bool recordZeroInitPadding() { return false; }
static bool zeroSizeRecordMembers() { return false; }
// Coroutines
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 60c4ad4..ec38231 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2731,8 +2731,25 @@ def fsanitize_skip_hot_cutoff_EQ
"(0.0 [default] = skip none; 1.0 = skip all). "
"Argument format: <sanitizer1>=<value1>,<sanitizer2>=<value2>,...">;
+defm sanitize_alloc_token_fast_abi : BoolOption<"f", "sanitize-alloc-token-fast-abi",
+ CodeGenOpts<"SanitizeAllocTokenFastABI">, DefaultFalse,
+ PosFlag<SetTrue, [], [ClangOption], "Use the AllocToken fast ABI">,
+ NegFlag<SetFalse, [], [ClangOption], "Use the default AllocToken ABI">>,
+ Group<f_clang_Group>;
+defm sanitize_alloc_token_extended : BoolOption<"f", "sanitize-alloc-token-extended",
+ CodeGenOpts<"SanitizeAllocTokenExtended">, DefaultFalse,
+ PosFlag<SetTrue, [], [ClangOption], "Enable">,
+ NegFlag<SetFalse, [], [ClangOption], "Disable">,
+ BothFlags<[], [ClangOption], " extended coverage to custom allocation functions">>,
+ Group<f_clang_Group>;
+
} // end -f[no-]sanitize* flags
+def falloc_token_max_EQ : Joined<["-"], "falloc-token-max=">,
+ Group<f_Group>, Visibility<[ClangOption, CC1Option]>,
+ MetaVarName<"<N>">,
+ HelpText<"Limit to maximum N allocation tokens (0 = no max)">;
+
def fallow_runtime_check_skip_hot_cutoff_EQ
: Joined<["-"], "fallow-runtime-check-skip-hot-cutoff=">,
Group<f_clang_Group>,
@@ -4715,6 +4732,10 @@ def gdwarf_4 : Flag<["-"], "gdwarf-4">, Group<g_Group>,
HelpText<"Generate source-level debug information with dwarf version 4">;
def gdwarf_5 : Flag<["-"], "gdwarf-5">, Group<g_Group>,
HelpText<"Generate source-level debug information with dwarf version 5">;
+def gdwarf_6
+ : Flag<["-"], "gdwarf-6">,
+ Group<g_Group>,
+ HelpText<"Generate source-level debug information with dwarf version 6">;
}
def gdwarf64 : Flag<["-"], "gdwarf64">, Group<g_Group>,
Visibility<[ClangOption, CC1Option, CC1AsOption]>,
diff --git a/clang/include/clang/Driver/SanitizerArgs.h b/clang/include/clang/Driver/SanitizerArgs.h
index 2b72268..eea7897 100644
--- a/clang/include/clang/Driver/SanitizerArgs.h
+++ b/clang/include/clang/Driver/SanitizerArgs.h
@@ -75,6 +75,8 @@ class SanitizerArgs {
llvm::AsanDetectStackUseAfterReturnMode::Invalid;
std::string MemtagMode;
+ bool AllocTokenFastABI = false;
+ bool AllocTokenExtended = false;
public:
/// Parses the sanitizer arguments from an argument list.
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 265462a..37598f8 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -10208,15 +10208,12 @@ public:
bool CStyle, bool &ObjCLifetimeConversion);
/// Determine whether the conversion from FromType to ToType is a valid
- /// conversion that strips "noexcept" or "noreturn" or "cfi_unchecked_callee"
- /// off the nested function type. This also checks if "cfi_unchecked_callee"
- /// was added to the function type. If "cfi_unchecked_callee" is added and
- /// `AddingCFIUncheckedCallee` is provided, it will be set to true. The same
- /// thing applies for `DiscardingCFIUncheckedCallee` if the attribute is
- /// discarded.
- bool IsFunctionConversion(QualType FromType, QualType ToType,
- bool *DiscardingCFIUncheckedCallee = nullptr,
- bool *AddingCFIUncheckedCallee = nullptr) const;
+ /// conversion of ExtInfo/ExtProtoInfo on the nested function type.
+ /// More precisely, this method checks whether FromType can be transformed
+ /// into an exact match for ToType, by transforming its extended function
+ /// type information in legal manner (e.g. by strictly stripping "noreturn"
+ /// or "noexcept", or by stripping "noescape" for arguments).
+ bool IsFunctionConversion(QualType FromType, QualType ToType) const;
/// Same as `IsFunctionConversion`, but if this would return true, it sets
/// `ResultTy` to `ToType`.