]>
granicus.if.org Git - clang/log
Hans Wennborg [Wed, 12 Mar 2014 16:07:46 +0000 (16:07 +0000)]
Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203668
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Wed, 12 Mar 2014 15:35:53 +0000 (15:35 +0000)]
Use vector<T>::data() to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203665
91177308 -0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Wed, 12 Mar 2014 14:02:50 +0000 (14:02 +0000)]
ARM: Correct alignment of structs passed as byval pointer
When a struct has bitfields overlapping with other members
(as required by the AAPCS), clang uses a packed struct to
represent this. If such a struct is large enough for clang to
pass it as a byval pointer (>64 bytes), we need to set the
alignment of the argument to match the original type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203660
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 12 Mar 2014 08:24:47 +0000 (08:24 +0000)]
clang-format: Fix crasher.
Caused by unknown tokens (e.g. "\n") not properly updating the state.
Example:
const char* c = STRINGIFY(
\na : b);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203645
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 12 Mar 2014 06:41:41 +0000 (06:41 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203643
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 12 Mar 2014 06:16:26 +0000 (06:16 +0000)]
Disable cross-windows-on-linux.cpp for now. It may or may not fail. :/
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203642
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 12 Mar 2014 05:09:18 +0000 (05:09 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203641
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 12 Mar 2014 04:55:44 +0000 (04:55 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203640
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 12 Mar 2014 02:53:12 +0000 (02:53 +0000)]
Lexer: split test into separate files
Unfortunately, XFAIL applies to the entire file. Split the test into two
different units, enabling the proper application of XFAIL on the test which is
expected to fail on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203633
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 12 Mar 2014 02:26:08 +0000 (02:26 +0000)]
Lex: reduce buffer size, add a test
Reduce the stack usage as hopefully include paths are usually not too long. Add
a test case for the path normalisation behaviour.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203632
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Wed, 12 Mar 2014 00:06:17 +0000 (00:06 +0000)]
Add an option -fmodules-validate-system-headers
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203630
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 12 Mar 2014 00:01:07 +0000 (00:01 +0000)]
Allow GNU-style attributes on lambda expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203628
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 11 Mar 2014 23:42:49 +0000 (23:42 +0000)]
DebugInfo: Remove debug-info-pubtypes.ccp - pubnames/pubtypes are adequately tested in LLVM now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203625
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 11 Mar 2014 23:42:29 +0000 (23:42 +0000)]
Be case sensitive when determining driver mode based on argv[0] except on Windows
This narrows the impact of r188833 after Dimitry pointed out that it's good to be
able to tell the difference between 'cc' and 'CC'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203624
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 11 Mar 2014 23:38:05 +0000 (23:38 +0000)]
DebugInfo: Fix test for LLVM change r203619
I'll fix this to not test assembly in a moment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203623
91177308 -0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 11 Mar 2014 23:12:31 +0000 (23:12 +0000)]
PGO: appease the bots after r203592
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203618
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Tue, 11 Mar 2014 22:41:45 +0000 (22:41 +0000)]
lex: improve include handling on Linux for Windows
Normalise the path separator character on non-windows platforms. Although this
would work on Windows as well (most newer versions of Windows support either '/'
or '\' as a path separator character), it could potentially cause problems with
full UNC paths. This change enables the use of the Windows SDK on Linux which
will not accept '\' as a path separator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203614
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 11 Mar 2014 21:05:26 +0000 (21:05 +0000)]
Driver: Support -gmlt as an alias for -gline-tables-only
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203603
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 11 Mar 2014 20:32:35 +0000 (20:32 +0000)]
Improving test coverage for lambda expressions with attribute specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203602
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 11 Mar 2014 18:56:18 +0000 (18:56 +0000)]
Objective-C. Prevent an assertion crash due to buggy code
as it can commonly happen. // rdar://
16261494
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203598
91177308 -0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 11 Mar 2014 18:18:12 +0000 (18:18 +0000)]
PGO: Clarify the testing README
<rdar://problem/
16276448 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203593
91177308 -0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 11 Mar 2014 18:18:10 +0000 (18:18 +0000)]
PGO: Scale large counters down to 32-bits
PGO counters are 64-bit and branch weights are 32-bit. Scale them down
when necessary, instead of just taking the lower 32 bits.
<rdar://problem/
16276448 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203592
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 11 Mar 2014 17:17:16 +0000 (17:17 +0000)]
Remove trailing whitespace introduced in r203028.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203588
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 11 Mar 2014 17:10:51 +0000 (17:10 +0000)]
Objective-C. Diagose use of undefined protocols
when a class adopts a protocol that inherits from
undefined protocols. // rdar://
16111182
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203586
91177308 -0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Tue, 11 Mar 2014 16:52:29 +0000 (16:52 +0000)]
[analyzer] Check all conditions in a chained if against each other.
Like the binary operator check of r201702, this actually checks the
condition of every if in a chain against every other condition, an
O(N^2) operation. In most cases N should be small enough to make this
practical, and checking all cases like this makes it much more likely
to catch a copy-paste error within the same series of branches.
Part of IdenticalExprChecker; patch by Daniel Fahlgren!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203585
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 11 Mar 2014 13:19:42 +0000 (13:19 +0000)]
Changing this test case to use an unknown attribute, since there are not currently any type attributes which would apply to a lambda, except in MSVC compatibility mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203566
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 11 Mar 2014 13:03:15 +0000 (13:03 +0000)]
Gracefully handle an attribute specifier following a lambda introducer when the parameter list wasn't present.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203565
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 11 Mar 2014 11:35:10 +0000 (11:35 +0000)]
Sema: demote invalid atomic ordering message to warning.
Someone could write:
if (0) {
__c11_atomic_load(ptr, memory_order_release);
}
or the equivalent, which is perfectly valid, so we shouldn't outright reject
invalid orderings on purely static grounds.
rdar://problem/
16242991
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203564
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 11 Mar 2014 11:03:26 +0000 (11:03 +0000)]
clang-format: Avoid unnecessary break before lambda return type.
Before:
auto
aaaaaaaa = [](int i, // break
int j)
-> int {
return
fffffffffffffffffffffffffffffffffffffff (i * j);
};
After:
auto
aaaaaaaa = [](int i, // break
int j) -> int {
return
fffffffffffffffffffffffffffffffffffffff (i * j);
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203562
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 11 Mar 2014 10:49:14 +0000 (10:49 +0000)]
Sema: produce error when invalid ordering is passed to atomic builtin
This is a conservative check, because it's valid for the expression to be
non-constant, and in cases like that we just don't know whether it's valid.
rdar://problem/
16242991
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203561
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 11 Mar 2014 10:49:03 +0000 (10:49 +0000)]
Update for IR: add a second AtomicOrdering to cmpxchg insts.
rdar://problem/
15996804
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203560
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 11 Mar 2014 10:03:33 +0000 (10:03 +0000)]
clang-format: Fix another false positive in the lambda detection.
Before:
int i = (*b)[a] -> f();
After:
int i = (*b)[a]->f();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203557
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 11 Mar 2014 09:59:36 +0000 (09:59 +0000)]
clang-format: Fix incorrect lambda recognition exposed by r203452.
Before:
int i = a[a][a] -> f();
After:
int i = a[a][a]->f();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203556
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 11 Mar 2014 09:37:27 +0000 (09:37 +0000)]
clang::HeaderSearch: Use default constructor even for POD.
Unfortunately, msvc 2012 didn't accept non-static member initializer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203554
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 11 Mar 2014 09:29:46 +0000 (09:29 +0000)]
clang-format: Detect weird macro lambda usage.
Before:
void f() {
MACRO((const AA & a) { return 1; });
}
After:
void f() {
MACRO((const AA &a) { return 1; });
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203551
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 11 Mar 2014 09:00:49 +0000 (09:00 +0000)]
clang/test/Modules/include-relative.c REQUIRES shell due to chdir.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203550
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 07:49:32 +0000 (07:49 +0000)]
Tests for DR381-388.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203549
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 07:17:35 +0000 (07:17 +0000)]
Revert C++11ification in r203534 and r203536. Apparently our toolchains aren't
ready for this yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203548
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 11 Mar 2014 06:50:42 +0000 (06:50 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203547
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 11 Mar 2014 06:49:34 +0000 (06:49 +0000)]
test: Regenerate profile data for PGO tests
Some of this data had gotten out of date, so we weren't quite testing
what we thought we were. This also moves the outdated data test to its
own file to simplify regenerating the test data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203546
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 11 Mar 2014 06:49:26 +0000 (06:49 +0000)]
Fix use of uninitialized variable in ExternalASTSourceTest.cpp (introduced in 203525)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203545
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 11 Mar 2014 06:22:39 +0000 (06:22 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203543
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 11 Mar 2014 06:21:28 +0000 (06:21 +0000)]
[HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path)
then we fail to find it if it is re-included later on.
rdar://
16285490
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203542
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 11 Mar 2014 04:37:49 +0000 (04:37 +0000)]
test: Give instrumentation based profiling tests their own directory
These tests are logically related, but they're spread about several
different CodeGen directories. Consolidate them in one place to make
them easier to manage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203541
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 11 Mar 2014 04:34:17 +0000 (04:34 +0000)]
test: Fix feature test for "native" in lit.cfg
Checking if the host arch is in the triple isn't quite correct. Change
the feature test to match llvm's, which made the same change in r193459.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203540
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 11 Mar 2014 04:07:52 +0000 (04:07 +0000)]
De-virtualize a method since it doesn't override anything and isn't overridden itself.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203538
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 11 Mar 2014 03:39:26 +0000 (03:39 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203537
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 03:30:30 +0000 (03:30 +0000)]
Speculative workaround for apparent libstdc++ bug exposed by r203534.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203536
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Tue, 11 Mar 2014 03:11:08 +0000 (03:11 +0000)]
Move the warning about unused relational comparison from -Wunused-value to
-Wunused-comparison. Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203535
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 03:10:46 +0000 (03:10 +0000)]
If a visibility update record is found for a DeclContext after that Decl has
already been loaded, apply that update record to the Decl immediately, rather
than adding it to a pending list and never applying it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203534
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 02:02:47 +0000 (02:02 +0000)]
If a module map is found in a relative -I path, convert the filenames within it
to absolute paths when building the includes file for the module. Without this,
the module build would fail, because the relative paths we were using are not
necessarily relative to a directory in our include path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203528
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 11 Mar 2014 01:18:47 +0000 (01:18 +0000)]
Add a unittest for the ExternalASTSource.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203525
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 11 Mar 2014 00:26:28 +0000 (00:26 +0000)]
Basic: Add -Wswitch-bool to control warn_bool_switch_condition
This warning was missing a flag, add one.
test/Misc/warning-flags.c has one fewer entry.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203522
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 11 Mar 2014 00:25:05 +0000 (00:25 +0000)]
Objective-C IRGen. Fixes several regressions caused by changes made
to setting of ObjC linkages. //rdar://
16206443
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203521
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Mon, 10 Mar 2014 23:17:14 +0000 (23:17 +0000)]
Add -fmodules-cache-path to test/Headers/c11.c
This started failing for me the last time someone modified the AST file
format. It would be nice if we could just have lit take care of the
module cache used during testing for us, but this helps in the meantime.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203511
91177308 -0d34-0410-b5e6-
96231b3b80d8
DeLesley Hutchins [Mon, 10 Mar 2014 23:03:49 +0000 (23:03 +0000)]
Thread safety analysis: move smart pointer checks from -Wthread-safety-beta
to -Wthread-safety.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203510
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anton Yartsev [Mon, 10 Mar 2014 22:35:02 +0000 (22:35 +0000)]
[analyzer] Eliminate memory leak in BugReporter::emitReport()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203507
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ben Langmuir [Mon, 10 Mar 2014 22:34:23 +0000 (22:34 +0000)]
Turn on the uncovered umbrella header warning by default
This warning (under -Wincomplete-umbrella) diagnoses cases that are
difficult to understand without the compiler's help, since the symptom
is likely to be that you are missing the contents of headers that are
mistakenly omitted from a module. This seems like a good thing to have
on by default (with the usual caveat for -Wsystem-headers).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203506
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 10 Mar 2014 22:27:33 +0000 (22:27 +0000)]
RTTI symbols for visible local types may need weak linkage.
Previously, we would always emit them with internal linkage,
but with hidden visibility when the function was hidden, which
is an illegal combination, which could lead LLVM to actually
emit them as strong hidden symbols with hilarious results.
rdar://
16265084
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203503
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ahmed Charles [Mon, 10 Mar 2014 22:12:14 +0000 (22:12 +0000)]
Add a main function to the clang-format.py vim integration.
This will allow using an early return statement in a subsequent change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203501
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 10 Mar 2014 21:35:33 +0000 (21:35 +0000)]
IRGen: __c11/__atomic compare-and-exchange should respect the standard
Summary:
'Expected' should only be modified if the operation fails.
This fixes PR18899.
Reviewers: chandlerc, rsmith, rjmccall
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2922
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203493
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 10 Mar 2014 17:55:02 +0000 (17:55 +0000)]
[C++11] Avoid implicit conversion of ArrayRef to std::vector and use move semantics where appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203477
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 10 Mar 2014 17:08:28 +0000 (17:08 +0000)]
[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203474
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Mar 2014 17:00:46 +0000 (17:00 +0000)]
Replace CLANG_IS_PRODUCTION with CLANG_PLUGIN_SUPPORT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203473
91177308 -0d34-0410-b5e6-
96231b3b80d8
Samuel Benzaquen [Mon, 10 Mar 2014 15:40:23 +0000 (15:40 +0000)]
Add loc() to the dynamic registry.
Summary:
Add loc() to the dynamic registry.
Other fixes:
- Fix the polymorphic variant value to accept an exact match, even if
there are other possible conversions.
- Fix specifiesTypeLoc() to not crash on an empty
NestedNameSpecifierLoc.
Reviewers: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2928
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203467
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 10 Mar 2014 15:06:25 +0000 (15:06 +0000)]
clang-format: Add spaces between lambdas and comments.
Before:
void f() {
bar([]() {}// Does not respect SpacesBeforeTrailingComments
);
}
After:
void f() {
bar([]() {} // Does not respect SpacesBeforeTrailingComments
);
}
This fixes llvm.org/PR19017.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203466
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 10 Mar 2014 13:43:55 +0000 (13:43 +0000)]
Reverting llvm::distance changes to use std::distance with iterators instead, per post-commit review feedback.
Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203461
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Mon, 10 Mar 2014 13:14:56 +0000 (13:14 +0000)]
Preserve hanging indent when breaking line comments.
Summary:
If we need to break the second line here:
// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa
with the patch it will be turned to
// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa
instead of
// something: aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa aaaaa aaaaaa aaaaa aaaaa
// aaaaa
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2988
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203458
91177308 -0d34-0410-b5e6-
96231b3b80d8
Robert Lytton [Mon, 10 Mar 2014 12:06:29 +0000 (12:06 +0000)]
Make __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203455
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 10 Mar 2014 10:02:02 +0000 (10:02 +0000)]
clang-format: Add spaces around trailing/lambda return types.
Before:
int c = []()->int { return 2; }();
After:
int c = []() -> int { return 2; }();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203452
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Mar 2014 06:02:13 +0000 (06:02 +0000)]
clang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203446
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 10 Mar 2014 06:02:03 +0000 (06:02 +0000)]
clang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203445
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Mon, 10 Mar 2014 00:04:29 +0000 (00:04 +0000)]
When a type's definition is instantiated, the definition becomes visible, even
if the type's declaration was previously instantiated in an unimported module.
(For an imported type definition, this already worked, because the source
location is set to the location of the definition, but for locally-instantiated
type definitions, it did not.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203425
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sun, 9 Mar 2014 23:02:27 +0000 (23:02 +0000)]
Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203422
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sun, 9 Mar 2014 17:09:28 +0000 (17:09 +0000)]
Tab to spaces. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203417
91177308 -0d34-0410-b5e6-
96231b3b80d8
Logan Chien [Sun, 9 Mar 2014 16:21:03 +0000 (16:21 +0000)]
Fix uninitialized value in AttributedTypeLoc.
Clang might crash while reading the precompiled headers if
we don't initialize the AttrEnumOperandLoc properly.
This commit fixes the combination of string attribute
operand and enum operand. Besides, this commit also adds
several assertions to avoid unexpected operand kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203416
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sun, 9 Mar 2014 12:59:45 +0000 (12:59 +0000)]
[C++11] Replacing some using declarations which are not supported on all compilers (such as MSVC 2012) with a less problematic typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203397
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ahmed Charles [Sun, 9 Mar 2014 12:24:23 +0000 (12:24 +0000)]
[C++11] Use std::unique_ptr for ownership in a vector.
Also change to using range-based for loops. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203396
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ahmed Charles [Sun, 9 Mar 2014 11:46:32 +0000 (11:46 +0000)]
Fix build break, replace take() with release().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203390
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ahmed Charles [Sun, 9 Mar 2014 11:36:40 +0000 (11:36 +0000)]
[C++11] Replace OwningPtr include with <memory>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203389
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ahmed Charles [Sun, 9 Mar 2014 11:34:25 +0000 (11:34 +0000)]
[C++11] Remove the remaining uses of OwningPtr.
Replace OwningArrayPtr with std::unique_ptr<T[]>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203388
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 9 Mar 2014 08:13:49 +0000 (08:13 +0000)]
[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
This includes special casing 'YES' and 'NO', which are constants
defined as macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203380
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 9 Mar 2014 07:09:06 +0000 (07:09 +0000)]
Update clang to account for changes made to LLVM in r203376
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203377
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 9 Mar 2014 05:18:27 +0000 (05:18 +0000)]
Remove uses of SmallString::equals in favor of SmallVectorImpl<char>'s operator==
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203373
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sun, 9 Mar 2014 05:15:28 +0000 (05:15 +0000)]
[Sema] Fix assertion hit with #pragma weak.
rdar://
16264844
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203372
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sun, 9 Mar 2014 04:24:57 +0000 (04:24 +0000)]
[libclang] Don't pad the main buffer for the preamble.
Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.
rdar://
15836513
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203370
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 9 Mar 2014 03:56:18 +0000 (03:56 +0000)]
retain-comments-from-system-headers.c: Flush module cache, or incremental test would fail since r203317.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203367
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 9 Mar 2014 03:16:50 +0000 (03:16 +0000)]
[C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
r203364: what was use_iterator is now user_iterator, and there is
a use_iterator for directly iterating over the uses.
This also switches to use the range-based APIs where appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203365
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Mar 2014 23:20:11 +0000 (23:20 +0000)]
[-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic operations involving sizeof(), but not raw integers.
This case was motivated by a false positive with the
llvm::AlignOf<> specialization in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203363
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 8 Mar 2014 22:19:01 +0000 (22:19 +0000)]
[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203362
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 8 Mar 2014 21:18:26 +0000 (21:18 +0000)]
[Preprocessor] Only check for -Wunused-macros if the translation unit kind is TU_Complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203360
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 8 Mar 2014 20:12:42 +0000 (20:12 +0000)]
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203355
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 8 Mar 2014 18:45:14 +0000 (18:45 +0000)]
[C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203353
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 8 Mar 2014 18:30:40 +0000 (18:30 +0000)]
Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203351
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Mar 2014 02:22:32 +0000 (02:22 +0000)]
[-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.
This can possibly be refined later, but right now the experience
is so incomprehensible for a user to understand what is going on
this isn't a useful warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203336
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Mar 2014 02:22:29 +0000 (02:22 +0000)]
Fix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203335
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Mar 2014 02:22:25 +0000 (02:22 +0000)]
[CFG] Record would-be successor for noreturn destructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203334
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Mar 2014 02:22:23 +0000 (02:22 +0000)]
[-Wunreachable-code] Handle 'return' with no argument dominated by 'noreturn' function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203333
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 8 Mar 2014 01:19:37 +0000 (01:19 +0000)]
Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.
The name CLANG_IS_PRODUCTION is historical. We should probably change it, but
should change the configure build at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203325
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 8 Mar 2014 00:41:53 +0000 (00:41 +0000)]
Revert "Add an option to disable plugins in clang."
This reverts commit r203320.
There is some order dependency going on that I missed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203321
91177308 -0d34-0410-b5e6-
96231b3b80d8