]> granicus.if.org Git - clang/log
clang
11 years agoObjectiveC migrator: Another use case of enum
Fariborz Jahanian [Fri, 19 Jul 2013 20:18:36 +0000 (20:18 +0000)]
ObjectiveC migrator: Another use case of enum
declaration which can be migrated to NS_ENUM.

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

11 years agoAdd support for raw_ostream on the printing methods of Diagnostics.
Samuel Benzaquen [Fri, 19 Jul 2013 20:02:35 +0000 (20:02 +0000)]
Add support for raw_ostream on the printing methods of Diagnostics.

Summary:
Add printToStream*(llvm::raw_ostream&) methods to Diagnostics, and reimplement everything based on streams instead of concatenating strings.
Also, fix some functions to start with lowercase to match the style guide.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1187

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

11 years agoCreate calling convention AttributedType sugar nodes
Reid Kleckner [Fri, 19 Jul 2013 19:51:03 +0000 (19:51 +0000)]
Create calling convention AttributedType sugar nodes

Canonical types are unchanged.  The type printer had to be changed to
avoid printing any non-default implicit calling convention as well as
the calling convention attribute.

Reviewers: rjmccall

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

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

11 years agoFix for template substitution with packs.
Eli Friedman [Fri, 19 Jul 2013 19:40:38 +0000 (19:40 +0000)]
Fix for template substitution with packs.

When we see a pack, and replace it with a template argument which is
also a pack, we want to use the pack pattern, not the expanded pack.
The caller should take care of expanding the pack afterwards.

Fixes PR16646.

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

11 years agoUpdate users manual to indicate:
Richard Smith [Fri, 19 Jul 2013 19:06:48 +0000 (19:06 +0000)]
Update users manual to indicate:
  1) clang++ must be used when linking C++ programs using -fsanitize=undefined, and
  2) MSan can't be combined with TSan or ASan.

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

11 years ago[mips] Add support for command-line options -mno-check-zero-division and
Akira Hatanaka [Fri, 19 Jul 2013 18:58:48 +0000 (18:58 +0000)]
[mips] Add support for command-line options -mno-check-zero-division and
-mcheck-zero-division.

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

11 years ago[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize...
Argyrios Kyrtzidis [Fri, 19 Jul 2013 18:57:15 +0000 (18:57 +0000)]
[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize of 'weak' property is only
allowed in ARC" errors.

rdar://14461559

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

11 years agoReplace some existing type attribute diagnostics with a
Aaron Ballman [Fri, 19 Jul 2013 18:53:44 +0000 (18:53 +0000)]
Replace some existing type attribute diagnostics with a
single diagnostic that selects.  No functional changes intended.

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

11 years agoAdd SourceRange to PPCallbacks::Defined callback.
John Thompson [Fri, 19 Jul 2013 18:50:04 +0000 (18:50 +0000)]
Add SourceRange to PPCallbacks::Defined callback.

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

11 years agoFix source range of implicitly instantiated friend declaration.
Enea Zaffanella [Fri, 19 Jul 2013 18:02:36 +0000 (18:02 +0000)]
Fix source range of implicitly instantiated friend declaration.

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

11 years agoFix test to actually check things.
Benjamin Kramer [Fri, 19 Jul 2013 17:49:21 +0000 (17:49 +0000)]
Fix test to actually check things.

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

11 years agoFixes an ObjC migrator crash when last decl
Fariborz Jahanian [Fri, 19 Jul 2013 17:44:32 +0000 (17:44 +0000)]
Fixes an ObjC migrator crash when last decl
in file is an enum.

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

11 years agoThis patch implements __get_cpuid_max() as an inline and __cpuid() and
Roman Divacky [Fri, 19 Jul 2013 17:28:36 +0000 (17:28 +0000)]
This patch implements __get_cpuid_max() as an inline and __cpuid() and
__cpuid_count() as macros to be compatible with GCC's cpuid.h.  It also adds
bit_<foo> constants for the various feature bits as described in version 039
(May 2011) of Intel's SDM Volume 2 in the description of the CPUID
instruction.  The list of bit_<foo> constants is a bit exhaustive (GCC
doesn't do near this many).  More bits could be added from a newer version of
SDM if desired.

Patch by John Baldwin!

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

11 years ago[SystemZ] Add -march= command-line option
Richard Sandiford [Fri, 19 Jul 2013 16:51:51 +0000 (16:51 +0000)]
[SystemZ] Add -march= command-line option

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

11 years ago[SystemZ] Enable frame-pointer elimination for -O1 and above
Richard Sandiford [Fri, 19 Jul 2013 14:06:49 +0000 (14:06 +0000)]
[SystemZ] Enable frame-pointer elimination for -O1 and above

Copies the x86 behavior.

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

11 years agoRevert r186672 - turns out ASan supports Mac OS 10.6 yet.
Alexey Samsonov [Fri, 19 Jul 2013 12:53:04 +0000 (12:53 +0000)]
Revert r186672 - turns out ASan supports Mac OS 10.6 yet.

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

11 years ago[ASan] Reflect the dropped Mac OS 10.6 support in docs
Alexey Samsonov [Fri, 19 Jul 2013 12:33:30 +0000 (12:33 +0000)]
[ASan] Reflect the dropped Mac OS 10.6 support in docs

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

11 years agoAllow clang tools to display an overview when using the CommonOptionsParser.
Manuel Klimek [Fri, 19 Jul 2013 12:20:59 +0000 (12:20 +0000)]
Allow clang tools to display an overview when using the CommonOptionsParser.

Patch by Guillaume Papin.

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

11 years agoAdds overlapsWith and contains predicates on tooling::Range.
Manuel Klimek [Fri, 19 Jul 2013 12:12:36 +0000 (12:12 +0000)]
Adds overlapsWith and contains predicates on tooling::Range.

Patch by Guillaume Papin.

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

11 years agoAdds ctorInitializer and forEachConstructorInitializer matchers.
Manuel Klimek [Fri, 19 Jul 2013 11:50:54 +0000 (11:50 +0000)]
Adds ctorInitializer and forEachConstructorInitializer matchers.

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

11 years agoStmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [...
NAKAMURA Takumi [Fri, 19 Jul 2013 10:31:05 +0000 (10:31 +0000)]
StmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [-Wdocumentation]

-  /// \param Clauses A list of clauses.

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

11 years agoStmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]
NAKAMURA Takumi [Fri, 19 Jul 2013 10:30:58 +0000 (10:30 +0000)]
StmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]

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

11 years agoImprove clang-format vim integration.
Daniel Jasper [Fri, 19 Jul 2013 09:30:44 +0000 (09:30 +0000)]
Improve clang-format vim integration.

The previous line-by-line replacement causes vim to take a long time if
the foldmethod is set to 'syntax'. This should significantly improve
performance in that case.

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

11 years agoSimplify the CodeGenFunction::Build*Virtual*Call family of functions
Timur Iskhodzhanov [Fri, 19 Jul 2013 08:14:45 +0000 (08:14 +0000)]
Simplify the CodeGenFunction::Build*Virtual*Call family of functions

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

11 years agoRemove trailing whitespace.
Craig Topper [Fri, 19 Jul 2013 04:46:31 +0000 (04:46 +0000)]
Remove trailing whitespace.

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

11 years agoRemove unnecessary IsFirst variable from debug codde in GetDiagInfo.
Craig Topper [Fri, 19 Jul 2013 03:59:51 +0000 (03:59 +0000)]
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.

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

11 years agoOpenMP: basic support for #pragma omp parallel
Alexey Bataev [Fri, 19 Jul 2013 03:13:43 +0000 (03:13 +0000)]
OpenMP: basic support for #pragma omp parallel

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

11 years agoObjectiveC migrator: add support to migrate to
Fariborz Jahanian [Fri, 19 Jul 2013 01:05:49 +0000 (01:05 +0000)]
ObjectiveC migrator: add support to migrate to
NS_OPTIONS.

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

11 years ago[analyzer] Include analysis stack in crash traces.
Jordan Rose [Fri, 19 Jul 2013 00:59:08 +0000 (00:59 +0000)]
[analyzer] Include analysis stack in crash traces.

Sample output:

0.     Program arguments: ...
1.     <eof> parser at end of file
2.     While analyzing stack:
       #0 void inlined()
       #1 void test()
3.     crash-trace.c:6:3: Error evaluating statement

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

11 years agoUpdate createCompileUnit call for llvm changes.
Eric Christopher [Fri, 19 Jul 2013 00:51:58 +0000 (00:51 +0000)]
Update createCompileUnit call for llvm changes.

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

11 years agoFix crash-on-invalid with inheriting constructor.
Eli Friedman [Thu, 18 Jul 2013 23:59:50 +0000 (23:59 +0000)]
Fix crash-on-invalid with inheriting constructor.

Fixes PR16656.

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

11 years agoClean up diagnostics for inheriting constructors.
Eli Friedman [Thu, 18 Jul 2013 23:29:14 +0000 (23:29 +0000)]
Clean up diagnostics for inheriting constructors.

No new diagnostics, just better wording and notes pointing at more
relevant locations.

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

11 years agoAdded -lines X:Y option to specify line range to process. This is a more human-friend...
Alexander Kornienko [Thu, 18 Jul 2013 22:54:56 +0000 (22:54 +0000)]
Added -lines X:Y option to specify line range to process. This is a more human-friendly alternative to -offset and -length.

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

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

11 years agoObjectiveC migrator: Remove semicolon after the typedef
Fariborz Jahanian [Thu, 18 Jul 2013 22:17:33 +0000 (22:17 +0000)]
ObjectiveC migrator: Remove semicolon after the typedef
declaration when converting to NS_ENUM. This required
some code refactoring.

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

11 years agoAddress -Wreorder warning in Driver.cpp
Hans Wennborg [Thu, 18 Jul 2013 21:45:42 +0000 (21:45 +0000)]
Address -Wreorder warning in Driver.cpp

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

11 years agoTurn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
Hans Wennborg [Thu, 18 Jul 2013 20:29:38 +0000 (20:29 +0000)]
Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
and add a new option --driver-mode= to control it explicitly.

The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there
are currently really three modes that Clang can run in: gcc, g++
or cpp, so it makes sense to represent them as an enum.

Having a command line flag to control it helps testing.

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

11 years agoObjectiveC migration. migration to NS_ENUM/SN_OPTION
Fariborz Jahanian [Thu, 18 Jul 2013 20:11:45 +0000 (20:11 +0000)]
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
- wip.

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

11 years ago[Driver] Use LLVM's response file parser because it can read UTF-16
Reid Kleckner [Thu, 18 Jul 2013 20:00:53 +0000 (20:00 +0000)]
[Driver] Use LLVM's response file parser because it can read UTF-16

MSBuild writes response files as UTF-16 little endian with a byte order
mark.  With this change, clang will be able to read them, although we
still can't parse any of their flags.

Adds a UTF-16-LE response file with a BOM for testing.

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

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

11 years agoSeparate the notion of 'context' when recursing down in the parser and actual errors.
Samuel Benzaquen [Thu, 18 Jul 2013 19:47:59 +0000 (19:47 +0000)]
Separate the notion of 'context' when recursing down in the parser and actual errors.

Summary:
Change how error messages are constructed and stored in Diagnostics.
Separate the notion of 'context' when recursing down in the parser and actual errors.
This will simplify adding some new features, like argument overloading and error recovery.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1168

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

11 years agoChanged declarations from Attr to InheritableAttr as they are already being processed...
Aaron Ballman [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Changed declarations from Attr to InheritableAttr as they are already being processed that way semantically.

Patch thanks to Dean Sutherland!  Reviewed by Eli Friedman.

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

11 years agoSwitching to use checkAttributeNumArgs for trivial cases. No functional changes...
Aaron Ballman [Thu, 18 Jul 2013 18:01:48 +0000 (18:01 +0000)]
Switching to use checkAttributeNumArgs for trivial cases.  No functional changes intended.

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

11 years agoTest contents were somehow duplicated, resulting in any testcase that fails automatic...
Aaron Ballman [Thu, 18 Jul 2013 17:41:26 +0000 (17:41 +0000)]
Test contents were somehow duplicated, resulting in any testcase that fails automatically failing twice.  Removing the duplicates.

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

11 years agoReplacing a morally duplicate diagnostic by adding it to an existing diagnostic's...
Aaron Ballman [Thu, 18 Jul 2013 14:56:42 +0000 (14:56 +0000)]
Replacing a morally duplicate diagnostic by adding it to an existing diagnostic's select list.  Updates the tests for the more consistent diagnostic.

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

11 years agoclang-format: Fix bad line break with pointers to members.
Daniel Jasper [Thu, 18 Jul 2013 14:46:07 +0000 (14:46 +0000)]
clang-format: Fix bad line break with pointers to members.

Before:
  void f() {
    (a->*
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
                                           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

After:
  void f() {
    (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
        aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

Also add missing test case.

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

11 years agoFix crash in libclang if code completion is used with unknown flags.
Manuel Klimek [Thu, 18 Jul 2013 14:23:12 +0000 (14:23 +0000)]
Fix crash in libclang if code completion is used with unknown flags.

Use CaptureDroppedDiagnostics to make sure that there is a diagnostic
client installed when warning flags are parsed.

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

11 years agoRemoved a parameter from handleAttrWithMessage to make it more consistent with other...
Aaron Ballman [Thu, 18 Jul 2013 13:13:52 +0000 (13:13 +0000)]
Removed a parameter from handleAttrWithMessage to make it more consistent with other attribute handlers, as well as other attribute error messages.  Added missing test cases for the unavailable attribute, and updated the deprecated test case.

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

11 years agoFix volatile _Complex alignment test on platforms where 64-bit floating point isn...
JF Bastien [Thu, 18 Jul 2013 06:11:45 +0000 (06:11 +0000)]
Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned

Add x86-64 triple, and check its datalayout. Also add some comments, and use the new CHECK-LABEL.

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

11 years agos/BuiltinLocation/ArtificialLocation/
Adrian Prantl [Thu, 18 Jul 2013 01:36:04 +0000 (01:36 +0000)]
s/BuiltinLocation/ArtificialLocation/

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

11 years agoInstead of checking against some version of "isType()" go ahead and
Eric Christopher [Thu, 18 Jul 2013 00:52:50 +0000 (00:52 +0000)]
Instead of checking against some version of "isType()" go ahead and
use the conversion to bool to check if we've managed to get a type
that isn't default constructed - as we meant to in the first place.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:47:12 +0000 (00:47 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:43:29 +0000 (00:43 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoDon't generate bogus line table entries for __copy_helper_block_ and
Adrian Prantl [Thu, 18 Jul 2013 00:28:05 +0000 (00:28 +0000)]
Don't generate bogus line table entries for __copy_helper_block_ and
__destroy_helper_block_, but do generate scope information.

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

11 years agoReplace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
Adrian Prantl [Thu, 18 Jul 2013 00:28:02 +0000 (00:28 +0000)]
Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
inspired by CodegenFunction::LexicalScope.
- NoLocation temporarily turns off debug locations altogether.
  This is useful for emitting instructions that should be
  counted towards the function prologue.
- BuiltinLocation temporarily switches to an artificial debug location
  that has a valid scope, but no line information. This is useful when
  emitting compiler-generated helper functions that have no source
  location associated with them.

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

11 years agoClarified documentation.
Adrian Prantl [Thu, 18 Jul 2013 00:27:59 +0000 (00:27 +0000)]
Clarified documentation.

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

11 years agoSimplify logic by using the appropriate function.
Adrian Prantl [Thu, 18 Jul 2013 00:27:56 +0000 (00:27 +0000)]
Simplify logic by using the appropriate function.

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

11 years agoAdd condition expression result to if and elif callbacks.
John Thompson [Thu, 18 Jul 2013 00:00:36 +0000 (00:00 +0000)]
Add condition expression result to if and elif callbacks.

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

11 years agoReinstate r186040, with additional fixes and more test coverage (reverted in
Richard Smith [Wed, 17 Jul 2013 23:53:16 +0000 (23:53 +0000)]
Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

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

11 years ago80-column fixes.
Eric Christopher [Wed, 17 Jul 2013 22:52:53 +0000 (22:52 +0000)]
80-column fixes.

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

11 years agoEven more code conformance.
Robert Wilhelm [Wed, 17 Jul 2013 21:14:35 +0000 (21:14 +0000)]
Even more code conformance.

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

11 years agoMS wide bitfield error check in Sema
Reid Kleckner [Wed, 17 Jul 2013 20:46:03 +0000 (20:46 +0000)]
MS wide bitfield error check in Sema

cl.exe treats wide bitfields as an error. This patch causes them to be
an error if IsMsStruct is true, as it is in straight C.

Patch by Warren Hunt!

Reviewers: eli.friedman

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

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

11 years agoclang-format: Add space in corner case.
Daniel Jasper [Wed, 17 Jul 2013 20:25:02 +0000 (20:25 +0000)]
clang-format: Add space in corner case.

Before:
  SomeType s __attribute__((unused))(InitValue);
After:
  SomeType s __attribute__((unused)) (InitValue);

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

11 years agoConstify Replacements parameter to applyAllReplacements.
David Blaikie [Wed, 17 Jul 2013 18:29:58 +0000 (18:29 +0000)]
Constify Replacements parameter to applyAllReplacements.

http://llvm-reviews.chandlerc.com/D1169

Patch by Guillaume Papin.

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

11 years agoImprove idiomatic-parentheses by checking method family instead of relying on the...
Jean-Daniel Dupas [Wed, 17 Jul 2013 18:17:14 +0000 (18:17 +0000)]
Improve idiomatic-parentheses by checking method family instead of relying on the selector name.

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

11 years agoSemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.
NAKAMURA Takumi [Wed, 17 Jul 2013 17:57:52 +0000 (17:57 +0000)]
SemaDeclCXX.cpp: Dissolve a ligature "fi" in comment.

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

11 years agoFixed source range of C++03 access declarations.
Enea Zaffanella [Wed, 17 Jul 2013 17:28:56 +0000 (17:28 +0000)]
Fixed source range of C++03 access declarations.

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

11 years ago[analyzer] Handle C++11 member initializer expressions.
Jordan Rose [Wed, 17 Jul 2013 17:16:42 +0000 (17:16 +0000)]
[analyzer] Handle C++11 member initializer expressions.

Previously, we would simply abort the path when we saw a default member
initialization; now, we actually attempt to evaluate it. Like default
arguments, the contents of these expressions are not actually part of the
current function, so we fall back to constant evaluation.

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

11 years ago[analyzer] Handle C string default values for const char * arguments.
Jordan Rose [Wed, 17 Jul 2013 17:16:38 +0000 (17:16 +0000)]
[analyzer] Handle C string default values for const char * arguments.

Previously, SValBuilder knew how to evaluate StringLiterals, but couldn't
handle an array-to-pointer decay for constant values. Additionally,
RegionStore was being too strict about loading from an array, refusing to
return a 'char' value from a 'const char' array. Both of these have been
fixed.

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

11 years ago[analyzer] Treat std::initializer_list as opaque rather than aborting.
Jordan Rose [Wed, 17 Jul 2013 17:16:33 +0000 (17:16 +0000)]
[analyzer] Treat std::initializer_list as opaque rather than aborting.

Previously, the use of a std::initializer_list (actually, a
CXXStdInitializerListExpr) would cause the analyzer to give up on the rest
of the path. Now, it just uses an opaque symbolic value for the
initializer_list and continues on.

At some point in the future we can add proper support for initializer_list,
with access to the elements in the InitListExpr.

<rdar://problem/14340207>

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

11 years agoOption parsing tables: remove some unnecessary #defines
Hans Wennborg [Wed, 17 Jul 2013 16:54:06 +0000 (16:54 +0000)]
Option parsing tables: remove some unnecessary #defines

Also make some strings static and add missing #undef's

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

11 years agoImprove line breaking before multi-line strings.
Daniel Jasper [Wed, 17 Jul 2013 15:38:19 +0000 (15:38 +0000)]
Improve line breaking before multi-line strings.

The AlwaysBreakBeforeMultilineStrings rule does not really make sense
if it does not a column gain.

Before (in Google style):
  f(
      "aaaa"
      "bbbb");

After:
  f("aaaa"
    "bbbb");

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

11 years agoAdd TemplateArgument related matchers to the registry.
Samuel Benzaquen [Wed, 17 Jul 2013 15:11:30 +0000 (15:11 +0000)]
Add TemplateArgument related matchers to the registry.

Summary:
Continue adding more matchers to the dynamic registry.
This time, we add TemplateArgument matchers.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1166

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

11 years agoAdd CXXCtorInitializer related matchers to the dynamic matcher registry.
Samuel Benzaquen [Wed, 17 Jul 2013 14:28:00 +0000 (14:28 +0000)]
Add CXXCtorInitializer related matchers to the dynamic matcher registry.

Summary: Now that CXXCtorInitializer is already supported in ASTNodeKind, add CXXCtorInitializer matchers to the dynamic matcher registry.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1158

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

11 years agoReplace TEST* with CHECK-DAG in vbtable tests
Timur Iskhodzhanov [Wed, 17 Jul 2013 12:23:51 +0000 (12:23 +0000)]
Replace TEST* with CHECK-DAG in vbtable tests

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

11 years ago[analyzer] Add very limited support for temporary destructors
Pavel Labath [Wed, 17 Jul 2013 08:33:58 +0000 (08:33 +0000)]
[analyzer] Add very limited support for temporary destructors

Summary:
This patch enables ExprEndgine to reason about temporary object destructors.
However, these destructor calls are never inlined, since this feature is still
broken. Still, this is sufficient to properly handle noreturn temporary
destructors and close bug #15599. I have also enabled the cfg-temporary-dtors
analyzer option by default.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1131

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

11 years agoclang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.
NAKAMURA Takumi [Wed, 17 Jul 2013 06:39:40 +0000 (06:39 +0000)]
clang/test/CodeGen/volatile-complex.c: Loosen CHECKs for -Asserts.

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

11 years agoPropagate alignment for _Complex
JF Bastien [Wed, 17 Jul 2013 05:57:42 +0000 (05:57 +0000)]
Propagate alignment for _Complex

_Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex.

Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part).

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

11 years agoUse the simpler is_directory.
Rafael Espindola [Wed, 17 Jul 2013 04:23:07 +0000 (04:23 +0000)]
Use the simpler is_directory.

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

11 years agoMore code conformance.
Fariborz Jahanian [Wed, 17 Jul 2013 00:05:08 +0000 (00:05 +0000)]
More code conformance.

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

11 years agoObjectiveC migrator: When adding conforming protocol,
Fariborz Jahanian [Wed, 17 Jul 2013 00:02:22 +0000 (00:02 +0000)]
ObjectiveC migrator: When adding conforming protocol,
only add outer-most conforming protocols as adding
others are redundant.

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

11 years agoAvoid breaking non-trailing block comments.
Alexander Kornienko [Tue, 16 Jul 2013 23:47:22 +0000 (23:47 +0000)]
Avoid breaking non-trailing block comments.

Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);

Formatting before the patch:
void ffffffffffff(int aaaaaa /* test
                              */);

Formatting after the patch:
void
ffffffffffff(int aaaaaa /* test */);

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

11 years agoFollow coding convention in argument decl.
Fariborz Jahanian [Tue, 16 Jul 2013 23:01:33 +0000 (23:01 +0000)]
Follow coding convention in argument decl.

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

11 years agoMake Expr::isConstantInitializer match IRGen.
Eli Friedman [Tue, 16 Jul 2013 22:40:53 +0000 (22:40 +0000)]
Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++.  This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

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

11 years ago[arcmt] Remove some dead code.
Argyrios Kyrtzidis [Tue, 16 Jul 2013 22:24:06 +0000 (22:24 +0000)]
[arcmt] Remove some dead code.

Patch by Rafael EspĂ­ndola.

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

11 years agoObjectiveC migrator. If a class implements a protocol's
Fariborz Jahanian [Tue, 16 Jul 2013 21:59:42 +0000 (21:59 +0000)]
ObjectiveC migrator. If a class implements a protocol's
properties, then class conforms to that protocol.

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

11 years agoDon't break line comments with escaped newlines.
Alexander Kornienko [Tue, 16 Jul 2013 21:06:13 +0000 (21:06 +0000)]
Don't break line comments with escaped newlines.

Summary:
These can appear when comments contain command lines with quoted line
breaks. As the text (including escaped newlines and '//' from consecutive lines)
is a single line comment, we used to break it even when it didn't exceed column
limit. This is a temporary solution, in the future we may want to support this
case completely - at least adjust leading whitespace when changing indentation
of the first line.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1146

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

11 years agoclang-format: Improve handling of unterminated string literals.
Daniel Jasper [Tue, 16 Jul 2013 20:28:33 +0000 (20:28 +0000)]
clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

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

11 years agoFix crash on complex constant zero.
Eli Friedman [Tue, 16 Jul 2013 20:19:04 +0000 (20:19 +0000)]
Fix crash on complex constant zero.

Fixes <rdar://problem/14442543>.

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

11 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 16 Jul 2013 19:44:23 +0000 (19:44 +0000)]
Update for llvm API change.

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

11 years agoObjectiveC migration: complete migrating class
Fariborz Jahanian [Tue, 16 Jul 2013 18:58:41 +0000 (18:58 +0000)]
ObjectiveC migration: complete migrating class
declaration to include list of protocols class
conforms to.

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

11 years agoFileCheckize test/Driver/immediate-options.c
Hans Wennborg [Tue, 16 Jul 2013 18:27:29 +0000 (18:27 +0000)]
FileCheckize test/Driver/immediate-options.c

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

11 years agoFix formatting. No functional change.
Craig Topper [Tue, 16 Jul 2013 18:27:27 +0000 (18:27 +0000)]
Fix formatting. No functional change.

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

11 years agoRevamp the formatting of C++11 braced init lists.
Daniel Jasper [Tue, 16 Jul 2013 18:22:10 +0000 (18:22 +0000)]
Revamp the formatting of C++11 braced init lists.

The fundamental concept is:
Format as if the braced init list was a function call (with parentheses
replaced by braces). If there is no name/type before the opening brace
(e.g. if the braced list is nested), assume a zero-length identifier
just before the opening brace.

This behavior is gated on a new style flag, which for now replaces the
SpacesInBracedLists style flag. Activate this style flag for Google
style to reflect recent style guide changes.

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

11 years agoAdd more types to ASTNodeKind. Refactor common instantiation code.
Samuel Benzaquen [Tue, 16 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Add more types to ASTNodeKind. Refactor common instantiation code.

Summary:
Add support for CXXCtorInitializer and TemplateArgument types to ASTNodeKind.
This change is to support more matchers from clang/ASTMatchers/ASTMatchers.h in the dynamic layer (clang/ASTMatchers/Dynamic).

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1143

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

11 years agoThis patch removes unused parameter allProperties and converts remaining
Fariborz Jahanian [Tue, 16 Jul 2013 15:33:19 +0000 (15:33 +0000)]
This patch removes unused parameter allProperties and converts remaining
parameters in ArrayRef'ize Sema::ActOnAtEnd  to ArrayRef.
Patch by Robert Wilhelm.

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

11 years agoRemove unnecessary assignment.
Manuel Klimek [Tue, 16 Jul 2013 13:58:44 +0000 (13:58 +0000)]
Remove unnecessary assignment.

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

11 years agoFixes another hard to test problem with iterator invalidation.
Manuel Klimek [Tue, 16 Jul 2013 13:20:30 +0000 (13:20 +0000)]
Fixes another hard to test problem with iterator invalidation.

As every match call can recursively call back into the memoized match
via a nested traversal matcher (for example:
stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))),
and every memoization step might clear the cache, we must not store
iterators into the result cache when calling match on a submatcher.

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

11 years agoclang-format: Improve detection of function types.
Daniel Jasper [Tue, 16 Jul 2013 11:37:21 +0000 (11:37 +0000)]
clang-format: Improve detection of function types.

This fixes an incorrect detection that led to a formatting error.
Before:
  some_var = function (*some_pointer_var)[0];
After:
  some_var = function(*some_pointer_var)[0];

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

11 years agoFix test on release builds.
Tim Northover [Tue, 16 Jul 2013 10:22:19 +0000 (10:22 +0000)]
Fix test on release builds.

Unfortunately I don't think there's a good way to validate branch targets on
release builds. Fortunately it's a minor part of this test (and based on
generic code) so I don't mind dropping it.

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

11 years agoARM: implement low-level intrinsics for the atomic exclusive operations.
Tim Northover [Tue, 16 Jul 2013 09:47:53 +0000 (09:47 +0000)]
ARM: implement low-level intrinsics for the atomic exclusive operations.

This adds three overloaded intrinsics to Clang:
    T __builtin_arm_ldrex(const volatile T *addr)
    int __builtin_arm_strex(T val, volatile T *addr)
    void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

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

11 years agoLimit number of bits in size representation so that bit size fit 64 bits.
Serge Pavlov [Tue, 16 Jul 2013 07:14:18 +0000 (07:14 +0000)]
Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.

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