Граф коммитов

44169 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 8841c532f2 [analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181504 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 06:55:35 +00:00
Ted Kremenek bded6eaeed Put some diagnostics in DiagnosticCommonKinds.td in a category, mirroring what they are in other .td files.
I really dislike the copy-pasting of the category strings.  If there is a better
way to do this with TableGen, please advise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181494 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 00:07:27 +00:00
Nico Weber d7ceab3f31 Objective-C: Correctly encode 'retain' and 'copy' for readonly properties.
clang would omit 'C' for 'copy' properties and '&' for 'retain' properties if
the property was also 'readonly'. Fix this, which makes clang match gcc4.2's
behavior.

Fixes PR15928.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181491 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:47:40 +00:00
Argyrios Kyrtzidis f9ba851c9b [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:46:55 +00:00
Argyrios Kyrtzidis d3220dbeea [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:46:46 +00:00
Fariborz Jahanian 5d2bb935af put noisy "unknown command tag name" warning
under -Wdocumentation-unknown-command and off by default.
patch by Dmitri Gribenko.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181487 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:38:56 +00:00
Adrian Prantl f06989b9f3 typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181485 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:37:22 +00:00
Dmitri Gribenko 41487f37d3 Comment: use \code...\endcode for code examples
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181481 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 23:09:44 +00:00
Dmitri Gribenko ef907b69ea All -Wdocumentation warnings are DefaultIgnore
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181480 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 22:54:41 +00:00
Fariborz Jahanian 5b382770ec unbreak buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 22:52:20 +00:00
Fariborz Jahanian ad91e5431f [doc parsing]: Also do typo correction for
dynamically registered commands. 
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181477 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 22:14:28 +00:00
Eli Bendersky 1c8f270a75 Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 20:58:01 +00:00
Richard Smith 7ba376be63 Add missing triple to unit test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181465 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 20:32:14 +00:00
Fariborz Jahanian abbfa67153 Turn off a warning caused by my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181464 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 20:29:57 +00:00
Fariborz Jahanian 0089bc4dde documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug. 
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 19:21:00 +00:00
Daniel Jasper 4b7b104c2c 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;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181439 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 15:06:58 +00:00
Daniel Jasper 395228fdc3 Fix formatting of pointers to members.
Before: int(S::*func)(void *);
After:  int (S::*func)(void *);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 14:58:20 +00:00
Reid Kleckner a518896372 Document Clang's support for #pragma comment(lib/linker) with -fms-extensions
As suggested by Dmitri Gribenko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 14:40:51 +00:00
Daniel Jasper 11e13801d8 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;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 14:12:04 +00:00
Reid Kleckner 3190ca922d 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 13:44:39 +00:00
Daniel Jasper b2f063aeb9 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 10:00:18 +00:00
Timur Iskhodzhanov 2fca8027fd Fix one FIXME in VTableBuilder
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181396 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 08:09:21 +00:00
David Blaikie 3923d6a87f 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 06:01:46 +00:00
John McCall 70133b5b4a In block enum-return inference, don't die on loads of enum lvalues.
More of rdar://13200889.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181390 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 03:34:22 +00:00
Richard Smith 384af4a723 Add test forgotten in r181388.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 02:38:36 +00:00
Richard Smith e756563500 C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181388 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 02:12:03 +00:00
Ted Kremenek aecda96617 [analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181385 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 01:15:24 +00:00
Ted Kremenek 8484b37a2b [analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181384 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 01:15:20 +00:00
Richard Smith a49a7fe2a7 C++1y constant expression evaluation: compound assignment support for floating-point and pointer types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181376 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 23:34:45 +00:00
Adrian Prantl ddb379ef3a The style guide prefers preincrement expressions :-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 22:41:09 +00:00
Adrian Prantl 4008088b00 remove commented out code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181372 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 22:26:03 +00:00
Nick Lewycky d9de51f83d 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181370 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 22:14:37 +00:00
Richard Smith 4c71b8cded Don't crash in IRGen if a conditional with 'throw' in one of its branches is
used as a branch condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:53:22 +00:00
Richard Trieu 28b34d86ba 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181365 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:36:24 +00:00
Ted Kremenek be0b207c49 [analyzer;alternate arrows] Fix inconsistencies in recorded location context when handling interprocedural paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:12:06 +00:00
Ted Kremenek f4bbb1d8c2 [analyzer; alternate arrows] add back recording whether we visited the first edge.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:12:03 +00:00
Ted Kremenek b17c2f7909 [analyzer; alternate arrows] remove pruning of loop diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:12:00 +00:00
Ted Kremenek 03194fb1bb [analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:11:57 +00:00
Ted Kremenek bc0fd81296 [analyzer; alternate arrows] include an edge from the "break" or "continue"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:11:54 +00:00
Ted Kremenek 98fb1cca0e [analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181357 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:11:52 +00:00
Ted Kremenek 96b8134337 [analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 21:11:49 +00:00
Argyrios Kyrtzidis 333e44c910 [libclang] Add a null check in CursorVisitor::visitPreprocessedEntities.
rdar://13680583

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 20:37:17 +00:00
Bill Wendling 35d06d2a69 We're in 3.4 land now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181351 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 20:31:37 +00:00
Argyrios Kyrtzidis 99e9fe08bb Try to recognise hidden tag type names in potential declarations, in ObjC code as well.
rdar://13829073

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 19:54:28 +00:00
Richard Smith 7f0ffb3a9f 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181342 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 19:32:56 +00:00
Anna Zaks 636478e288 [analyzer] Fix a crash triggered by printing a note on a default argument
Instead, use the location of the call to print the note.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181337 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 17:42:42 +00:00
Ted Kremenek e2f7337958 [analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 17:02:41 +00:00
Serge Pavlov 5068b6f6bd Test commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 16:56:03 +00:00
Edwin Vane 54eeac9cb5 Prevent crashes from hasCanonicalType matcher
Adding an QualType::isNull() check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 15:53:23 +00:00
Alexander Kornienko d71ec16fff 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181326 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 15:32:14 +00:00