]> granicus.if.org Git - clang/log
clang
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

10 years agoFix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.
Ted Kremenek [Fri, 7 Mar 2014 07:14:36 +0000 (07:14 +0000)]
Fix recent regressions in -Wreturn-type caused by heuristics to -Wunreachable-code.

I had forgotten that the same reachability code is used by both -Wreturn-type
and -Wunreachable-code, so the heuristics applied to the latter were indirectly
impacting the former.

To address this, the reachability code is more refactored so that whiled
the logic at its core is shared, the intention of the clients are better
captured and segregated in helper APIs.

Fixes PR19074, and also some false positives reported offline to me
by Nick Lewycky.

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

10 years agoAdd dependencies from imported modules with -MD
Ben Langmuir [Fri, 7 Mar 2014 06:40:32 +0000 (06:40 +0000)]
Add dependencies from imported modules with -MD

Add module dependencies to the dependency files created by -MD/-MMD/etc.
by attaching an ASTReaderListener that will call into the dependency
file generator when a module input file is seen in the serialized AST.

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

10 years agoAnother one fix for getSema()/getDerived().getSema()
Alexey Bataev [Fri, 7 Mar 2014 04:16:48 +0000 (04:16 +0000)]
Another one fix for getSema()/getDerived().getSema()

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

10 years agoFixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.
Alexey Bataev [Fri, 7 Mar 2014 04:01:56 +0000 (04:01 +0000)]
Fixed getSema()/getDerived().getSema() diff pointed by Hal Finkel.

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

10 years ago[-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' and...
Ted Kremenek [Fri, 7 Mar 2014 02:25:53 +0000 (02:25 +0000)]
[-Wunreachable-code] Correctly expand artificial reachability to pruned '&&' and '||' branches involving configuration values.

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

10 years ago[-Wunreachable-code] Teach reachable code analysis heuristics about more literal...
Ted Kremenek [Fri, 7 Mar 2014 02:25:50 +0000 (02:25 +0000)]
[-Wunreachable-code] Teach reachable code analysis heuristics about more literal types.

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

10 years agoThe Visual Studio IDE changed behavior in VS2012. It used to be the case that
Yunzhong Gao [Fri, 7 Mar 2014 00:23:36 +0000 (00:23 +0000)]
The Visual Studio IDE changed behavior in VS2012. It used to be the case that
the clang diagnostic has to report a column number one less than the correct
value in order for the IDE to move the cursor to the expected location. This
behavior is changed in VS2012 and VS2013 so that the IDE is now expecting the
column number to match the actual source location.
  Before: source(line, column-1): type: message
  After: source(line, column): type: message

This patch changes -fdiagnostics-format=msvc to match the new VS2012 and VS2013
when fmsc-version is 1700 or greater.

Differential Revision: http://llvm-reviews.chandlerc.com/D2949

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

10 years agoPartial revert of r203179. The build bots are telling me that some out-of-tree builds...
Aaron Ballman [Fri, 7 Mar 2014 00:10:58 +0000 (00:10 +0000)]
Partial revert of r203179. The build bots are telling me that some out-of-tree builds are using redecls_begin()/redecls_end(), so adding some machinery back in to support them.

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

10 years ago[C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range...
Aaron Ballman [Thu, 6 Mar 2014 23:45:36 +0000 (23:45 +0000)]
[C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely.

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

10 years agoC. Compare vector sizes using their raw element size instead of
Fariborz Jahanian [Thu, 6 Mar 2014 22:47:09 +0000 (22:47 +0000)]
C. Compare vector sizes using their raw element size instead of
getTypeSize (which rounds up sizes) in order to issue diagnostics
when casting to mismatched vector sizes; instead of crashing in IRGen.
// rdar:// 16196902. Reviewed offline by John McCall.

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

10 years agoUse llvm.compiler.used instead of llvm.used for objc symbols.
Rafael Espindola [Thu, 6 Mar 2014 22:15:10 +0000 (22:15 +0000)]
Use llvm.compiler.used instead of llvm.used for objc symbols.

LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not
print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the
ones that the clang's objc codegen is producing. The net result, is that it is
equivalent to llvm.compiler.used.

The need for putting the private symbol in llvm.compiler.used should be clear
(the objc runtime uses them). The reason for also putting the weak symbols in
it is for LTO: ld64 will not ask us to preserve the it.

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

10 years agoMake the test a bit stronger by showing what is added to llvm.used.
Rafael Espindola [Thu, 6 Mar 2014 22:02:16 +0000 (22:02 +0000)]
Make the test a bit stronger by showing what is added to llvm.used.

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

10 years agoRemove a dead store, add a FIXME for another.
Richard Smith [Thu, 6 Mar 2014 21:59:38 +0000 (21:59 +0000)]
Remove a dead store, add a FIXME for another.

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

10 years agoExclude invalid old decl from mismatching linkage assertion
Ismail Pazarbasi [Thu, 6 Mar 2014 21:48:45 +0000 (21:48 +0000)]
Exclude invalid old decl from mismatching linkage assertion

This patch fixes PR18964. In linkage computation, assertion fails when
an old invalid declaration's linkage mismatches with the current
decl's one.

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

10 years agoRemove dead code I introduced 6 years, 4 months ago in r43518.
Ted Kremenek [Thu, 6 Mar 2014 21:42:43 +0000 (21:42 +0000)]
Remove dead code I introduced 6 years, 4 months ago in r43518.

Found by -Wunreachable-code.

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

10 years agoPGO: rename profile data files from .pgodata to .profdata.
Bob Wilson [Thu, 6 Mar 2014 21:36:04 +0000 (21:36 +0000)]
PGO: rename profile data files from .pgodata to .profdata.

These tests were added before we had settled on using a .profdata extension
for the profile data files. Renaming them now for consistency.

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

10 years agoPGO: rename FileCheck variable to follow the existing convention.
Bob Wilson [Thu, 6 Mar 2014 21:35:59 +0000 (21:35 +0000)]
PGO: rename FileCheck variable to follow the existing convention.

I added this "STF" variable without noticing that all the other counter names
end with a "C". Renaming it to "STC" for consistency.

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

10 years agoUpdate for LLVM API change
Saleem Abdulrasool [Thu, 6 Mar 2014 20:47:19 +0000 (20:47 +0000)]
Update for LLVM API change

Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

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

10 years ago[docs] s/cpp11-migrate/clang-modernize/
Rui Ueyama [Thu, 6 Mar 2014 20:30:05 +0000 (20:30 +0000)]
[docs] s/cpp11-migrate/clang-modernize/

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

10 years agoPGO: Add support for Objective-C blocks.
Bob Wilson [Thu, 6 Mar 2014 20:24:27 +0000 (20:24 +0000)]
PGO: Add support for Objective-C blocks.

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

10 years agoFix dead store and simplify. No functionality change (although the code is now
Richard Smith [Thu, 6 Mar 2014 20:00:05 +0000 (20:00 +0000)]
Fix dead store and simplify. No functionality change (although the code is now
correct if MaxEditDistance were increased to something greater than 1).

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

10 years agoMS ABI: Disambiguate the manglings for global guard variables
David Majnemer [Thu, 6 Mar 2014 19:57:36 +0000 (19:57 +0000)]
MS ABI: Disambiguate the manglings for global guard variables

If a guard variable will be created for an entity at global scope,
then we cannot rely on the scope depth to disambiguate names for us.

Instead, mangle the entire variable into the guard to ensure it's uniqueness.

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

10 years agoBased on usage, the NamedDecl is always set when constructing a CallingContext, but...
Aaron Ballman [Thu, 6 Mar 2014 19:37:24 +0000 (19:37 +0000)]
Based on usage, the NamedDecl is always set when constructing a CallingContext, but none of the other optional parameters are. Removing the optional parameters, and making the NamedDecl required.

No functional changes intended.

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

10 years agoRefactored to use a simple helper function that wraps the logic of creating an SExprN...
Aaron Ballman [Thu, 6 Mar 2014 19:25:11 +0000 (19:25 +0000)]
Refactored to use a simple helper function that wraps the logic of creating an SExprNode and returning the position in which it was inserted.

No functional change intended.

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

10 years agoAdd tests for MS inline asm change r203146
Reid Kleckner [Thu, 6 Mar 2014 19:19:36 +0000 (19:19 +0000)]
Add tests for MS inline asm change r203146

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

10 years agoMS ABI: Fix the initializer/finalizer mangling for static data members
David Majnemer [Thu, 6 Mar 2014 19:10:27 +0000 (19:10 +0000)]
MS ABI: Fix the initializer/finalizer mangling for static data members

Initializers and finalizers for static data members have the variable's
access-specifier, storage-class, type and CV-qualifiers mangled in.

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

10 years agoVery minor simplification and typo correction; no functional changes intended.
Aaron Ballman [Thu, 6 Mar 2014 19:10:16 +0000 (19:10 +0000)]
Very minor simplification and typo correction; no functional changes intended.

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

10 years agoRevert "Use private linkage for remaining GlobalVariables with private names."
Rafael Espindola [Thu, 6 Mar 2014 18:54:12 +0000 (18:54 +0000)]
Revert "Use private linkage for remaining GlobalVariables with private names."

This reverts commit r203059.

Revert while we discuss what does it mean to be private and weak.

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

10 years agoFix use-after-free detected by ASan bootstrap.
Richard Smith [Thu, 6 Mar 2014 18:08:08 +0000 (18:08 +0000)]
Fix use-after-free detected by ASan bootstrap.

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

10 years agoRun -fprofile-instr tests with %clang_cc1.
Bob Wilson [Thu, 6 Mar 2014 17:18:34 +0000 (17:18 +0000)]
Run -fprofile-instr tests with %clang_cc1.

This should help avoid problems like the buildbot fallout from my change in
r203085. I left the CodeGenCXX tests alone for now.

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

10 years agoExpand documentation section on comment parsing
Dmitri Gribenko [Thu, 6 Mar 2014 16:32:09 +0000 (16:32 +0000)]
Expand documentation section on comment parsing

Patch by Jonathan Sauer, with a little editing by me.

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