]> granicus.if.org Git - clang/log
clang
10 years agoTests for DR381-388.
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

10 years agoRevert C++11ification in r203534 and r203536. Apparently our toolchains aren't
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

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
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

10 years agotest: Regenerate profile data for PGO tests
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

10 years agoFix use of uninitialized variable in ExternalASTSourceTest.cpp (introduced in 203525)
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

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
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

10 years ago[HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework...
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

10 years agotest: Give instrumentation based profiling tests their own directory
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

10 years agotest: Fix feature test for "native" in lit.cfg
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

10 years agoDe-virtualize a method since it doesn't override anything and isn't overridden itself.
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

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
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

10 years agoSpeculative workaround for apparent libstdc++ bug exposed by r203534.
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

10 years agoMove the warning about unused relational comparison from -Wunused-value to
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

10 years agoIf a visibility update record is found for a DeclContext after that Decl has
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

10 years agoIf a module map is found in a relative -I path, convert the filenames within it
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

10 years agoAdd a unittest for the ExternalASTSource.
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

10 years agoBasic: Add -Wswitch-bool to control warn_bool_switch_condition
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

10 years agoObjective-C IRGen. Fixes several regressions caused by changes made
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

10 years agoAdd -fmodules-cache-path to test/Headers/c11.c
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

10 years agoThread safety analysis: move smart pointer checks from -Wthread-safety-beta
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

10 years ago[analyzer] Eliminate memory leak in BugReporter::emitReport()
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

10 years agoTurn on the uncovered umbrella header warning by default
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

10 years agoRTTI symbols for visible local types may need weak linkage.
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

10 years agoAdd a main function to the clang-format.py vim integration.
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

10 years agoIRGen: __c11/__atomic compare-and-exchange should respect the standard
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

10 years ago[C++11] Avoid implicit conversion of ArrayRef to std::vector and use move semantics...
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

10 years ago[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end...
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

10 years agoReplace CLANG_IS_PRODUCTION with CLANG_PLUGIN_SUPPORT.
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

10 years agoAdd loc() to the dynamic registry.
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

10 years agoclang-format: Add spaces between lambdas and comments.
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

10 years agoReverting llvm::distance changes to use std::distance with iterators instead, per...
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

10 years agoPreserve hanging indent when breaking line comments.
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

10 years agoMake __LITTLE_ENDIAN__/__BIG_ENDOAN__ common PredefinedMacros
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

10 years agoclang-format: Add spaces around trailing/lambda return types.
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

10 years agoclang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.
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

10 years agoclang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.
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

10 years agoWhen a type's definition is instantiated, the definition becomes visible, even
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

10 years agoRemove trailing whitespace.
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

10 years agoTab to spaces. No functionality change.
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

10 years agoFix uninitialized value in AttributedTypeLoc.
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

10 years ago[C++11] Replacing some using declarations which are not supported on all compilers...
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

10 years ago[C++11] Use std::unique_ptr for ownership in a vector.
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

10 years agoFix build break, replace take() with release().
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

10 years ago[C++11] Replace OwningPtr include with <memory>.
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

10 years ago[C++11] Remove the remaining uses of OwningPtr.
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

10 years ago[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
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

10 years agoUpdate clang to account for changes made to LLVM in r203376
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

10 years agoRemove uses of SmallString::equals in favor of SmallVectorImpl<char>'s operator==
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

10 years ago[Sema] Fix assertion hit with #pragma weak.
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

10 years ago[libclang] Don't pad the main buffer for the preamble.
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

10 years agoretain-comments-from-system-headers.c: Flush module cache, or incremental test would...
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

10 years ago[C++11] Update Clang for the change to LLVM's Use-Def chain iterators in
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

10 years ago[-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic...
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

10 years ago[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range...
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

10 years ago[Preprocessor] Only check for -Wunused-macros if the translation unit kind is TU_Comp...
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

10 years ago[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_ra...
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

10 years ago[C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with...
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

10 years agoReapplying r203299 in a slightly different manner. Now range APIs are implemented...
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

10 years ago[-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.
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

10 years agoFix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
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

10 years ago[CFG] Record would-be successor for noreturn destructor.
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

10 years ago[-Wunreachable-code] Handle 'return' with no argument dominated by 'noreturn' function.
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

10 years agoAdd an option to disable plugins in clang.
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

10 years agoRevert "Add an option to disable plugins in clang."
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

10 years agoAdd an option to disable plugins in clang.
Rafael Espindola [Sat, 8 Mar 2014 00:33:15 +0000 (00:33 +0000)]
Add an option to disable plugins in clang.

An option with the same name already exists in the makefile build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203320 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert accidentally-committed file.
Richard Smith [Sat, 8 Mar 2014 00:04:19 +0000 (00:04 +0000)]
Revert accidentally-committed file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203318 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoModule [extern_c] attribute: inherit to submodules, don't write 'extern "C"'
Richard Smith [Sat, 8 Mar 2014 00:03:56 +0000 (00:03 +0000)]
Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'
blocks when building in C mode, and serialize and deserialize the attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203317 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace "can not" with "cannot" in diagnostics messages.
Ismail Pazarbasi [Fri, 7 Mar 2014 22:36:23 +0000 (22:36 +0000)]
Replace "can not" with "cannot" in diagnostics messages.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203302 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIn my tests, I'm finding that declaring iterators in terms of ranges can sometimes...
Aaron Ballman [Fri, 7 Mar 2014 22:17:20 +0000 (22:17 +0000)]
In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.

This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203299 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Revert uses of lambdas with array_pod_sort.
Benjamin Kramer [Fri, 7 Mar 2014 21:51:58 +0000 (21:51 +0000)]
[C++11] Revert uses of lambdas with array_pod_sort.

Looks like GCC implements the lambda->function pointer conversion differently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203293 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Convert sort predicates into lambdas.
Benjamin Kramer [Fri, 7 Mar 2014 21:35:40 +0000 (21:35 +0000)]
[C++11] Convert sort predicates into lambdas.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203289 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[-Wunreachable-code] Treat constant globals as configuration values in unreachable...
Ted Kremenek [Fri, 7 Mar 2014 20:51:13 +0000 (20:51 +0000)]
[-Wunreachable-code] Treat constant globals as configuration values in unreachable code heuristics.

This one could possibly be refined even further; e.g. looking
at the initializer and see if it is truly a configuration value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203283 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoZap another dead 'break' statement.
Ted Kremenek [Fri, 7 Mar 2014 20:51:10 +0000 (20:51 +0000)]
Zap another dead 'break' statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203282 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace OwningPtr with std::unique_ptr.
Ahmed Charles [Fri, 7 Mar 2014 20:03:18 +0000 (20:03 +0000)]
Replace OwningPtr with std::unique_ptr.

This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_rang...
Aaron Ballman [Fri, 7 Mar 2014 19:56:05 +0000 (19:56 +0000)]
[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203278 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace OwningPtr::isValid() with conversion to bool.
Ahmed Charles [Fri, 7 Mar 2014 19:51:06 +0000 (19:51 +0000)]
Replace OwningPtr::isValid() with conversion to bool.

This is a precursor to moving to std::unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203277 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChange OwningPtr::take() to OwningPtr::release().
Ahmed Charles [Fri, 7 Mar 2014 19:33:25 +0000 (19:33 +0000)]
Change OwningPtr::take() to OwningPtr::release().

This is a precursor to moving to std::unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203275 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove dead return and simplify code.
Ted Kremenek [Fri, 7 Mar 2014 18:53:05 +0000 (18:53 +0000)]
Remove dead return and simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203266 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRenaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
Aaron Ballman [Fri, 7 Mar 2014 18:36:15 +0000 (18:36 +0000)]
Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203262 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with...
Aaron Ballman [Fri, 7 Mar 2014 18:11:58 +0000 (18:11 +0000)]
[C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203261 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a note in the user manual that tsan is not supported on Mac.
Nico Weber [Fri, 7 Mar 2014 18:11:40 +0000 (18:11 +0000)]
Add a note in the user manual that tsan is not supported on Mac.

Patch from Sean McBride <sean@rogue-research.com>!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203260 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago"Mac OS/X" -> "Mac OS X" spelling fixes for clang.
Nico Weber [Fri, 7 Mar 2014 18:09:57 +0000 (18:09 +0000)]
"Mac OS/X" -> "Mac OS X" spelling fixes for clang.

Patch from Sean McBride <sean@rogue-research.com>!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203259 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterato...
Aaron Ballman [Fri, 7 Mar 2014 17:50:17 +0000 (17:50 +0000)]
[C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203255 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDe...
Aaron Ballman [Fri, 7 Mar 2014 16:40:17 +0000 (16:40 +0000)]
[C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDecl class; however, the only usage of the iterators cannot be converted to using the range yet. This change is for consistency with other Decls exposing parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203252 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_ran...
Aaron Ballman [Fri, 7 Mar 2014 16:09:59 +0000 (16:09 +0000)]
[C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203250 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_...
Aaron Ballman [Fri, 7 Mar 2014 15:12:56 +0000 (15:12 +0000)]
[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203248 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replace LLVM-style type traits with C++11 standard ones.
Benjamin Kramer [Fri, 7 Mar 2014 14:30:23 +0000 (14:30 +0000)]
[C++11] Replace LLVM-style type traits with C++11 standard ones.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203241 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing iterators ddiag_begin() and ddiag_end() with iterator_range ddiags...
Aaron Ballman [Fri, 7 Mar 2014 14:09:15 +0000 (14:09 +0000)]
[C++11] Replacing iterators ddiag_begin() and ddiag_end() with iterator_range ddiags(). Updating all of the usages of the iterators with range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203240 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.
Aaron Ballman [Fri, 7 Mar 2014 13:44:44 +0000 (13:44 +0000)]
[C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203239 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
Aaron Ballman [Fri, 7 Mar 2014 13:13:38 +0000 (13:13 +0000)]
Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203237 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs...
Aaron Ballman [Fri, 7 Mar 2014 12:50:00 +0000 (12:50 +0000)]
[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range 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@203236 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove a test that we don't need anymore
Timur Iskhodzhanov [Fri, 7 Mar 2014 10:21:25 +0000 (10:21 +0000)]
Remove a test that we don't need anymore

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203228 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Fix for threadprivate construct instantiatiation.
Alexey Bataev [Fri, 7 Mar 2014 09:46:29 +0000 (09:46 +0000)]
[OPENMP] Fix for threadprivate construct instantiatiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203225 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritan...
Timur Iskhodzhanov [Fri, 7 Mar 2014 09:34:59 +0000 (09:34 +0000)]
Fix PR18967 -- Bad this adjustment for virtual methods in a diamond virtual inheritance hierarchy

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203222 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExternalClangExamples: add a link to ToyClangPlugin
Dmitri Gribenko [Fri, 7 Mar 2014 09:06:12 +0000 (09:06 +0000)]
ExternalClangExamples: add a link to ToyClangPlugin

Patch by Alexey Denisov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203219 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTweak some test paths to match on Windows
Ben Langmuir [Fri, 7 Mar 2014 08:15:35 +0000 (08:15 +0000)]
Tweak some test paths to match on Windows

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203215 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Small update in threadprivate variables processing to fix template instantia...
Alexey Bataev [Fri, 7 Mar 2014 08:03:37 +0000 (08:03 +0000)]
[OPENMP] Small update in threadprivate variables processing to fix template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203214 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
Argyrios Kyrtzidis [Fri, 7 Mar 2014 07:47:58 +0000 (07:47 +0000)]
[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
avoid warning for unused macros.

rdar://15034698

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203213 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[OPENMP] Fixed linked libraries for libiomp5 on Linux
Alexey Bataev [Fri, 7 Mar 2014 07:43:52 +0000 (07:43 +0000)]
[OPENMP] Fixed linked libraries for libiomp5 on Linux

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203212 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a bunch of missing changes from r203208
Ben Langmuir [Fri, 7 Mar 2014 07:27:49 +0000 (07:27 +0000)]
Add a bunch of missing changes from r203208

Somehow lost these in a git operation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203210 91177308-0d34-0410-b5e6-96231b3b80d8