Revision tags: llvmorg-21-init |
|
#
e622468f |
| 23-Jan-2025 |
Kazu Hirata <kazu@google.com> |
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124074)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast(
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#124074)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T>
Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect CO to be nonnull.
show more ...
|
Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2 |
|
#
d412cea8 |
| 03-Oct-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC] Implement 'tile' attribute AST (#110999)
The 'tile' clause shares quite a bit of the rules with 'collapse', so a
followup patch will add those tests/behaviors. This patch deals with
addi
[OpenACC] Implement 'tile' attribute AST (#110999)
The 'tile' clause shares quite a bit of the rules with 'collapse', so a
followup patch will add those tests/behaviors. This patch deals with
adding the AST node.
The 'tile' clause takes a series of integer constant expressions, or *.
The asterisk is now represented by a new OpenACCAsteriskSizeExpr node,
else this clause is very similar to others.
show more ...
|
Revision tags: llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3 |
|
#
2b0a8fcf |
| 15-Aug-2024 |
Sirraide <aeternalmail@gmail.com> |
[Clang] Implement C++26’s P2893R3 ‘Variadic friends’ (#101448)
Implement P2893R3 ‘Variadic friends’ for C++26.
This closes #98587.
Co-authored-by: Younan Zhang <zyn7109@gmail.com>
|
#
635d20e9 |
| 08-Aug-2024 |
Vladislav Belov <vladislav.belov@syntacore.com> |
[RISCV] full support for riscv_rvv_vector_bits attribute (#100110)
Add support for using attribute((rvv_vector_bits(N))), when N < 8.
It allows using all fixed length vector mask types regardless V
[RISCV] full support for riscv_rvv_vector_bits attribute (#100110)
Add support for using attribute((rvv_vector_bits(N))), when N < 8.
It allows using all fixed length vector mask types regardless VLEN
value.
show more ...
|
Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init |
|
#
e6ec7c8f |
| 15-Jul-2024 |
Krystian Stasiowski <sdkrystian@gmail.com> |
[Clang][AST] Move NamespaceDecl bits to DeclContext (#98567)
Currently, `NamespaceDecl` has a member `AnonOrFirstNamespaceAndFlags`
which stores a few pieces of data:
- a bit indicating whether th
[Clang][AST] Move NamespaceDecl bits to DeclContext (#98567)
Currently, `NamespaceDecl` has a member `AnonOrFirstNamespaceAndFlags`
which stores a few pieces of data:
- a bit indicating whether the namespace was declared `inline`, and
- a bit indicating whether the namespace was declared as a
_nested-namespace-definition_, and
- a pointer a `NamespaceDecl` that either stores:
- a pointer to the first declaration of that namespace if the
declaration is no the first declaration, or
- a pointer to the unnamed namespace that inhabits the namespace
otherwise.
`Redeclarable` already stores a pointer to the first declaration of an
entity, so it's unnecessary to store this in `NamespaceDecl`.
`DeclContext` has 8 bytes in which various bitfields can be stored for a
declaration, so it's not necessary to store these in `NamespaceDecl`
either. We only need to store a pointer to the unnamed namespace that
inhabits the first declaration of a namespace. This patch moves the two
bits currently stored in `NamespaceDecl` to `DeclContext`, and only
stores a pointer to the unnamed namespace that inhabits a namespace in
the first declaration of that namespace. Since `getOriginalNamespace`
always returns the same `NamespaceDecl` as `getFirstDecl`, this function
is removed to avoid confusion.
show more ...
|
#
ccc0b66d |
| 05-Jul-2024 |
Youngsuk Kim <youngsuk.kim@hpe.com> |
[clang] Avoid 'raw_string_ostream::str' (NFC)
Since `raw_string_ostream` doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer
[clang] Avoid 'raw_string_ostream::str' (NFC)
Since `raw_string_ostream` doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer rather than use `raw_string_ostream::str()`.
Work towards TODO item to remove `raw_string_ostream::str()`.
p.s. also remove some unneeded/dead code.
show more ...
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7 |
|
#
2bde13cd |
| 22-May-2024 |
Matheus Izvekov <mizvekov@gmail.com> |
[clang] NFCI: use TemplateArgumentLoc for NTTP DefaultArgument (#92852)
This is an enabler for https://github.com/llvm/llvm-project/pull/92855
This allows an NTTP default argument to be set as an a
[clang] NFCI: use TemplateArgumentLoc for NTTP DefaultArgument (#92852)
This is an enabler for https://github.com/llvm/llvm-project/pull/92855
This allows an NTTP default argument to be set as an arbitrary TemplateArgument, not just an expression. This allows template parameter packs to have default arguments in the AST, even though the language proper doesn't support the syntax for it.
This allows NTTP default arguments to be other kinds of arguments, like packs, integral constants, and such.
show more ...
|
#
e42b799b |
| 21-May-2024 |
Matheus Izvekov <mizvekov@gmail.com> |
[clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (#92854)
This is an enabler for a future patch.
This allows an type-parameter default argument to be set as an arbitrary
Temp
[clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (#92854)
This is an enabler for a future patch.
This allows an type-parameter default argument to be set as an arbitrary
TemplateArgument, not just a type.
This allows template parameter packs to have default arguments in the
AST, even though the language proper doesn't support the syntax for it.
This will be used in a later patch which synthesizes template parameter
lists with arbitrary default arguments taken from template
specializations.
There are a few places we used SubsType, because we only had a type, now
we use SubstTemplateArgument.
SubstTemplateArgument was missing arguments for setting Instantiation
location and entity names.
Adding those is needed so we don't regress in diagnostics.
show more ...
|
Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4 |
|
#
ef164cee |
| 14-Apr-2024 |
Sirraide <aeternalmail@gmail.com> |
[Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (#86526)
This implements support for the `= delete("message")` syntax that was
only just added to C++26
([P2573R2](https://is
[Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (#86526)
This implements support for the `= delete("message")` syntax that was
only just added to C++26
([P2573R2](https://isocpp.org/files/papers/P2573R2.html#proposal-scope)).
show more ...
|
#
986d0dba |
| 12-Apr-2024 |
yronglin <yronglin777@gmail.com> |
[Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (#88269)
This PR fix a AST dump issue since
https://github.com/llvm/llvm-project/pull/80001
When Clang dumps `CXXDefaultArgExpr`/
[Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (#88269)
This PR fix a AST dump issue since
https://github.com/llvm/llvm-project/pull/80001
When Clang dumps `CXXDefaultArgExpr`/`CXXDefaultInitExpr`, there has no
recursively dump the complete `CXXDefaultArgExpr`/`CXXDefaultInitExpr`.
Since this PR, Clang will recursively dump a
`CXXDefaultArgExpr`/`CXXDefaultInitExpr` node, even if the node has no
rewritten init.
*Consider*:
```
struct A {
int arr[1];
};
struct B {
const A &a = A{{0}};
};
void test() {
B b{};
}
```
*Before*:
```
`-FunctionDecl <line:9:1, line:11:1> line:9:6 test 'void ()'
`-CompoundStmt <col:13, line:11:1>
`-DeclStmt <line:10:3, col:8>
`-VarDecl <col:3, col:7> col:5 b 'B' listinit
`-InitListExpr <col:6, col:7> 'B'
`-CXXDefaultInitExpr <col:7> 'const A' lvalue has rewritten init
`-ExprWithCleanups <line:6:16, col:21> 'const A' lvalue
```
*After*:
```
`-FunctionDecl 0x15a9455a8 <line:9:1, line:11:1> line:9:6 test 'void ()'
`-CompoundStmt 0x15a945850 <col:13, line:11:1>
`-DeclStmt 0x15a945838 <line:10:3, col:8>
`-VarDecl 0x15a945708 <col:3, col:7> col:5 b 'B' listinit
`-InitListExpr 0x15a9457b0 <col:6, col:7> 'B'
`-CXXDefaultInitExpr 0x15a9457f8 <col:7> 'const A' lvalue has rewritten init
`-ExprWithCleanups 0x15a945568 <line:6:16, col:21> 'const A' lvalue
`-MaterializeTemporaryExpr 0x15a945500 <col:16, col:21> 'const A' lvalue extended by Field 0x15a945160 'a' 'const A &'
`-ImplicitCastExpr 0x15a9454e8 <col:16, col:21> 'const A' <NoOp>
`-CXXFunctionalCastExpr 0x15a9454c0 <col:16, col:21> 'A' functional cast to A <NoOp>
`-InitListExpr 0x15a9452c0 <col:17, col:21> 'A'
`-InitListExpr 0x15a945308 <col:18, col:20> 'int[1]'
`-IntegerLiteral 0x15a945210 <col:19> 'int' 0
```
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
show more ...
|
#
30f6eafa |
| 05-Apr-2024 |
Erich Keane <ekeane@nvidia.com> |
[OpenACC][NFC] Add OpenACC Clause AST Nodes/infrastructure (#87675)
As a first step in adding clause support for OpenACC to Semantic
Analysis, this patch adds the 'base' AST nodes required for clau
[OpenACC][NFC] Add OpenACC Clause AST Nodes/infrastructure (#87675)
As a first step in adding clause support for OpenACC to Semantic
Analysis, this patch adds the 'base' AST nodes required for clauses.
This patch has no functional effect at the moment, but followup patches
will add the semantic analysis of clauses (plus individual clauses).
show more ...
|
Revision tags: llvmorg-18.1.3 |
|
#
28ddbd4a |
| 26-Mar-2024 |
Chris B <chris.bieneman@me.com> |
[NFC] Refactor ConstantArrayType size storage (#85716)
In PR #79382, I need to add a new type that derives from
ConstantArrayType. This means that ConstantArrayType can no longer use
`llvm::Traili
[NFC] Refactor ConstantArrayType size storage (#85716)
In PR #79382, I need to add a new type that derives from
ConstantArrayType. This means that ConstantArrayType can no longer use
`llvm::TrailingObjects` to store the trailing optional Expr*.
This change refactors ConstantArrayType to store a 60-bit integer and
4-bits for the integer size in bytes. This replaces the APInt field
previously in the type but preserves enough information to recreate it
where needed.
To reduce the number of places where the APInt is re-constructed I've
also added some helper methods to the ConstantArrayType to allow some
common use cases that operate on either the stored small integer or the
APInt as appropriate.
Resolves #85124.
show more ...
|
Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2 |
|
#
8d1b1c9b |
| 31-Jan-2024 |
Sam McCall <sam.mccall@gmail.com> |
[AST] Add dump() method to TypeLoc (#65484)
The ability to dump AST nodes is important to ad-hoc debugging, and
the fact this doesn't work with TypeLoc nodes is an obvious missing
feature in e.g.
[AST] Add dump() method to TypeLoc (#65484)
The ability to dump AST nodes is important to ad-hoc debugging, and
the fact this doesn't work with TypeLoc nodes is an obvious missing
feature in e.g. clang-query (`set output dump` simply does nothing).
Having TypeLoc::dump(), and enabling DynTypedNode::dump() for such nodes
seems like a clear win.
It looks like this:
```
int main(int argc, char **argv);
FunctionProtoTypeLoc <test.cc:3:1, col:31> 'int (int, char **)' cdecl
|-ParmVarDecl 0x30071a8 <col:10, col:14> col:14 argc 'int'
| `-BuiltinTypeLoc <col:10> 'int'
|-ParmVarDecl 0x3007250 <col:20, col:27> col:27 argv 'char **'
| `-PointerTypeLoc <col:20, col:26> 'char **'
| `-PointerTypeLoc <col:20, col:25> 'char *'
| `-BuiltinTypeLoc <col:20> 'char'
`-BuiltinTypeLoc <col:1> 'int'
```
It dumps the lexically nested tree of type locs.
This often looks similar to how types are dumped, but unlike types
we don't look at desugaring e.g. typedefs, as their underlying types
are not lexically spelled here.
---
Less clear is exactly when to include these nodes in existing text AST
dumps rooted at (TranslationUnit)Decls.
These already omit supported nodes sometimes, e.g. NestedNameSpecifiers
are often mentioned but not recursively dumped.
TypeLocs are a more extreme case: they're ~always more verbose
than the current AST dump.
So this patch punts on that, TypeLocs are only ever printed recursively
as part of a TypeLoc::dump() call.
It would also be nice to be able to invoke `clang` to dump a typeloc
somehow, like `clang -cc1 -ast-dump`. But I don't know exactly what the
best verison of that is, so this patch doesn't do it.
---
There are similar (less critical!) nodes: TemplateArgumentLoc etc,
these also don't have dump() functions today and are obvious extensions.
I suspect that we should add these, and Loc nodes should dump each other
(e.g. the ElaboratedTypeLoc `vector<int>::iterator` should dump
the NestedNameSpecifierLoc `vector<int>::`, which dumps the
TemplateSpecializationTypeLoc `vector<int>::` etc).
Maybe this generalizes further to a "full syntactic dump" mode, where
even Decls and Stmts would print the TypeLocs they lexically contain.
But this may be more complex than useful.
---
While here, ConceptReference JSON dumping must be implemented. It's not
totally clear to me why this implementation wasn't required before but
is now...
show more ...
|
Revision tags: llvmorg-18.1.0-rc1 |
|
#
c92ad411 |
| 25-Jan-2024 |
Craig Topper <craig.topper@sifive.com> |
Recommit "[RISCV] Support __riscv_v_fixed_vlen for vbool types. (#76551)"
Test updated to expect i8 gep.
Original message:
This adopts a similar behavior to AArch64 SVE, where bool vectors are rep
Recommit "[RISCV] Support __riscv_v_fixed_vlen for vbool types. (#76551)"
Test updated to expect i8 gep.
Original message:
This adopts a similar behavior to AArch64 SVE, where bool vectors are represented as a vector of chars with 1/8 the number of elements. This ensures the vector always occupies a power of 2 number of bytes.
A consequence of this is that vbool64_t, vbool32_t, and vool16_t can only be used with a vector length that guarantees at least 8 bits.
show more ...
|
#
51b25bad |
| 25-Jan-2024 |
Craig Topper <craig.topper@sifive.com> |
Revert "[RISCV] Support __riscv_v_fixed_vlen for vbool types. (#76551)"
This reverts commit b0511419b3fd71fa8f8c3618b7e849aabd2ccf65.
Test failure was reported.
|
#
b0511419 |
| 25-Jan-2024 |
Craig Topper <craig.topper@sifive.com> |
[RISCV] Support __riscv_v_fixed_vlen for vbool types. (#76551)
This adopts a similar behavior to AArch64 SVE, where bool vectors are
represented as a vector of chars with 1/8 the number of elements
[RISCV] Support __riscv_v_fixed_vlen for vbool types. (#76551)
This adopts a similar behavior to AArch64 SVE, where bool vectors are
represented as a vector of chars with 1/8 the number of elements. This
ensures the vector always occupies a power of 2 number of bytes.
A consequence of this is that vbool64_t, vbool32_t, and vool16_t can
only be used with a vector length that guarantees at least 8 bits.
show more ...
|
Revision tags: llvmorg-19-init |
|
#
cc3fd197 |
| 21-Jan-2024 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang] Remove `CXXNewInitializationStyle::Implicit` (#78793)
This is a follow up to https://github.com/llvm/llvm-project/pull/71417 ,
which aims to resolve concerns brought up there. Namely, this
[clang] Remove `CXXNewInitializationStyle::Implicit` (#78793)
This is a follow up to https://github.com/llvm/llvm-project/pull/71417 ,
which aims to resolve concerns brought up there. Namely, this patch
replaces `CXXNewInitializationStyle::Implicit` with a dedicated
`HasInitializer` flag. This makes `CXXNewInitializationStyle` to model
syntax again. This patch also renames `Call` and `List` to less
confusing `Parens` and `Braces`.
show more ...
|
#
e90e43fb |
| 18-Jan-2024 |
cor3ntin <corentinjabot@gmail.com> |
[Clang][NFC] Rename CXXMethodDecl::isPure -> is VirtualPure (#78463)
To avoid any possible confusion with the notion of pure function and the
gnu::pure attribute.
|
Revision tags: llvmorg-17.0.6, llvmorg-17.0.5 |
|
#
7fb606e9 |
| 13-Nov-2023 |
elizabethandrews <elizabeth.andrews@intel.com> |
[Clang] Fix a crash when using ast-dump=json (#70224)
CXXDeductionGuideDecl inherits from FunctionDecl. For FunctionDecls,
the JSONVisitor includes a call to visit NamedDecl in order to provide
ma
[Clang] Fix a crash when using ast-dump=json (#70224)
CXXDeductionGuideDecl inherits from FunctionDecl. For FunctionDecls,
the JSONVisitor includes a call to visit NamedDecl in order to provide
mangled names in the dump. This did not correctly exclude
CXXDeductionGuideDecl, which resulted in an assert being hit.
show more ...
|
#
f2d8a0ac |
| 06-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Refactor `ParamCommandComment::PassDirection`
This patch converts `ParamCommandComment::PassDirection` to a scoped enum at namespace scope, making it eligible for forward declaring. Thi
[clang][NFC] Refactor `ParamCommandComment::PassDirection`
This patch converts `ParamCommandComment::PassDirection` to a scoped enum at namespace scope, making it eligible for forward declaring. This is useful for e.g. annotating bit-fields with `preferred_type`.
show more ...
|
#
565e21b3 |
| 06-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Refactor `InlineCommandComment::RenderKind`
This patch converts `InlineCommandComment::RenderKind` to a scoped enum at namespace scope, making it eligible for forward declaring. This is
[clang][NFC] Refactor `InlineCommandComment::RenderKind`
This patch converts `InlineCommandComment::RenderKind` to a scoped enum at namespace scope, making it eligible for forward declaring. This is useful for e.g. annotating bit-fields with `preferred_type`.
show more ...
|
#
e929f069 |
| 06-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (#71417)
This patch converts CXXNewExpr::InitializationStyle into a scoped enumat namespace scope. It also affirms the status quo by
[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (re-land) (#71417)
This patch converts CXXNewExpr::InitializationStyle into a scoped enumat namespace scope. It also affirms the status quo by adding a new enumerator to represent implicit initializer.
This is a re-land of https://github.com/llvm/llvm-project/pull/71322 ace4489397d17abfb20d36de1404cfbe102401a7
show more ...
|
#
43e5f775 |
| 06-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
Revert "[clang][NFC] Refactor `CXXNewExpr::InitializationStyle`" (#71395)
Reverts llvm/llvm-project#71322
|
#
ace44893 |
| 06-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (#71322)
This patch converts `CXXNewExpr::InitializationStyle` into a scoped enum at namespace scope. It also affirms the status quo by adding
[clang][NFC] Refactor `CXXNewExpr::InitializationStyle` (#71322)
This patch converts `CXXNewExpr::InitializationStyle` into a scoped enum at namespace scope. It also affirms the status quo by adding a new enumerator to represent implicit initializer.
show more ...
|
#
a9070f22 |
| 05-Nov-2023 |
Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> |
[clang][NFC] Refactor `CXXConstructExpr::ConstructionKind`
This patch converts `CXXConstructExpr::ConstructionKind` into a scoped enum in namespace scope, making it eligible for forward declaring. T
[clang][NFC] Refactor `CXXConstructExpr::ConstructionKind`
This patch converts `CXXConstructExpr::ConstructionKind` into a scoped enum in namespace scope, making it eligible for forward declaring. This is useful in cases like annotating bit-fields with `preferred_type`.
show more ...
|