Commit Graph

30500 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 6f722b4eb9 [modules] When building a module, make sure we don't serialize out HeaderFileInfo for headers not belonging to the module.
After r180934 we may initiate module map parsing for modules not related to the module what we are building,
make sure we ignore the header file info of headers from such modules.

First part of rdar://13840148

llvm-svn: 181489
2013-05-08 23:46:46 +00:00
Adrian Prantl c20237d21f typo
llvm-svn: 181485
2013-05-08 23:37:22 +00:00
Dmitri Gribenko 6c96ba2dc0 Comment: use \code...\endcode for code examples
llvm-svn: 181481
2013-05-08 23:09:44 +00:00
Fariborz Jahanian 7e548f70e8 unbreak buildbot.
llvm-svn: 181479
2013-05-08 22:52:20 +00:00
Fariborz Jahanian aa9b280c79 [doc parsing]: Also do typo correction for
dynamically registered commands. 
// rdar://12381408

llvm-svn: 181477
2013-05-08 22:14:28 +00:00
Fariborz Jahanian ebb262f79c Turn off a warning caused by my last patch.
llvm-svn: 181464
2013-05-08 20:29:57 +00:00
Fariborz Jahanian 6c7a16666d documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug. 
// rdar://12381408

llvm-svn: 181458
2013-05-08 19:21:00 +00:00
Daniel Jasper 2f34cacc3b Further fix to pointer to member formatting.
With style where the *s go with the type:
Before: typedef bool* (Class:: *Member)() const;
After:  typedef bool* (Class::*Member)() const;

llvm-svn: 181439
2013-05-08 15:06:58 +00:00
Daniel Jasper cfda517ea8 Fix formatting of pointers to members.
Before: int(S::*func)(void *);
After:  int (S::*func)(void *);
llvm-svn: 181438
2013-05-08 14:58:20 +00:00
Daniel Jasper d69fc77b9e Improve line breaking in binary expressions.
If the LHS of a binary expression is broken, clang-format should also
break after the operator as otherwise:
- The RHS can be easy to miss
- It can look as if clang-format doesn't understand operator precedence

Before:
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
                                 bbbbbbbbbbbbbbbbbb && ccccccccc == ddddddddddd;
After:
bool aaaaaaaaaaaaaaaaaaaaa =
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbb &&
    ccccccccc == ddddddddddd;

As an additional note, clang-format would also be ok with the following
formatting, it just has a higher penalty (IMO correctly so).
bool aaaaaaaaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !=
                                 bbbbbbbbbbbbbbbbbb &&
                             ccccccccc == ddddddddddd;

llvm-svn: 181430
2013-05-08 14:12:04 +00:00
Reid Kleckner e43f0fea15 Forward #pragma comment(lib/linker) through as flags metadata
Summary:
Most of this change is wiring the pragma all the way through from the
lexer, parser, and sema to codegen.  I considered adding a Decl AST node
for this, but it seemed too heavyweight.

Mach-O already uses a metadata flag called "Linker Options" to do this
kind of auto-linking.  This change follows that pattern.

LLVM knows how to forward the "Linker Options" metadata into the COFF
.drectve section where these flags belong.  ELF support is not
implemented, but possible.

This is related to auto-linking, which is http://llvm.org/PR13016.

CC: cfe-commits

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

llvm-svn: 181426
2013-05-08 13:44:39 +00:00
Daniel Jasper 0f0234e16e Change indentation of multi-line nested name specifiers.
Before:
aaaaaaaa::
    aaaaaaaa::
    aaaaaaaa();
After:
aaaaaaaa::
    aaaaaaaa::
        aaaaaaaa();

The reason for the change is that:
a) we are not sure which is better
b) it is a really rare edge case
c) it simplifies the code
d) it currently causes problems with memoization

llvm-svn: 181421
2013-05-08 10:00:18 +00:00
Timur Iskhodzhanov bb5a17e8fa Fix one FIXME in VTableBuilder
llvm-svn: 181396
2013-05-08 08:09:21 +00:00
David Blaikie b0b645cad1 Debug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and functions.
Basic support is implemented here - it still doesn't account for
declared-but-not-defined variables or functions. It cannot handle out of
order (declared, 'using', then defined) cases for variables, but can
handle that for functions (& can handle declared, 'using'd, and not
defined at all cases for types).

llvm-svn: 181393
2013-05-08 06:01:46 +00:00
John McCall 1b4259b53b In block enum-return inference, don't die on loads of enum lvalues.
More of rdar://13200889.

llvm-svn: 181390
2013-05-08 03:34:22 +00:00
Richard Smith a3d3bd215b C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
llvm-svn: 181388
2013-05-08 02:12:03 +00:00
Ted Kremenek cba4a0c593 [analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.
llvm-svn: 181385
2013-05-08 01:15:24 +00:00
Ted Kremenek 0e84ac83eb [analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
llvm-svn: 181384
2013-05-08 01:15:20 +00:00
Richard Smith 861b5b5aed C++1y constant expression evaluation: compound assignment support for floating-point and pointer types.
llvm-svn: 181376
2013-05-07 23:34:45 +00:00
Adrian Prantl 8f1fb6f03d The style guide prefers preincrement expressions :-)
llvm-svn: 181373
2013-05-07 22:41:09 +00:00
Adrian Prantl 95652c7ccb remove commented out code.
llvm-svn: 181372
2013-05-07 22:26:03 +00:00
Nick Lewycky d1b0df46f5 When typo correction produces an overloaded result when looking up a member,
return all the overloads instead of just picking the first possible declaration.
This removes an invalid note (and on occasion other invalid diagnostics) and
also makes clang's parsing recovery behave as if the text from its fixit were
applied.

llvm-svn: 181370
2013-05-07 22:14:37 +00:00
Richard Smith ea85232c40 Don't crash in IRGen if a conditional with 'throw' in one of its branches is
used as a branch condition.

llvm-svn: 181368
2013-05-07 21:53:22 +00:00
Richard Trieu 091872c5df Fix crash on invalid in template type diffing.
This is a fix for PR15895, where Clang will crash when trying to print a
template diff and the template uses an address of operator.  This resulted
from expecting a DeclRefExpr when the Expr could have also been
UnaryOperator->DeclRefExpr.

llvm-svn: 181365
2013-05-07 21:36:24 +00:00
Ted Kremenek 68a60451b3 [analyzer;alternate arrows] Fix inconsistencies in recorded location context when handling interprocedural paths.
llvm-svn: 181362
2013-05-07 21:12:06 +00:00
Ted Kremenek 1c382b2936 [analyzer; alternate arrows] add back recording whether we visited the first edge.
llvm-svn: 181361
2013-05-07 21:12:03 +00:00
Ted Kremenek abf617c27e [analyzer; alternate arrows] remove pruning of loop diagnostics.
llvm-svn: 181360
2013-05-07 21:12:00 +00:00
Ted Kremenek b48f5d9d56 [analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
llvm-svn: 181359
2013-05-07 21:11:57 +00:00
Ted Kremenek 3a865221c7 [analyzer; alternate arrows] include an edge from the "break" or "continue"
llvm-svn: 181358
2013-05-07 21:11:54 +00:00
Ted Kremenek f3510071f3 [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.
llvm-svn: 181357
2013-05-07 21:11:52 +00:00
Ted Kremenek 2f2a3042e1 [analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.
llvm-svn: 181356
2013-05-07 21:11:49 +00:00
Argyrios Kyrtzidis c64c029f85 Try to recognise hidden tag type names in potential declarations, in ObjC code as well.
rdar://13829073

llvm-svn: 181345
2013-05-07 19:54:28 +00:00
Richard Smith 0a715429b9 C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.

llvm-svn: 181342
2013-05-07 19:32:56 +00:00
Anna Zaks e5e416c6de [analyzer] Fix a crash triggered by printing a note on a default argument
Instead, use the location of the call to print the note.

llvm-svn: 181337
2013-05-07 17:42:42 +00:00
Ted Kremenek ae7c38ddc7 [analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.
llvm-svn: 181333
2013-05-07 17:02:41 +00:00
Serge Pavlov 64bc7038a2 Test commit
llvm-svn: 181332
2013-05-07 16:56:03 +00:00
Alexander Kornienko d6538338fd Config file support for clang-format, part 1.
Summary:
Added parseConfiguration method, which reads FormatStyle from YAML
string. This supports all FormatStyle fields and an additional BasedOnStyle
field, which can be used to specify base style.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 181326
2013-05-07 15:32:14 +00:00
Daniel Jasper 990ff9729b Correctly recognize dereference after 'delete'.
With certain styles:
Before: delete* x;
After:  delete *x;

llvm-svn: 181318
2013-05-07 14:17:18 +00:00
Ted Kremenek 75b8cdee19 [analyzer; alternate edges] simplify optimization rules to look at control-flow conditions to prune edges.
llvm-svn: 181292
2013-05-07 07:30:07 +00:00
Ted Kremenek 868b55336e [analyzer; alternate arrows] use the terminator condition as the location for 'entering loop body'
llvm-svn: 181291
2013-05-07 07:30:00 +00:00
John McCall 6054d5aa7b Weaken an assertion in memcpyization to account for
unnamed bitfields.

Unnamed bitfields won't have an explicit copy operation
in the AST, which breaks the strong form of the invariant.

rdar://13816940

llvm-svn: 181289
2013-05-07 05:20:46 +00:00
Richard Smith 43e77733c2 C++1y constant expression evaluation: support for compound assignments on integers.
llvm-svn: 181287
2013-05-07 04:50:00 +00:00
Argyrios Kyrtzidis d391046930 Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location
when the the FileID is for an empty file.

rdar://13803893

llvm-svn: 181285
2013-05-07 04:29:22 +00:00
Richard Smith 99005e65cd C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.
llvm-svn: 181284
2013-05-07 03:19:20 +00:00
Ted Kremenek fe516f8924 [analyzer; alternate arrows] provide a diagnostic for entering a loop for the first time.
llvm-svn: 181282
2013-05-07 01:18:10 +00:00
David Blaikie fd5aa13549 DebugInfo: Support imported modules (using directives) within lexical blocks.
llvm-svn: 181272
2013-05-06 23:33:13 +00:00
Ted Kremenek 9af6baaaa3 [analyzer; alternate arrows] don't increment the path iterator when we just deleted the next iterator.
This is an optimization.  It is possible that by deleting the next
edge we will pattern match again at the current spot.

llvm-svn: 181256
2013-05-06 21:59:37 +00:00
John McCall d25db7ed0f Grab-bag of bit-field fixes:
- References to ObjC bit-field ivars are bit-field lvalues;
    fixes rdar://13794269, which got me started down this.
  - Introduce Expr::refersToBitField, switch a couple users to
    it where semantically important, and comment the difference
    between this and the existing API.
  - Discourage Expr::getBitField by making it a bit longer and
    less general-sounding.
  - Lock down on const_casts of bit-field gl-values until we
    hear back from the committee as to whether they're allowed.

llvm-svn: 181252
2013-05-06 21:39:12 +00:00
Richard Smith 252a0acce2 Add missing initialization for Sema::CurScope. This is important for AST consumers which don't create a Parser. Pointed out by Tom Honermann.
llvm-svn: 181251
2013-05-06 21:35:35 +00:00
Reid Kleckner 002562a8c1 Move PragmaCommentHandler to lib/Parse in preparation for calling Sema
Summary:
No functionality change.  The existing tests for this pragma only verify
that we can preprocess it.

Reviewers: rsmith

CC: cfe-commits

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

llvm-svn: 181246
2013-05-06 21:02:12 +00:00