Commit Graph

52459 Commits

Author SHA1 Message Date
Benjamin Kramer 53156af57c Another try at making MSVC happy again.
llvm-svn: 208497
2014-05-11 16:03:08 +00:00
Benjamin Kramer 062bf473c1 Put back raw_ostream.h include.
Some configurations of MSVC get horribly confused by the forward declaration
and explode.

llvm-svn: 208493
2014-05-11 10:41:20 +00:00
Benjamin Kramer b7ee689f91 Silence warning in Release builds. This function is only used in an assert.
llvm-svn: 208491
2014-05-11 09:31:47 +00:00
Saleem Abdulrasool 8ab3e83efa CodeGen: support dll{ex,im}port on WoA
Add ARM support for dllexport and dllimport attributes.  This is a relatively
conservative change.  The alternative is to entirely drop the architecture
requirement.  The dllimport and dllexport attributes are not restricted to any
architecture, simply to platforms that support this attribute (currently
Windows).

llvm-svn: 208486
2014-05-11 01:31:57 +00:00
Nico Weber e8e53116f8 Wrap at 80 columns. No code change.
llvm-svn: 208485
2014-05-11 01:04:02 +00:00
Nico Weber 7aeab6022f Follow-up to r208481: Free all default arguments, not just the first one.
Also add test coverage for this case.  Found by Richard Smith!

llvm-svn: 208484
2014-05-11 00:28:16 +00:00
Nico Weber 3fddae75c7 Don't leak CXStrings for replacement fix-its in c-index-test.
The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

llvm-svn: 208483
2014-05-10 23:56:43 +00:00
Benjamin Kramer ef316ee8df Try to bring the 32 bit buildbots back to life.
llvm-svn: 208482
2014-05-10 20:57:56 +00:00
Nico Weber e2b5e40203 Don't leak default arg tokens on invalid destructors or conversion functions.
Fixes PR19689, and possibly the last leak in clang (PR19521). PR19689 contains
a few suggestions on how to make the default argument token code a bit more
solid, these changes can possibly be landed in follow-ups.

llvm-svn: 208481
2014-05-10 19:23:28 +00:00
Nico Weber cf596d8fa8 Add test coverage for invalid conversion functions with default args.
This currently leaks memory (PR19689) but wasn't covered by tests, so LSan
couldn't find it.

llvm-svn: 208477
2014-05-10 19:15:24 +00:00
Nico Weber 77c76c54fc Wrap to 80 columns. No behavior change.
llvm-svn: 208475
2014-05-10 17:43:15 +00:00
Fariborz Jahanian c70a54366e Objective-C ARC. Add support for toll-free bridge
type ,and bridge attribute, checking with static_cast. 
// rdar://16756639

llvm-svn: 208474
2014-05-10 17:40:11 +00:00
Benjamin Kramer e6f743f9ab Analyzer: Make helper function static.
llvm-svn: 208473
2014-05-10 17:13:34 +00:00
Benjamin Kramer f3ca269839 Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.
Required pulling LambdaExpr::Capture into its own header.
No functionality change.

llvm-svn: 208470
2014-05-10 16:31:55 +00:00
David Blaikie 9c8821bbef Add FIXME describing the limitation of using column info to disambiguate inlining.
Also tidy up, simplify, and extend the test coverage to demonstrate the
limitations. This test should now fail if the bugs are fixed (&
hopefully whoever ends up in this situation sees the FIXMEs and realizes
that the test needs to be updated to positively test their change that
has fixed some or all of these issues).

I do wonder whether I could demonstrate breakage without a macro here,
but any way I slice it I can't think of a way to get two calls to the
same function on the same line/column in non-macro C++ - implicit
conversions happen at the same location as an explicit function, but
you'd never get an implicit conversion on the result of an explicit call
to the same implicit conversion operator (since the value is already
converted to the desired result)...

llvm-svn: 208468
2014-05-10 02:44:57 +00:00
Richard Smith d7af8a334c Stop all the Decl classes poking at Redeclarable's data member directly, and make getNextRedeclaration follow the pattern of its friends getPreviousDecl and getMostRecentDecl.
llvm-svn: 208467
2014-05-10 01:17:36 +00:00
Reid Kleckner 37abaca3c2 MS ABI: Pass 'sret' as the second parameter of instance methods
Summary:
MSVC always passes 'sret' after 'this', unlike GCC.  This required
changing a number of places in Clang that assumed the sret parameter was
always first in LLVM IR.

This fixes win64 MSVC ABI compatibility for methods returning structs.

Reviewers: rsmith, majnemer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3618

llvm-svn: 208458
2014-05-09 22:46:15 +00:00
Nico Weber 7dd96c23fd Don't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()
r144269 changed clang_disposeDiagnostic() to be a no-op, but didn't update
code completion diagnostics.  Let CXCodeCompleteResults store all diagnostics
returned by clang_codeCompleteGetDiagnostic() and then free them up in
clang_disposeCodeCompleteResults().

Code completion diagnostics referred to data stored in CXCodeCompleteResults
before already, so it wasn't possible to refer to the results of
clang_codeCompleteGetDiagnostic() after clang_disposeCodeCompleteResults()
before this change already -- hence this should be a safe, backwards-compatible
change.

Leak found by LSan, fixes PR19690.

llvm-svn: 208454
2014-05-09 22:33:11 +00:00
David Blaikie 04e2e665cb Don't emit -Wnon-virtual-dtor on final classes, since it's not a problem there.
The base class is the culprit/risk here - a sealed/final derived class
with virtual functions and a non-virtual dtor can't accidentally be
polymorphically destroyed (if the base class's dtor is protected - which
also suppresses this warning).

llvm-svn: 208449
2014-05-09 22:02:28 +00:00
Richard Smith 6d54014144 PR19698, PR19674: enable __has_feature checks for cxx_generic_lambdas and
cxx_decltype_auto, and fix documentation of cxx_generic_lambdas and
cxx_init_captures to specify the right feature-check name.

llvm-svn: 208445
2014-05-09 21:08:59 +00:00
Fariborz Jahanian 65a78b5d9b Objective-C. Reduce false positive warnings with -Wselector by issuing warning
only when named selector is declared in TU and it is not declared in a system
header. rdar://16600230

llvm-svn: 208443
2014-05-09 19:51:39 +00:00
Aaron Ballman 0c6a14ca82 Amending r208439 to remove buildLExpr; this code isn't strictly required yet, and fixes a dead code warning.
llvm-svn: 208440
2014-05-09 18:44:48 +00:00
Aaron Ballman 7c192b452f Add the ability to use logical expressions for capability attributes. This is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg)
void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger)));

This is WIP code.

llvm-svn: 208439
2014-05-09 18:26:23 +00:00
Nico Weber 5f5b94141c Don't leak MacroArgs when using code completion, PR19688.
MacroArgs are owned by TokenLexer, and when a TokenLexer is destroyed, it'll
call its MacroArgs's destroy() method.  destroy() only appends the MacroArg to
Preprocessor's MacroArgCache list, and Preprocessor's destructor then calls
deallocate() on all MacroArgs in that list.  This method then ends up freeing
the MacroArgs's memory.

In a code completion context, Parser::cutOffParsing() gets called when a code
completion token is hit, which changes the type of the current token to
tok::eof.  eof tokens aren't always ConsumeToken()ed, so
Preprocessor::HandleEndOfFile() isn't always called, and that function is
responsible for popping the macro stack.

Due to this, Preprocessor::CurTokenLexer can be non-NULL when
~Preprocessor runs.  It's a unique_ptr, so it ended up being destructed after
~Preprocessor completed, and its MacroArgs thus got added to the freelist after
the code freeing things on the freelist had already completed.  The fix is to
explicitly call reset() before the freelist processing happens.  (See the bug
for more notes.)

llvm-svn: 208438
2014-05-09 18:09:42 +00:00
Benjamin Kramer a7bcab75d2 ThreadSafetyAnalysis: Don't crash when trying to analyze objc methods.
The thread safety analysis isn't very useful in ObjC (you can't annotate
ObjC classes or methods) but we can still analyze the actual code and
show violations in usage of C/C++ functions.

Fixes PR19541, which does not use thread safety attributes but crashes
with -Weverything.

llvm-svn: 208436
2014-05-09 17:08:01 +00:00
James Molloy e735b2bae3 Pacify bots again - turns out my checkout was slightly polluted when I was reverting a olista01s change, and this pollution made it upstream during the revert checkin :/ Sorryemacs -nw lib/CodeGen/CodeGenModule.cpp
llvm-svn: 208426
2014-05-09 16:28:56 +00:00
James Molloy 6f244b6f78 Reapply r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). Bots are now pacified.
llvm-svn: 208425
2014-05-09 16:21:39 +00:00
James Molloy 1aa0d5f3b2 Revert r208417 (olista01 'ARM: HFAs must be passed in consecutive registers'). This is a followon commit from r208413 which broke the LLVM bots.
llvm-svn: 208422
2014-05-09 16:17:09 +00:00
Oliver Stannard 19f3b4f2ce ARM: HFAs must be passed in consecutive registers
This is the clang counterpart to 208413, which ensures that Homogeneous
Floating-point Aggregates are passed in consecutive registers on ARM.

llvm-svn: 208417
2014-05-09 15:14:56 +00:00
Daniel Jasper b05a81debb clang-format: Fix bug introduced by r208392.
Also run clang-format over clang-format's files.

llvm-svn: 208409
2014-05-09 13:11:16 +00:00
Daniel Jasper 8f83a9072d clang-format: [JS] Allow up to 3 empty lines in Google's JS style.
llvm-svn: 208404
2014-05-09 10:28:58 +00:00
Daniel Jasper 8951908218 clang-format: [JS] Fix spacing in dict literals.
Before:
  someVariable = {'a':[{}]};

After:
  someVariable = {'a': [{}]};

llvm-svn: 208403
2014-05-09 10:26:08 +00:00
Will Wilson eadcdbbe57 Permit duplicate explicit class instantiations if MSVCCompat is enabled
llvm-svn: 208402
2014-05-09 09:52:13 +00:00
Ismail Pazarbasi 77c456be3e Revised wording for diagnostics in r208299
llvm-svn: 208401
2014-05-09 09:49:29 +00:00
Alp Toker e265cf1a33 Add support for partial jump scope checking
This lets us diagnose and perform more complete semantic analysis when faced
with errors in the function body or declaration.

By recovering here we provide more consistent diagnostics, particularly during
interactive editing.

llvm-svn: 208394
2014-05-09 08:40:10 +00:00
Craig Topper 2145bc0229 [C++11] Use 'nullptr'.
llvm-svn: 208392
2014-05-09 08:15:10 +00:00
Rafael Espindola e98ed2f49a Don't repeat function name in comment.
llvm-svn: 208387
2014-05-09 01:34:38 +00:00
Nico Weber 0e9da35c3d Wrap to 80 columns, no code change.
llvm-svn: 208386
2014-05-09 01:00:48 +00:00
Rafael Espindola 42ae74531c Don't indent in namespaces.
llvm-svn: 208384
2014-05-09 00:57:59 +00:00
Rafael Espindola b32629589d Simplify the code a bit by using linkage predicates.
llvm-svn: 208382
2014-05-09 00:43:37 +00:00
Nico Weber 33b2d71cb8 Fix filename in file header comment more.
llvm-svn: 208381
2014-05-09 00:42:08 +00:00
Nico Weber a7d1619e84 Fix filename in file header comment.
llvm-svn: 208380
2014-05-09 00:39:59 +00:00
Rafael Espindola 1404809002 Don't indent inside namespaces.
llvm-svn: 208377
2014-05-09 00:26:20 +00:00
Richard Smith 10f22aa1ea Fix link target.
llvm-svn: 208376
2014-05-09 00:20:01 +00:00
Rafael Espindola 2ae250c36a Use auto to avoid duplicating the type.
llvm-svn: 208374
2014-05-09 00:08:36 +00:00
Ben Langmuir c95e56488d Switch Wmodule-build to a remark
On reflection, this is better despite the missing command-line handling
bits for remarks.  Making this a remark makes it much clearer that
this is purely informational and avoids the negative connotations of a
'warning'.

llvm-svn: 208367
2014-05-08 22:36:02 +00:00
Richard Smith a0a5d508ef Fix an outdated comment.
llvm-svn: 208366
2014-05-08 22:32:00 +00:00
Simon Atanasyan 6f657c46e9 [Driver] Range-based loop simplification.
llvm-svn: 208354
2014-05-08 19:32:46 +00:00
Ben Langmuir 46b02e3edd Remove -Wnon-modular-include
But keep -Wnon-modular-include-in-[framework-]module

This warning is too noisy and doesn't really indicate a problem for most
people.  Even though it would only really affect people using
-Weverything, that seems bad so remove it.

llvm-svn: 208345
2014-05-08 18:09:29 +00:00
Saleem Abdulrasool 61449c6b9a CodeGen: fix code model mapping
Large is CodeModel::Model::Large, not CodeModel::Model::Medium.  Thanks to
majnemer for pointing out the typo!  Its unclear how to test the mapped value in
the compiler, the tests already cover the driver side.

llvm-svn: 208335
2014-05-08 16:28:48 +00:00