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

15275 Коммитов

Автор SHA1 Сообщение Дата
Steve Naroff ece8e71d12 Add code completion support for ObjC property declarations/attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 21:55:05 +00:00
Mike Stump 8408db36ee Convert some tests to FileCheck to be more portable. Patch by John Thompson.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 21:52:07 +00:00
Douglas Gregor b5352cf949 Implement support for -Wunused-variable, from Oscar Bonilla!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 21:35:42 +00:00
Douglas Gregor b46f57d9da Fix an assertion in the XML output, from Olaf Krzikalla!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 21:29:50 +00:00
Devang Patel e23429269f Record location info before emiting alloca for arguments. This allows arguments to have proper location info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 18:53:37 +00:00
Fariborz Jahanian 27d4be5b3f Implement [expr.mptr.oper]p6 for '->*' operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 18:00:39 +00:00
Ted Kremenek b8fc325f00 Remove use of std::ofstream in HTMLDiagnostics.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:44:41 +00:00
Anders Carlsson 74d644abe5 If a global initializer has a non-trivial constructor or destructor, we never want to defer generation of it, even if it is declared static.
With this change we're finally able to compile and run the (infamous)

#include <string>
#include <iostream>

int main(int argc, char **argv) {
  std::cout << "Hello, World" << std::endl;
}

$ clang hello.cpp -lstdc++ -o hello
$ ./hello 
Hello, World



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:28:59 +00:00
Anders Carlsson a3f36ab6dd Port test over to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:22:47 +00:00
Anders Carlsson 8f8fd8ea7e Mangle std::basic_ostream<char, std::char_traits<char>> as So.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83557 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:20:26 +00:00
Douglas Gregor 9916a047c5 Add more testing for the properties of explicit specialization.
Also, eliminate a redundant diagnostic by marking a variable declared
with incomplete type as an invalid declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 16:41:22 +00:00
Fariborz Jahanian 12af63bd24 Refactoring to further simplify collection of visible conversion
functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 16:33:37 +00:00
Douglas Gregor 741fab6157 Don't complain about out-of-line explicit specializations of member
function and member function templates that are not definitions. Add
more tests to ensure that explicit specializations of member function
templates prevent instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 15:54:21 +00:00
Douglas Gregor 42887b9224 More testing for explicit specializations of member class templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83548 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 15:27:05 +00:00
Douglas Gregor f6b1185f0a Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized. 

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 15:14:33 +00:00
Douglas Gregor 251b4ff257 For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 07:24:58 +00:00
Douglas Gregor e9374d5e2c Make sure to set the template specialization kind of an explicit
template instantiation of a member function of a class template.
FIXME -= 2;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 01:19:17 +00:00
Douglas Gregor 44e368b6a8 Compress storage for MemberSpecializationInfo into a single
pointer. Yay, PointerIntPair.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 00:19:07 +00:00
Douglas Gregor 63e5e64a49 Only perform an implicit instantiation of a function if its template
specialization kind is TSK_ImplicitInstantiation. Previously, we would
end up implicitly instantiating functions that had explicit
specialization declarations or explicit instantiation declarations
(with no corresponding definitions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 00:14:38 +00:00
Douglas Gregor 2db323294a Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 23:56:10 +00:00
John McCall e3af0235ce Refactoring around friend class templates. Better error message for friend enums.
Don't create a new declaration for friend classes if a declaration already exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 23:34:25 +00:00
Douglas Gregor 1fef4e60e7 Type checking for specializations of member functions of class
templates. Previously, these weren't handled as specializations at
all. The AST for representing these as specializations is still a work
in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:35:40 +00:00
Anders Carlsson 6e8f550439 Handle MemberExprs in ResolveAddressOfOverloadedFunction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:26:29 +00:00
John McCall 71fdaf4c5e Dead code elimination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:04:40 +00:00
Fariborz Jahanian 0351a1e2e1 Fixes problem in finding visible convertion functions of a class
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 20:43:36 +00:00
Douglas Gregor 0a4074768a Diagnose explicit instantiations and specializations that occur in class scope
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:30:37 +00:00
Fariborz Jahanian ca4fb04b5c When building candidate set for built-ins; when looking for
convesion functions, look in base classes to.
(Removes a FIXME).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:26:09 +00:00
Douglas Gregor 7974c3b706 Class template partial specializations can be declared anywhere that
its definition may be defined, including in a class.

Also, put in an assertion when trying to instantiate a class template
partial specialization of a member template, which is not yet
implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:21:34 +00:00
Fariborz Jahanian 4303697cbc Removed couple of unnecessary canonicalization
per Doug's obsevation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 16:56:50 +00:00
Ted Kremenek f0e75d6baf Add 'template' keyword to disambiguate the use of a member template within a templated class. Hopefully this will please the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 06:20:14 +00:00
Ted Kremenek 55bac53391 Revert r83443.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 03:21:11 +00:00
Anders Carlsson c4355b6883 Mangle anonymous structs/unions correctly. Fixes PR5139.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:45:02 +00:00
Mike Stump 44da821078 Fixup pathnames.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:11:54 +00:00
Anders Carlsson b540491851 Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:06:45 +00:00
Douglas Gregor 3d92d8c94e More testing of explicit specializations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:45:53 +00:00
Ted Kremenek 5fe4d9deb5 Change ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc() traffic when adding successors/predecessors to a node. This was done by introducing BumpVector, which is essentially SmallVector with all memory being BumpPtrAllocated (this can certainly be cleaned up or moved into llvm/ADT).
This change yields a 1.8% speed increase when running the analyzer (with -analyzer-store=region) on a small benchmark file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:42:52 +00:00
Ted Kremenek b490363117 Force a specific target triple in c-index-api-test.m, making the behavior of the test not be dependent on the host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:39:48 +00:00
Douglas Gregor d5cb8765ad Refactor checking of the scope of explicit template specialization
declarations and explicit template instantiations, improving
diagnostics and making the code usable for function template
specializations (as well as class template specializations and partial
specializations). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:13:32 +00:00
Mike Stump 82109bd64a Fix eof.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:38:59 +00:00
Mike Stump da5529121e Fix eof.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:38:31 +00:00
Fariborz Jahanian 4657a99274 Patch to implement C++ [over.built]p11 of overload resolution.
Doug, please review. There is a FIXME in the test case with a question
which is unrelated to this patch (that is, error is issued
before set of builtins are added to the candidate list).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:08:05 +00:00
Anders Carlsson edee783ed3 Uncomment some commented out code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:02:00 +00:00
Mike Stump 31c5141451 Add codegen for __builtin_abort. Convert to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 22:58:45 +00:00
Anders Carlsson 2f1986b557 Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 22:43:30 +00:00
Anders Carlsson ff38915e02 Add files to xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 22:07:00 +00:00
Anders Carlsson b217c1b9d2 When mangling names, always use the canonical decl. Fixes PR5144.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:58:01 +00:00
Devang Patel 6e461bf753 InsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:53:41 +00:00
Douglas Gregor 13d2d6cfd6 Test explicit specialization for all of the various cases where
explicit specializations can occur. Also, fix a minor recovery bug
where we should allow declarations coming from the parser to be NULL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:27:51 +00:00
Mike Stump 07b1270f43 Add more of __builtin_abort, WIP, still missing codegen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 20:30:09 +00:00
Ted Kremenek 38fdb6de98 Updated checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 20:19:01 +00:00