https://github.com/shafik commented:
This needs summary text, in particular a bit more of explanation of the problem
and why these changes fixes it.
https://github.com/llvm/llvm-project/pull/160047
___
cfe-commits mailing list
cfe-commits@lists.llvm.o
shafik wrote:
> @shafik was https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#3017
> resolved ?
No, it is still active. It looks like
[CWG1436](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1436) is
where the action will be moving forward.
https://github.com/llvm/ll
Javier =?utf-8?q?Mu=C3=B1oz?= Kirschberg
Message-ID:
In-Reply-To:
@@ -0,0 +1,41 @@
+// RUN: %clang -std=c23 -Wnrvo -Xclang -verify %s
+// expected-no-diagnostics
+
+#include
+
+#define SIZE 20
+
+typedef struct String_s {
+char* buf;
+size_t len;
+} String;
+
+
+void c
@@ -1000,6 +1001,21 @@ int z = 128'78;
EXPECT_STREQ("#include \n", Out.data());
}
+TEST(MinimizeSourceToDependencyDirectivesTest, CharacterLiteralInPreprocessor)
{
+ SmallVector Out;
+ SmallVector Tokens;
+ SmallVector Directives;
+
+ StringRef Source = R"(
+#if 1'2
shafik wrote:
> > Is your suggestion to add tests with different rounding modes?
>
> Yes, but I think we need a conclusion on the design question before knowing
> what such tests would look like.
I agree, we need a rationale here. I hope some other more knowledgeable folks
will weigh in soon
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fmodules -std=c++17 -emit-llvm %s -o - -triple
x86_64-linux-gnu | FileCheck %s
+// RUN: %clang_cc1 -fmodules -std=c++17 -emit-llvm %s -o - -triple
x86_64-linux-gnu -fexperimental-new-constant-interpreter | FileCheck %s
shafik
https://github.com/shafik commented:
Can you please add a more complete description of the actual underlying problem
something along the lines of what I added here:
https://github.com/llvm/llvm-project/pull/159579#issuecomment-3310185185
It took me and others a bit to get the original problem
https://github.com/shafik commented:
I think I would feel more comfortable if there was a justification of why this
is allowed.
Looking at the
[documentation](https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fconstant_005fp)
they talk about "constant folding"
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/159579
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
This is linked to the following regression:
https://github.com/llvm/llvm-project/issues/159563
https://github.com/llvm/llvm-project/pull/134142
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
https://github.com/shafik commented:
You mention `UnsignedOrNone` in the summary but that is not directly involved
in the code you modify. It looks like it is used in
`GetDecompositionElementCount` which uses `isTupleLike` but the connection is
not obvious.
https://github.com/llvm/llvm-projec
@@ -572,3 +571,19 @@ namespace VectorCast {
#endif
}
#endif
+
+namespace ToPrimPtrs {
+ struct S { int foo () { return 0; } };
+ auto ptr = __builtin_bit_cast(int *, ((__INTPTR_TYPE__) 0));
+ auto nptr = __builtin_bit_cast(nullptr_t, ((__INTPTR_TYPE__)0));
+
+ constexpr au
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -triple x86_64 -fsyntax-only -verify %s
+
+typedef _Bool bool;
+
+typedef __attribute__((ext_vector_type(8))) int v8i;
+typedef __attribute__((ext_vector_type(8))) bool v8b;
+typedef __attribute__((ext_vector_type(4))) float v4f;
+typedef __att
shafik wrote:
This is linked to https://github.com/llvm/llvm-project/issues/159080
https://github.com/llvm/llvm-project/pull/68059
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Thank you removing the extra changes, I have one more. It looks good but I
would like someone who is more familiar with this area to take a look
https://github.com/llvm/llvm-project/pull/158146
___
cfe-commits mail
@@ -3321,9 +3321,9 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation Loc,
}
return D;
}
-
shafik wrote:
Please remove this newline
https://github.com/llvm/llvm-project/pull/158146
___
cfe-commits mailing l
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/158146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -49,14 +49,15 @@ EvaluationResult EvalEmitter::interpretExpr(const Expr *E,
return std::move(this->EvalResult);
}
-EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD,
+EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD, const Expr
*Init,
shafik wrote:
> @frederick-vs-ja This is currently considered in [CWG
> 2932](https://cplusplus.github.io/CWG/issues/2932.html). I will close this
> until there is a decision.
I am not sure when we will look at that again. We will be heading into handling
NB comments, unless this comes up in
shafik wrote:
@avikivity https://lists.isocpp.org/core/2025/03/17665.php
https://github.com/llvm/llvm-project/pull/130866
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
"abort when initalizing a global temporary" vaguely sounds like change in
behavior but there is no test.
https://github.com/llvm/llvm-project/pull/158038
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
@@ -7085,18 +7102,24 @@ ExprResult
Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
? Context.getIntWidth(IntegerType)
: Context.getTypeSize(IntegerType));
- SugaredConverted = TemplateArgum
https://github.com/shafik commented:
@mizvekov
https://github.com/llvm/llvm-project/pull/134461
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/134461
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing
@@ -3408,8 +3418,7 @@ applyOMPAllocateAttribute(Sema &S, VarDecl *VD,
(Alignment->isTypeDependent() || Alignment->isValueDependent() ||
Alignment->isInstantiationDependent() ||
Alignment->containsUnexpandedParameterPack()))
-// Apply later when we have a
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/158146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -36,3 +36,10 @@ void test_builtin_os_log(void *buf, int i, const char *data)
{
constexpr int len = __builtin_os_log_format_buffer_size("%d %{public}s
%{private}.16P", i, data, data);
static_assert(len > 0, "Expect len > 0");
}
+
+void addc_dummy()
+{
+ unsigned int a;
@@ -3445,30 +3451,27 @@ SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPAllocateDirective(
else
llvm_unreachable("Unexpected clause on allocate directive");
}
+ // No forward-decl needed; just classify with null-guards.
OMPAllocateDeclAttr::AllocatorTypeT
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing
@@ -3445,30 +3451,27 @@ SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPAllocateDirective(
else
llvm_unreachable("Unexpected clause on allocate directive");
}
+ // No forward-decl needed; just classify with null-guards.
OMPAllocateDeclAttr::AllocatorTypeT
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing
@@ -3430,9 +3439,6 @@ SemaOpenMP::DeclGroupPtrTy
SemaOpenMP::ActOnOpenMPAllocateDirective(
Expr *Allocator = nullptr;
if (Clauses.empty()) {
// OpenMP 5.0, 2.11.3 allocate Directive, Restrictions.
-// allocate directives that appear in a target region must specify
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation
Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing
https://github.com/shafik commented:
Thank you for you PR, there are a bunch of small issues and some questions that
need replies.
https://github.com/llvm/llvm-project/pull/158146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
https://github.com/shafik approved this pull request.
LGTM but we need a release note.
https://github.com/llvm/llvm-project/pull/157139
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6007,10 +6007,9 @@ bool Parser::isConstructorDeclarator(bool IsUnqualified,
bool DeductionGuide,
// A C++11 attribute here signals that we have a constructor, and is an
// attribute on the first constructor parameter.
- if (getLangOpts().CPlusPlus11 &&
- isCXX11
https://github.com/shafik commented:
Mostly minor comments
https://github.com/llvm/llvm-project/pull/156075
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -167,6 +167,9 @@ void dereference_reinterpret_cast() {
(void)reinterpret_cast(d); // expected-warning {{reinterpret_cast
from 'double' to 'float &' has undefined behavior}}
(void)*reinterpret_cast(&d); // expected-warning {{dereference of
type 'float *' that was reint
https://github.com/shafik commented:
Please add a release note.
https://github.com/llvm/llvm-project/pull/157033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
> This only changes debugging output so there are no tests for it.
So it looks like this output is only used for `dump()` functions, makes sense.
https://github.com/llvm/llvm-project/pull/156858
___
cfe-commits mailing list
cfe-commits@l
https://github.com/shafik commented:
I am a surprised there are not changed tests nor additional test given the
problem description. It would seem we are avoiding output in a specific format.
We should have a test in which the output would differ w/o this change.
https://github.com/llvm/llvm-
shafik wrote:
What is an Itor cast?
https://github.com/llvm/llvm-project/pull/156669
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -431,6 +435,30 @@ Expr *BuiltinTypeMethodBuilder::getResourceHandleExpr() {
OK_Ordinary);
}
+template
+BuiltinTypeMethodBuilder &
+BuiltinTypeMethodBuilder::getResourceHandle(T ResourceRecord) {
+ ensureCompleteDecl();
+
+ Expr *Resour
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/156075
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -676,6 +704,44 @@
BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding() {
.finalize();
}
+BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addCopyConstructor() {
+ if (Record->isCompleteDefinition())
+return *this;
+
+ ASTContext &AST = SemaRef.getAS
@@ -676,6 +704,44 @@
BuiltinTypeDeclBuilder::addHandleConstructorFromImplicitBinding() {
.finalize();
}
+BuiltinTypeDeclBuilder &BuiltinTypeDeclBuilder::addCopyConstructor() {
+ if (Record->isCompleteDefinition())
+return *this;
+
+ ASTContext &AST = SemaRef.getAS
@@ -431,6 +435,30 @@ Expr *BuiltinTypeMethodBuilder::getResourceHandleExpr() {
OK_Ordinary);
}
+template
+BuiltinTypeMethodBuilder &
+BuiltinTypeMethodBuilder::getResourceHandle(T ResourceRecord) {
+ ensureCompleteDecl();
+
+ Expr *Resour
shafik wrote:
This feels like a regression, unless you think the bug is elsewhere and the
assert just catches it now:
https://github.com/llvm/llvm-project/issues/156458#issuecomment-3246453958
https://github.com/llvm/llvm-project/pull/147835
___
cfe-
https://github.com/shafik approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/156094
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wconditional-scope %s
+
+int *get_something();
+int *get_something_else();
+int *get_something_else_again();
+
+int test() {
+ if (int *ptr = get_something()) {
+return ptr[0] * ptr[0];
+ }
+ else if (int *ptr2 = g
shafik wrote:
I don't have further comments, @erichkeane are you good?
https://github.com/llvm/llvm-project/pull/151400
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -194,6 +194,11 @@ namespace ModifyingCapture {
[=] {
n = 1; // expected-error {{cannot assign to a variable captured by copy
in a non-mutable lambda}}
};
+const int cn = 0;
shafik wrote:
I think we should have also tested a `constexpr` va
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion
RootSigVer,
RootSignatureValMD->addOperand(MDVals);
}
+// Find array variable declaration from nested array subscript AST nodes
+static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {
shafik wrote:
This change is linked to the following regression:
https://github.com/llvm/llvm-project/issues/156232
Please fix asap
https://github.com/llvm/llvm-project/pull/155839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
@@ -986,6 +989,10 @@ def warn_module_conflict : Warning<
InGroup;
// C++20 modules
+def err_module_decl_in_header
+: Error<"module declaration must not come from an #include directive">;
shafik wrote:
I don't see a test that covers this or the next diag
@@ -1775,10 +1775,18 @@ def ext_bit_int : Extension<
} // end of Parse Issue category.
let CategoryName = "Modules Issue" in {
-def err_unexpected_module_decl : Error<
- "module declaration can only appear at the top level">;
+def err_invalid_module_or_import_directive : Erro
@@ -513,14 +513,65 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
return nullptr;
}
+static unsigned
+getImageFormat(const LangOptions &LangOpts,
+ const HLSLAttributedResourceType::Attributes &attributes,
+ llvm::Type *SampledType, Qual
https://github.com/shafik commented:
I would have expected additional test coverage since this looks like it would
change behavior for out of bound shift amounts.
https://github.com/llvm/llvm-project/pull/156019
___
cfe-commits mailing list
cfe-commit
@@ -873,6 +875,27 @@ static_assert(__builtin_elementwise_min(1, 2) == 1);
static_assert(__builtin_elementwise_min(-1, 1) == -1);
static_assert(__builtin_elementwise_min(1U, 2U) == 1U);
static_assert(__builtin_elementwise_min(~0U, 0U) == 0U);
+static_assert(__builtin_fabs(__buil
@@ -11599,6 +11599,89 @@ static bool handleVectorElementCast(EvalInfo &Info,
const FPOptions FPO,
return false;
}
+enum class PackKind {
+ SSWB,
+ USWB,
+ SSDW,
+ USDW
+}; // 16→8 signed/unsigned; 32→16 signed/unsigned
+
+static bool evalPackBuiltin(const CallExpr *E, E
@@ -11599,6 +11599,89 @@ static bool handleVectorElementCast(EvalInfo &Info,
const FPOptions FPO,
return false;
}
+enum class PackKind {
+ SSWB,
+ USWB,
+ SSDW,
+ USDW
+}; // 16→8 signed/unsigned; 32→16 signed/unsigned
+
+static bool evalPackBuiltin(const CallExpr *E, E
@@ -11599,6 +11599,89 @@ static bool handleVectorElementCast(EvalInfo &Info,
const FPOptions FPO,
return false;
}
+enum class PackKind {
+ SSWB,
+ USWB,
+ SSDW,
+ USDW
+}; // 16→8 signed/unsigned; 32→16 signed/unsigned
+
+static bool evalPackBuiltin(const CallExpr *E, E
@@ -11599,6 +11599,89 @@ static bool handleVectorElementCast(EvalInfo &Info,
const FPOptions FPO,
return false;
}
+enum class PackKind {
shafik wrote:
Pack is such an overloaded word in C++, can we get something more specific, I
don't have a good suggesti
@@ -15884,6 +15884,55 @@ static bool checkBuiltinVectorMathMixedEnums(Sema &S,
Expr *LHS, Expr *RHS,
return false;
}
+/// Check if all arguments have the same type. If the types don't match, emit
an
+/// error message and return true. Otherwise return false.
+///
+/// For
shafik wrote:
If they are including `Type.h` in files that only exist downstream that will
force them to deal with this both times around, unless I am missing something.
https://github.com/llvm/llvm-project/pull/155049
___
cfe-commits mailing list
cfe
https://github.com/shafik commented:
Thank you for the quick fix!
https://github.com/llvm/llvm-project/pull/155904
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
I am not sure it makes sense to label such larger changes NFC, anything this
large should have at least one review if not more.
https://github.com/llvm/llvm-project/pull/155313
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
shafik wrote:
CC @zygoloid is clang correct to reject the example in this code?
https://github.com/llvm/llvm-project/pull/155230
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
shafik wrote:
@ahatanak it seems like trunk now return 4 for all cases:
https://godbolt.org/z/ds4ofbv6d I will have to look into the first two cases to
understand what is going on better
https://github.com/llvm/llvm-project/pull/95474
___
cfe-commi
https://github.com/shafik commented:
Thank you for the quick fix!
https://github.com/llvm/llvm-project/pull/155563
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Do you know which clause causes clang to choose to reject this, looks like we
are the only one: https://godbolt.org/z/KhfeP5W6d
CC @hokein looks like came in w/ bd4662cd3f374
https://github.com/llvm/llvm-project/pull/155230
_
shafik wrote:
> This patch doesn't touch LLDB. If LLDB uses this bit, then LLDB also needs to
> be updated in the same manner as we are updating DebugInfo here.
If the change breaks LLDB then you should also fix that break as well.
https://github.com/llvm/llvm-project/pull/155120
___
shafik wrote:
Test failure does not look related, looks like a flaky test.
https://github.com/llvm/llvm-project/pull/154623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/shafik commented:
Thank you for the quick fix.
https://github.com/llvm/llvm-project/pull/155150
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -961,3 +961,51 @@ static_assert(fmaDouble1[3] == 26.0);
constexpr float fmaArray[] = {2.0f, 2.0f, 2.0f, 2.0f};
constexpr float fmaResult = __builtin_elementwise_fma(fmaArray[1],
fmaArray[2], fmaArray[3]);
static_assert(fmaResult == 6.0f, "");
+
+static_assert(__builtin_elem
@@ -961,3 +961,51 @@ static_assert(fmaDouble1[3] == 26.0);
constexpr float fmaArray[] = {2.0f, 2.0f, 2.0f, 2.0f};
constexpr float fmaResult = __builtin_elementwise_fma(fmaArray[1],
fmaArray[2], fmaArray[3]);
static_assert(fmaResult == 6.0f, "");
+
+static_assert(__builtin_elem
@@ -338,3 +338,12 @@ static void *FooTable[1] = {
}
};
+int strcmp(const char *, const char *); // all-note {{passing argument to
parameter here}}
+#define S "\x01\x02\x03\x04\x05\x06\x07\x08"
+const char _str[] = {S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7]};
+const u
@@ -2778,6 +2778,40 @@ static bool interp__builtin_elementwise_fma(InterpState
&S, CodePtr OpPC,
return true;
}
+/// AVX512 predicated move: "Result = Mask[] ? LHS[] : RHS[]".
+static bool interp__builtin_select(InterpState &S, CodePtr OpPC,
+
@@ -11045,10 +11045,6 @@ bool RecordExprEvaluator::VisitCXXConstructExpr(const
CXXConstructExpr *E,
bool ZeroInit = E->requiresZeroInitialization();
if (CheckTrivialDefaultConstructor(Info, E->getExprLoc(), FD, ZeroInit)) {
-// If we've already performed zero-initiali
@@ -4404,14 +4404,19 @@ CompareImplicitConversionSequences(Sema &S,
SourceLocation Loc,
Result = CompareStandardConversionSequences(S, Loc,
ICS1.Standard, ICS2.Standard);
else if (ICS1.isUserDefined()) {
+const Function
@@ -11874,6 +11874,28 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr
*E) {
return Success(APValue(ResultElements.data(), ResultElements.size()), E);
}
+
+ case Builtin::BI__builtin_elementwise_fma: {
+APValue SourceX, SourceY, SourceZ;
+if (!Evaluate
@@ -163,12 +186,11 @@ APValue Pointer::toAPValue(const ASTContext &ASTCtx)
const {
}
if (isTypeidPointer()) {
-TypeInfoLValue TypeInfo(PointeeStorage.Typeid.TypePtr);
-return APValue(
-APValue::LValueBase::getTypeInfo(
-TypeInfo, QualType(Point
@@ -95,31 +93,23 @@ class Pointer {
static constexpr unsigned RootPtrMark = ~0u;
public:
- Pointer() {
-StorageKind = Storage::Int;
-PointeeStorage.Int.Value = 0;
-PointeeStorage.Int.Desc = nullptr;
- }
- Pointer(IntPointer &&IntPtr) : StorageKind(Storage::Int
https://github.com/shafik closed
https://github.com/llvm/llvm-project/pull/154623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -966,3 +966,15 @@ namespace AddressComparison {
static_assert(&U2.a[0] != &U2.b[1]);
static_assert(&U2.a[0] == &U2.b[1]); // both-error {{failed}}
}
+
+#if __cplusplus >= 202002L
+namespace UnionMemberOnePastEnd {
+ constexpr bool b() {
+union {
+ int p;
+
https://github.com/shafik commented:
I don't see any tests for this.
https://github.com/llvm/llvm-project/pull/154275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion
RootSigVer,
RootSignatureValMD->addOperand(MDVals);
}
+// Find array variable declaration from nested array subscript AST nodes
+static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {
@@ -84,6 +85,111 @@ void addRootSignature(llvm::dxbc::RootSignatureVersion
RootSigVer,
RootSignatureValMD->addOperand(MDVals);
}
+// Find array variable declaration from nested array subscript AST nodes
+static const ValueDecl *getArrayDecl(const ArraySubscriptExpr *ASE) {
@@ -2234,30 +2236,136 @@ static unsigned computePointerOffset(const ASTContext
&ASTCtx,
return Result;
}
+/// Does Ptr point to the last subobject?
+static bool pointsToLastObject(const Pointer &Ptr) {
+ Pointer P = Ptr;
+ while (!P.isRoot()) {
+
+if (P.isArrayElement
@@ -2170,29 +2170,32 @@ static bool interp__builtin_memchr(InterpState &S,
CodePtr OpPC,
return true;
}
-static unsigned computeFullDescSize(const ASTContext &ASTCtx,
-const Descriptor *Desc) {
-
+static std::optional computeFullDescSize(
@@ -60,16 +60,18 @@ template class OptionScope final {
public:
/// Root constructor, compiling or discarding primitives.
OptionScope(Compiler *Ctx, bool NewDiscardResult,
- bool NewInitializing)
+ bool NewInitializing, bool NewToLValue)
: C
https://github.com/shafik commented:
I will come back to this
https://github.com/llvm/llvm-project/pull/153601
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2234,30 +2236,136 @@ static unsigned computePointerOffset(const ASTContext
&ASTCtx,
return Result;
}
+/// Does Ptr point to the last subobject?
+static bool pointsToLastObject(const Pointer &Ptr) {
+ Pointer P = Ptr;
+ while (!P.isRoot()) {
+
+if (P.isArrayElement
https://github.com/shafik edited
https://github.com/llvm/llvm-project/pull/153601
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13548,7 +13583,24 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const
CallExpr *E,
APInt Result = LHS.isSigned() ? LHS.ssub_sat(RHS) : LHS.usub_sat(RHS);
return Success(APSInt(Result, !LHS.isSigned()), E);
}
+ case Builtin::BI__builtin_elementwise_max: {
+A
@@ -2437,9 +2437,17 @@ inline bool Destroy(InterpState &S, CodePtr OpPC,
uint32_t I) {
const Pointer &Ptr = S.Current->getLocalPointer(Local.Offset);
if (Ptr.getLifetime() == Lifetime::Ended) {
- auto *D = cast(Ptr.getFieldDesc()->asDecl());
- S.FFDiag(D->ge
https://github.com/shafik commented:
LGTM
https://github.com/llvm/llvm-project/pull/154695
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1652,6 +1655,9 @@ bool InitFieldActivate(InterpState &S, CodePtr OpPC,
uint32_t I) {
const Pointer &Ptr = S.Stk.peek();
if (!CheckRange(S, OpPC, Ptr, CSK_Field))
return false;
+ if (!CheckArray(S, OpPC, Ptr))
shafik wrote:
I feel like `CheckArray
1 - 100 of 1318 matches
Mail list logo