Age | Commit message (Collapse) | Author | Files | Lines |
|
Doxygen allows for the `@throw`, `@throws`, and `@exception` commands to
have an attached argument indicating the type being thrown. Currently,
Clang's AST parsing doesn't support parsing out this argument from doc
comments. The result is missing compatibility with Doxygen.
This PR implements parsing of arguments for the `@throw`, `@throws`, and
`@exception` commands. Each command can only have one argument, matching
the semantics of Doxygen.
|
|
Closes #94181
|
|
The original bug is legitimate UB, but this is in the clang constant
expression interpreter, not clang-repl.
https://github.com/llvm/llvm-project/issues/94994 covers investigation
of this specific bug in clang-repl.
|
|
https://github.com/llvm/llvm-project/pull/89811 caused this test to fail,
somehow.
I think it may not be at fault, but actually be exposing some
existing undefined behaviour, see
https://github.com/llvm/llvm-project/issues/94741.
Skipping this for now to get the bots green again.
|
|
Fixes https://github.com/llvm/llvm-project/issues/94599
|
|
Short-circuit the parsing of tok::colon to label colons found within
lines starting with asm as InlineASMColon.
Fixes #92616.
---------
Co-authored-by: Owen Pan <owenpiano@gmail.com>
|
|
Fixes #94555.
|
|
This adds a `MemberPointer` class along with a `PT_MemberPtr` primitive
type.
A `MemberPointer` has a `Pointer` Base as well as a `Decl*` (could be
`ValueDecl*`?) decl it points to.
For the actual logic, this mainly changes the way we handle `PtrMemOp`s
in `VisitBinaryOperator`.
|
|
Fixes #94326.
|
|
(#93753)" (#94488)
This reverts commit 9862080b1cbf685c0d462b29596e3f7206d24aa2.
|
|
Do not erase Builder when the first check fails because it could succeed
on the second stack frame.
The problem was that `InnerMatcher.matches` erases the bindings when it
returns false. The appropriate solution is to pass a copy of the
bindings, similar to what `matchesFirstInRange` does.
|
|
operators. (#94332)
To avoid generating unnecessary values, we don't create a new value but
instead
leave it to the specific analysis to do this if desired.
|
|
Don't skip searching in `ToContext` during importing `EnumDecl`. And
`IsStructuralMatch` in `StructralEquivalence` can make sure to determine
whether the found result is match or not.
---------
Co-authored-by: huqizhi <836744285@qq.com>
|
|
operators. (#94217)
To avoid generating unnecessary values, we don't create a new value but
instead
leave it to the specific analysis to do this if desired.
|
|
Fixes #94184.
|
|
This commit fixes https://github.com/llvm/llvm-project/issues/88896 by
passing LangOpts from the CompilerInstance to
DependencyScanningWorker so that the original LangOpts are
preserved/respected.
This makes for more accurate parsing/lexing when certain language
versions or features specific to versions are to be used.
|
|
goma is deprecated and not maintained anymore.
https://chromium.googlesource.com/infra/goma/client/
|
|
|
|
Fixes #92657.
|
|
Fixes #93603.
|
|
And sort out some unused headers
|
|
Reduce code bloat by checking test requirements in a common test fixture
|
|
support 2 (#84758)
|
|
Fixes #93604.
|
|
This patch improves the preservation of qualifiers and loss of type
sugar in TemplateNames.
This problem is analogous to https://reviews.llvm.org/D112374 and this
patch takes a very similar approach to that patch, except the impact
here is much lesser.
When a TemplateName was written bare, without qualifications, we
wouldn't produce a QualifiedTemplate which could be used to disambiguate
it from a Canonical TemplateName. This had effects in the TemplateName
printer, which had workarounds to deal with this, and wouldn't print the
TemplateName as-written in most situations.
There are also some related fixes to help preserve this type sugar along
the way into diagnostics, so that this patch can be properly tested.
- Fix dropping the template keyword.
- Fix type deduction to preserve sugar in TST TemplateNames.
|
|
check host JIT support (#84758)
fea7399e97b73a3209fcbe3338d412069769a637 had removed the unused function that was still there when I tested.
|
|
support (#84758)
|
|
This patch fixes:
clang/unittests/Interpreter/IncrementalProcessingTest.cpp:39:13:
error: unused function 'HostSupportsJit' [-Werror,-Wunused-function]
|
|
(#84758)
|
|
Until now the IncrExecutor was created lazily on the first execution
request. In order to process the PTUs that come from initialization, we
have to do it upfront implicitly.
|
|
Closes #92999.
|
|
On Windows, long is always 32 bit, thus one can't use long for casting
pointers to integers, on 64 bit architectures.
Instead use long long, which should be large enough.
This avoids errors like "error: cast from pointer to smaller type 'long'
loses information" in this testcase.
This condition only seems to be an error in mingw mode; in MSVC mode
(clang-cl), this is only a warning.
|
|
Update the folder titles for targets in the monorepository that have not
seen taken care of for some time. These are the folders that targets are
organized in Visual Studio and XCode (`set_property(TARGET <target>
PROPERTY FOLDER "<title>")`) when using the respective CMake's IDE
generator.
* Ensure that every target is in a folder
* Use a folder hierarchy with each LLVM subproject as a top-level folder
* Use consistent folder names between subprojects
* When using target-creating functions from AddLLVM.cmake, automatically
deduce the folder. This reduces the number of
`set_property`/`set_target_property`, but are still necessary when
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's
root CMakeLists.txt.
|
|
This amends b49ce9c304b00dae49148b6a2f5f27965000206c
|
|
This tries to fix all of the places where a diagnostic message starts
with a capital letter (other than acroynyms or proper nouns) or ends
with punctuation (other than a question mark).
This is in support of a planned change to tablegen to start diagnosing
incorrect diagnostic message styles.
|
|
(#92654)
Fixes #71161
[D64087](https://reviews.llvm.org/D64087) updated some locations of the
instantiated method but forgot `DNLoc`.
`FunctionDecl::getNameInfo()` constructs a `DeclarationNameInfo` using
`Decl::Loc` as the beginning of the declaration name, and
`FunctionDecl::DNLoc` to compute the end of the declaration name. The
former was updated, but the latter was not, so
`DeclarationName::getSourceRange()` would return a range where the end
of the declaration name could come before its beginning.
Patch by Alejandro Alvarez Ayllon
Co-authored-by: steakhal
CPP-5166
Co-authored-by: Alejandro Alvarez Ayllon <alejandro.alvarez@sonarsource.com>
|
|
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.
|
|
Since C++14 has been released for about nine years and most standard
libraries have implemented sized deallocation functions, it's time to
make this feature default again.
This is another try of https://reviews.llvm.org/D112921.
The original commit cf5a8b4 was reverted by 2e5035a due to some
failures (see #83774).
Fixes #60061
|
|
PR #90161 uncovered a bug that annotates C++ xor as UnaryOperator if
followed by a binary operator. This patch fixes that and all other C++
alternative operator keywords when followed by a binary operator in C.
Fixes #92688.
|
|
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.
|
|
|
|
Fixes #92300.
|
|
|
|
implicit class member access expressions (#92318)
According to [expr.prim.id.general] p2:
> If an _id-expression_ `E` denotes a non-static non-type member of some
class `C` at a point where the current class is `X` and
> - `E` is potentially evaluated or `C` is `X` or a base class of `X`,
and
> - `E` is not the _id-expression_ of a class member access expression,
and
> - if `E` is a _qualified-id_, `E` is not the un-parenthesized operand
of the unary `&` operator,
>
> the _id-expression_ is transformed into a class member access
expression using `(*this)` as the object expression.
Consider the following:
```
struct A
{
void f0();
template<typename T>
void f1();
};
template<typename T>
struct B : T
{
auto g0() -> decltype(T::f0()); // ok
auto g1() -> decltype(T::template f1<int>()); // error: call to non-static member function without an object argument
};
template struct B<A>;
```
Clang incorrectly rejects the call to `f1` in the _trailing-return-type_
of `g1`. Furthermore, the following snippet results in a crash during
codegen:
```
struct A
{
void f();
};
template<typename T>
struct B : T
{
template<typename U>
static void g();
template<>
void g<int>()
{
return T::f(); // crash here
}
};
template struct B<A>;
```
This happens because we unconditionally build a
`CXXDependentScopeMemberExpr` (with an implicit object expression) for
`T::f` when parsing the template definition, even though we don't know
whether `g` is an implicit object member function yet.
This patch fixes these issues by instead building
`DependentScopeDeclRefExpr`s for such expressions, and only transforming
them into implicit class member access expressions during instantiation.
Since we implemented the MS "unqualified lookup into dependent bases"
extension by building an implicit class member access (and relying on
the first component name of the _nested-name-specifier_ to be looked up
in the context of the object expression during instantiation), we
instead pre-append a fake _nested-name-specifier_ that refers to the
injected-class-name of the enclosing class. This patch also refactors
`Sema::BuildQualifiedDeclarationNameExpr` and
`Sema::BuildQualifiedTemplateIdExpr`, streamlining their implementation
and removing any redundant checks.
|
|
Wherever applicable, replace EXPECT_EQ with verifyFormat and std::string
with StringRef. Also, change a raw string literal to a regular one.
|
|
This functionality was added about three years ago, but has been in a
significantly broken state since it was added. It has begun to cause a
maintenance burden for work in Clang (largely due to the complexity of
having two levels of code generation involved), and the original author
is unable to help maintain it. Because it only worked under limited
circumstances and because of the maintenance burden, it is being
removed. If someone wishes to resurrect the functionality, they should
hopefully be able to do so from this one commit.
Fixes #82591
|
|
This commit deletes the "simple" constructor of `CallDescription` which
did not require a `CallDescription::Mode` argument and always used the
"wildcard" mode `CDM::Unspecified`.
A few months ago, this vague matching mode was used by many checkers,
which caused bugs like https://github.com/llvm/llvm-project/issues/81597
and https://github.com/llvm/llvm-project/issues/88181. Since then, my
commits improved the available matching modes and ensured that all
checkers explicitly specify the right matching mode.
After those commits, the only remaining references to the "simple"
constructor were some unit tests; this commit updates them to use an
explicitly specified matching mode (often `CDM::SimpleFunc`).
The mode `CDM::Unspecified` was not deleted in this commit because it's
still a reasonable choice in `GenericTaintChecker` and a few unit tests.
|
|
Fixes #92350.
|
|
Instead, leave the line wrapping as is.
Fixes #43887.
Fixes #44363.
|
|
default mode. (#91454)
By default (`shouldVisitImplicitCode()` returns `false`), RAV should not
traverse AST nodes that are not spelled in the source code. Deduction
guides for alias templates are always synthesized, so they should not be
traversed.
This is usually done by checking the implicit bit of the Decl. However,
this doesn't work deduction guides that are synthesized from explicit
user-defined deduction guides, as we must maintain the explicit bit to
ensure correct overload resolution.
|