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

8818 Коммитов

Автор 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
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
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 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 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 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 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
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
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
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
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 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
Devang Patel bbd9fa4b4a Add support to attach debug info to an instruction.
This is not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:36:08 +00:00
Anders Carlsson c33e4ba203 Emit the destructor epilogue in a cleanup block so a return from a destructor body still calls the epilogue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:09:57 +00:00
Douglas Gregor a8f32e0965 Refactor the code that walks a C++ inheritance hierarchy, searching
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:59:45 +00:00
Anders Carlsson b299d3516d Pass the right type to GetAddrOfFunction when getting functions for the VTable. Fixes PR5021.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:54:23 +00:00
Rafael Espindola 6961fdd661 Add the -nostdclanginc option to clang (the driver).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 12:45:37 +00:00
Ted Kremenek 9e8710b2ca Fix 'clang-cc -analyzer-display-progress' by flushing standard error after printing the name of the analyzed function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:49:25 +00:00
Ted Kremenek b1d042212f Fix crash introduced by r83358 where a symbol could be eagerly
evaluated to an APSInt with a different bitwidth than the other
operand in a binary expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:44:49 +00:00
Ted Kremenek cd8f6ac9b6 Fix: <rdar://problem/7275774> Static analyzer warns about NULL pointer when
adding assert

This fix required a few changes:

SimpleSValuator:
- Eagerly replace a symbolic value with its constant value in EvalBinOpNN
  when it is constrained to a constant.  This allows us to better constant fold
  values along a path.
- Handle trivial case of '<', '>' comparison of pointers when the two pointers
  are exactly the same.

RegionStoreManager:





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:39:48 +00:00
Rafael Espindola 2e9f652d53 Refactor the c++ include path a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:33:02 +00:00
Devang Patel 979ec2e5ee Set appropriate context for a global variable while emitting debug info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:35:31 +00:00
Fariborz Jahanian 56fc0d18ca Refixed pr5086 by letting Expr::isNullPointerConstant
handle checking for a null pointer for a zero-valued
enumerator; moving the test case from CodeGen to Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:09:31 +00:00
Mike Stump bd6dbd1978 Fix thinko and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:08:21 +00:00
Mike Stump fb51ddfafc Ensure we have atleast 2-byte alignment for member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 22:49:20 +00:00