Commit Graph

45317 Commits

Author SHA1 Message Date
David Blaikie 8039fdf48c DebugInfo: Simply & constrain test(s) for PR9600/PR9608
Both these tests were ultimately fixed by the check for
"isIncompleteType" & neither test case was really reduced to a minimal
form. On doing so it becomes apparent that the problem wasn't specific
to templates at all, so I've moved the test case to a more appropriate
test file and added FileCheck verification to it (to show the forward
declaration of the array element type as well as the array alignment and
size being 0 since it cannot be computed). That's about as far down this
rabbithole as I'm willing to go today, so the rest of the un-FileChecked
tests in test/CodeGenCXX/debug-info.cpp will have to go another day
without actually testing anything other than the fact that they don't
crash.

& improve the actually interesting test case in
test/CodeGenCXX/debug-info-templates.cpp which was my original goal (in
preparation for expanding it/fixing some related bugs in non-type
template parameters)

llvm-svn: 181552
2013-05-09 21:32:04 +00:00
Dmitri Gribenko f4d5bee616 Documentation warning: \param, not \parm
llvm-svn: 181550
2013-05-09 21:15:22 +00:00
Reid Kleckner b0f459e8ae Add pragma-comment.c test case for r181426 that I forgot to add
llvm-svn: 181546
2013-05-09 21:10:06 +00:00
Dmitri Gribenko 9c785c217b ArrayRef'ize some SemaOverload methods
Patch by Robert Wilhelm.

llvm-svn: 181544
2013-05-09 21:02:07 +00:00
Reid Kleckner 452abac4b3 [ms-cxxabi] Implement member pointer conversions
Summary:
This only supports converting along non-virtual inheritance paths by
changing the field offset or the non-virtual base adjustment.

This implements three kinds of conversions:
- codegen for Value conversions
- Constant emission for APValue
- Constant folding for CastExprs

In almost all constant initialization settings
EmitMemberPointer(APValue) is called, except when the expression
contains a reinterpret cast.

reinterpret casts end up being a big corner case because the null value
changes between different kinds of member pointers.

Reviewers: rsmith

CC: cfe-commits

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

llvm-svn: 181543
2013-05-09 21:01:17 +00:00
David Blaikie f03b2e8385 Debug Info: Remove unnecessary check for dependent array types
This was added, untested (though the relevant crash was tested), in
r128725/PR9600. Removing it doesn't cause failures & nothing I can
imagine could cause this check to ever return 'true' (we should never be
dealing with dependent types here). The subsequent change to check
"isIncompleteType" (r128855/PR9608) makes a lot more sense.

llvm-svn: 181542
2013-05-09 20:48:12 +00:00
Ben Langmuir 0698787d19 Fix captured statements codegen test on ARM
The return type of the destructor may vary between platforms, so stop
inadvertently testing it.

llvm-svn: 181541
2013-05-09 20:42:43 +00:00
Ben Langmuir 3b4c30b7e7 CodeGen for CapturedStmts
EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function.  This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function.  It is based
on GenerateBlockFunction, but is much simpler.  The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

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

llvm-svn: 181536
2013-05-09 19:17:11 +00:00
Richard Smith f2f6e114fd Switch C++1y paper links back to the canonical location at open-std.org now that the post-Bristol mailing has shipped.
llvm-svn: 181533
2013-05-09 18:53:17 +00:00
Richard Smith 8797d39fd9 Add testcase missed from r181527.
llvm-svn: 181531
2013-05-09 18:33:50 +00:00
Richard Smith 0646c86dcb Fix the return type of the complex creal functions. Patch by YunZhong Gao, modified to use _Static_assert and to check __STDC_HOSTED__ by me.
llvm-svn: 181527
2013-05-09 17:41:19 +00:00
David Blaikie e4a5588bcb Remove trailing whitespace
llvm-svn: 181525
2013-05-09 17:29:54 +00:00
Fariborz Jahanian 0321b8ffd6 [doc parsing]: make single character command impostures
warn in pedantic mode.

llvm-svn: 181523
2013-05-09 17:18:52 +00:00
Edwin Vane fc4f7dc0a6 Adding isConst() ASTMatcher for CXXMethodDecl nodes
Updated reference and unit tests.

llvm-svn: 181522
2013-05-09 17:00:17 +00:00
Fariborz Jahanian 395a6d4878 [doc parsing]: So, in this patch, single character
'commands' will not go through typo fixit logic,
preserving the old behavior (no typo, no diagnostics).
// rdar://12381408

llvm-svn: 181521
2013-05-09 16:44:02 +00:00
Edwin Vane c50e730d6e Updating LibASTMatchersReference to include namespaceDecl()
The namespaceDecl() ASTMatcher was added in r179027.

llvm-svn: 181519
2013-05-09 16:42:37 +00:00
Fariborz Jahanian e46dd48e9f [doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408 

llvm-svn: 181517
2013-05-09 16:22:31 +00:00
Benjamin Kramer 4baf67a61b xopintrin.h: Add wrappers for all flavors of _mm_com.
GCC defines only the wrappers, MSVC defines both, we define both now too.
PR15844.

llvm-svn: 181514
2013-05-09 15:07:46 +00:00
Benjamin Kramer fd57b195a3 Add include guards to prfchwintrin.h.
llvm-svn: 181513
2013-05-09 15:07:39 +00:00
Richard Smith 7525ff67f1 Implement C++1y constant initializer rules: in a constant initializer for an
object x, x's subobjects can be constructed by constexpr constructor even if
they are of non-literal type, and can be read and written even though they're
not members of a constexpr object or temporary.

llvm-svn: 181506
2013-05-09 07:14:00 +00:00
Ted Kremenek 399980acf5 [analyzer; alternate arrows] for "loop back" edges add back the extra edge to the closing '}'
llvm-svn: 181505
2013-05-09 06:55:41 +00:00
Ted Kremenek b5999f6321 [analyzer;alternate arrows] adapt 'for' loop aesthetic cleanup to 'while' loops.
llvm-svn: 181504
2013-05-09 06:55:35 +00:00
Ted Kremenek b613dfadcb 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.

llvm-svn: 181494
2013-05-09 00:07:27 +00:00
Nico Weber 4e8626f708 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.

llvm-svn: 181491
2013-05-08 23:47:40 +00:00
Argyrios Kyrtzidis 1054bbf08d [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.
This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

llvm-svn: 181490
2013-05-08 23:46:55 +00:00
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
Fariborz Jahanian d3d3d27003 put noisy "unknown command tag name" warning
under -Wdocumentation-unknown-command and off by default.
patch by Dmitri Gribenko.

llvm-svn: 181487
2013-05-08 23:38:56 +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
Dmitri Gribenko 352e81ffb5 All -Wdocumentation warnings are DefaultIgnore
llvm-svn: 181480
2013-05-08 22:54:41 +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
Eli Bendersky d142ce7068 Fix test in two ways: remove incorrect comment (the intrinsic generated now
is of the llvm.sjlj.* flavore) and convert grep->FileCheck

llvm-svn: 181468
2013-05-08 20:58:01 +00:00
Richard Smith 469a74772a Add missing triple to unit test.
llvm-svn: 181465
2013-05-08 20:32:14 +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
Reid Kleckner 78fb10f194 Document Clang's support for #pragma comment(lib/linker) with -fms-extensions
As suggested by Dmitri Gribenko.

llvm-svn: 181433
2013-05-08 14:40:51 +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 220dd33446 Add test forgotten in r181388.
llvm-svn: 181389
2013-05-08 02:38:36 +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