Commit Graph

54518 Commits

Author SHA1 Message Date
Benjamin Kramer a39beb9dd6 Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.
No change in functionality.

llvm-svn: 217025
2014-09-03 11:06:10 +00:00
Daniel Jasper db986eb6bb clang-format: Add an option 'SpaceAfterCStyleCast'.
This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.

Fixes llvm.org/PR19982.

Before:
  (int)i;

After:
  (int) i;

Patch by Marek Kurdej.

llvm-svn: 217022
2014-09-03 07:37:29 +00:00
Ed Schouten ca98874943 Allow a scoped lockable object to acquire/release multiple locks.
Scoped lockable objects (mutex guards) are implemented as if it is a
lock itself that is acquired upon construction and unlocked upon
destruction. As it if course needs to be used to actually lock down
something else (a mutex), it keeps track of this knowledge through its
underlying mutex field in its FactEntry.

The problem with this approach is that this only allows us to lock down
a single mutex, so extend the code to use a vector of underlying
mutexes. This, however, makes the code a bit more complex than
necessary, so subclass FactEntry into LockableFactEntry and
ScopedLockableFactEntry and move all the logic that differs between
regular locks and scoped lockables into member functions.

llvm-svn: 217016
2014-09-03 06:00:11 +00:00
Richard Smith 73b21d8fa1 [modules] Use DeclContext::equals rather than == on DeclContext* when
determining whether a declaration is out of line, instead of assuming
that the semantic and lexical DeclContext will be the same declaration
whenever they're the same entity.

This fixes behavior of declarations within merged classes and enums.

llvm-svn: 217008
2014-09-03 02:33:22 +00:00
Eric Christopher af2b7dc522 Reinstate "Update for llvm API change.""
This reinstates r215113.

llvm-svn: 216986
2014-09-02 22:35:49 +00:00
Eli Bendersky 838600482a Fix up formatting.
llvm-svn: 216976
2014-09-02 22:00:06 +00:00
Richard Smith cdd7cbcac0 Avoid test failure on platforms where size_t is long long (and thus can't be
directly written in strictly-conforming source code).

llvm-svn: 216969
2014-09-02 21:39:21 +00:00
Reid Kleckner be80f6d901 Add --analyze to clang-cl
llvm-svn: 216964
2014-09-02 21:35:28 +00:00
Richard Smith a10a16264f Tests for DR550-572.
llvm-svn: 216953
2014-09-02 21:29:16 +00:00
Ed Schouten bf041d975e Use /usr/bin/env python instead of /usr/bin/python.
On operating systems like the BSDs, it is typically the case that
/usr/bin/python does not exist. We should therefore use /usr/bin/env
instead. This is also done in various other scripts in tools/.

llvm-svn: 216945
2014-09-02 20:59:13 +00:00
Rafael Espindola 9efb728920 Don't indent inside a namespace.
llvm-svn: 216937
2014-09-02 19:37:08 +00:00
Richard Trieu b292604553 Don't allow lambdas to capture invalid decls during template instantiations.
Fixes PR20731.

llvm-svn: 216936
2014-09-02 19:32:44 +00:00
Yunzhong Gao 637cb90ba8 Fixing a typo in the documented __builtin_convertvector example.
"vf[0]" ==> "vs[0]"

llvm-svn: 216935
2014-09-02 19:24:14 +00:00
David Blaikie 86b9464e01 Fix for LLVM API change to SpecialCaseList::create
llvm-svn: 216926
2014-09-02 18:13:58 +00:00
Rafael Espindola fa8d024210 Test cleanup: move CHECK close to code.
llvm-svn: 216892
2014-09-01 22:29:32 +00:00
David Majnemer 9676a2bc47 Frontend: Reindent Opts.CoverageFile
No functional change intended.

llvm-svn: 216888
2014-09-01 18:50:05 +00:00
David Majnemer ca32f9342b MS ABI: Reindent MicrosoftCXXABI::GetVirtualBaseClassOffset
No functional change intended.

llvm-svn: 216887
2014-09-01 18:50:02 +00:00
Alexander Potapenko c8e749a5fd Typo fix, no functionality change.
llvm-svn: 216876
2014-09-01 12:35:57 +00:00
NAKAMURA Takumi 3a1469ea04 clang/test/CXX/drs/dr5xx.cpp: Suppress dr547 for targeting MSVC x86 for now, due to incompatibility of attribute(thiscall).
With targeting i686-win32,

  error: 'error' diagnostics seen but not expected:
    File clang/test/CXX/drs/dr5xx.cpp Line 521: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>'
    File clang/test/CXX/drs/dr5xx.cpp Line 518: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>'
    File clang/test/CXX/drs/dr5xx.cpp Line 518: implicit instantiation of undefined template 'dr547::X<void () __attribute__((thiscall)) const>'
  error: 'note' diagnostics seen but not expected:
    File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here
    File clang/test/CXX/drs/dr5xx.cpp Line 521: in instantiation of function template specialization 'dr547::f<void () __attribute__((thiscall)) const, dr547::S>' requested here
    File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here
    File clang/test/CXX/drs/dr5xx.cpp Line 516: template is declared here
  7 errors generated.

llvm-svn: 216841
2014-08-31 12:21:50 +00:00
Richard Smith 1b88632886 cxx_status: we did support some of C++14 in Clang 3.3.
llvm-svn: 216837
2014-08-31 04:18:54 +00:00
Richard Smith 20f3767f36 cxx_status: the name C++14 isn't provisional any more.
llvm-svn: 216836
2014-08-31 04:17:48 +00:00
Richard Smith fb640501a2 Tests for DR525-550.
llvm-svn: 216834
2014-08-31 03:06:20 +00:00
NAKAMURA Takumi 41429874d6 clang/test/CodeGenCXX/debug-info-access.cpp: Use %itanium_abi_triple to appease msvc. "[def] [free]" can be seen in different order.
llvm-svn: 216829
2014-08-31 00:27:00 +00:00
Craig Topper bf3e32705a Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already.
llvm-svn: 216825
2014-08-30 16:55:52 +00:00
Craig Topper 8c2a2a0f82 Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>.
llvm-svn: 216824
2014-08-30 16:55:39 +00:00
Rafael Espindola f7765ac9b9 Cleanup test.
This should make it easier to add more tests to this file.

llvm-svn: 216807
2014-08-30 00:15:37 +00:00
Richard Smith 70d5850955 [modules] Fix deserialization cycle when loading a tag declaration with a typedef name for linkage purposes. When loading the type, delay loading its typedef until we've finished loading and merging the type. In its place, save out the name of the typedef, which we need for merging purposes.
llvm-svn: 216806
2014-08-30 00:04:23 +00:00
Rafael Espindola 2321920b61 Cleanup the test a bit. It was too dependent on the output order.
llvm-svn: 216802
2014-08-29 23:45:52 +00:00
Adrian Prantl 21361fb308 Debug info: Only emit C++ accessibility specifiers when they are diverging
from the default for the containing type.

rdar://problem/18154959

llvm-svn: 216800
2014-08-29 22:44:27 +00:00
Richard Smith b602c7f843 Add some missing test coverage for merging 'extern "C"' functions with modules.
llvm-svn: 216796
2014-08-29 22:33:38 +00:00
Reid Kleckner 76176f28b9 Fix my broken test cases.
llvm-svn: 216791
2014-08-29 22:06:20 +00:00
David Blaikie 02118cedd5 unique_ptrify PTHManager's PerIDCache using the newly added llvm::FreeDeleter
llvm-svn: 216786
2014-08-29 22:04:45 +00:00
David Blaikie 60e836ba99 unique_ptrify some parameters to PTHManager::PTHManager
A couple of these arguments were passed by void* as a rather extreme
example of pimpling. Adjusting this to a more classic form of the idiom
(involving forward declarations) makes this more legible and allows
explicit passing of ownership via std::unique_ptr.

llvm-svn: 216785
2014-08-29 22:04:40 +00:00
Anna Zaks ae08e431dd Fixup for r216763. Add a driver test.
llvm-svn: 216783
2014-08-29 21:51:22 +00:00
Reid Kleckner c34735148f Make all virtual member pointers use variadic musttail calls
This avoids encoding information about the function prototype into the
thunk at the cost of some function prototype bitcast gymnastics.

Fixes PR20653.

llvm-svn: 216782
2014-08-29 21:43:29 +00:00
Larisse Voufo 2e84650768 Fix for PR20660, where unexpanded parameter pack in function parameter clause causes clang to crash.
llvm-svn: 216778
2014-08-29 21:08:16 +00:00
Nico Weber ce069f11f9 Add a comment, no functional change.
llvm-svn: 216777
2014-08-29 21:05:44 +00:00
Fariborz Jahanian 3b23008987 Objective-C [qoi]. If property is going to be implemented
in the super class, do not issue the warning about property
in current class's protocol will not be auto synthesized.
// rdar://18179833

llvm-svn: 216769
2014-08-29 20:29:31 +00:00
David Blaikie eb62b822e3 unique_ptrify the raw_ostream argument to clang::serialized_diags::create
llvm-svn: 216767
2014-08-29 20:17:13 +00:00
David Blaikie 53dd8fea69 unique_ptrify clang::ento::createCheckerManager
llvm-svn: 216765
2014-08-29 20:11:03 +00:00
David Blaikie c9950cb1dd unique_ptrify PathDiagnosticConsumer::HandlePathDiagnostic
FoldingSet, another intrusive data structure that could use some
unique_ptr love on its interfaces. Eventually.

llvm-svn: 216764
2014-08-29 20:06:10 +00:00
Anna Zaks d5478fdd8f Add an option to silence all analyzer warnings.
People have been incorrectly using "-analyzer-disable-checker" to
silence analyzer warnings on a file, when analyzing a project. Add
the "-analyzer-disable-all-checks" option, which would allow the
suppression and suggest it as part of the error message for
"-analyzer-disable-checker". The idea here is to compose this with
"--analyze" so that users can selectively opt out specific files from
static analysis.

llvm-svn: 216763
2014-08-29 20:01:38 +00:00
David Blaikie 43e3717bdb unique_ptrify thep passing of BugReports to BugReportEquivClass
I suspect llvm::ilist should take elements by unique_ptr, since it does
take ownership of the element (by stitching it into the linked list) -
one day.

llvm-svn: 216761
2014-08-29 19:57:52 +00:00
David Blaikie 09844adc41 unique_ptrify HeaderMap::FileBuffer
llvm-svn: 216758
2014-08-29 19:51:32 +00:00
David Blaikie 6d5038c19c unique_ptrify Preprocessor's TokenLexerCache
llvm-svn: 216756
2014-08-29 19:36:52 +00:00
David Blaikie e90195c09b unique_ptrify the result of CFG::buildCFG/CFGBuilder::buildCFG
llvm-svn: 216755
2014-08-29 18:53:26 +00:00
David Blaikie 759548b5a6 unique_ptrify the diagnostics in CXDiagnosticSetImpl
llvm-svn: 216754
2014-08-29 18:43:24 +00:00
Fariborz Jahanian c9b771560a Objective-C. Tweak diagnosing properties that are not auto-synthesized.
Do not warn when property declared in class's protocol will be auto-synthesized
by its uper class implementation because super class has also declared this
property while this class has not. Continue to warn if current class
has declared the property also (because this declaration will not result
in a 2nd synthesis).
rdar://18152478

llvm-svn: 216753
2014-08-29 18:31:16 +00:00
David Blaikie 8d05190e1d unique_ptrify PathDiagnostic::setEndOfPath's argument
Again, if shared ownership is the right model here (I assume it is,
given graph algorithms & such) this could be tidied up (the 'release'
call removed in favor of something safer) by having
IntrunsiveRefCntPointer constructible from a unique_ptr.

(& honestly I'd probably favor taking a page out of shared_ptr's book,
allowing implicit construction from a unique_ptr rvalue, and only allow
explicit from a raw pointer - currently IntrusiveRefCntPointer can
implicitly own from a raw pointer, which seems unsafe)

llvm-svn: 216752
2014-08-29 18:18:47 +00:00
David Blaikie d15481ccea unique_ptr-ify PathDiagnosticPiece ownership
llvm-svn: 216751
2014-08-29 18:18:43 +00:00