| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This reverts commit r290171. It triggers a bunch of warnings, because
the new enumerator isn't handled in all switches. We want a warning-free
build.
Replied on the commit with more details.
llvm-svn: 290173
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fixes spelling name ranges for user-defined string literal operators.
Example:
constexpr int operator""_toint(unsigned long long val)
{ return int(val); }
Before this patch the spelling name range on consisted of 'operator'.
After this patch: 'operator""_toint'.
Related to http://reviews.llvm.org/D5041, which fixes the function for
other cursor kinds.
Reviewers: akyrtzi, craigt, skalinichev, klimek, milianw, bkramer
Subscribers: cfe-commits
Tags: #clang-c
Differential Revision: https://reviews.llvm.org/D18462
llvm-svn: 290172
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Enabling the compression of CLK_NULL_QUEUE to variable of type queue_t.
Reviewers: Anastasia
Subscribers: cfe-commits, yaxunl, bader
Differential Revision: https://reviews.llvm.org/D27569
llvm-svn: 290171
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fails MSan when running test/CodeGen/object-size.c in
a confusing way. After some discussion with George, it isn't really
clear what is going on here. We can make the MSan failure go away by
testing for the invalid bit, but *why* things are invalid isn't clear.
And yet, other code in the surrounding area is doing precisely this and
testing for invalid.
George is going to take a closer look at this to better understand the
nature of the failure and recommit it, for now backing it out to clean
up MSan builds.
llvm-svn: 290169
|
|
|
|
| |
llvm-svn: 290166
|
|
|
|
|
|
|
|
| |
The latter agrees with most existing diagnostics and the C and C++ standards.
Differential Revision: https://reviews.llvm.org/D26530
llvm-svn: 290159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes an assertion that is triggered when RecordLayoutBuilder
tries to compute the size of a field (for capture "name" in the test
case) whose type hasn't been deduced. The patch fixes the bug by
correcting the typo of the capture initializer after the initializer is
parsed and before setting the expression for the annotation token.
Fixes PR30566.
rdar://problem/23380132
Differential Revision: https://reviews.llvm.org/D25206
llvm-svn: 290156
|
|
|
|
|
|
| |
This reapplies r289921.
llvm-svn: 290155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch does three things:
- Gives us the alloc_size attribute in clang, which lets us infer the
number of bytes handed back to us by malloc/realloc/calloc/any user
functions that act in a similar manner.
- Teaches our constexpr evaluator that evaluating some `const` variables
is OK sometimes. This is why we have a change in
test/SemaCXX/constant-expression-cxx11.cpp and other seemingly
unrelated tests. Richard Smith okay'ed this idea some time ago in
person.
- Uniques some Blocks in CodeGen, which was reviewed separately at
D26410. Lack of uniquing only really shows up as a problem when
combined with our new eagerness in the face of const.
Differential Revision: https://reviews.llvm.org/D14274
llvm-svn: 290149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* In C++, never create a FunctionNoProtoType for a builtin (fixes C++1z
crasher from r289754).
* Fix type of __sync_synchronize to be a no-parameter function rather than a
varargs function. This matches GCC.
* Fix type of vfprintf to match its actual type. We gave it a wrong type due
to PR4290 (apparently autoconf generates invalid code and expects compilers
to choke it down or it miscompiles the program; the relevant error in clang
was downgraded to a warning in r122744 to fix other occurrences of this
autoconf brokenness, so we don't need this workaround any more).
* Turn off vararg argument checking for __noop, since it's not *really* a
varargs function. Alternatively we could add custom type checking for it
and synthesize parameter types matching the actual arguments in each call,
but that seemed like overkill.
llvm-svn: 290146
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D27955
llvm-svn: 290145
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gtest is a widely-used unit-testing API. It provides macros for unit test
assertions:
ASSERT_TRUE(p != nullptr);
that expand into an if statement that constructs an object representing
the result of the assertion and returns when the assertion is false:
if (AssertionResult gtest_ar_ = AssertionResult(p == nullptr))
;
else
return ...;
Unfortunately, the analyzer does not model the effect of the constructor
precisely because (1) the copy constructor implementation is missing from the
the header (so it can't be inlined) and (2) the boolean-argument constructor
is constructed into a temporary (so the analyzer decides not to inline it since
it doesn't reliably call temporary destructors right now).
This results in false positives because the analyzer does not realize that the
the assertion must hold along the non-return path.
This commit addresses the false positives by explicitly modeling the effects
of the two un-inlined constructors on the AssertionResult state.
I've added a new package, "apiModeling", for these kinds of checkers that
model APIs but don't emit any diagnostics. I envision all the checkers in
this package always being on by default.
This addresses the false positives reported in PR30936.
Differential Revision: https://reviews.llvm.org/D27773
rdar://problem/22705813
llvm-svn: 290143
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The newly-added notes from r290132 are too noisy even when the fix-it
is valid. For the existing warning from r286521, it's probably the
right decision 95% of the time to put the change outside the macro if
the array is outside the macro and inside otherwise, but I don't want
to overthink it right now.
Caught by the ASan bot!
More rdar://problem/29524992
llvm-svn: 290141
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The analyzer's CFG currently doesn't have nodes for calls to temporary
destructors. This causes the analyzer to explore infeasible paths in which
a no-return destructor would have stopped exploration and so results in false
positives when no-return destructors are used to implement assertions.
To mitigate these false positives, this patch stops generates a sink after
evaluating a constructor on a temporary object that has a no-return destructor.
This results in a loss of coverage because the time at which the destructor is
called may be after the time of construction (especially for lifetime-extended
temporaries).
This addresses PR15599.
rdar://problem/29131566
llvm-svn: 290140
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is especially important for arrays, since no one knows the proper
syntax for putting qualifiers in arrays.
nullability.h:3:26: warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
void arrayParameter(int x[]);
^
nullability.h:3:26: note: insert '_Nullable' if the array parameter may be null
void arrayParameter(int x[]);
^
_Nullable
nullability.h:3:26: note: insert '_Nonnull' if the array parameter should never be null
void arrayParameter(int x[]);
^
_Nonnull
rdar://problem/29524992
llvm-svn: 290132
|
|
|
|
| |
llvm-svn: 290130
|
|
|
|
|
|
|
| |
This time trying to commit just the relevant 3 tests!
Reviewed by abataev (in D27794)
llvm-svn: 290128
|
|
|
|
| |
llvm-svn: 290121
|
|
|
|
|
|
| |
Reviewed by abataev (in D27794)
llvm-svn: 290120
|
|
|
|
| |
llvm-svn: 290110
|
|
|
|
|
|
|
| |
This reverts commit r290080 as it leads to many Clang crashes, e.g.:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/1814
llvm-svn: 290092
|
|
|
|
|
|
| |
latest (provisional) draft of SD-6.
llvm-svn: 290082
|
|
|
|
| |
llvm-svn: 290081
|
|
|
|
|
|
|
|
|
|
|
| |
This change introduces UsingPackDecl as a marker for the set of UsingDecls
produced by pack expansion of a single (unresolved) using declaration. This is
not strictly necessary (we just need to be able to map from the original using
declaration to its expansions somehow), but it's useful to maintain the
invariant that each declaration reference instantiates to refer to one
declaration.
llvm-svn: 290080
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D27909
llvm-svn: 290075
|
|
|
|
|
|
| |
using-declarations.
llvm-svn: 290072
|
|
|
|
|
|
|
|
|
|
|
| |
* a dependent non-type using-declaration within a function template can be
valid, as it can refer to an enumerator, so don't reject it in the template
definition
* we can partially substitute into a dependent using-declaration if it appears
within a (local class in a) generic lambda within a function template, which
means an UnresolvedUsing*Decl doesn't necessarily instantiate to a UsingDecl.
llvm-svn: 290071
|
|
|
|
|
|
|
|
|
|
| |
The test requests a target which supports cl_khr_gl_msaa_sharing since in test/PCH/ocl_types.h
it tries to enable cl_khr_gl_msaa_sharing. Therefore this test fails on targets not supporting
cl_khr_gl_msaa_sharing, e.g. ppc64, etc.
The fix is to add triple spir-unknown-unknown which supports cl_khr_gl_msaa_sharing.
llvm-svn: 290059
|
|
|
|
|
|
|
|
| |
with extensions
Fixed undefined behavior due to cast integer to bool in initializer list.
llvm-svn: 290056
|
|
|
|
|
|
|
|
| |
This patch is to implement sema and parsing for 'target teams' pragma.
Differential Revision: https://reviews.llvm.org/D27818
llvm-svn: 290038
|
|
|
|
|
|
|
|
|
|
| |
Update the UnixAPIChecker to not diagnose for calls to functions that
are declared in C++ namespaces. This avoids false positives when a
namespaced function has the same name as a Unix API.
This address PR28331.
llvm-svn: 290023
|
|
|
|
| |
llvm-svn: 290008
|
|
|
|
|
|
|
|
|
| |
The openat() API has similar constraints to the open() API -- it just takes
an extra parameter.
rdar://problem/29526458
llvm-svn: 290005
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.
Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.
Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.
I propose that the parts required to build a simple expression parser be added to Clang. Initially, I aim to have the following features:
- A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.
- A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.
This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter. When complete, this tester will implement the first of the above goals.
Differential Revision: https://reviews.llvm.org/D27180
llvm-svn: 290004
|
|
|
|
|
|
| |
constant wider than 64 bits.
llvm-svn: 289996
|
|
|
|
|
|
|
|
|
| |
clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType
Patch by Emilio Cobos Álvarez!
See https://reviews.llvm.org/D26907
llvm-svn: 289995
|
|
|
|
| |
llvm-svn: 289991
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lambda expression is instantiated.
Rather than waiting until Sema::CheckCXXDefaultArgExpr tries to
transform the default arguments (which fails because it can't get the
template arguments that are used), transform the default arguments
earlier when the lambda expression is transformed in
TransformLambdaExpr.
rdar://problem/27535319
Differential Revision: https://reviews.llvm.org/D23096
llvm-svn: 289990
|
|
|
|
|
|
|
|
| |
This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma.
Differential Revision: https://reviews.llvm.org/D27821
llvm-svn: 289989
|
|
|
|
|
|
|
| |
Also, dump the AST and run FileCheck to make sure the expected nodes are
created in the AST.
llvm-svn: 289986
|
|
|
|
|
|
| |
This reverts commit r289921.
llvm-svn: 289984
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a map to associate types and declarations with extensions.
Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation.
Fixed some bugs for types associated with extensions.
Allow users to use pragma to declare types and functions for supported extensions, e.g.
#pragma OPENCL EXTENSION the_new_extension_name : begin
// declare types and functions associated with the extension here
#pragma OPENCL EXTENSION the_new_extension_name : end
Differential Revision: https://reviews.llvm.org/D21698
llvm-svn: 289979
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a crash in the MallocChecker when the extent size for the argument
to new[] is not known.
A patch by Abramo Bagnara and Dániel Krupp!
https://reviews.llvm.org/D27849
Differential Revision: https://reviews.llvm.org/D27849
llvm-svn: 289970
|
|
|
|
|
|
|
|
|
|
| |
Treat pointers passed to QObject::connectImpl() as escaping.
rdar://problem/29550440
Differential Revision: https://reviews.llvm.org/D27717
llvm-svn: 289939
|
|
|
|
| |
llvm-svn: 289924
|
|
|
|
| |
llvm-svn: 289921
|
|
|
|
| |
llvm-svn: 289919
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions in a function or class template.
This patch makes the following changes:
- Create a DependentScopeDeclRefExpr for the default argument instead of
a CXXDependentScopeMemberExpr.
- Pass CombineWithOuterScope=true so that the outer scope in which the
enum is declared is searched for the instantiation of the enum.
This is the first part of https://reviews.llvm.org/D23096. Fixes PR28795
rdar://problem/27535319
llvm-svn: 289914
|
|
|
|
|
|
| |
This reverts commit 289901 while investigating bot breakage.
llvm-svn: 289908
|
|
|
|
| |
llvm-svn: 289905
|