]> granicus.if.org Git - clang/log
clang
11 years ago[PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
Argyrios Kyrtzidis [Wed, 8 May 2013 23:46:55 +0000 (23:46 +0000)]
[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

11 years ago[modules] When building a module, make sure we don't serialize out HeaderFileInfo...
Argyrios Kyrtzidis [Wed, 8 May 2013 23:46:46 +0000 (23:46 +0000)]
[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

11 years agoput noisy "unknown command tag name" warning
Fariborz Jahanian [Wed, 8 May 2013 23:38:56 +0000 (23:38 +0000)]
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

11 years agotypo
Adrian Prantl [Wed, 8 May 2013 23:37:22 +0000 (23:37 +0000)]
typo

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

11 years agoComment: use \code...\endcode for code examples
Dmitri Gribenko [Wed, 8 May 2013 23:09:44 +0000 (23:09 +0000)]
Comment: use \code...\endcode for code examples

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

11 years agoAll -Wdocumentation warnings are DefaultIgnore
Dmitri Gribenko [Wed, 8 May 2013 22:54:41 +0000 (22:54 +0000)]
All -Wdocumentation warnings are DefaultIgnore

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

11 years agounbreak buildbot.
Fariborz Jahanian [Wed, 8 May 2013 22:52:20 +0000 (22:52 +0000)]
unbreak buildbot.

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

11 years ago[doc parsing]: Also do typo correction for
Fariborz Jahanian [Wed, 8 May 2013 22:14:28 +0000 (22:14 +0000)]
[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

11 years agoFix test in two ways: remove incorrect comment (the intrinsic generated now
Eli Bendersky [Wed, 8 May 2013 20:58:01 +0000 (20:58 +0000)]
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

11 years agoAdd missing triple to unit test.
Richard Smith [Wed, 8 May 2013 20:32:14 +0000 (20:32 +0000)]
Add missing triple to unit test.

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

11 years agoTurn off a warning caused by my last patch.
Fariborz Jahanian [Wed, 8 May 2013 20:29:57 +0000 (20:29 +0000)]
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

11 years agodocumentation parsing. Patch to do typo correction for
Fariborz Jahanian [Wed, 8 May 2013 19:21:00 +0000 (19:21 +0000)]
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

11 years agoFurther fix to pointer to member formatting.
Daniel Jasper [Wed, 8 May 2013 15:06:58 +0000 (15:06 +0000)]
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

11 years agoFix formatting of pointers to members.
Daniel Jasper [Wed, 8 May 2013 14:58:20 +0000 (14:58 +0000)]
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

11 years agoDocument Clang's support for #pragma comment(lib/linker) with -fms-extensions
Reid Kleckner [Wed, 8 May 2013 14:40:51 +0000 (14:40 +0000)]
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

11 years agoImprove line breaking in binary expressions.
Daniel Jasper [Wed, 8 May 2013 14:12:04 +0000 (14:12 +0000)]
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

11 years agoForward #pragma comment(lib/linker) through as flags metadata
Reid Kleckner [Wed, 8 May 2013 13:44:39 +0000 (13:44 +0000)]
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

11 years agoChange indentation of multi-line nested name specifiers.
Daniel Jasper [Wed, 8 May 2013 10:00:18 +0000 (10:00 +0000)]
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

11 years agoFix one FIXME in VTableBuilder
Timur Iskhodzhanov [Wed, 8 May 2013 08:09:21 +0000 (08:09 +0000)]
Fix one FIXME in VTableBuilder

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

11 years agoDebug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and...
David Blaikie [Wed, 8 May 2013 06:01:46 +0000 (06:01 +0000)]
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

11 years agoIn block enum-return inference, don't die on loads of enum lvalues.
John McCall [Wed, 8 May 2013 03:34:22 +0000 (03:34 +0000)]
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

11 years agoAdd test forgotten in r181388.
Richard Smith [Wed, 8 May 2013 02:38:36 +0000 (02:38 +0000)]
Add test forgotten in r181388.

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

11 years agoC++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
Richard Smith [Wed, 8 May 2013 02:12:03 +0000 (02:12 +0000)]
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

11 years ago[analyzer; alternate edges] insert an extra edge for 'for' statements to conditions.
Ted Kremenek [Wed, 8 May 2013 01:15:24 +0000 (01:15 +0000)]
[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

11 years ago[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
Ted Kremenek [Wed, 8 May 2013 01:15:20 +0000 (01:15 +0000)]
[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

11 years agoC++1y constant expression evaluation: compound assignment support for floating-point...
Richard Smith [Tue, 7 May 2013 23:34:45 +0000 (23:34 +0000)]
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

11 years agoThe style guide prefers preincrement expressions :-)
Adrian Prantl [Tue, 7 May 2013 22:41:09 +0000 (22:41 +0000)]
The style guide prefers preincrement expressions :-)

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

11 years agoremove commented out code.
Adrian Prantl [Tue, 7 May 2013 22:26:03 +0000 (22:26 +0000)]
remove commented out code.

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

11 years agoWhen typo correction produces an overloaded result when looking up a member,
Nick Lewycky [Tue, 7 May 2013 22:14:37 +0000 (22:14 +0000)]
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

11 years agoDon't crash in IRGen if a conditional with 'throw' in one of its branches is
Richard Smith [Tue, 7 May 2013 21:53:22 +0000 (21:53 +0000)]
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

11 years agoFix crash on invalid in template type diffing.
Richard Trieu [Tue, 7 May 2013 21:36:24 +0000 (21:36 +0000)]
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

11 years ago[analyzer;alternate arrows] Fix inconsistencies in recorded location context when...
Ted Kremenek [Tue, 7 May 2013 21:12:06 +0000 (21:12 +0000)]
[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

11 years ago[analyzer; alternate arrows] add back recording whether we visited the first edge.
Ted Kremenek [Tue, 7 May 2013 21:12:03 +0000 (21:12 +0000)]
[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

11 years ago[analyzer; alternate arrows] remove pruning of loop diagnostics.
Ted Kremenek [Tue, 7 May 2013 21:12:00 +0000 (21:12 +0000)]
[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

11 years ago[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
Ted Kremenek [Tue, 7 May 2013 21:11:57 +0000 (21:11 +0000)]
[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

11 years ago[analyzer; alternate arrows] include an edge from the "break" or "continue"
Ted Kremenek [Tue, 7 May 2013 21:11:54 +0000 (21:11 +0000)]
[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

11 years ago[analyzer; alternate arrows] the extra edge to the closing '}' in a loop adds no...
Ted Kremenek [Tue, 7 May 2013 21:11:52 +0000 (21:11 +0000)]
[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

11 years ago[analyzer; alternate arrows] the initializer of a ForStmt isn't interesting either.
Ted Kremenek [Tue, 7 May 2013 21:11:49 +0000 (21:11 +0000)]
[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

11 years ago[libclang] Add a null check in CursorVisitor::visitPreprocessedEntities.
Argyrios Kyrtzidis [Tue, 7 May 2013 20:37:17 +0000 (20:37 +0000)]
[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

11 years agoWe're in 3.4 land now.
Bill Wendling [Tue, 7 May 2013 20:31:37 +0000 (20:31 +0000)]
We're in 3.4 land now.

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

11 years agoTry to recognise hidden tag type names in potential declarations, in ObjC code as...
Argyrios Kyrtzidis [Tue, 7 May 2013 19:54:28 +0000 (19:54 +0000)]
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

11 years agoC++1y: Update __cplusplus to temporary value 201305L to allow detection of provisiona...
Richard Smith [Tue, 7 May 2013 19:32:56 +0000 (19:32 +0000)]
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

11 years ago[analyzer] Fix a crash triggered by printing a note on a default argument
Anna Zaks [Tue, 7 May 2013 17:42:42 +0000 (17:42 +0000)]
[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

11 years ago[analyzer; alternate arrows] The ForStmt increment is not a critical anchor for arrows.
Ted Kremenek [Tue, 7 May 2013 17:02:41 +0000 (17:02 +0000)]
[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

11 years agoTest commit
Serge Pavlov [Tue, 7 May 2013 16:56:03 +0000 (16:56 +0000)]
Test commit

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

11 years agoPrevent crashes from hasCanonicalType matcher
Edwin Vane [Tue, 7 May 2013 15:53:23 +0000 (15:53 +0000)]
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

11 years agoConfig file support for clang-format, part 1.
Alexander Kornienko [Tue, 7 May 2013 15:32:14 +0000 (15:32 +0000)]
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

11 years agoCorrectly recognize dereference after 'delete'.
Daniel Jasper [Tue, 7 May 2013 14:17:18 +0000 (14:17 +0000)]
Correctly recognize dereference after 'delete'.

With certain styles:
Before: delete* x;
After:  delete *x;

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

11 years agoFurther fix to clang-format emacs integration.
Daniel Jasper [Tue, 7 May 2013 10:04:47 +0000 (10:04 +0000)]
Further fix to clang-format emacs integration.

This is just a slight improvement for the fix in r181299, which fixes
formatting the very last line of a file.

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

11 years agoFix clang-format emacs integration in last line.
Daniel Jasper [Tue, 7 May 2013 09:25:29 +0000 (09:25 +0000)]
Fix clang-format emacs integration in last line.

Emacs seems to have a line that is just past the last character of the
buffers content. This needs to be handled specially so that clang-format
is not called with an invalid -offset.

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

11 years ago[analyzer; alternate edges] simplify optimization rules to look at control-flow condi...
Ted Kremenek [Tue, 7 May 2013 07:30:07 +0000 (07:30 +0000)]
[analyzer; alternate edges] simplify optimization rules to look at control-flow conditions to prune edges.

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

11 years ago[analyzer; alternate arrows] use the terminator condition as the location for 'enteri...
Ted Kremenek [Tue, 7 May 2013 07:30:00 +0000 (07:30 +0000)]
[analyzer; alternate arrows] use the terminator condition as the location for 'entering loop body'

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

11 years agoWeaken an assertion in memcpyization to account for
John McCall [Tue, 7 May 2013 05:20:46 +0000 (05:20 +0000)]
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

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

11 years agoC++1y constant expression evaluation: support for compound assignments on integers.
Richard Smith [Tue, 7 May 2013 04:50:00 +0000 (04:50 +0000)]
C++1y constant expression evaluation: support for compound assignments on integers.

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

11 years agoHave SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
Argyrios Kyrtzidis [Tue, 7 May 2013 04:29:22 +0000 (04:29 +0000)]
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

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

11 years agoC++1y: an assignment operator is implicitly 'constexpr' if it would only call 'conste...
Richard Smith [Tue, 7 May 2013 03:19:20 +0000 (03:19 +0000)]
C++1y: an assignment operator is implicitly 'constexpr' if it would only call 'constexpr' assignment operators for a literal class type.

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

11 years agoC++ status:
Richard Smith [Tue, 7 May 2013 02:55:48 +0000 (02:55 +0000)]
C++ status:
 - fix paper links to point to isocpp.org, where most of the papers are already up
 - update "SVN" features to "Clang 3.3" to distinguish them from features which we
   complete after the branch
 - document use of -std=c++1y to enable c++1y support

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

11 years ago[analyzer; alternate arrows] provide a diagnostic for entering a loop for the first...
Ted Kremenek [Tue, 7 May 2013 01:18:10 +0000 (01:18 +0000)]
[analyzer; alternate arrows] provide a diagnostic for entering a loop for the first time.

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

11 years agoDebugInfo: Support imported modules (using directives) within lexical blocks.
David Blaikie [Mon, 6 May 2013 23:33:13 +0000 (23:33 +0000)]
DebugInfo: Support imported modules (using directives) within lexical blocks.

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

11 years ago[analyzer; alternate arrows] don't increment the path iterator when we just deleted...
Ted Kremenek [Mon, 6 May 2013 21:59:37 +0000 (21:59 +0000)]
[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.

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

11 years agoGrab-bag of bit-field fixes:
John McCall [Mon, 6 May 2013 21:39:12 +0000 (21:39 +0000)]
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.

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

11 years agoAdd missing initialization for Sema::CurScope. This is important for AST consumers...
Richard Smith [Mon, 6 May 2013 21:35:35 +0000 (21:35 +0000)]
Add missing initialization for Sema::CurScope. This is important for AST consumers which don't create a Parser. Pointed out by Tom Honermann.

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

11 years agoMove PragmaCommentHandler to lib/Parse in preparation for calling Sema
Reid Kleckner [Mon, 6 May 2013 21:02:12 +0000 (21:02 +0000)]
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

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

11 years agoModify ASTReaderListener to allow visiting the input files of an AST file.
Argyrios Kyrtzidis [Mon, 6 May 2013 19:23:40 +0000 (19:23 +0000)]
Modify ASTReaderListener to allow visiting the input files of an AST file.

We can pass such an input-file-visiting ASTReaderListener to ASTReader::readASTFileControlBlock.

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

11 years agoHave the RecursiveASTVisitor traverse the type source info of an objc class message.
Argyrios Kyrtzidis [Mon, 6 May 2013 19:08:57 +0000 (19:08 +0000)]
Have the RecursiveASTVisitor traverse the type source info of an objc class message.

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

11 years ago[analyzer] Remove now-unused bindCompoundLiteral helper function.
Jordan Rose [Mon, 6 May 2013 16:48:26 +0000 (16:48 +0000)]
[analyzer] Remove now-unused bindCompoundLiteral helper function.

The one user has been changed to use getLValue on the compound literal
expression and then use the normal bindLoc to assign a value. No need
to special case this in the StoreManager.

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

11 years ago[analyzer] Handle CXXTemporaryObjectExprs in compound literals.
Jordan Rose [Mon, 6 May 2013 16:48:20 +0000 (16:48 +0000)]
[analyzer] Handle CXXTemporaryObjectExprs in compound literals.

This occurs because in C++11 the compound literal syntax can trigger a
constructor call via list-initialization. That is, "Point{x, y}" and
"(Point){x, y}" end up being equivalent. If this occurs, the inner
CXXConstructExpr will have already handled the object construction; the
CompoundLiteralExpr just needs to propagate that value forwards.

<rdar://problem/13804098>

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

11 years agoFix representation of compound literals for C++ objects with destructors.
Jordan Rose [Mon, 6 May 2013 16:48:12 +0000 (16:48 +0000)]
Fix representation of compound literals for C++ objects with destructors.

Previously, this compound literal expression (a GNU extension in C++):

  (AggregateWithDtor){1, 2}

resulted in this AST:

 `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
   `-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
     `-CXXBindTemporaryExpr [...] 'struct AggregateWithDtor' (CXXTemporary [...])
       `-InitListExpr [...] 'struct AggregateWithDtor'
         |-IntegerLiteral [...] 'int' 1
         `-IntegerLiteral [...] 'int' 2

Note the two CXXBindTemporaryExprs. The InitListExpr is really part of the
CompoundLiteralExpr, not an object in its own right. By introducing a new
entity initialization kind in Sema specifically for compound literals, we
avoid the treatment of the inner InitListExpr as a temporary.

 `-CXXBindTemporaryExpr [...] 'struct Point' (CXXTemporary [...])
   `-CompoundLiteralExpr [...] 'struct AggregateWithDtor'
     `-InitListExpr [...] 'struct AggregateWithDtor'
       |-IntegerLiteral [...] 'int' 1
       `-IntegerLiteral [...] 'int' 2

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

11 years agoAdd SystemZ support
Ulrich Weigand [Mon, 6 May 2013 16:26:41 +0000 (16:26 +0000)]
Add SystemZ support

This patch then adds all the usual platform-specific pieces for SystemZ:
driver support, basic target info, register names and constraints,
ABI info and vararg support.  It also adds new tests to verify pre-defined
macros and inline asm, and updates a test for the minimum alignment change.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

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

11 years agoAllow targets to define minimum alignment for global variables
Ulrich Weigand [Mon, 6 May 2013 16:23:57 +0000 (16:23 +0000)]
Allow targets to define minimum alignment for global variables

This patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols.  The background for this is
that on SystemZ, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction.  This instruction
provides PC-relative addressing, but only to *even* addresses.  For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2.  [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ]  GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, this patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting.  Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

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

11 years agoR600: Update GPU variants in -mcpu option
Tom Stellard [Mon, 6 May 2013 16:12:05 +0000 (16:12 +0000)]
R600: Update GPU variants in -mcpu option

We've added the RS880 variant in the LLVM backend to represent an R600
GPU with no vertex cache, so we need to update the GPU mappings for
-mcpu.

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

11 years agoRemove forward slashes from check; should unbreak Windows buildbots.
Douglas Gregor [Mon, 6 May 2013 15:42:15 +0000 (15:42 +0000)]
Remove forward slashes from check; should unbreak Windows buildbots.

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

11 years agoAdd llvm_unreachable at end of fully covered switch
Hans Wennborg [Mon, 6 May 2013 15:13:34 +0000 (15:13 +0000)]
Add llvm_unreachable at end of fully covered switch

To pacify GCC warning about control reaching end of non-void function.

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

11 years agoAdded Mozilla style, cleaned get*Style methods.
Alexander Kornienko [Mon, 6 May 2013 14:11:27 +0000 (14:11 +0000)]
Added Mozilla style, cleaned get*Style methods.

Summary: Patch based on a patch by Ehsan Akhgari.

Reviewers: djasper

Reviewed By: djasper

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

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

11 years agoDon't break comments after includes.
Daniel Jasper [Mon, 6 May 2013 10:24:51 +0000 (10:24 +0000)]
Don't break comments after includes.

LLVM/Clang basically don't use such comments and for Google-style,
include-lines are explicitly exempt from the column limit. Also, for
most cases, where the column limit is violated, the "better" solution
would be to move the comment to before the include, which clang-format
cannot do (yet).

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

11 years agoChange indentation when breaking after a type.
Daniel Jasper [Mon, 6 May 2013 08:27:33 +0000 (08:27 +0000)]
Change indentation when breaking after a type.

clang-format did not indent any declarations/definitions when breaking
after the type. With this change, it indents for all declarations but
does not indent for function definitions, i.e.:

Before:
const SomeLongTypeName&
some_long_variable_name;
typedef SomeLongTypeName
SomeLongTypeAlias;
const SomeLongReturnType*
SomeLongFunctionName();
const SomeLongReturnType*
SomeLongFunctionName() { ... }

After:
const SomeLongTypeName&
    some_long_variable_name;
typedef SomeLongTypeName
    SomeLongTypeAlias;
const SomeLongReturnType*
    SomeLongFunctionName();
const SomeLongReturnType*
SomeLongFunctionName() { ... }

While it might seem inconsistent to indent function declarations, but
not definitions, there are two reasons for that:
- Function declarations are very similar to declarations of function
type variables, so there is another side to consistency to consider.
- There can be many function declarations on subsequent lines and not
indenting can make them harder to identify. Function definitions
are already separated by their body and not indenting
makes the function name slighly easier to find.

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

11 years agoRequire the containing type to be complete when we see
John McCall [Mon, 6 May 2013 07:40:34 +0000 (07:40 +0000)]
Require the containing type to be complete when we see
__alignof__ of a field.

This problem can only happen in C++11.

Also do some petty optimizations.

rdar://13784901

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

11 years agoC++1y: support range-based for loops in constant expressions.
Richard Smith [Mon, 6 May 2013 06:51:17 +0000 (06:51 +0000)]
C++1y: support range-based for loops in constant expressions.

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

11 years agoBreak the class-inheritance ":" to the new line.
Daniel Jasper [Mon, 6 May 2013 06:45:09 +0000 (06:45 +0000)]
Break the class-inheritance ":" to the new line.

This seems to be more common in LLVM, Google and Chromium.

Before:
class AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA :
    public BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
    public CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC {
};

After:
class AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    : public BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
      public CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC {
};

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

11 years agoDon't put a space before ellipsis.
Daniel Jasper [Mon, 6 May 2013 06:35:44 +0000 (06:35 +0000)]
Don't put a space before ellipsis.

Before: template <class ... Ts> void Foo(Ts ... ts) { Foo(ts ...); }
After:  template <class... Ts> void Foo(Ts... ts) { Foo(ts...); }

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

11 years agoC++1y: support 'for', 'while', and 'do ... while' in constant expressions.
Richard Smith [Mon, 6 May 2013 05:56:11 +0000 (05:56 +0000)]
C++1y: support 'for', 'while', and 'do ... while' in constant expressions.

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

11 years agoFix assert if __extension__ or _Generic is used when initializing a char array from...
Richard Smith [Mon, 6 May 2013 00:35:47 +0000 (00:35 +0000)]
Fix assert if __extension__ or _Generic is used when initializing a char array from a string literal.

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

11 years agoC++1y: support for increment and decrement in constant expression evaluation.
Richard Smith [Sun, 5 May 2013 23:31:59 +0000 (23:31 +0000)]
C++1y: support for increment and decrement in constant expression evaluation.

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

11 years agoFactor out duplication between lvalue-to-rvalue conversions and variable
Richard Smith [Sun, 5 May 2013 21:17:10 +0000 (21:17 +0000)]
Factor out duplication between lvalue-to-rvalue conversions and variable
assignments in constant expressions. No significant functionality changes
(slight improvement to potential constant expression checking).

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

11 years agoReplace 'MultiExprArg()' with 'None'
Dmitri Gribenko [Sun, 5 May 2013 20:40:26 +0000 (20:40 +0000)]
Replace 'MultiExprArg()' with 'None'

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

11 years agoMake all 'is in extern "C"' tests use the lexical context.
Rafael Espindola [Sun, 5 May 2013 20:15:21 +0000 (20:15 +0000)]
Make all 'is in extern "C"' tests use the lexical context.

I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.

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

11 years agoArrayRef'ize Sema::CheckObjCMethodCall
Dmitri Gribenko [Sun, 5 May 2013 19:42:09 +0000 (19:42 +0000)]
ArrayRef'ize Sema::CheckObjCMethodCall

Patch by Robert Wilhelm.

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

11 years agoUse lexical contexts when checking for conflicting language linkages.
Rafael Espindola [Sun, 5 May 2013 18:24:05 +0000 (18:24 +0000)]
Use lexical contexts when checking for conflicting language linkages.

This fixes pr14958. I will audit other calls to isExternCContext to see
if there are any similar bugs left.

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

11 years agoHandle parens properly when initializing a char array from a string literal.
Richard Smith [Sun, 5 May 2013 16:40:13 +0000 (16:40 +0000)]
Handle parens properly when initializing a char array from a string literal.

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

11 years agoArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!
Richard Smith [Sun, 5 May 2013 15:51:06 +0000 (15:51 +0000)]
ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!

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

11 years agoUse remove_if to erase parts of a vector. Avoids O(n^2) worst cases.
Benjamin Kramer [Sun, 5 May 2013 12:39:28 +0000 (12:39 +0000)]
Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.

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

11 years agoArrayRef<T>() -> None cleanup
Dmitri Gribenko [Sun, 5 May 2013 01:03:47 +0000 (01:03 +0000)]
ArrayRef<T>() -> None cleanup

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

11 years agoReplace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor...
Dmitri Gribenko [Sun, 5 May 2013 00:41:58 +0000 (00:41 +0000)]
Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.

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

11 years agoProperly parsing __declspec(safebuffers), though there is no semantic hookup. For...
Aaron Ballman [Sat, 4 May 2013 16:58:37 +0000 (16:58 +0000)]
Properly parsing __declspec(safebuffers), though there is no semantic hookup.  For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx

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

11 years agoReverting r181004 since it has broken test/Sema/wchar.c.
Aaron Ballman [Sat, 4 May 2013 16:56:22 +0000 (16:56 +0000)]
Reverting r181004 since it has broken test/Sema/wchar.c.

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

11 years agoMoved pretty printer test for thread local storage in its own file
Enea Zaffanella [Sat, 4 May 2013 11:26:59 +0000 (11:26 +0000)]
Moved pretty printer test for thread local storage in its own file
and specified the triple.

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

11 years agoLex: Fix quadratic behavior when unescaping _Pragma strings.
Benjamin Kramer [Sat, 4 May 2013 10:37:20 +0000 (10:37 +0000)]
Lex: Fix quadratic behavior when unescaping _Pragma strings.

No functionality change.

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

11 years agoIn VarDecl nodes, store the thread storage class specifier as written.
Enea Zaffanella [Sat, 4 May 2013 08:27:07 +0000 (08:27 +0000)]
In VarDecl nodes, store the thread storage class specifier as written.

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

11 years agoAArch64: teach Clang about __clear_cache intrinsic
Tim Northover [Sat, 4 May 2013 07:15:13 +0000 (07:15 +0000)]
AArch64: teach Clang about __clear_cache intrinsic

libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

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

11 years agoTweaks to C++ status: add a link to Faisal's generic lambdas implementation,
Richard Smith [Sat, 4 May 2013 07:12:37 +0000 (07:12 +0000)]
Tweaks to C++ status: add a link to Faisal's generic lambdas implementation,
and mark "clarifying memory allocation" as done, since it turns out that our
optimizations here (such as they are) already conform to the new rules.

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