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

20677 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 9c25039c4b Cache results computed by CGDebugInfo::getOrCreateFile() in a DenseMap.
This reduces '-c -g' time on one file in 403.gcc by 12%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 00:27:51 +00:00
Douglas Gregor b836518bfc When copying a partial diagnostic into a DependentDiagnostic, allocate
storage for that partial diagnostic via the ASTContext's
BumpPtrAllocator rather than using up slots in the ASTContext's
cache. Now that we do this, we don't have to worry about destroying
dependent diagnostics when destroying a DependentStoredDeclsMap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 23:56:53 +00:00
Douglas Gregor fe6b2d481d Optimize PartialDiagnostic's memory-allocation behavior by placing a
cache of PartialDiagnostic::Storage objects into an allocator within
the ASTContext. This eliminates a significant amount of malloc
traffic, for a 10% performance improvement in -fsyntax-only wall-clock
time with 403.gcc's combine.c.

Also, eliminate the RequireNonAbstractType hack I put in earlier,
which was but a symptom of this larger problem.

Fixes <rdar://problem/7806091>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 23:34:08 +00:00
Gabor Greif 74350825e3 provide a simpler way to get to the headers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:36:06 +00:00
Douglas Gregor cb9bafeb9b Exit early from the simple form of Sema::RequireNonAbstractType(), for
a 2.47% speedup in 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:28:52 +00:00
Anders Carlsson 1c3639351f When collecting virtual bases it's very important to use the canonical type of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 19:49:09 +00:00
Ted Kremenek a1d2d397d6 Remove FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99828 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 19:10:41 +00:00
Ted Kremenek 590838badd Change 'TypeCache' from being an std::map to a llvm::DenseMap. This reduces codegen time
on one .i file from 403.gcc by 0.5%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 18:29:57 +00:00
Chris Lattner 3edbeb78fe add support for -MQ flag to quote targets in dependency file,
PR6661, patch by Ori Avtalion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:55:58 +00:00
Chris Lattner 2eb91e4812 emit signed integer subtractions as 'sub nsw', patch by
Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:28:16 +00:00
Anders Carlsson adb507df13 Another vtable layout fix, making us match gcc better.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 15:08:41 +00:00
Douglas Gregor 0b4c9b5834 Support __attribute__((packed)) (along with other attributes) at the
end of a struct/class/union in C++, from Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 14:42:08 +00:00
Anders Carlsson 67d568aaeb Handle pure virtual member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 05:40:50 +00:00
Anders Carlsson 6f6de73180 Fix a nasty bug in the virtual base computation which would lead to us initializing virtual bases in the wrong order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 05:13:12 +00:00
Rafael Espindola 802c66edc5 Be a bit more consistent in using operator->
This patch moves some methods from QualType to Type and changes the users to
use -> instead of .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 03:39:46 +00:00
Anders Carlsson a7cde3bb62 More vtable work - it's not possible to use the new vtable code for everything by setting a flag inside CGVtable.cpp. My plan is to run some tests and bootstrap and once that's done flip the bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 03:38:52 +00:00
Anders Carlsson d18b4de53d More magic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 03:26:49 +00:00
Anders Carlsson f01149ab1f Sprinkle some sed dust over check-ztt to make it work with newer clang asm output. (I am not a sed expert so this might be terribly inefficient :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 03:21:40 +00:00
Anders Carlsson acfa6ae66e Only add thunks for the most derived class. This fixes some link errors I was seeing in files generated by the vtable tester utility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 02:53:58 +00:00
Anders Carlsson 851853d8b7 Flip the switch to always get vtables from the VTT when necessary, I've verified that clang bootstraps with this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 02:38:51 +00:00
Anders Carlsson 0a4a2fd5da Use the newly added function in the VTT builder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 02:14:35 +00:00
Anders Carlsson 64c9eca97e Cleanup, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 02:08:26 +00:00
Anders Carlsson 276701f38d Add the thunks needed by this vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:38:05 +00:00
Anders Carlsson aed924e9f2 Make sure to sort the vtable thunks by their vtable index :) With this we now pass the test from http://www.codesourcery.com/public/cxx-abi/abi-examples.html#vtable-ctor successfully.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:28:05 +00:00
Anders Carlsson 14da9de3ad Fix another thinko, so that flags don't depend on previous bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:16:41 +00:00
Anders Carlsson b358814a25 When generating base ctors/dtors, we need to lookup virtual bases using the vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:14:25 +00:00
Anders Carlsson 80faf6986c Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:12:13 +00:00
Anders Carlsson c83f1061fe Use construction vtables when needed. This is currently guarded by -fdump-vtable-layouts since it doesn't work 100% yet :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:08:49 +00:00
Anders Carlsson f6da6a082c Two bug fixes, we weren't updating the thunk index when creating the vtable initializer and we weren't storing the secondary virtual pointer indices.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 01:04:16 +00:00
Rafael Espindola 6a6aa53ec6 Make default arguments to getFunctionNoProtoType an all or nothing option (as they already are in practise).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 22:48:23 +00:00
Rafael Espindola 1279deea79 Drop default arguments no one is using.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 22:19:17 +00:00
Anders Carlsson 603d6d12cc Reapply r99775 with a fix for a silly bug - we were setting the vtable pointer for all bases, even those without a vtable pointer :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 21:07:49 +00:00
Anders Carlsson 4658990ac1 Looks like I broke self-host again :(.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 20:55:21 +00:00
Anders Carlsson bdb8865520 More improvements to setting the vtable pointer. We now no longer set the vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99775 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 20:34:31 +00:00
Anders Carlsson d103f9f9b4 Factor vtable pointer setting code out into a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 19:40:00 +00:00
Douglas Gregor 02024a9f0d After performing template argument deduction for a function template,
check deduced non-type template arguments and template template
arguments against the template parameters for which they were deduced,
performing conversions as appropriate so that deduced template
arguments get the same treatment as explicitly-specified template
arguments. This is the bulk of PR6723.

Also keep track of whether deduction of a non-type template argument
came from an array bound (vs. anywhere else). With this information,
we enforce C++ [temp.deduct.type]p17, which requires exact type
matches when deduction deduces a non-type template argument from
something that is not an array bound.

Finally, when in a SFINAE context, translate the "zero sized
arrays are an extension" extension diagnostic into a hard error (for
better standard conformance), which was a minor part of PR6723.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 02:42:43 +00:00
Benjamin Kramer 5e2d2c2ee3 Checker: random include cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 21:19:47 +00:00
Fariborz Jahanian f28385991f Further improvement to point to category
whose protocolls methods needs implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 21:10:05 +00:00
Anders Carlsson ada087c451 Give thunks the same linkage as their original methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 20:50:27 +00:00
Fariborz Jahanian 8822f7cda5 Improve diagnostics on incomplete implementation
of objc classes; including which methods
need be implemented and where they come from.
WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 19:02:17 +00:00
Ted Kremenek 9a4d77f563 Remove VS information for analyzer until we have more real support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 16:56:20 +00:00
Kovarththanan Rajaratnam 03cf219502 s/Clangify2010.py/clangify2010.py
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 08:21:15 +00:00
John McCall 2cc2675d42 Accumulate all functions and classes that the effective context is
nested within, and suddenly local classes start working.  Wouldn't be
necessary if I hadn't used local classes in Clang in the first place.
Or, well, wouldn't be necessary yet. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 06:55:49 +00:00
John McCall b0cb022dae Implement method friends in class templates and fix a few related problems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 05:57:59 +00:00
Rafael Espindola d0c89a471b Test for the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 02:52:40 +00:00
Rafael Espindola d1a5c31b78 When given the magic class __cxxabiv1::__fundamental_type_info, produce
the typeinfo for the fundamental types.

Fixes PR6685.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 02:52:14 +00:00
Ted Kremenek b6e0edc4d0 Add initial draft of web page on 'clangifty2010.py' script for analyzing VS projects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 01:06:58 +00:00
John McCall d8e10d26b5 When mapping restrict to noalias, look for 'restrict' on the parameter variable
instead of the canonical parameter type (which has correctly dropped all such
direct qualifiers).  Fixes PR6695.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 00:47:27 +00:00
Ted Kremenek 524c308506 scan-build: set environment variable LDPLUSPLUS to 'c++-analyzer' to correctly link projects
with c++ code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 00:20:01 +00:00
Ted Kremenek 5800f7ea9c Fix comparison in isDiagnosticInFlight().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 23:36:48 +00:00