Tony Jiang [Wed, 24 May 2017 14:45:57 +0000 (14:45 +0000)]
Generalize two diagnostic messages to take function name as parameter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303753
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Wed, 24 May 2017 14:34:19 +0000 (14:34 +0000)]
[coroutines] Improved diagnostics when unhandled_exception is missing in the promise_type
Summary: Now we helpfully provide a note pointing at the promise_type in question.
Reviewers: EricWF, GorNishanov
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33481
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303752
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 24 May 2017 14:23:40 +0000 (14:23 +0000)]
[index] The references to explicit class properties should be recorded
rdar://
32376363
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303751
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Wed, 24 May 2017 14:19:48 +0000 (14:19 +0000)]
[coroutines] [NFC] Add tests for return_void, unhandled_exception and promise dtor
Summary:
* Test that coroutine promise destructor is called.
* Test that we call return_void on fallthrough
* Test that we call unhandled exception in a try catch surrounding the body
Reviewers: EricWF, GorNishanov
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33479
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303748
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Wed, 24 May 2017 12:15:42 +0000 (12:15 +0000)]
[clang-format] Remove unused using directive, NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303742
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Wed, 24 May 2017 11:57:37 +0000 (11:57 +0000)]
Method loadFromCommandLine should be able to report errors
Now FixedCompilationDatabase::loadFromCommandLine has no means to report
which error occurred if it fails to create compilation object. This is
a block for implementing D33013, because after that change driver will
refuse to create compilation if command line contains erroneous options.
This change adds additional argument to loadFromCommandLine, which is
assigned error message text if compilation object was not created. This is
the same way as other methods of CompilationDatabase report failure.
Differential Revision: https://reviews.llvm.org/D33272
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303741
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Ferrand [Wed, 24 May 2017 11:36:58 +0000 (11:36 +0000)]
clang-format: Introduce BreakConstructorInitializers option
Summary:
This option replaces the BreakConstructorInitializersBeforeComma option with an enum, thus introducing a mode where the colon stays on the same line as constructor declaration:
// When it fits on line:
Constructor() : initializer1(), initializer2() {}
// When it does not fit:
Constructor() :
initializer1(), initializer2()
{}
// When ConstructorInitializerAllOnOneLineOrOnePerLine = true:
Constructor() :
initializer1(),
initializer2()
{}
Reviewers: krasimir, djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32479
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303739
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 24 May 2017 10:38:09 +0000 (10:38 +0000)]
Fix 'set but not used' [-Wunused-but-set-variable] warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303734
91177308-0d34-0410-b5e6-
96231b3b80d8
Dean Michael Berris [Wed, 24 May 2017 05:46:36 +0000 (05:46 +0000)]
[XRay][clang] Allow imbuing arg1 logging attribute via -fxray-always-instrument=
Summary:
This change allows us to add arg1 logging support to functions through
the special case list provided through -fxray-always-instrument=. This
is useful for adding arg1 logging to functions that are either in
headers that users don't have control over (i.e. cannot change the
source) or would rather not do.
It only takes effect when the pattern is matched through the "fun:"
special case, as a category. As in:
fun:*pattern=arg1
Reviewers: pelikan, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33392
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303719
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Wed, 24 May 2017 02:38:26 +0000 (02:38 +0000)]
[coroutines] Implement correct GRO lifetime
Summary:
Sema creates a declaration for gro variable as:
auto $gro = $promise.get_return_object();
However, gro variable has to outlive coroutine frame and coroutine promise, but,
it can only be initialized after the coroutine promise was created, thus, we
split its emission in two parts: EmitGroAlloca emits an alloca and sets up
the cleanups. Later when the coroutine promise is available we initialize
the gro and set the flag that the cleanup is now active.
Duplicate of: https://reviews.llvm.org/D31670 (which arc patch refuses to apply for some reason)
Reviewers: GorNishanov, rsmith
Reviewed By: GorNishanov
Subscribers: EricWF, cfe-commits
Differential Revision: https://reviews.llvm.org/D33477
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303716
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Wed, 24 May 2017 01:54:37 +0000 (01:54 +0000)]
[coroutines] Fix leak in CGCoroutine.cpp
FinalBB need to be emitted even when unused to make sure it is deleted
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303714
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 24 May 2017 01:38:00 +0000 (01:38 +0000)]
Change __has_feature(objc_diagnose_if_attr) to __has_feature(attribute_diagnose_if_objc) for consistency with rest of attribute checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303713
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 24 May 2017 00:46:27 +0000 (00:46 +0000)]
Enhance the 'diagnose_if' attribute so that we can apply it for ObjC methods and properties as well
This is an initial commit to allow using it with constant expressions, a follow-up commit will enable full support for it in ObjC methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303712
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Tue, 23 May 2017 23:53:17 +0000 (23:53 +0000)]
[Modules] Fix overly conservative assertion for import diagnostic
We currenltly assert when want to diagnose a missing import and the decl
in question is already visible. It turns out that the decl in question
might be visible because another decl from the same module actually made
the module visible in a previous error diagnostic.
Remove the assertion and avoid re-exporting the module if it's already
visible.
rdar://problem/
27975402
Differential Revision: https://reviews.llvm.org/D32828
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303705
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 23 May 2017 22:02:49 +0000 (22:02 +0000)]
[modules] When reparenting a local declaration, don't mark the declaration as
being visible with its owning module if we're not tracking owning modules for
local declarations.
This avoids the possibility of a declaration being (meaninglessly) marked as
hidden with no owning module, which would otherwise lead to violated AST
invariants (checked by the added assertion).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303699
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 23 May 2017 21:41:49 +0000 (21:41 +0000)]
Sema: allow imaginary constants via GNU extension if UDL overloads not present.
C++14 added user-defined literal support for complex numbers so that you can
write something like "complex<double> val = 2i". However, there is an existing
GNU extension supporting this syntax and interpreting the result as a _Complex
type.
This changes parsing so that such literals are interpreted in terms of C++14's
operators if an overload is present but otherwise falls back to the original
GNU extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303694
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 23 May 2017 20:48:21 +0000 (20:48 +0000)]
[Frontend] Don't index into an empty string.
Found by msan!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303686
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuka Takahashi [Tue, 23 May 2017 18:52:27 +0000 (18:52 +0000)]
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303672
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuka Takahashi [Tue, 23 May 2017 18:39:08 +0000 (18:39 +0000)]
[GSoC] Shell autocompletion for clang
Summary:
This is a first patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.
Simple flag completion and path completion is available in this patch.
Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33237
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303670
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Tue, 23 May 2017 16:56:10 +0000 (16:56 +0000)]
Removed fallthrough annotation which does not directly precede switch label.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303653
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 May 2017 16:47:01 +0000 (16:47 +0000)]
[index] The references to enum constants from member enums that are
from template instantiations should refer to the enum constant in the pattern
enum in the base template
rdar://
32325459
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303651
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 May 2017 16:35:50 +0000 (16:35 +0000)]
[index] The references to member enums from template instantiations should
refer to the pattern member enum in the base template
rdar://
32325459
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303650
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Tue, 23 May 2017 16:33:07 +0000 (16:33 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303649
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 May 2017 16:27:42 +0000 (16:27 +0000)]
[index] The references to type aliases and typedefs from template
instantiations should refer to the pattern type aliases / typedefs in the base
templates
rdar://
32325459
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303648
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 May 2017 16:25:06 +0000 (16:25 +0000)]
[index] The references to fields from nested records in template instantiations
should refer to the pattern fields in the nested records in the base templates
rdar://
32352429
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303647
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 23 May 2017 16:23:28 +0000 (16:23 +0000)]
[index] The references to records from template instantiations should refer
to the pattern records in the base templates
rdar://
32325459
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303646
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Tue, 23 May 2017 16:15:53 +0000 (16:15 +0000)]
[AMDGPU] Do not require opencl triple environment for OpenCL
A recent change requires opencl triple environment for compiling OpenCL
program, which causes regressions in libclc.
This patch fixes that. Instead of deducing language based on triple
environment, it checks LangOptions.
Differential Revision: https://reviews.llvm.org/D33445
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303644
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 23 May 2017 16:09:13 +0000 (16:09 +0000)]
Add test coverage for recent behavior change in GNU line marker pre-processing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303642
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Tue, 23 May 2017 13:50:43 +0000 (13:50 +0000)]
[Tooling][libclang] Remove unused CompilationDatabase::MappedSources
Summary:
This field is never assigned to and it's only ever read from libclang.
This patch removes it and adapts libclang to return constants.
Reviewers: klimek, bkramer
Reviewed By: klimek
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32351
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303635
91177308-0d34-0410-b5e6-
96231b3b80d8
Ilya Biryukov [Tue, 23 May 2017 11:37:52 +0000 (11:37 +0000)]
Allow to use vfs::FileSystem for file accesses inside ASTUnit.
Reviewers: bkramer, krasimir, arphaman, akyrtzi
Reviewed By: bkramer
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303630
91177308-0d34-0410-b5e6-
96231b3b80d8
Sven van Haastregt [Tue, 23 May 2017 10:36:43 +0000 (10:36 +0000)]
[libclang] [OpenCL] Expose more OpenCL CIndex types
Expose pipe, sampler_t, clk_event_t, queue_t, reserve_id_t, and all
image types.
Update the opencl-types.cl test RUN line such that we can test the
OpenCL 2.0 types.
Patch by Simon Perretta.
Differential Revision: https://reviews.llvm.org/D33197
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303626
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Tue, 23 May 2017 09:42:50 +0000 (09:42 +0000)]
[mips] Make checks in CodeGen/mips-varargs.c less fragile
This test was failing on our fork of clang because it was not capturing
[[ARG]] in the N32 case. Therefore it used the value from the last function
which does not always have to be the same. All other cases were already
capturing ARG so this appears to be an oversight.
The test now uses -enable-var-scope to prevent such errors in the future.
Reviewers: sdardis, atanasyan
Patch by: Alexander Richardson
Differential Revision: https://reviews.llvm.org/D32425
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303619
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Tue, 23 May 2017 05:25:31 +0000 (05:25 +0000)]
[coroutines] Skip over passthrough operator co_await
https://reviews.llvm.org/D31627
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303605
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Tue, 23 May 2017 05:17:49 +0000 (05:17 +0000)]
Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303604
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Tue, 23 May 2017 05:04:01 +0000 (05:04 +0000)]
[coroutines] Add emission of initial and final suspends
https://reviews.llvm.org/D31608
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303603
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Tue, 23 May 2017 04:21:27 +0000 (04:21 +0000)]
[coroutines] Add support for deallocation elision
Wrap deallocation code with:
if (auto *mem = coro.free()) Deallocate
When backend decides to elide allocations it will replace coro.free with nullptr to suppress deallocation code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303599
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Tue, 23 May 2017 03:46:59 +0000 (03:46 +0000)]
[coroutines] Replace all coro.frame builtins with an SSA value of coro.begin
SemaCoroutine forms expressions referring to the coroutine frame of the enclosing coroutine using coro.frame builtin.
During codegen, we emit llvm.coro.begin intrinsic that returns the address of the coroutine frame.
When coro.frame is emitted, we replace it with SSA value of coro.begin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303598
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Tue, 23 May 2017 01:13:17 +0000 (01:13 +0000)]
[coroutines] Add support for allocation elision
Summary:
We wrap allocation code so that backend can elide it if necessary.
llvm.coro.alloc intrinsic returns true, when allocation is needed and false otherwise.
```
%NeedAlloc = call i1 @llvm.coro.alloc(token %2)
br i1 %NeedAlloc, label %AllocBB, label %InitBB
AllocBB:
%5 = call i64 @llvm.coro.size.i64()
%call = call i8* @_Znwm(i64 %5) ; operator new
br label %InitBB
InitBB:
%Phi = phi i8* [ null, %0 ], [ %call, %4 ]
call i8* @llvm.coro.begin(token %2, i8* %Phi)
```
Reviewers: majnemer, EricWF
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31584
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303596
91177308-0d34-0410-b5e6-
96231b3b80d8
Faisal Vali [Tue, 23 May 2017 01:07:12 +0000 (01:07 +0000)]
[NFC, Refactor] Modernize TemplateIdAnnotation using TrailingObjects
A refactoring of TemplateIdAnnotation that uses TrailingObjects to create a variably-sized object on the heap.
https://reviews.llvm.org/D31414
Thanks to Aaron B for the review!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303594
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Tue, 23 May 2017 00:35:09 +0000 (00:35 +0000)]
Adjust clang test for r303590
Forgot to commit this separately from the llvm change to use a new
module flag type for pic and pie levels. Should fix the bot errors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303593
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 22 May 2017 23:51:40 +0000 (23:51 +0000)]
Add option to include multiple lines in snippets.
When a diagnostic includes a highlighted range spanning multiple lines, clang
now supports printing out multiple lines of context if necessary to show the
highlighted ranges. This is not yet exposed in the driver, but can be enabled
by "-Xclang -fcaret-diagnostics-max-lines -Xclang N".
This is experimental until we can find out whether it works well in practice,
and if so, what a good default for the maximum number of lines is.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303589
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Mon, 22 May 2017 22:41:28 +0000 (22:41 +0000)]
[coroutines] Fix coro-eh-cleanup.cpp test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303584
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Mon, 22 May 2017 22:33:17 +0000 (22:33 +0000)]
[coroutines] Wrap the body of the coroutine in try-catch
Summary:
If unhandled_exception member function is present in the coroutine promise,
wrap the body of the coroutine in:
```
try {
body
} catch(...) { promise.unhandled_exception(); }
```
Reviewers: EricWF, rnk, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31692
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303583
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 22 May 2017 21:42:58 +0000 (21:42 +0000)]
Give files from #line the characteristics of the current file
This allows #line directives to appear in system headers that have code
that clang would normally warn on. This is compatible with GCC, which is
easy to test by running `gcc -E`.
Fixes PR30752
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303582
91177308-0d34-0410-b5e6-
96231b3b80d8
Gor Nishanov [Mon, 22 May 2017 20:22:23 +0000 (20:22 +0000)]
[coroutines] Build GRO declaration and return GRO statement
Summary:
1. build declaration of the gro local variable that keeps the result of get_return_object.
2. build return statement returning the gro variable
3. emit them during CodeGen
4. sema and CodeGen tests updated
Reviewers: EricWF, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31646
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303573
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 May 2017 16:50:54 +0000 (16:50 +0000)]
[index] Index the default template parameter values
rdar://
32323724
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303568
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Mon, 22 May 2017 15:53:34 +0000 (15:53 +0000)]
[mips] Add one more check to the micromips attribute test case. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303565
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Mon, 22 May 2017 15:53:31 +0000 (15:53 +0000)]
[mips] Quote command line options with `` in the micromips attribute description. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303564
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 May 2017 15:42:45 +0000 (15:42 +0000)]
[index] Index the deleted functions
rdar://
32323386
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303563
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Pilkington [Mon, 22 May 2017 15:41:12 +0000 (15:41 +0000)]
[Sema][ObjC] Fix a bug where -Wunguarded-availability was emitted at the wrong location
Differential revision: https://reviews.llvm.org/D33250
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303562
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 May 2017 15:17:44 +0000 (15:17 +0000)]
[index] Visit the default argument values in function definitions
rdar://
32323315
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303559
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Probst [Mon, 22 May 2017 14:58:26 +0000 (14:58 +0000)]
clang-format: [JS] avoid line breaks before unindented r_parens.
The change that enabled wrapping at the previous scope's indentation had
unintended side-effects in that clang-format would prefer to wrap
closing parentheses to the next line if it avoided a wrap on the next
line (assuming very narrow lines):
fooObject
.someCall(barbazbam)
.then(bam);
Would get formatted as:
fooObject.someCall(barbazbam
).then(bam);
Because the ')' is now indented at the parent level (fooObject).
Normally formatting a builder pattern style call sequence like that is
outlawed in clang-format anyway. However for JavaScript this is special
cased to support trailing .bind calls.
This change disallows this special case when following a closing ')' to
avoid the problem.
Included are some random comment fixes.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33399
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303557
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Ferrand [Mon, 22 May 2017 14:47:17 +0000 (14:47 +0000)]
clang-format: do not reflow bullet lists
Summary:
This patch prevents reflowing bullet lists in block comments.
It handles all lists supported by doxygen and markdown, e.g. bullet
lists starting with '-', '*', '+', as well as numbered lists starting
with -# or a number followed by a dot.
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: djasper, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33285
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303556
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 22 May 2017 14:39:39 +0000 (14:39 +0000)]
[index] 'using namespace' declarations in functions should record
the reference to the namespace
rdar://
32323190
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303555
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Mon, 22 May 2017 12:47:43 +0000 (12:47 +0000)]
[mips] Support `micromips` attribute
This patch adds support for the `micromips` and `nomicromips` attributes
for MIPS targets.
Differential revision: https://reviews.llvm.org/D33363
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303546
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Mon, 22 May 2017 10:07:56 +0000 (10:07 +0000)]
[clang-format] Keep trailing preprocessor line comments separate from the following section comments
Summary:
r303415 changed the way a sequence of line comments following a preprocessor
macro is handled, which has the unfortunate effect of aligning a trailing
preprocessor line comment and following unrelated section comments, so:
```
#ifdef A // comment about A
// section comment
#endif
```
gets turned into:
```
#ifdef A // comment about A
// section comment
#endif
```
This patch fixes this by additionally checking the original start columns of
the line comments.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33394
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303541
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Ferrand [Mon, 22 May 2017 08:28:17 +0000 (08:28 +0000)]
clang-format: Allow customizing the penalty for breaking assignment
Summary:
Add option to customize the penalty for breaking assignment
This allows increasing the priority of the assignment, to prefer spliting
an operation instead of splitting the assignment, e.g. :
int a =
bbbbbbbbbbbbbbbb +
cccccccccccccccc;
Reviewers: krasimir, djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32477
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303534
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 21 May 2017 07:29:07 +0000 (07:29 +0000)]
[Format] Add curly braces to suppress a -Wmisleading-indentation warning from gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303501
91177308-0d34-0410-b5e6-
96231b3b80d8
Faisal Vali [Sat, 20 May 2017 19:58:04 +0000 (19:58 +0000)]
Fix PR25627: constant expressions being odr-used in template arguments.
This patch ensures that clang processes the expression-nodes that are generated when disambiguating between types and expressions within template arguments as constant-expressions by installing the ConstantEvaluated ExpressionEvaluationContext just before attempting the disambiguation - and then making sure that Context carries through into ParseConstantExpression (by refactoring it out into a function that does not create its own EvaluationContext: ParseConstantExpressionInExprEvalContext)
Note, prior to this patch, trunk would correctly disambiguate and identify the expression as an expression - and while it would annotate the token with the expression - it would fail to complete the odr-use processing (specifically, failing to trigger Sema::UpdateMarkingForLValueToRValue as is done for all Constant Expressions, which would remove it from being considered odr-used). By installing the ConstantExpression Evaluation Context prior to disambiguation, and making sure it carries though, we ensure correct processing of the expression-node.
For e.g:
template<int> struct X { };
void f() {
const int N = 10;
X<N> x; // should be OK.
[] { return X<N>{}; }; // Should be OK - no capture - but clang errors!
}
See a related bug: https://bugs.llvm.org//show_bug.cgi?id=25627
In summary (and reiteration), the fix is as follows:
- Remove the EnteredConstantEvaluatedContext action from ParseTemplateArgumentList (relying on ParseTemplateArgument getting it right)
- Add the EnteredConstantEvaluatedContext action just prior to undergoing the disambiguating parse, and if the parse succeeds for an expression, carry the context though into a refactored version of ParseConstantExpression that does not create its own ExpressionEvaluationContext.
See https://reviews.llvm.org/D31588 for additional context regarding some of the more fragile and complicated approaches attempted, and Richard's feedback that eventually shaped the simpler and more robust rendition that is being committed.
Thanks Richard!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303492
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Sat, 20 May 2017 08:56:18 +0000 (08:56 +0000)]
[Devirtualization] insert placement new barrier with -O0
Summary:
To not break LTO with different optimizations levels, we should insert
the barrier regardles of optimization level.
Reviewers: rjmccall, rsmith, mehdi_amini
Reviewed By: mehdi_amini
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D32401
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303488
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 20 May 2017 04:11:33 +0000 (04:11 +0000)]
[index] Fix forward declarations interfering with USR generation of external source symbols
Patch by Nathan Hawes.
https://reviews.llvm.org/D33346
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303484
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sat, 20 May 2017 01:36:41 +0000 (01:36 +0000)]
Rename RAII objects for performing eager instantiation to have names that
describe what they're for, not how they do it, and factor out a bit more
common code into them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303479
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 20 May 2017 01:29:55 +0000 (01:29 +0000)]
CodeGenModule: Always output wchar_size, check LLVM assumptions.
Re-commit r303463 now that LLVM is fixed and adjust some lit tests.
llvm::TargetLibraryInfo needs to know the size of wchar_t to work on
functions like `wcslen`. This patch changes clang to always emit the
wchar_size module flag (it would only do so for ARM previously).
This also adds an `assert()` to ensure the LLVM defaults based on the
target triple are in sync with clang.
Differential Revision: https://reviews.llvm.org/D32982
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303478
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 20 May 2017 00:38:27 +0000 (00:38 +0000)]
Revert "CodeGenModule: Always output wchar_size, check LLVM assumptions."
Let's revert this for now (and with it the assert()) to get the bots
back to green until I have LLVM synced up properly.
This reverts commit r303463.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303474
91177308-0d34-0410-b5e6-
96231b3b80d8
Hubert Tong [Sat, 20 May 2017 00:21:55 +0000 (00:21 +0000)]
Fix valid-for-expr ellipses eaten as invalid decl
Summary:
The trial parse for declarative syntax accepts an invalid pack
declaration syntax, which is ambiguous with valid pack expansions of
expressions. This commit removes the invalid pack declaration syntax to
avoid mistaking valid pack expansions as invalid declarator components.
Additionally, the trial parse of a //template-argument-list// then needs
to handle the optional ellipsis that is part of that grammar, as opposed
to relying on the trial parse for declarators accepting stray ellipses.
Reviewers: rsmith, rcraik, aaron.ballman
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33339
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303472
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 19 May 2017 23:49:00 +0000 (23:49 +0000)]
Remove last (unnecessary) use of mapping from SourceLocation to Module and
remove the mechanism for doing so.
This mechanism was incorrect in the presence of preprocessed modules (and
#pragma clang module begin/end).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303469
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 19 May 2017 23:32:38 +0000 (23:32 +0000)]
[modules] Simplify module macro handling in non-local-submodule-visibility mode.
When reaching the end of a module, we used to convert its macros to
ModuleMacros but also leave them in the MacroDirective chain for the
identifier. This meant that every lookup of such a macro would find two
(identical) definitions. It also made it difficult to determine the correct
owner for a macro when reaching the end of a module: the most recent
MacroDirective in the chain could be from an #included submodule rather than
the current module.
Simplify this: whenever we convert a MacroDirective to a ModuleMacro when
leaving a module, clear out the MacroDirective chain for that identifier, and
just rely on the ModuleMacro to provide the macro definition information.
(We don't want to do this for local submodule visibility mode, because in that
mode we maintain a distinct MacroDirective chain for each submodule, and we
need to keep around the prior MacroDirective in case we re-enter the submodule
-- for instance, if its header is #included more than once in a module build,
we need the include guard directive to stick around. But the problem doesn't
arise in this case for the same reason: each submodule has its own
MacroDirective chain, so the macros don't leak out of submodules in the first
place.)
This reinstates r302932, reverted in r302947, with a fix for a bug that
resulted in us sometimes losing macro definitions due to failing to clear out
the overridden module macro list when promoting a directive to a module macro.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303468
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 19 May 2017 22:37:15 +0000 (22:37 +0000)]
CodeGenModule: Always output wchar_size, check LLVM assumptions.
llvm::TargetLibraryInfo needs to know the size of wchar_t to work on
functions like `wcslen`. This patch changes clang to always emit the
wchar_size module flag (it would only do so for ARM previously).
This also adds an `assert()` to ensure the LLVM defaults based on the
target triple are in sync with clang.
Differential Revision: https://reviews.llvm.org/D32982
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303463
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Fri, 19 May 2017 22:35:41 +0000 (22:35 +0000)]
[ODRHash] Revert r303450 to fix buildbot
r303450
[ODRHash] Support TemplateName and TemplateArgument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303459
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 19 May 2017 20:20:13 +0000 (20:20 +0000)]
Do not issue -Wnullability-completeness for dependent types that are not written as pointer types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303451
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Fri, 19 May 2017 20:05:16 +0000 (20:05 +0000)]
[ODRHash] Support TemplateName and TemplateArgument
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303450
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Fri, 19 May 2017 16:46:06 +0000 (16:46 +0000)]
[modules] Further delay calling DeclMustBeEmitted until it's safe.
As discussed in D30793, we have some unsafe calls to isConsumerInterestedIn().
This patch implements Richard's suggestion (from the inline comment) that we
should track if we just deserialized an declaration. If we just deserialized,
we can skip the unsafe call because we know it's interesting. If we didn't just
deserialize the declaration, calling isConsumerInterestedIn() should be safe.
We tried to create a test case for this but we were not successful.
Patch by Raphael Isemann (D32499)!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303432
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 19 May 2017 12:03:34 +0000 (12:03 +0000)]
Restore and update documentation comment for EmitPointerWithAlignment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303419
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Fri, 19 May 2017 10:34:57 +0000 (10:34 +0000)]
[clang-format] Handle trailing comment sections in import statement lines
Summary:
This patch updates the handling of multiline trailing comment sections in
import statement lines to make it more consistent with the case in general.
This includes updating the parsing logic to collect the trailing comment
sections and the formatting logic to not insert escaped newlines at the end of
comment lines in import statement lines.
Specifically, before this patch this code:
```
#include <a> // line 1
// line 2
```
will be turned into two unwrapped lines, whereas this code:
```
int i; // line 1
// line 2
```
is turned into a single unwrapped line, enabling reflowing across comments.
An example where the old behaviour is bad is when partially formatting the lines
3 to 4 of this code:
```
#include <a> // line 1
// line 2
int i;
```
which gets turned into:
```
#include <a> // line 1
// line 2
int i;
```
because the two comment lines were independent and the indent was copied.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33351
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303415
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 19 May 2017 10:19:59 +0000 (10:19 +0000)]
CodeGenFunction::EmitPointerWithAlignment(): Prune a \param in r303358, possibly obsolete. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303414
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 19 May 2017 01:54:59 +0000 (01:54 +0000)]
When a type-id is unexpectedly given a name, assume that the name is unrelated
syntax unless we have a reason to think otherwise.
This improves error recovery in a couple of cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303398
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Probst [Thu, 18 May 2017 21:19:29 +0000 (21:19 +0000)]
clang-format: [JS] for await, and fix a crash with for loops.
Summary:
The syntax is actually `for await (const x of y)` (d'oh).
This also fixes a crash for `for` tokens not followed by additional tokens.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33329
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303382
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 18 May 2017 19:34:55 +0000 (19:34 +0000)]
When we enter a module within a linkage specification, switch the linkage
specification and the TU to the new module.
This is necessary to get the module ownership correct for entities that we
temporarily hang off the TranslationUnitDecl, such as template parameters and
function parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303373
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 18 May 2017 19:21:48 +0000 (19:21 +0000)]
Fix the location of "missing ';'" suggestions after annotation tokens.
We were incorrectly setting PrevTokLocation to the first token in the
annotation token instead of the last when consuming it. To fix this without
adding a complex switch to the hot path through ConsumeToken, we now have a
ConsumeAnnotationToken function for consuming annotation tokens in addition
to the other Consume*Token special case functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303372
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Thu, 18 May 2017 18:51:09 +0000 (18:51 +0000)]
CodeGen: Cast alloca to expected address space
Alloca always returns a pointer in alloca address space, which may
be different from the type defined by the language. For example,
in C++ the auto variables are in the default address space. Therefore
cast alloca to the expected address space when necessary.
Differential Revision: https://reviews.llvm.org/D32248
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303370
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 18 May 2017 18:06:07 +0000 (18:06 +0000)]
[index] Avoid one more crash caused by infinite recursion that happens when
looking up a dependent name in a record that derives from itself
rdar://
32273000
Differential Revision: https://reviews.llvm.org/D33324
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303366
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 18 May 2017 17:07:11 +0000 (17:07 +0000)]
[CodeGen] Propagate LValueBaseInfo instead of AlignmentSource
The functions creating LValues propagated information about alignment
source. Extend the propagated data to also include information about
possible unrestricted aliasing. A new class LValueBaseInfo will
contain both AlignmentSource and MayAlias info.
This patch should not introduce any functional changes.
Differential Revision: https://reviews.llvm.org/D33284
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303358
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Thu, 18 May 2017 15:16:24 +0000 (15:16 +0000)]
[clang-format] Fix MatchingOpeningBlockLineIndex computation
Summary:
Computed line index must be relative to the current 'parent' node, and
thus use CurrentLines instead of Lines.
Without this, a child line's MatchingOpeningBlockLineIndex is out of
range of the parent's list of line, which can cause crash or unexpected
behavior if this field is used in childs.
Contributed by @Typz!
Reviewers: krasimir, djasper
Reviewed By: krasimir
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32524
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303353
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 18 May 2017 10:43:11 +0000 (10:43 +0000)]
[index] Record references to class receivers used in property references
rdar://
32250025
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303343
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Thu, 18 May 2017 08:07:52 +0000 (08:07 +0000)]
[clang-format] Make NoLineBreakFormatter respect MustBreakBefore
Summary:
This patch makes NoLineBreakFormatter to insert a break before tokens where
MustBreakBefore is true.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33238
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303332
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Thu, 18 May 2017 07:36:21 +0000 (07:36 +0000)]
clang-format: fix prefix for doxygen comments after member
Summary:
Doxygen supports putting documentation blocks after member, by adding
an additional < marker in the comment block. This patch makes sure
this marker is used in lines which are introduced by breaking the
comment.
int foo; ///< Some very long comment.
becomes:
int foo; ///< Some very long
///< comment.
Contributed by @Typz!
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: djasper, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D33282
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303330
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 18 May 2017 03:02:15 +0000 (03:02 +0000)]
Fix an assertion failure in FormatASTNodeDiagnosticArgument.
Summary:
The test being added in this patch used to cause an assertion failure:
/build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
--
Exit Code: 134
Command Output (stderr):
--
clang: /src/tools/clang/lib/AST/ASTDiagnostic.cpp:424: void clang::FormatASTNodeDiagnosticArgument(DiagnosticsEngine::ArgumentKind, intptr_t, llvm::StringRef, llvm::StringRef, ArrayRef<DiagnosticsEngine::ArgumentValue>, SmallVectorImpl<char> &, void *, ArrayRef<intptr_t>): Assertion `isa<NamedDecl>(DC) && "Expected a NamedDecl"' failed.
#0 0x0000000001c7a1b4 PrintStackTraceSignalHandler(void*) (/build/./bin/clang+0x1c7a1b4)
#1 0x0000000001c7a4e6 SignalHandler(int) (/build/./bin/clang+0x1c7a4e6)
#2 0x00007f30880078d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#3 0x00007f3087054067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
#4 0x00007f3087055448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
#5 0x00007f308704d266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
#6 0x00007f308704d312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
#7 0x00000000035b7f22 clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind, long, llvm::StringRef, llvm::StringRef, llvm::ArrayRef<std::pair<clang::DiagnosticsEngine::ArgumentKind, long> >, llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) (/build/
./bin/clang+0x35b7f22)
#8 0x0000000001ddbae4 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddbae4)
#9 0x0000000001ddb323 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddb323)
#10 0x00000000022878a4 clang::TextDiagnosticBuffer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) (/build/./bin/clang+0x22878a4)
#11 0x0000000001ddf387 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const (/build/./bin/clang+0x1ddf387)
#12 0x0000000001dd9dea clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) (/build/./bin/clang+0x1dd9dea)
#13 0x0000000002cad00c clang::Sema::EmitCurrentDiagnostic(unsigned int) (/build/./bin/clang+0x2cad00c)
#14 0x0000000002d91cd2 clang::Sema::CheckShadow(clang::NamedDecl*, clang::NamedDecl*, clang::LookupResult const&) (/build/./bin/clang+0x2d91cd2)
Stack dump:
0. Program arguments: /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
1. /src/tools/clang/test/SemaCXX/warn-shadow.cpp:214:23: current parser token ';'
2. /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: parsing function body 'handleLinkageSpec'
3. /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: in compound statement ('{}')
/build/tools/clang/test/SemaCXX/Output/warn-shadow.cpp.script: line 1: 15595 Aborted (core dumped) /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: krytarowski, cfe-commits
Differential Revision: https://reviews.llvm.org/D33207
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303325
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 18 May 2017 02:29:20 +0000 (02:29 +0000)]
[modules] Switch from inferring owning modules based on source location to
inferring based on the current module at the point of creation.
This should result in no functional change except when building a preprocessed
module (or more generally when using #pragma clang module begin/end to switch
module in the middle of a file), in which case it allows us to correctly track
the owning module for declarations. We can't map from FileID to module in the
preprocessed module case, since all modules would have the same FileID.
There are still a couple of remaining places that try to infer a module from a
source location; I'll clean those up in follow-up changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303322
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 18 May 2017 01:11:52 +0000 (01:11 +0000)]
[Statistics] Use the new Statistic::updateMax to atomically calculate a maximum value statistic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303320
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 17 May 2017 23:56:54 +0000 (23:56 +0000)]
The constant expression evaluator should examine function arguments for non-constexpr function calls unless the EvalInfo says to stop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303317
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 17 May 2017 15:27:44 +0000 (15:27 +0000)]
clang-cl: Fix path-based MSVC version detection
The code wasn't taking the architecture-specific subdirectory into
account.
Differential Revision: https://reviews.llvm.org/D33258
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303267
91177308-0d34-0410-b5e6-
96231b3b80d8
Krasimir Georgiev [Wed, 17 May 2017 14:51:44 +0000 (14:51 +0000)]
[Frontend] Remove unused TemporaryFiles
Summary:
OnDiskData.TemporaryFiles is filled only by ASTUnit::addTemporaryFile, which is
dead. Also these files are used nowhere in the frontend nor in libclang.
Reviewers: bkramer, ilya-biryukov
Reviewed By: bkramer, ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33270
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303265
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Wed, 17 May 2017 12:09:11 +0000 (12:09 +0000)]
Constify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303250
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 17 May 2017 11:08:36 +0000 (11:08 +0000)]
[Lexer] Ensure that the token is not an annotation token when
retrieving the identifer info for an Objective-C keyword
This commit fixes an assertion that's triggered in getIdentifier when the token
is an annotation token.
rdar://
32225463
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303246
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 17 May 2017 03:23:35 +0000 (03:23 +0000)]
[ODRHash] Support NestedNameSpecifier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303233
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 17 May 2017 02:29:02 +0000 (02:29 +0000)]
[ODRHash] Support more types in the ODR checker.
Added support for TagType, TypeWithKeyword, and all children types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303231
91177308-0d34-0410-b5e6-
96231b3b80d8
Ekaterina Romanova [Wed, 17 May 2017 01:46:11 +0000 (01:46 +0000)]
(1) Fixed mismatch in intrinsics names in declarations and in doxygen comments.
(2) Removed uncessary anymore \c commands, since the same effect will be achived by <c> ... </c> sequence.
I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303228
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 17 May 2017 00:24:14 +0000 (00:24 +0000)]
[modules] When creating a declaration, cache its owning module immediately
rather than waiting until it's queried.
Currently this is only applied to local submodule visibility mode, as we don't
yet allocate storage for the owning module in non-local-visibility modules
compilations.
This reinstates r302965, reverted in r303037, with a fix for the reported
crash, which occurred when reparenting a local declaration to be a child of
a hidden imported declaration (specifically during template instantiation).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303224
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 16 May 2017 23:46:10 +0000 (23:46 +0000)]
Fix scope of namespaced DISubprograms when the function definition is out-of-line.
This fixes a regression introduced in r302915.
Using the lexical decl context is not necessary here for what r302915
wast trying to achieve. Not canonicalizing the NamespaceDecl in
getOrCreateNamespace is suficient.
rdar://problem/
29339538
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303222
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 16 May 2017 17:33:17 +0000 (17:33 +0000)]
[index] Avoid another crash that happens when looking up a dependent name
in a record that has a base without a definition
rdar://
32224197
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303192
91177308-0d34-0410-b5e6-
96231b3b80d8