@@ -366,9 +387,15 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty,
bool isVariadic,
return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
}
- // Ignore empty records.
- if (isEmptyRecord(getContext(), Ty, true))
-return ABIArgInfo::ge
@@ -588,7 +615,8 @@ ABIArgInfo ARMABIInfo::classifyReturnType(QualType RetTy,
bool isVariadic,
// Otherwise this is an AAPCS variant.
- if (isEmptyRecord(getContext(), RetTy, true))
+ if (isEmptyRecord(getContext(), RetTy, true) ||
+ getContext().getTypeSize(RetTy)
@@ -366,9 +387,15 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty,
bool isVariadic,
return getNaturalAlignIndirect(Ty, RAA == CGCXXABI::RAA_DirectInMemory);
}
- // Ignore empty records.
- if (isEmptyRecord(getContext(), Ty, true))
-return ABIArgInfo::ge
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/124760
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Please add some tests for lambdas with streaming attributes, for example:
```
void f() { auto x = []__arm_locally_streaming {}; x(); }
```
https://github.com/llvm/llvm-project/pull/124750
___
cfe-commits mailing list
cfe-commits@l
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/119423
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
The likelihood of anyone actually tripping over this outside a synthetic
testcase is very low; you need a combination of unusual constructs to hit this.
So I'm not really worried about documentation/ABI compat flags.
https://github.com/llvm/llvm-project/pull/124760
__
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/123395
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/112714
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/112714
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
You can cherry-pick this to the 20.x branch if you want; we can still land
fixes like this for a few weeks after the branch is created.
https://github.com/llvm/llvm-project/pull/120670
___
cfe-commits mailing list
cfe-commits@list
@@ -1144,6 +1144,12 @@ Arm and AArch64 Support
* FUJITSU-MONAKA (fujitsu-monaka)
+- The AArch64 calling convention for empty structs in C++ mode was changed to
efriedma-quic wrote:
I assume this is supposed to mention AArch32/AAPCS32?
https://github.com/l
@@ -945,7 +944,7 @@ void AArch64AsmPrinter::emitEndOfAsmFile(Module &M) {
// If import call optimization is enabled, emit the appropriate section.
// We do this whether or not we recorded any import calls.
- if (EnableImportCallOptimization && TT.isOSBinFormatCOFF()) {
+
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/122831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM with one minor comment.
https://github.com/llvm/llvm-project/pull/122831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
@@ -1144,6 +1144,12 @@ Arm and AArch64 Support
* FUJITSU-MONAKA (fujitsu-monaka)
+- The AArch64 calling convention for empty structs in C++ mode was changed to
+ pass them as if they have a size of 1 byte, matching the AAPCS64
+ specification and GCC's implementation. The
https://github.com/efriedma-quic approved this pull request.
https://github.com/llvm/llvm-project/pull/124750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-linux-gnu
-fms-layout-compatibility=microsoft %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-pc-windows-gnu %s
+// RUN: %clang_cc1 -emi
@@ -997,6 +997,9 @@ def warn_npot_ms_struct : Warning<
"data types with sizes that aren't a power of two">,
DefaultError, InGroup;
+def err_itanium_layout_unimplemented : Error<
+ "Itanium-compatible layout for the Microsoft C++ ABI is not yet supported">;
---
@@ -66,6 +66,17 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID
IID) {
}
}
+bool IntrinsicInst::canAccessFPEnvironment(Intrinsic::ID IID) {
+ switch (IID) {
+#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
\
+case Intrinsic::INTR
efriedma-quic wrote:
The 32-bit Arm failures are fixed by 7aec7caca30f800811b76ba94291645494788a4f .
The other failures appear to be unrelated.
https://github.com/llvm/llvm-project/pull/120300
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
@@ -66,6 +66,12 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID
IID) {
}
}
+bool IntrinsicInst::canAccessFPEnvironment(LLVMContext &C, Intrinsic::ID IID) {
+ AttributeList Attrs = Intrinsic::getAttributes(C, IID);
+ MemoryEffects ME = Attrs.getMemoryEffects();
@@ -1060,236 +1061,358 @@
CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type,
return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true);
}
-const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset(
-ASTContext &Ctx, const
@@ -1060,236 +1061,358 @@
CodeGenFunction::evaluateOrEmitBuiltinObjectSize(const Expr *E, unsigned Type,
return ConstantInt::get(ResType, ObjectSize, /*isSigned=*/true);
}
-const FieldDecl *CodeGenFunction::FindFlexibleArrayMemberFieldAndOffset(
-ASTContext &Ctx, const
efriedma-quic wrote:
The two issues are sort of tied together: if the intrinsic isn't IntrNoMem, I
suspect the assumption cache stops cooperating.
But anyway, I guess the question is really whether we want these constructs
represented explicitly in IR, to try to leverage the AssumptionCache, o
https://github.com/efriedma-quic approved this pull request.
LGTM
I don't see any reason to mess with the runtime bits: we try to keep them
stable where we can.
https://github.com/llvm/llvm-project/pull/120719
___
cfe-commits mailing list
cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/120861
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -803,10 +804,16 @@ bool ConstStructBuilder::Build(const InitListExpr *ILE,
bool AllowOverwrite) {
if (!AppendField(Field, Layout.getFieldOffset(FieldNo), EltInit,
AllowOverwrite))
return false;
- // After emitting a non-empty field
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool
isNonVirtualBaseType) {
// Empty fields have no storage.
++Field;
} else {
- // Use base subobject layout for the potentially-overlapping field,
- // as it is done in RecordLayoutBuild
@@ -389,14 +389,28 @@ void CGRecordLowering::accumulateFields(bool
isNonVirtualBaseType) {
// Empty fields have no storage.
++Field;
} else {
- // Use base subobject layout for the potentially-overlapping field,
- // as it is done in RecordLayoutBuild
efriedma-quic wrote:
I think you're looking for -DLLVM_RUNTIME_TARGETS ?
https://github.com/llvm/llvm-project/pull/109164
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
I think you need to do some target-specific stuff to get the builtins library
to build... see, for example, https://reviews.llvm.org/D42958 .
https://github.com/llvm/llvm-project/pull/109164
___
cfe-commits mailing list
cfe-commit
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/121788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3771,6 +3771,12 @@ CINDEX_LINKAGE enum CXRefQualifierKind
clang_Type_getCXXRefQualifier(CXType T);
*/
CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor);
+/**
+ * Returns the offset in bits of a CX_CXXBaseSpecifier relative to the parent
+ * class.
+ */
+CINDEX_LINKAG
https://github.com/efriedma-quic updated
https://github.com/llvm/llvm-project/pull/122386
>From 2f6e9acc324802854132ff1b48693a47a8466fa4 Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Tue, 17 Dec 2024 17:46:09 -0800
Subject: [PATCH] [libclang] Allow using PrintingPolicy with types
This allo
https://github.com/efriedma-quic updated
https://github.com/llvm/llvm-project/pull/120494
>From 13a9c0b88afae7a5f48a66e86357f7284fdace95 Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Tue, 17 Dec 2024 15:25:00 -0800
Subject: [PATCH] [libclang/python] Add python bindings for PrintingPolicy
T
@@ -137,6 +137,10 @@ llvm::AllocaInst
*CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
Alloca =
new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
ArraySize, Name, AllocaInsertPt->getIterator());
+ if (Alloca->getName
efriedma-quic wrote:
Still failing the same way.
Should I go ahead and merge anyway, or is there someone who can look into this?
https://github.com/llvm/llvm-project/pull/120494
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
@@ -14585,11 +14585,18 @@ void Sema::CheckAddressOfPackedMember(Expr *rhs) {
_2, _3, _4));
}
+static ExprResult UsualUnaryConversionsNoPromoteInt(Sema &S, Expr *E) {
+ // Don't promote integer types
+ if (QualType Ty = E->getType();
S.getASTContext().is
@@ -14604,57 +14611,63 @@ bool
Sema::PrepareBuiltinElementwiseMathOneArgCall(CallExpr *TheCall) {
}
bool Sema::BuiltinElementwiseMath(CallExpr *TheCall, bool FPOnly) {
- QualType Res;
- if (BuiltinVectorMath(TheCall, Res, FPOnly))
-return true;
- TheCall->setType(Res);
@@ -1,4 +1,5 @@
;RUN: llc -mtriple=armv7-eabi %s -o - | FileCheck %s
+;RUN: llc -mtriple=armv7-msvc %s -o - | FileCheck %s
efriedma-quic wrote:
That's fine. But the CHECK lines in the new test don't look right (`nobits`
etc. are ELF-specific).
https://github.
Author: Eli Friedman
Date: 2025-01-14T14:49:45-08:00
New Revision: 7aec7caca30f800811b76ba94291645494788a4f
URL:
https://github.com/llvm/llvm-project/commit/7aec7caca30f800811b76ba94291645494788a4f
DIFF:
https://github.com/llvm/llvm-project/commit/7aec7caca30f800811b76ba94291645494788a4f.diff
https://github.com/efriedma-quic commented:
LGTM with one minor comment
https://github.com/llvm/llvm-project/pull/122735
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -86,6 +86,35 @@ IRBuilderBase::createCallHelper(Function *Callee,
ArrayRef Ops,
return CI;
}
+CallInst *IRBuilderBase::CreateCall(FunctionType *FTy, Value *Callee,
+ArrayRef Args,
+ArrayRef OpBundles
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/122735
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic commented:
This is not the right fix.
After we check the constant expression in Sema, we should create a ConstantExpr
containing the the evaluated value, so we don't need to re-evaluate it later.
https://github.com/llvm/llvm-project/pull/127223
https://github.com/efriedma-quic requested changes to this pull request.
Hang on... I need to think a little more about the interaction with snan in
strictfp mode.
https://github.com/llvm/llvm-project/pull/126750
___
cfe-commits mailing list
cfe-commi
efriedma-quic wrote:
How does this interact with strictfp? Do we need a constrained version of
sincospi which raises appropriate exceptions?
https://github.com/llvm/llvm-project/pull/127065
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
efriedma-quic wrote:
Referring to the C standard and implementations, I think modf does in fact
raise an fp exception when the operand is an snan. So to handle this, we need
different lowering in strictfp mode, probably to a "constrained" intrinsic.
https://github.com/llvm/llvm-project/pull/1
efriedma-quic wrote:
> when -fno-math-errno is set
What does -fno-math-errno have to do with anything? modf never sets errno
anyway.
https://github.com/llvm/llvm-project/pull/126750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
@@ -859,6 +859,24 @@ static void emitSincosBuiltin(CodeGenFunction &CGF, const
CallExpr *E,
StoreCos->setMetadata(LLVMContext::MD_noalias, AliasScopeList);
}
+static llvm::Value *emitModfBuiltin(CodeGenFunction &CGF, const CallExpr *E,
+l
efriedma-quic wrote:
Can you just move the modf handling into the section for non-math intrinsics?
It's not a "math intrinsic" in this context: it doesn't set errno or raise
exceptions.
https://github.com/llvm/llvm-project/pull/126750
___
cfe-commit
efriedma-quic wrote:
> I can experiment with --filter-out, but I'd prefer to do that as a followup.
If you want, you can run the IR through "opt -passes=mem2reg" or something...
we just don't want to run the full optimization pipeline because that leads to
a bunch of spurious changes to clang
@@ -14054,6 +14054,23 @@ void Sema::CheckCastAlign(Expr *Op, QualType T,
SourceRange TRange) {
<< TRange << Op->getSourceRange();
}
+void Sema::CheckVectorAccess(const Expr *BaseExpr, const Expr *IndexExpr) {
+ const auto *VTy = BaseExpr->getType()->getAs();
+ if (!VTy)
@@ -114,3 +114,13 @@ struct s15 fooa(char a, char b) {
x.arr[1] = b;
return x;
}
+
+struct s8_t {
+ char a;
+};
+
+// AVR-NOT: {{.*}} signext
+// TINY-NOT: {{.*}} signext
efriedma-quic wrote:
Can you rewrite this test to avoid "NOT"? Something like `//
@@ -135,7 +135,8 @@ class AVRTargetCodeGenInfo : public TargetCodeGenInfo {
if (GV->isDeclaration())
return;
const auto *FD = dyn_cast_or_null(D);
-if (!FD) return;
+if (!FD)
efriedma-quic wrote:
Please don't reformat code that isn't rele
@@ -114,3 +114,13 @@ struct s15 fooa(char a, char b) {
x.arr[1] = b;
return x;
}
+
+struct s8_t {
+ char a;
+};
+
+// AVR: define {{.*}} i8 @foob(i8 {{.*}})
+// TINY define {{.*}} i8 @foob(i8 {{.*}})
efriedma-quic wrote:
```suggestion
// AVR: define {{
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/131976
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
The RISCV builtins are generated code; riscv_vector_builtin_cg.inc is 87000
lines. There's an open bug about this: #88368.
https://github.com/llvm/llvm-project/pull/132252
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
@@ -42,6 +42,11 @@ Potentially Breaking Changes
C/C++ Language Potentially Breaking Changes
---
+- Some old-style offsetof idioms like ``((int)(&(((struct S *)0)->field)))``
are treated
efriedma-quic wrote:
I think it
efriedma-quic wrote:
https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches
https://llvm.org/docs/HowToReleaseLLVM.html#release-patch-rules .
https://github.com/llvm/llvm-project/pull/126382
___
cfe-commits mailing list
cfe-commit
@@ -1073,6 +1073,28 @@ inputs. Here is some example of ``$``-prefixed options:
Language and Target-Independent Features
+Freestanding Builds
+---
+Passing the ``-ffreestanding`` flag causes Clang to build for a freestand
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/126481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Sorry, I meant to get back to this sooner.
I'm not sure it makes sense to distinguish between "compile-time" and
"link-time" in the sense this patch is doing: whether an instrumentation pass
runs at compile-time or link-time is more a matter of what's convenient for a
giv
efriedma-quic wrote:
Non-canonical types, are, as the name suggests, non-canonical: they can have
all kinds of type sugar, and type qualifiers at all levels. Please don't try
to change that; just fix getCommonSugaredType so it can tolerate a const
qualifier in this position.
https://github.c
Timm =?utf-8?q?B=C3=A4der?=
Message-ID:
In-Reply-To:
efriedma-quic wrote:
Reduced testcase for the microsoft-abi-member-pointers.cpp failure:
```
constinit int &b = b;
```
This should produce an error; clang -std=c++23 currently accepts it.
https://github.com/llvm/llvm-project/pull/129646
_
Timm =?utf-8?q?Bäder?=
Message-ID:
In-Reply-To:
efriedma-quic wrote:
The other test changes look mostly okay, but worth investigating to see if we
can improve the diagnostic notes for illegal uses of constexpr-unknown
variables.
https://github.com/llvm/llvm-project/pull/129646
_
efriedma-quic wrote:
This is a lot of tests... do we really need every combination of
type/operator/flag? I guess it makes sure we don't have gaps, but thousands of
lines of tests seems excessive.
https://github.com/llvm/llvm-project/pull/131447
___
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/131447
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/131533
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Running both mem2reg and sroa is redunant; just run sroa.
If the undefs are getting introduced by sroa, that's fine; they'll go away when
we fix sroa.
https://github.com/llvm/llvm-project/pull/131925
___
cfe-commits mailing list
@@ -27,7 +27,7 @@ void testva (int n, ...) {
va_start(ap,n);
// CHECK: [[AP:%[a-z0-9]+]] = alloca ptr, align 4
// CHECK: [[V5:%[a-z0-9]+]] = alloca %struct.x, align 4
- // CHECK: [[TMP:%[a-z0-9]+]] = alloca [4 x i32], align 4
+ // CHECK: [[TMP:%[a-z0-9\.]+]] = alloca [4
efriedma-quic wrote:
At first glance, it seems like a good idea to allow people to choose how their
square roots are lowered on a per-function level: some code cares about precise
square roots, some doesn't, and you should be able to make choices on a
case-by-case basis.
But looking at the co
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/133472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Why is this a module flag, instead of a function attribute?
https://github.com/llvm/llvm-project/pull/134244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
efriedma-quic wrote:
Code formatter returned issues; please fix
(https://github.com/llvm/llvm-project/pull/126481#issuecomment-2649368078)
https://github.com/llvm/llvm-project/pull/126481
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https:/
@@ -42,6 +42,11 @@ Potentially Breaking Changes
C/C++ Language Potentially Breaking Changes
---
+- Some old-style offsetof idioms like ``((int)(&(((struct S *)0)->field)))``
are treated
efriedma-quic wrote:
Well, no, b
efriedma-quic wrote:
-ffreestanding currently has the following effects:
- Disables builtins recognition (-fno-builtins)
- Sets `__STDC_HOSTED__` to 0.
- Disables unwind tables (-fno-asynchronous-unwind-tables -fno-unwind-tables)
(refer to df50259f9856ae98b5a1b34c4c955074aff3c566)
Maybe we shou
efriedma-quic wrote:
The timing of this is sort of unfortunate with #132252; the merge conflict
there is going to be very painful. @jthackray , thoughts?
https://github.com/llvm/llvm-project/pull/132060
___
cfe-commits mailing list
cfe-commits@lists.
https://github.com/efriedma-quic closed
https://github.com/llvm/llvm-project/pull/126382
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Mateusz =?utf-8?q?Mikuła?= ,
Mateusz =?utf-8?q?Mikuła?= ,
Mateusz =?utf-8?q?Mikuła?= ,
Mateusz =?utf-8?q?Mikuła?=
Message-ID:
In-Reply-To:
https://github.com/efriedma-quic commented:
Please split this into multiple pull requests; some of these probably need
different reviewers, and GitHub doe
https://github.com/efriedma-quic updated
https://github.com/llvm/llvm-project/pull/132990
>From 2873bb1aee5470ecd7fa66c1f255bfe8b26dbc68 Mon Sep 17 00:00:00 2001
From: Eli Friedman
Date: Mon, 17 Mar 2025 11:20:21 -0700
Subject: [PATCH] [clang] fix constexpr-unknown handling of self-references.
@@ -1073,6 +1073,29 @@ inputs. Here is some example of ``$``-prefixed options:
Language and Target-Independent Features
+Freestanding Builds
+---
+Passing the ``-ffreestanding`` flag causes Clang to build for a freestand
efriedma-quic wrote:
> Do you intend to backport this change to 20?
The weird behavior only shows up if you refer to a reference variable inside
its own initializer, as far as I can tell. Maybe not worth backporting, even
if it is a regression, because people shouldn't be writing code like th
@@ -3629,17 +3644,17 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const
Expr *E,
Result = VD->getEvaluatedValue();
- // C++23 [expr.const]p8
- // ... For such an object that is not usable in constant expressions, the
- // dynamic type of the object is constexpr-un
@@ -177,3 +177,50 @@ namespace extern_reference_used_as_unknown {
int y;
constinit int& g = (x,y); // expected-warning {{left operand of comma
operator has no effect}}
}
+
+namespace uninit_reference_used {
+ int y;
+ constexpr int &r = r; // expected-error {{must be ini
@@ -64,21 +64,27 @@ class CGBuilderTy : public CGBuilderBaseTy {
Address createConstGEP2_32(Address Addr, unsigned Idx0, unsigned Idx1,
const llvm::Twine &Name) {
const llvm::DataLayout &DL = BB->getDataLayout();
-llvm::GetElementPtrInst *
https://github.com/efriedma-quic created
https://github.com/llvm/llvm-project/pull/132990
Usually, in constant evaluation, references which are local to the evaluation
have to be initialized before they're accessed. However, there's one funny
special case: the initializer of a reference can r
@@ -42,6 +42,11 @@ Potentially Breaking Changes
C/C++ Language Potentially Breaking Changes
---
+- Some old-style offsetof idioms like ``((int)(&(((struct S *)0)->field)))``
are treated
efriedma-quic wrote:
I was think
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/133472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7653,8 +7653,11 @@ ExprResult Sema::TemporaryMaterializationConversion(Expr
*E) {
// In C++98, we don't want to implicitly create an xvalue.
// FIXME: This means that AST consumers need to deal with "prvalues" that
// denote materialized temporaries. Maybe we should
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/133472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/134269
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/135064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic commented:
The general idea here makes sense.
https://github.com/llvm/llvm-project/pull/135064
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -485,6 +485,24 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType
Ty, bool IsVariadicFn,
}
Size = llvm::alignTo(Size, Alignment);
+// If the Aggregate is made up of pointers, use an array of pointers for
the
+// coerced type. This prevents having
@@ -0,0 +1,72 @@
+// RUN: %clang_cc1 -triple thumbv8.1m.main-unknown-none-eabi
-emit-module-interface -target-feature +pacbti -mbranch-target-enforce
-std=c++20 %s -o %t.pcm
efriedma-quic wrote:
I don't think we need all the combinations here in RUN lines; we v
Jan =?utf-8?q?Górski?= ,
Jan =?utf-8?q?Górski?= ,
Jan =?utf-8?q?Górski?= ,
Jan =?utf-8?q?Górski?= ,
Jan =?utf-8?q?Górski?=
Message-ID:
In-Reply-To:
efriedma-quic wrote:
I don't really understand what the new version of the patch is doing...
instcombine can infer `nuw` on `trunc` if the operan
@@ -447,6 +447,8 @@ llvm::Function
*CodeGenModule::CreateGlobalInitOrCleanUpFunction(
if (Linkage == llvm::GlobalVariable::InternalLinkage)
SetInternalFunctionAttributes(GlobalDecl(), Fn, FI);
+ else
+getTargetCodeGenInfo().setTargetAttributes(nullptr, Fn, *this);
efriedma-quic wrote:
There isn't any reason we can't do this... but it doesn't really solve the
issue in general. And there are a lot of other ways to trip over this. CC
@dblaike @hvdijk @jmorse
Do we want to try to handle _BitInt, or a struct containing an i128?
https://github.com/llvm/ll
1501 - 1600 of 2038 matches
Mail list logo