]> granicus.if.org Git - clang/log
clang
14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 years agoMove the "needs exception support" logic to clang. This also fixes
Rafael Espindola [Thu, 1 Oct 2009 13:33:33 +0000 (13:33 +0000)]
Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.

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

14 years agoFix a lame regression in IR gen for C++ delete expressions. PR5102
Douglas Gregor [Thu, 1 Oct 2009 05:49:51 +0000 (05:49 +0000)]
Fix a lame regression in IR gen for C++ delete expressions. PR5102

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

14 years agoAdd support for class and protocol references.
Steve Naroff [Thu, 1 Oct 2009 00:31:07 +0000 (00:31 +0000)]
Add support for class and protocol references.

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

14 years agoA couple of refinements for laying out debug information for
Mike Stump [Thu, 1 Oct 2009 00:27:30 +0000 (00:27 +0000)]
A couple of refinements for laying out debug information for
BlockDeclRefDecls.

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

14 years agoAnonymous namespaces, sema + codegen. A lot of semantics are still broken,
John McCall [Thu, 1 Oct 2009 00:25:31 +0000 (00:25 +0000)]
Anonymous namespaces, sema + codegen.  A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.

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

14 years agoImprove template argument deduction in the case where the parameter
Douglas Gregor [Wed, 30 Sep 2009 22:13:51 +0000 (22:13 +0000)]
Improve template argument deduction in the case where the parameter
type is a template-id (e.g., basic_ostream<CharT, Traits>) and the
argument type is a class that has a derived class matching the
parameter type. Previously, we were giving up on template argument
deduction too early.

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

14 years agoWhen overload resolution fails for an overloaded operator, show the
Douglas Gregor [Wed, 30 Sep 2009 21:46:01 +0000 (21:46 +0000)]
When overload resolution fails for an overloaded operator, show the
overload candidates (but not the built-in ones). We still rely on the
underlying built-in semantic analysis to produce the initial
diagnostic, then print the candidates following that diagnostic.

One side advantage of this approach is that we can perform more validation
of C++'s operator overloading with built-in candidates vs. the
semantic analysis for those built-in operators: when there are no
viable candidates, we know to expect an error from the built-in
operator handling code. Otherwise, we are not modeling the built-in
semantics properly within operator overloading. This is checked as:

      assert(Result.isInvalid() &&
             "C++ binary operator overloading is missing
             candidates!");
      if (Result.isInvalid())
        PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);

The assert() catches cases where we're wrong in a +Asserts build. The
"if" makes sure that, if this happens in a production clang
(-Asserts), we still build the proper built-in operator and continue
on our merry way. This is effectively what happened before this
change, but we've added the assert() to catch more flies.

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

14 years agoTweak CHECK lines to eliminate a failure on i686-apple-darwin10
Douglas Gregor [Wed, 30 Sep 2009 21:39:51 +0000 (21:39 +0000)]
Tweak CHECK lines to eliminate a failure on i686-apple-darwin10

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

14 years agoIssue good diagnostics when initializing a refernce type with
Fariborz Jahanian [Wed, 30 Sep 2009 21:23:30 +0000 (21:23 +0000)]
Issue good diagnostics when initializing a refernce type with
a bad initializer. Fixes pr4274.

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

14 years agoAdd an error for function parameters that have a qualified address space since this...
Tanya Lattner [Wed, 30 Sep 2009 20:47:43 +0000 (20:47 +0000)]
Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.

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

14 years agofix line #'s
Chris Lattner [Wed, 30 Sep 2009 20:20:06 +0000 (20:20 +0000)]
fix line #'s

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

14 years agoadd some more popular examples, color code warning: and error: like the command line.
Chris Lattner [Wed, 30 Sep 2009 20:19:10 +0000 (20:19 +0000)]
add some more popular examples, color code warning: and error: like the command line.

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

14 years agoConvert from nonportable grep to filecheck, patch by John Thompson
Chris Lattner [Wed, 30 Sep 2009 19:55:07 +0000 (19:55 +0000)]
Convert from nonportable grep to filecheck, patch by John Thompson

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

14 years agoUpdate C++ status page
Douglas Gregor [Wed, 30 Sep 2009 18:32:57 +0000 (18:32 +0000)]
Update C++ status page

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

14 years agoNote location of operators caused the circularity.
Fariborz Jahanian [Wed, 30 Sep 2009 17:46:20 +0000 (17:46 +0000)]
Note location of operators caused the circularity.

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

14 years ago<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result...
Fariborz Jahanian [Wed, 30 Sep 2009 17:10:29 +0000 (17:10 +0000)]
<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.

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

14 years agoupdate copyright.
Chris Lattner [Wed, 30 Sep 2009 15:59:45 +0000 (15:59 +0000)]
update copyright.

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

14 years agoImprove debugging information for BlockDeclRefExpr. WIP. Given this
Mike Stump [Wed, 30 Sep 2009 02:43:10 +0000 (02:43 +0000)]
Improve debugging information for BlockDeclRefExpr.  WIP.  Given this
scheme, we can switch the previous scheme over to using this code
path.  There's a bit of simplifications yet to do as well.

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

14 years agoSpare the processors of those poor wretches who have no choice but to write
John McCall [Wed, 30 Sep 2009 01:30:54 +0000 (01:30 +0000)]
Spare the processors of those poor wretches who have no choice but to write
unbounded chains of operator-> delegations.

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

14 years agoDetect operator-> chains of arbitrary length. Use a terrible data structure
John McCall [Wed, 30 Sep 2009 01:01:30 +0000 (01:01 +0000)]
Detect operator-> chains of arbitrary length.  Use a terrible data structure
to strike fear into the hearts of CPUs everywhere.

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

14 years agoself-referecing operator '->' member function was causing
Fariborz Jahanian [Wed, 30 Sep 2009 00:19:41 +0000 (00:19 +0000)]
self-referecing operator '->' member function was causing
infinit recursion. This patch fixes it. [13.3.1.2]-p2

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

14 years agoFind operators new/delete in base classes. FIXME -= 2;
Douglas Gregor [Wed, 30 Sep 2009 00:03:47 +0000 (00:03 +0000)]
Find operators new/delete in base classes. FIXME -= 2;

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

14 years agoDesugaring optimizations. Add single-step desugaring methods to all
John McCall [Tue, 29 Sep 2009 23:03:30 +0000 (23:03 +0000)]
Desugaring optimizations.  Add single-step desugaring methods to all
concrete types.  Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate.  Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.

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

14 years agoThe C++ delete expression strips cv-qualifiers from the pointed-to type. My previous...
Douglas Gregor [Tue, 29 Sep 2009 21:38:53 +0000 (21:38 +0000)]
The C++ delete expression strips cv-qualifiers from the pointed-to type. My previous fix eliminated this behavior, so bring it back again.

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

14 years agoPull TypeLocVisitor into its own header file.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 21:27:32 +0000 (21:27 +0000)]
Pull TypeLocVisitor into its own header file.

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

14 years agoKeep track of type references in DeclReferenceMap.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 21:26:53 +0000 (21:26 +0000)]
Keep track of type references in DeclReferenceMap.

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

14 years agoIn ASTVisitor, call the correct base methods.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 21:26:35 +0000 (21:26 +0000)]
In ASTVisitor, call the correct base methods.

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

14 years agoFix Decl class hierarchy.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 21:26:14 +0000 (21:26 +0000)]
Fix Decl class hierarchy.

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

14 years ago13.1-p3 Overloadable declarations
Fariborz Jahanian [Tue, 29 Sep 2009 20:28:06 +0000 (20:28 +0000)]
13.1-p3 Overloadable declarations
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.

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

14 years agoResolve a source location inside the return type of a functon.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 19:58:16 +0000 (19:58 +0000)]
Resolve a source location inside the return type of a functon.

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

14 years agoWhen pointing at a type decl reference, ASTLocation is a NamedDeclRef.
Argyrios Kyrtzidis [Tue, 29 Sep 2009 19:45:58 +0000 (19:45 +0000)]
When pointing at a type decl reference, ASTLocation is a NamedDeclRef.

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