Age | Commit message (Collapse) | Author | Files | Lines |
|
interp__builtin_elementwise_int_binop (#160362)
Fixes #160281
|
|
Adding a new builtin type for AMDGPU's image descriptor rsrc data type
This requires for https://github.com/llvm/llvm-project/pull/140210
|
|
value" warning. NFC. (#161168)
|
|
transformation directive and "looprange" clause (#139293)
This change implements the fuse directive, `#pragma omp fuse`, as specified in the OpenMP 6.0, along with the `looprange` clause in clang.
This change also adds minimal stubs so flang keeps compiling (a full implementation in flang of this directive is still pending).
---------
Co-authored-by: Roger Ferrer Ibanez <roger.ferrer@bsc.es>
|
|
|
|
This simplifies those transforms a lot, removing a bunch of workarounds
which were introducing problems.
The transforms become independent of the template instantiator, so they
are moved to TreeTransform instead.
Fixes #131342
This PR was already reviewed and approved at
https://github.com/llvm/llvm-project/pull/160777, but I accidentally
merged that into another PR, instead of main.
|
|
(#160970)
ASTContext::getSubstBuiltinTemplatePack finds InsertPos and then calls
itself
recursively, which may lead to rehashing and invalidation of all
pointers to
buckets. The function then proceeds with using the potentially invalid
InsertPos, leading to use-after-free.
The issue goes back to https://github.com/llvm/llvm-project/pull/157662.
I didn't manage to produce a reasonably-sized test case yet.
|
|
|
|
Fix a double assignment to a local variable and use the new
popToAPSInt() overload.
|
|
In the important places. They are all fully covered switch statements so
we know where to add code when adding a new pointer type.
|
|
Currently, RVV/SVE intrinsics are cached, but the corresponding type
construction is not. As a result, `ASTContext::getScalableVectorType`
can become a performance hotspot, since every query must run through a
long sequence of type checks and macro expansions.
|
|
Program itself is unused in that file, so just include the needed
headers.
|
|
base-ptrs. (#155625)
These have been pulled out of the codegen PR #153683, to reduce the size
of that PR.
|
|
Fixes #157492
|
|
This patch fixes:
clang/lib/AST/ByteCode/InterpBuiltin.cpp:2603:15: error: unused
variable 'VT1' [-Werror,-Wunused-variable]
|
|
Instead of going the way through `Pointer::isUnknownSizeArray()`.
|
|
pack intrinsics to be used in constexpr (#156003)
Fixes #154283
|
|
... for dynamic memory allocation. This happens when the requested array
size is too large.
Fixes #152951
|
|
Instead of keeping the `Pointer`s itself in `InterpFrame`, just save
them as offsets and use stackRef<>() when we need them.
|
|
On z/OS `strnlen()` is not available by default so we use the wrapper
header `zOSSupport.h` to make it visible. This will fix the following
error:
```
clang/lib/AST/ByteCode/Context.cpp:250:16: error: use of undeclared identifier 'strnlen'
250 | Result = strnlen(reinterpret_cast<const char *>(Ptr.getRawAddress()), N);
| ^~~~~~~
1 error generated.
```
|
|
fixes #109839
This change is really simple. It creates a matrix alias that will let
HLSL use the existing clang `matrix_type` infra.
The only additional change was to add explict alias for the typed
dimensions of 1-4 inclusive matricies available in HLSL.
Testing therefore is limited to exercising the alias, sema errors, and
basic codegen.
future work will add things like constructors and accessors.
The main difference in this attempt is the type printer and less of an
emphasis on tests where things overlap with existing `matrix_type`
testing like cast behavior.
|
|
interp__builtin_elementwise_int_unaryop callback (#160332)
Fix #160287
|
|
ops (#160280)
Add interp__builtin_elementwise_int_unaryop - similar to what we already have with interp__builtin_elementwise_int_binop to handle binops
Update x86 lzcnt/tzcnt intrinsics to use with a suitable callback
I'll add vector handling in a future patch when we add x86 vector intrinsics that can use it
|
|
Fixes #153948
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
|
|
This doesn't seem to be needed anymore and causes problems.
Fixes #159787
|
|
(#159998)
Fixes #158646
|
|
So ignore the rest in `checkFullyInitialized()`.
Fixes #160071
|
|
As happens in C.
Fixes #158482
|
|
in Program::dump().
|
|
Formats `Expr::HasSideEffects` because incorrect identation of block end token
makes clang-format go haywire in patch mode.
Also removes stray whitespace from a test file.
|
|
This changes the instiantiated_from field to use
`getTemplateInstantiationPattern`, which makes this field work for all
template specialization kinds, not just member templates.
Also adds this field to variables, and adds equivalents for the JSON
dumper as well.
|
|
std::get free function (#122265)
When we generate the debug-info for a `VarDecl` we try to determine
whether it was introduced as part of a structure binding (aka a "holding
var"). If it was then we don't mark it as `artificial`.
The heuristic to determine a holding var uses
`IgnoreUnlessSpelledInSource` to unwrap the `VarDecl` initializer until
we hit a `DeclRefExpr` that refers to a `Decomposition`. For "tuple-like
decompositions", Clang will generate a call to a `template<size_t I> Foo
get(Bar)` function that retrieves the `Ith` element from the tuple-like
structure. If that function is a member function, we get an AST that
looks as follows:
```
VarDecl implicit used z1 'std::tuple_element<0, B>::type &&' cinit
`-ExprWithCleanups <col:10> 'int' xvalue
`-MaterializeTemporaryExpr <col:10> 'int' xvalue extended by Var 0x11d110cf8 'z1' 'std::tuple_element<0, B>::type &&'
`-CXXMemberCallExpr <col:10> 'int'
`-MemberExpr <col:10> '<bound member function type>' .get 0x11d104390
`-ImplicitCastExpr <col:10> 'B' xvalue <NoOp>
`-DeclRefExpr <col:10> 'B' lvalue Decomposition 0x11d1100a8 '' 'B'
```
`IgnoreUnlessSpelledInSource` happily unwraps this down to the
`DeclRefExpr`. However, when the `get` helper is a free function (which
it is for `std::pair` in libc++ for example), then the AST is:
```
VarDecl col:16 implicit used k 'std::tuple_element<0, const std::tuple<int, int>>::type &' cinit
`-CallExpr <col:16> 'const typename tuple_element<0UL, tuple<int, int>>::type':'const int' lvalue adl
|-ImplicitCastExpr <col:16> 'const typename tuple_element<0UL, tuple<int, int>>::type &(*)(const tuple<int, int> &) noexcept' <FunctionToPointerDecay>
| `-DeclRefExpr <col:16> 'const typename tuple_element<0UL, tuple<int, int>>::type &(const tuple<int, int> &) noexcept' lvalue Function 0x1210262d8 'get' 'const typename tuple_element<0UL, tuple<int, int>>::type &(const tuple<int, int> &) noexcept' (FunctionTemplate 0x11d068088 'get')
`-DeclRefExpr <col:16> 'const std::tuple<int, int>' lvalue Decomposition 0x121021518 '' 'const std::tuple<int, int> &'
```
`IgnoreUnlessSpelledInSource` doesn't unwrap this `CallExpr`, so we
incorrectly mark the binding as `artificial` in debug-info.
This patch adjusts `IgnoreUnlessSpelledInSource` so it unwraps implicit
`CallExpr`s. It's almost identical to how we treat implicit constructor
calls (unfortunately the code can't quite be re-used because a
`CXXConstructExpr` is-not a `CallExpr`, and we check `isElidable`, which
doesn't exist for regular function calls. So I added a new
`IgnoreImplicitCallSingleStep`).
Fixes https://github.com/llvm/llvm-project/issues/122028
|
|
#159505 (#159859)
We can't give a correct answer for dependent types, so for now just
report no ptrauth involves if the type being queried is dependent. In
future we may want to distinguigh the `None` vs `Dependent` cases but
that does not seem warranted for now.
Fixes #159505
|
|
This fixes a regression reported here:
https://github.com/llvm/llvm-project/pull/159463#issuecomment-3312157416
Since this regression was never released, there are no release notes.
|
|
https://github.com/llvm/llvm-project/pull/121943 rewrote
`__atomic_test_and_set` and `__atomic_clear` to be lowered through
AtomicExpr
StmtPrinter::VisitAtomicExpr still treated them like other atomic
builtins with a Val1 operand. This led to incorrect pretty-printing when
dumping the AST.
Skip Val1 for these two builtins like atomic loads.
|
|
Fix two older FIXME items from the `functions.cpp` test.
|
|
Summary:
The added bit counting builtins for vectors used `cttz` and `ctlz`,
which is consistent with the LLVM naming convention. However, these are
clang builtins and implement exactly the `__builtin_ctzg` and
`__builtin_clzg` behavior. It is confusing to people familiar with other
other builtins that these are the only bit counting intrinsics named
differently. This includes the additional operation for the undefined
zero case, which was added as a `clzg` extension.
|
|
So the static invoker's Function still points to the static invoker
instead of the call operator of the lambda record. This is important for
a later commit.
|
|
`llvm::DenseMapInfo<llvm::FoldingSetNodeID>` (#159718)
In preparation of #141776
|
|
|
|
AVX/AVX512 subvector insertion intrinsics to be used in constexpr #157709 (#158778)
AVX/AVX512 vector insert intrinsics now support constexpr evaluation in both the AST evaluator and bytecode interpreter paths.
FIXES: #157709
|
|
Replace `StackChunk::End` with `StackChunk::Size`, mark the allocating
code paths as unlikely and move `grow()` into the header, which allows
us to template this for the `Size` parameter. Since we only push our
primitive types on the stack and all the sizes are aligned to pointer
size multiples, this only results in a few instantiations.
|
|
They are only pointer-sized and copying them is cheaper than taking the
const ref.
|
|
(#158134)
|
|
If it's truly a known const int, it won't emit any diagnostics anyway.
And if it did, we wouldn't notice because no call site passed something
non-null.
|
|
NFC. (#159330)
This avoids the following warnings:
../../clang/lib/AST/ExprConstant.cpp: In member function ‘bool {anonymous}::IntExprEvaluator::VisitBuiltinCallExpr(const clang::CallExpr*, unsigned int)’:
../../clang/lib/AST/ExprConstant.cpp:14104:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
14104 | }
| ^
../../clang/lib/AST/ExprConstant.cpp:14105:3: note: here
14105 | case Builtin::BIstrlen:
| ^~~~
../../clang/lib/Driver/ToolChains/CommonArgs.cpp: In function ‘std::string clang::driver::tools::complexRangeKindToStr(clang::LangOptionsBase::ComplexRangeKind ’:
../../clang/lib/Driver/ToolChains/CommonArgs.cpp:3523:1: warning: control reaches end of non-void function [-Wreturn-type]
3523 | }
| ^
|
|
This popped up during our internal integrates of upstream changes. It
started happening after ba9d1c41c41d568a798e0a8c38a89d294647c28d, which
started using `TemplateSpecializationType` in this place and the code
was not prepared to handle it.
|
|
Instead of having `State::getLangOpts()`, which does a virtual call to
`getASTContext()` to call `getLangOpts()` on that, just move
`getLangOpts()` to the subclasses so we can do that without the virtual
call. We never call `getLangOpts()` in `State.cpp`, so it's not needed
in the base class.
|
|
Both the expression (the initializer) as well as the VarDecl can't be
null here. Assert that.
|
|
The bottom frame is the one without a parent. No need to save that
information separately.
|