| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
We can also remove a number of explicit asserts and reply on the internal asserts in castAs<>
llvm-svn: 373667
|
|
|
|
|
|
|
|
| |
dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373626
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373612
|
|
|
|
| |
llvm-svn: 373611
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<RecordType> directly and if not assert will fire for us.
llvm-svn: 373584
|
|
|
|
|
|
|
|
|
|
| |
pointer-to-member call can't determine a callee.
We will have produced a diagnostic already if the callee is known to be
unevaluatable, and diagnosing here rejects valid code during potential
constant expression checking.
llvm-svn: 373553
|
|
|
|
|
|
|
|
|
| |
For now, we restrict this support to use from within the standard
library implementation, since we're required to make parts of the
standard library that use placement new work, but not permitted to
make uses of placement new from user code work.
llvm-svn: 373547
|
|
|
|
|
|
| |
std::allocator::{allocate,deallocate} in constant evaluation.
llvm-svn: 373546
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373480
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<VectorType> directly and if not assert will fire for us.
llvm-svn: 373478
|
|
|
|
|
|
| |
The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 373447
|
|
|
|
|
|
|
|
| |
our autogenerated files. NFC.
As requested by Nico Weber.
llvm-svn: 373425
|
|
|
|
|
|
|
| |
We got confused and thought we might be pseudo-destroying the pointee
instead.
llvm-svn: 373418
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Clang uses the location identifier should be inserted for declarator
decls when a decl is unnamed. But for type template and template template
paramaters it uses the location of "typename/class" keyword, which makes it hard
for tooling to insert/change parameter names.
This change tries to unify these two cases by making template parameter
parsing and sourcerange operations similar to function params/declarator decls.
Reviewers: ilya-biryukov
Subscribers: arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68143
llvm-svn: 373340
|
|
|
|
|
|
| |
NFC preparation work for upcoming ExternalASTMerger patches.
llvm-svn: 373312
|
|
|
|
|
|
| |
array-of-class types, not just for class types.
llvm-svn: 373279
|
|
|
|
|
|
| |
reference member access on its left-hand side.
llvm-svn: 373276
|
|
|
|
|
|
| |
In r373247 I added a helper function, but neglected to make it static.
llvm-svn: 373268
|
|
|
|
|
|
|
|
|
|
|
| |
I incorrectly thought that the 'isLambda' check never fired, so when
splitting up a helper function, I lost the 'nullptr' return value.
ClangD Hover functionality apparently uses this, so the Unittest caught
that.
This patch correctly propogates the nullptr from the helper function.
llvm-svn: 373259
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CallGraph visited LambdaExpr by getting the Call Operator from
CXXRecordDecl (LambdaExpr::getCallOperator calls
CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda
call operators with the non-instantiated FunctionDecl. The result was
that the CallGraph would only pick up non-dependent calls.
This patch does a few things:
1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which
will get the FunctionTemplateDecl, rather than immediately getting the
TemplateDecl.
2- Define getLambdaCallOperator and getDependentLambdaCallOperator in
terms of a common function.
3- Extend LambdaExpr with a getDependentCallOperator, which just calls
the above function.
4- Changes CallGraph to handle Generic LambdaExprs.
llvm-svn: 373247
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ExternalASTMerger
Summary:
The ExternalASTMerger should use the ASTImporterSharedState. This allows it to
handle std::pair in LLDB (but the rest of libc++ is still work in progress).
Reviewers: martong, shafik, a.sidorin
Subscribers: rnkovacs, christof, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68140
llvm-svn: 373193
|
|
|
|
|
|
|
|
|
|
|
|
| |
constexpr) destructors from being used in the values of constexpr
variables.
The standard rules here are unclear at best, so rejecting the
problematic cases seems prudent. Prior to this change, we would fail to
run the destructors for these temporaries, even if they had
side-effects, which is certainly not the right behavior.
llvm-svn: 373161
|
|
|
|
|
|
|
|
|
| |
In the presence of mutable state, we need to check whether temporaries
involved in a constant expression have permissible values at the end of
the overall evaluation, rather than at the end of the evaluation of the
initializer of the temporary.
llvm-svn: 373160
|
|
|
|
|
|
|
|
|
|
| |
has a constexpr destructor.
For constexpr variables, reject if the variable does not have constant
destruction. In all cases, do not emit runtime calls to the destructor
for variables with constant destruction.
llvm-svn: 373159
|
|
|
|
|
|
| |
pseudo-destructor calls in constant evaluation.
llvm-svn: 373122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gnu_inline" in C++ mode
This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl.
GCC documents the gnu_inline attribute with "In C++, this attribute does
not depend on extern in any way, but it still requires the inline keyword
to enable its special behavior."
The previous behaviour of gnu_inline in C++, without the extern
keyword, can be traced back to the original commit that added
support for gnu_inline, SVN r69045.
Differential Revision: https://reviews.llvm.org/D67414
llvm-svn: 373078
|
|
|
|
|
|
|
|
|
| |
We need to discard all remaining cleanups if an earlier cleanup failed,
otherwise we may try to rerun the remaining cleanups later, potentially
after the scope containing the object is destroyed. (This can happen
when checking a potential constant expression.)
llvm-svn: 373042
|
|
|
|
| |
llvm-svn: 373037
|
|
|
|
|
|
| |
constant evaluation.
llvm-svn: 373036
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLDB synthesizes decls using asm labels. These decls cannot have a mangle
different than the one specified in the label name. I.e., the '\01' prefix
should not be added.
Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS.
rdar://45827323
Differential Revision: https://reviews.llvm.org/D67774
llvm-svn: 372903
|
|
|
|
|
|
|
|
|
|
| |
Decl::printQualifiedName
Reverted in r372880 due to the test failure.
Also contains a fix that adjusts printQualifiedName to return the same results as before in
case of anonymous function locals and parameters.
llvm-svn: 372889
|
|
|
|
|
|
|
| |
Decl::printQualifiedName
Reason: causes a test failure, will investigate and re-land with a fix.
llvm-svn: 372880
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Decl::printQualifiedName
Summary:
To be used in clangd, e.g. in D66647.
Currently the alternative to this function is doing string manipulation on results of `printQualifiedName`, which is
hard-to-impossible to get right in presence of template arguments.
Reviewers: kadircet, aaron.ballman
Reviewed By: kadircet, aaron.ballman
Subscribers: aaron.ballman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67825
llvm-svn: 372863
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specializations are inline""
This work-around was necessary to handle standard library headers in
Visual Studio 2019 16.2. Now that 16.3 has shipped to stable, we can
remove it.
> Re-commit r363191 "[MS] Pretend constexpr variable template specializations are inline"
>
> While the next Visual Studio update (16.3) will fix this issue, that hasn't
> shipped yet. Until then Clang wouldn't work with MSVC's headers which seems
> unfortunate. Let's keep this in until VS 16.3 ships. (See also PR42843.)
>
>> Fixes link errors with clang and the latest Visual C++ 14.21.27702
>> headers, which was reported as PR42027.
>>
>> I chose to intentionally make these things linkonce_odr, i.e.
>> discardable, so that we don't emit definitions of these things in every
>> translation unit that includes STL headers.
>>
>> Note that this is *not* what MSVC does: MSVC has not yet implemented C++
>> DR2387, so they emit fully specialized constexpr variable templates with
>> static / internal linkage.
>>
>> Reviewers: rsmith
>>
>> Differential Revision: https://reviews.llvm.org/D63175
llvm-svn: 372844
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.
Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613
Reapplies r372663 after adapting a failing test in the LLDB testsuite.
llvm-svn: 372681
|
|
|
|
|
|
| |
This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007.
llvm-svn: 372672
|
|
|
|
|
|
|
|
|
|
| |
This patch provides support for DW_LANG_C_plus_plus_11,
DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend.
Patch by Sourabh Singh Tomar!
Differential Revision: https://reviews.llvm.org/D67613
llvm-svn: 372663
|
|
|
|
|
|
|
| |
Reused standard clauses parsing scheme for parsing/matching 'match'
clause in 'declare variant' directive.
llvm-svn: 372635
|
|
|
|
|
|
|
|
|
|
|
| |
appropriate during constant evaluation.
Note that the evaluator is sometimes invoked on incomplete expressions.
In such cases, if an object is constructed but we never reach the point
where it would be destroyed (and it has non-trivial destruction), we
treat the expression as having an unmodeled side-effect.
llvm-svn: 372538
|
|
|
|
|
|
|
|
|
| |
ObjCObjectPointerType arguments.
All callers already had one, just creating a QualType to pass, after
which the function cast it right back.
llvm-svn: 372492
|
|
|
|
|
|
| |
free() was not directly included in InterpStack.cpp, added include now.
llvm-svn: 372455
|
|
|
|
|
|
|
| |
APInt comparison require both to have the same bitwidth. Since only the value
is needed, use the compare function APInt::isSameValue instead.
llvm-svn: 372454
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Wtautological-overlap-compare and self-comparison from -Wtautological-compare
relay on detecting the same operand in different locations. Previously, each
warning had it's own operand checker. Now, both are merged together into
one function that each can call. The function also now looks through member
access and array accesses.
Differential Revision: https://reviews.llvm.org/D66045
llvm-svn: 372453
|
|
|
|
| |
llvm-svn: 372438
|
|
|
|
|
|
| |
uninitialized variable in an init-statement of a 'for' or 'if'.
llvm-svn: 372437
|
|
|
|
|
|
| |
This corrects the testing issues.
llvm-svn: 372334
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/17919
llvm-svn: 372325
|
|
|
|
|
|
| |
People use the AST dumping interface while debugging, so it's not safe to assume that a declaration will be dumped before a constant expression is dumped. This means the Context member may not get set properly and problems would happen. Rather than rely on the interface that requires the ASTContext, call the generic dump() interface instead; this allows us to remove the Context member variable.
llvm-svn: 372323
|
|
|
|
|
|
|
|
|
|
|
| |
Also, add a diagnostic under -Wformat for printing a boolean value as a
character.
rdar://54579473
Differential revision: https://reviews.llvm.org/D66856
llvm-svn: 372247
|
|
|
|
|
|
| |
constant evaluation.
llvm-svn: 372237
|