]> granicus.if.org Git - clang/log
clang
15 years agoFix an assertion in the XML output, from Olaf Krzikalla!
Douglas Gregor [Thu, 8 Oct 2009 21:29:50 +0000 (21:29 +0000)]
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

15 years agoRecord location info before emiting alloca for arguments. This allows arguments to...
Devang Patel [Thu, 8 Oct 2009 18:53:37 +0000 (18:53 +0000)]
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

15 years agoImplement [expr.mptr.oper]p6 for '->*' operator.
Fariborz Jahanian [Thu, 8 Oct 2009 18:00:39 +0000 (18:00 +0000)]
Implement [expr.mptr.oper]p6 for '->*' operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83562 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove use of std::ofstream in HTMLDiagnostics.cpp.
Ted Kremenek [Thu, 8 Oct 2009 17:44:41 +0000 (17:44 +0000)]
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

15 years agoIf a global initializer has a non-trivial constructor or destructor, we never want...
Anders Carlsson [Thu, 8 Oct 2009 17:28:59 +0000 (17:28 +0000)]
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

15 years agoPort test over to FileCheck.
Anders Carlsson [Thu, 8 Oct 2009 17:22:47 +0000 (17:22 +0000)]
Port test over to FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83558 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMangle std::basic_ostream<char, std::char_traits<char>> as So.
Anders Carlsson [Thu, 8 Oct 2009 17:20:26 +0000 (17:20 +0000)]
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

15 years agoAdd more testing for the properties of explicit specialization.
Douglas Gregor [Thu, 8 Oct 2009 16:41:22 +0000 (16:41 +0000)]
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

15 years agoRefactoring to further simplify collection of visible conversion
Fariborz Jahanian [Thu, 8 Oct 2009 16:33:37 +0000 (16:33 +0000)]
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

15 years agoDon't complain about out-of-line explicit specializations of member
Douglas Gregor [Thu, 8 Oct 2009 15:54:21 +0000 (15:54 +0000)]
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

15 years agoMore testing for explicit specializations of member class templates
Douglas Gregor [Thu, 8 Oct 2009 15:27:05 +0000 (15:27 +0000)]
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

15 years agoImprove checking for specializations of member classes of class
Douglas Gregor [Thu, 8 Oct 2009 15:14:33 +0000 (15:14 +0000)]
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

15 years agoFor instantiations of static data members of class templates, keep
Douglas Gregor [Thu, 8 Oct 2009 07:24:58 +0000 (07:24 +0000)]
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

15 years agoMake sure to set the template specialization kind of an explicit
Douglas Gregor [Thu, 8 Oct 2009 01:19:17 +0000 (01:19 +0000)]
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

15 years agoCompress storage for MemberSpecializationInfo into a single
Douglas Gregor [Thu, 8 Oct 2009 00:19:07 +0000 (00:19 +0000)]
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

15 years agoOnly perform an implicit instantiation of a function if its template
Douglas Gregor [Thu, 8 Oct 2009 00:14:38 +0000 (00:14 +0000)]
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

15 years agoKeep track of whether a member function instantiated from a member
Douglas Gregor [Wed, 7 Oct 2009 23:56:10 +0000 (23:56 +0000)]
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

15 years agoRefactoring around friend class templates. Better error message for friend enums.
John McCall [Wed, 7 Oct 2009 23:34:25 +0000 (23:34 +0000)]
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

15 years agoType checking for specializations of member functions of class
Douglas Gregor [Wed, 7 Oct 2009 22:35:40 +0000 (22:35 +0000)]
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

15 years agoHandle MemberExprs in ResolveAddressOfOverloadedFunction.
Anders Carlsson [Wed, 7 Oct 2009 22:26:29 +0000 (22:26 +0000)]
Handle MemberExprs in ResolveAddressOfOverloadedFunction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83495 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDead code elimination.
John McCall [Wed, 7 Oct 2009 22:04:40 +0000 (22:04 +0000)]
Dead code elimination.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixes problem in finding visible convertion functions of a class
Fariborz Jahanian [Wed, 7 Oct 2009 20:43:36 +0000 (20:43 +0000)]
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

15 years agoDiagnose explicit instantiations and specializations that occur in class scope
Douglas Gregor [Wed, 7 Oct 2009 17:30:37 +0000 (17:30 +0000)]
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

15 years agoWhen building candidate set for built-ins; when looking for
Fariborz Jahanian [Wed, 7 Oct 2009 17:26:09 +0000 (17:26 +0000)]
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

15 years agoClass template partial specializations can be declared anywhere that
Douglas Gregor [Wed, 7 Oct 2009 17:21:34 +0000 (17:21 +0000)]
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

15 years agoRemoved couple of unnecessary canonicalization
Fariborz Jahanian [Wed, 7 Oct 2009 16:56:50 +0000 (16:56 +0000)]
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

15 years agoAdd 'template' keyword to disambiguate the use of a member template within a template...
Ted Kremenek [Wed, 7 Oct 2009 06:20:14 +0000 (06:20 +0000)]
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

15 years agoRevert r83443.
Ted Kremenek [Wed, 7 Oct 2009 03:21:11 +0000 (03:21 +0000)]
Revert r83443.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83451 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMangle anonymous structs/unions correctly. Fixes PR5139.
Anders Carlsson [Wed, 7 Oct 2009 01:45:02 +0000 (01:45 +0000)]
Mangle anonymous structs/unions correctly. Fixes PR5139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83448 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixup pathnames.
Mike Stump [Wed, 7 Oct 2009 01:11:54 +0000 (01:11 +0000)]
Fixup pathnames.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a MangleContext and pass it to all mangle functions. It will be used for keeping...
Anders Carlsson [Wed, 7 Oct 2009 01:06:45 +0000 (01:06 +0000)]
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

15 years agoMore testing of explicit specializations
Douglas Gregor [Wed, 7 Oct 2009 00:45:53 +0000 (00:45 +0000)]
More testing of explicit specializations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83440 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc...
Ted Kremenek [Wed, 7 Oct 2009 00:42:52 +0000 (00:42 +0000)]
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

15 years agoForce a specific target triple in c-index-api-test.m, making the behavior of the...
Ted Kremenek [Wed, 7 Oct 2009 00:39:48 +0000 (00:39 +0000)]
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

15 years agoRefactor checking of the scope of explicit template specialization
Douglas Gregor [Wed, 7 Oct 2009 00:13:32 +0000 (00:13 +0000)]
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

15 years agoFix eof.
Mike Stump [Tue, 6 Oct 2009 23:38:59 +0000 (23:38 +0000)]
Fix eof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83433 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix eof.
Mike Stump [Tue, 6 Oct 2009 23:38:31 +0000 (23:38 +0000)]
Fix eof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83432 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to implement C++ [over.built]p11 of overload resolution.
Fariborz Jahanian [Tue, 6 Oct 2009 23:08:05 +0000 (23:08 +0000)]
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

15 years agoUncomment some commented out code.
Anders Carlsson [Tue, 6 Oct 2009 23:02:00 +0000 (23:02 +0000)]
Uncomment some commented out code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83428 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd codegen for __builtin_abort. Convert to FileCheck.
Mike Stump [Tue, 6 Oct 2009 22:58:45 +0000 (22:58 +0000)]
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

15 years agoChange GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offset...
Anders Carlsson [Tue, 6 Oct 2009 22:43:30 +0000 (22:43 +0000)]
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

15 years agoAdd files to xcode project.
Anders Carlsson [Tue, 6 Oct 2009 22:07:00 +0000 (22:07 +0000)]
Add files to xcode project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83423 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen mangling names, always use the canonical decl. Fixes PR5144.
Anders Carlsson [Tue, 6 Oct 2009 21:58:01 +0000 (21:58 +0000)]
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

15 years agoInsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
Devang Patel [Tue, 6 Oct 2009 21:53:41 +0000 (21:53 +0000)]
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

15 years agoTest explicit specialization for all of the various cases where
Douglas Gregor [Tue, 6 Oct 2009 21:27:51 +0000 (21:27 +0000)]
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

15 years agoAdd more of __builtin_abort, WIP, still missing codegen.
Mike Stump [Tue, 6 Oct 2009 20:30:09 +0000 (20:30 +0000)]
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

15 years agoUpdated checker build.
Ted Kremenek [Tue, 6 Oct 2009 20:19:01 +0000 (20:19 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83408 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd support to attach debug info to an instruction.
Devang Patel [Tue, 6 Oct 2009 18:36:08 +0000 (18:36 +0000)]
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

15 years agoFix test.
Anders Carlsson [Tue, 6 Oct 2009 18:12:12 +0000 (18:12 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83398 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEmit the destructor epilogue in a cleanup block so a return from a destructor body...
Anders Carlsson [Tue, 6 Oct 2009 18:09:57 +0000 (18:09 +0000)]
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

15 years agoRefactor the code that walks a C++ inheritance hierarchy, searching
Douglas Gregor [Tue, 6 Oct 2009 17:59:45 +0000 (17:59 +0000)]
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

15 years agoPass the right type to GetAddrOfFunction when getting functions for the VTable. Fixes...
Anders Carlsson [Tue, 6 Oct 2009 17:54:23 +0000 (17:54 +0000)]
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

15 years agoAdd the -nostdclanginc option to clang (the driver).
Rafael Espindola [Tue, 6 Oct 2009 12:45:37 +0000 (12:45 +0000)]
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

15 years agoFix 'clang-cc -analyzer-display-progress' by flushing standard error after printing...
Ted Kremenek [Tue, 6 Oct 2009 03:49:25 +0000 (03:49 +0000)]
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

15 years agoFix crash introduced by r83358 where a symbol could be eagerly
Ted Kremenek [Tue, 6 Oct 2009 03:44:49 +0000 (03:44 +0000)]
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

15 years agoFix: <rdar://problem/7275774> Static analyzer warns about NULL pointer when
Ted Kremenek [Tue, 6 Oct 2009 01:39:48 +0000 (01:39 +0000)]
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

15 years agoRefactor the c++ include path a bit.
Rafael Espindola [Tue, 6 Oct 2009 01:33:02 +0000 (01:33 +0000)]
Refactor the c++ include path a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83357 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet appropriate context for a global variable while emitting debug info.
Devang Patel [Tue, 6 Oct 2009 00:35:31 +0000 (00:35 +0000)]
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

15 years agoRefixed pr5086 by letting Expr::isNullPointerConstant
Fariborz Jahanian [Tue, 6 Oct 2009 00:09:31 +0000 (00:09 +0000)]
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

15 years agoThis is slightly contentious, but, if llvm has gone to addressable
Mike Stump [Mon, 5 Oct 2009 23:40:59 +0000 (23:40 +0000)]
This is slightly contentious, but, if llvm has gone to addressable
units, we should as well.  The problem is the non-predictability of
the dimension of the values.  I'd love for the dimension to be part of
the static type system...  but in C++ it is kinda annoying to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83345 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix thinko and simplify.
Mike Stump [Mon, 5 Oct 2009 23:08:21 +0000 (23:08 +0000)]
Fix thinko and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83342 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnsure we have atleast 2-byte alignment for member functions.
Mike Stump [Mon, 5 Oct 2009 22:49:20 +0000 (22:49 +0000)]
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

15 years agoMake sure that c-index-test links as a C++ executable
Douglas Gregor [Mon, 5 Oct 2009 22:29:42 +0000 (22:29 +0000)]
Make sure that c-index-test links as a C++ executable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83335 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure that libCIndex links as a C++ library
Douglas Gregor [Mon, 5 Oct 2009 22:25:29 +0000 (22:25 +0000)]
Make sure that libCIndex links as a C++ library

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83331 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTestcase for recent checkin.
Mike Stump [Mon, 5 Oct 2009 22:24:47 +0000 (22:24 +0000)]
Testcase for recent checkin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83330 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRespect alignments better.
Mike Stump [Mon, 5 Oct 2009 21:58:44 +0000 (21:58 +0000)]
Respect alignments better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix C90 compile warning about mixed declarations and code.
Eric Christopher [Mon, 5 Oct 2009 21:33:42 +0000 (21:33 +0000)]
Fix C90 compile warning about mixed declarations and code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83327 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotweaked my last patch to 1) preserve the protocol in
Fariborz Jahanian [Mon, 5 Oct 2009 21:32:49 +0000 (21:32 +0000)]
tweaked my last patch to 1) preserve the protocol in
extension class's protocol list so its AST is complete.
2) Because of this no need to issue warning on unimplemeted
methods coming from the extended class protocols
because warning is issued when class definition is seen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83326 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove this test, grepping for define isn't really testing anything.
Chris Lattner [Mon, 5 Oct 2009 21:16:22 +0000 (21:16 +0000)]
remove this test, grepping for define isn't really testing anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83325 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEncode the Clang branch and Subversion revision into a PCH file, and
Douglas Gregor [Mon, 5 Oct 2009 21:07:28 +0000 (21:07 +0000)]
Encode the Clang branch and Subversion revision into a PCH file, and
assume that PCH files from different Clang revisions are not
compatible. Addresses <rdar://problem/7266572>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83323 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to implement Protocols on class extensions.
Fariborz Jahanian [Mon, 5 Oct 2009 20:41:32 +0000 (20:41 +0000)]
Patch to implement Protocols on class extensions.
<rdar://problem/7269631> Protocols on class extensions don't work

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83322 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProvide a common set of routines in Version.h that return Subversion
Douglas Gregor [Mon, 5 Oct 2009 20:33:49 +0000 (20:33 +0000)]
Provide a common set of routines in Version.h that return Subversion
branch/revision information. Use that information in the driver,
rather than one-off branch/revision computation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83321 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPre-commit commit to get URL keyword expansion for Clang version information
Douglas Gregor [Mon, 5 Oct 2009 18:52:24 +0000 (18:52 +0000)]
Pre-commit commit to get URL keyword expansion for Clang version information

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83319 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
Steve Naroff [Mon, 5 Oct 2009 17:58:19 +0000 (17:58 +0000)]
- Fix assert in clang_getCursorDecl (having to do with recently added ObjC_ProtocolRef).
- Make sure CHECK: lines in test case match the expected output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83316 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse new predicates for some type equality tests.
Benjamin Kramer [Mon, 5 Oct 2009 13:47:21 +0000 (13:47 +0000)]
Use new predicates for some type equality tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a -nostdclanginc flag to clang-cc that prevents it from searching
Rafael Espindola [Mon, 5 Oct 2009 13:12:17 +0000 (13:12 +0000)]
Add a -nostdclanginc flag to clang-cc that prevents it from searching
its own binary-relative headers. Useful when using clang's preprocessor
with gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83302 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass the canonical method decl to GetVtableIndex. Fixes PR5120.
Anders Carlsson [Sat, 3 Oct 2009 19:56:56 +0000 (19:56 +0000)]
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement code generation of member function pointer calls. Fixes PR5121.
Anders Carlsson [Sat, 3 Oct 2009 19:43:08 +0000 (19:43 +0000)]
Implement code generation of member function pointer calls. Fixes PR5121.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83271 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCreate CXXMemberCallExpr for pointer-to-member calls.
Anders Carlsson [Sat, 3 Oct 2009 17:40:22 +0000 (17:40 +0000)]
Create CXXMemberCallExpr for pointer-to-member calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83268 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIgnore No-op casts when evaluating lvalue expressions. Fixes PR5122.
Anders Carlsson [Sat, 3 Oct 2009 16:30:22 +0000 (16:30 +0000)]
Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach AggExprEmitter about pointers to member functions.
Anders Carlsson [Sat, 3 Oct 2009 15:43:24 +0000 (15:43 +0000)]
Teach AggExprEmitter about pointers to member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83266 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle base-to-derived casts of member function pointers in CGExprConstant.cpp
Anders Carlsson [Sat, 3 Oct 2009 15:13:22 +0000 (15:13 +0000)]
Handle base-to-derived casts of member function pointers in CGExprConstant.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83265 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle members to function pointers in CGExprConstant.
Anders Carlsson [Sat, 3 Oct 2009 15:02:02 +0000 (15:02 +0000)]
Handle members to function pointers in CGExprConstant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83264 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove some functions from CodeGenFunctions to CodeGenModule so they can be used by...
Anders Carlsson [Sat, 3 Oct 2009 14:56:57 +0000 (14:56 +0000)]
Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83263 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRewrite member function pointer test not to rely on -O2.
Anders Carlsson [Sat, 3 Oct 2009 14:39:13 +0000 (14:39 +0000)]
Rewrite member function pointer test not to rely on -O2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83262 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix typo.
Benjamin Kramer [Fri, 2 Oct 2009 12:19:16 +0000 (12:19 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83246 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFileCheckize test case.
Benjamin Kramer [Fri, 2 Oct 2009 10:32:51 +0000 (10:32 +0000)]
FileCheckize test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83244 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDon't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
Anders Carlsson [Fri, 2 Oct 2009 04:52:12 +0000 (04:52 +0000)]
Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83235 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore magic pixie dust.
Mike Stump [Fri, 2 Oct 2009 02:30:50 +0000 (02:30 +0000)]
More magic pixie dust.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83232 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix up debug information for block pointers a bit more.
Mike Stump [Fri, 2 Oct 2009 02:23:37 +0000 (02:23 +0000)]
Fix up debug information for block pointers a bit more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83231 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen building constant structs, check if the resulting LLVM struct will be bigger...
Anders Carlsson [Fri, 2 Oct 2009 02:15:20 +0000 (02:15 +0000)]
When building constant structs, check if the resulting LLVM struct will be bigger than the record layout size and use a packed struct if that's the case. Fixes PR5108.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83230 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake sure to free the explicit template arguments provided for an
Douglas Gregor [Thu, 1 Oct 2009 23:51:25 +0000 (23:51 +0000)]
Make sure to free the explicit template arguments provided for an
explicit instantiation. Also, tighten up reference-count checking to
help catch these issues earlier. Fixes PR5069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83225 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Remove Sema::FindMethodInNestedImplementations().
Steve Naroff [Thu, 1 Oct 2009 23:46:04 +0000 (23:46 +0000)]
- Remove Sema::FindMethodInNestedImplementations().
- Add ObjCInterfaceDecl::lookupPrivateInstanceMethod().
- Convert clients.

No functionality change - One less method in Sema:-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83224 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen the return type of a function is dependent, don't perform any
Douglas Gregor [Thu, 1 Oct 2009 23:25:31 +0000 (23:25 +0000)]
When the return type of a function is dependent, don't perform any
of the flow-control checks for falling off the end of a function,
since the return type may instantiate to void. Similarly, if a
return statement has an expression and the return type of the function
is void, don't complain if the expression is type-dependent, since
that type could instantiate to void.

Fixes PR5071.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83222 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement a FIXME. This improves codegen just a tad.
Mike Stump [Thu, 1 Oct 2009 22:29:41 +0000 (22:29 +0000)]
Implement a FIXME.  This improves codegen just a tad.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83221 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoenumerator value of 0 is not a null pointer constant for
Fariborz Jahanian [Thu, 1 Oct 2009 22:10:15 +0000 (22:10 +0000)]
enumerator value of 0 is not a null pointer constant for
deciding const of null pointer conversion. Fixes PR5086.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83217 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCodeGen may see out-of-line declarations of the various special member
Douglas Gregor [Thu, 1 Oct 2009 20:44:19 +0000 (20:44 +0000)]
CodeGen may see out-of-line declarations of the various special member
functions when they are explicitly declared, e.g., via a function
template specialization or explicit template instantiation
declaration. Don't try to synthesize bodies for the special member
functions in this case; rather, check whether we have an implicit
declaration and, if so, synthesize the appropriate function
body. Fixes PR5084.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83212 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch to implement static casting which requires one
Fariborz Jahanian [Thu, 1 Oct 2009 20:39:51 +0000 (20:39 +0000)]
Patch to implement static casting which requires one
user-defined type conversion. Fixes PR5040.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83211 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet __EXCEPTIONS by checking on darwin's triple.
Fariborz Jahanian [Thu, 1 Oct 2009 20:30:46 +0000 (20:30 +0000)]
Set __EXCEPTIONS by checking on darwin's triple.
Patch by Rafael Espindola.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83209 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix bad grammar in static analyzer diagnostic. Reported by Robert Purves!
Ted Kremenek [Thu, 1 Oct 2009 17:31:50 +0000 (17:31 +0000)]
Fix bad grammar in static analyzer diagnostic.  Reported by Robert Purves!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83204 91177308-0d34-0410-b5e6-96231b3b80d8