]> granicus.if.org Git - clang/log
clang
13 years agoEliminate an unused local variable
Douglas Gregor [Mon, 1 Nov 2010 21:56:54 +0000 (21:56 +0000)]
Eliminate an unused local variable

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

13 years agoClean up temporaries created by an asm statement. Fixes rdar://8540491
Argyrios Kyrtzidis [Mon, 1 Nov 2010 21:51:42 +0000 (21:51 +0000)]
Clean up temporaries created by an asm statement. Fixes rdar://8540491

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

13 years agoHarden Sema::MaybeBindTotemporary.
Douglas Gregor [Mon, 1 Nov 2010 21:10:29 +0000 (21:10 +0000)]
Harden Sema::MaybeBindTotemporary.

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

13 years agoRestore patch for PR8453 which was undone in r117829
Fariborz Jahanian [Mon, 1 Nov 2010 20:47:16 +0000 (20:47 +0000)]
Restore patch for PR8453 which was undone in r117829
(was project bugs).

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

13 years agoDo not compare invalid source locations
Douglas Gregor [Mon, 1 Nov 2010 20:13:04 +0000 (20:13 +0000)]
Do not compare invalid source locations

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

13 years agoEmit error when using a bound member function for something other than calling it.
Argyrios Kyrtzidis [Mon, 1 Nov 2010 18:49:26 +0000 (18:49 +0000)]
Emit error when using a bound member function for something other than calling it.

Also avoids IRGen crashes due to accepting invalid code.

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

13 years agoRequire that the types of the parameters of a block literal are complete.
Douglas Gregor [Mon, 1 Nov 2010 18:37:59 +0000 (18:37 +0000)]
Require that the types of the parameters of a block literal are complete.

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

13 years agoSimplify. Builtin types' context is always implied.
Devang Patel [Mon, 1 Nov 2010 16:52:40 +0000 (16:52 +0000)]
Simplify. Builtin types' context is always implied.

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

13 years agoDon't update empty field subobjects for bitfields. Fixes PR8519.
Anders Carlsson [Mon, 1 Nov 2010 15:14:51 +0000 (15:14 +0000)]
Don't update empty field subobjects for bitfields. Fixes PR8519.

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

13 years agoPlug a leak in the preprocessing record's handling of inclusion
Douglas Gregor [Mon, 1 Nov 2010 15:03:47 +0000 (15:03 +0000)]
Plug a leak in the preprocessing record's handling of inclusion
directives. We had a std::string in an object that was allocated via a
BumpPtrAllocator.

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

13 years agoDisable some timing code
Douglas Gregor [Mon, 1 Nov 2010 13:48:43 +0000 (13:48 +0000)]
Disable some timing code

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

13 years agoExplicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
Zhongxing Xu [Mon, 1 Nov 2010 13:04:58 +0000 (13:04 +0000)]
Explicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
and ImplicitCastExpr to propagate asLValue AddStmtChoice property.
But do not propagate AlwaysAdd property.

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

13 years agoNow initializer of C++ record type is visited as block-level expr.
Zhongxing Xu [Mon, 1 Nov 2010 09:09:44 +0000 (09:09 +0000)]
Now initializer of C++ record type is visited as block-level expr.
Let the destination of AggExprVisitor be an explicit MemRegion.
Reenable the test case.

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

13 years agoMake all CXXConstructExpr's block-level expressions. This is required by
Zhongxing Xu [Mon, 1 Nov 2010 06:46:05 +0000 (06:46 +0000)]
Make all CXXConstructExpr's block-level expressions. This is required by
method inlining. Temporarily fail a test case.

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

13 years agoOnly apply -fvisibility-inlines-hidden to definitions. Apparently
John McCall [Mon, 1 Nov 2010 01:29:57 +0000 (01:29 +0000)]
Only apply -fvisibility-inlines-hidden to definitions.  Apparently
isInlined() just gives meaningless results for non-definitions.

Fixes rdar://problem/8614470

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

13 years agoGet rid of more calls to getBaseClassOffsetInBits.
Anders Carlsson [Mon, 1 Nov 2010 00:21:58 +0000 (00:21 +0000)]
Get rid of more calls to getBaseClassOffsetInBits.

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

13 years agoPort over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset...
Anders Carlsson [Sun, 31 Oct 2010 23:45:59 +0000 (23:45 +0000)]
Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.

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

13 years agoRename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOff...
Anders Carlsson [Sun, 31 Oct 2010 23:22:37 +0000 (23:22 +0000)]
Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.

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

13 years agoStart converting over the RecordLayoutBuilder next.
Anders Carlsson [Sun, 31 Oct 2010 22:20:42 +0000 (22:20 +0000)]
Start converting over the RecordLayoutBuilder next.

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

13 years agoEmptyObjectMap now uses CharUnits wherever possible.
Anders Carlsson [Sun, 31 Oct 2010 22:13:23 +0000 (22:13 +0000)]
EmptyObjectMap now uses CharUnits wherever possible.

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

13 years agoMore CharUnits conversion.
Anders Carlsson [Sun, 31 Oct 2010 21:54:55 +0000 (21:54 +0000)]
More CharUnits conversion.

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

13 years agoMore CharUnits conversion.
Anders Carlsson [Sun, 31 Oct 2010 21:39:24 +0000 (21:39 +0000)]
More CharUnits conversion.

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

13 years agoUse CharUnits in the EmptyClassOffsets map.
Anders Carlsson [Sun, 31 Oct 2010 21:22:43 +0000 (21:22 +0000)]
Use CharUnits in the EmptyClassOffsets map.

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

13 years agoAdd a DenseMapInfo specializaiton for CharUnits.
Anders Carlsson [Sun, 31 Oct 2010 21:17:03 +0000 (21:17 +0000)]
Add a DenseMapInfo specializaiton for CharUnits.

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

13 years agoCorrect typos and whitespace, spotted by Nico Weber!
Nick Lewycky [Sun, 31 Oct 2010 21:07:24 +0000 (21:07 +0000)]
Correct typos and whitespace, spotted by Nico Weber!

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

13 years agoFix typo spotted by Nico Weber.
Nick Lewycky [Sun, 31 Oct 2010 21:04:33 +0000 (21:04 +0000)]
Fix typo spotted by Nico Weber.

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

13 years agoBaby steps towards using only CharUnits for base class offsets in ASTRecordLayout...
Anders Carlsson [Sun, 31 Oct 2010 21:01:46 +0000 (21:01 +0000)]
Baby steps towards using only CharUnits for base class offsets in ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object.

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

13 years agoTeach the constant expr evaluator about derived-to-base casts when no virtual bases...
Anders Carlsson [Sun, 31 Oct 2010 20:41:46 +0000 (20:41 +0000)]
Teach the constant expr evaluator about derived-to-base casts when no virtual bases are involved. Fixes PR5974.

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

13 years agoMake Clang static analyzer skip function template definitions. This fixes Clang...
Zhanyong Wan [Sun, 31 Oct 2010 04:22:34 +0000 (04:22 +0000)]
Make Clang static analyzer skip function template definitions.  This fixes Clang PR 8426, 8427, & 8433.  Reviewed by Ted Kremenek and Doug Gregor.

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

13 years agoDon't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes...
Anders Carlsson [Sun, 31 Oct 2010 01:21:47 +0000 (01:21 +0000)]
Don't try to evaluate the LHS or RHS of a member pointer binary operation. Fixes PR8507.

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

13 years agoEmit an error when trying to form a pointer-to-member to a bitfield.
Argyrios Kyrtzidis [Sat, 30 Oct 2010 19:52:22 +0000 (19:52 +0000)]
Emit an error when trying to form a pointer-to-member to a bitfield.

As a bonus, avoids a crash on the IRGen side due to accepting invalid code.

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

13 years agorenamed: test/SemaCXX/ptrtomember-badcall.cpp -> test/SemaCXX/ptrtomember.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 19:52:19 +0000 (19:52 +0000)]
renamed:    test/SemaCXX/ptrtomember-badcall.cpp -> test/SemaCXX/ptrtomember.cpp

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

13 years agoRevert r117678, "Qualified 'id' should implement all of static class type's", it...
Daniel Dunbar [Sat, 30 Oct 2010 19:22:48 +0000 (19:22 +0000)]
Revert r117678, "Qualified 'id' should implement all of static class type's", it breaks things.

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

13 years agoTurns out that we may end up calling dladdr on GetExecutablePath, give it external...
Benjamin Kramer [Sat, 30 Oct 2010 17:32:40 +0000 (17:32 +0000)]
Turns out that we may end up calling dladdr on GetExecutablePath, give it external linkage to make sure the lookup works on all platforms.

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

13 years agoThis function doesn't need external linkage either.
Benjamin Kramer [Sat, 30 Oct 2010 14:28:41 +0000 (14:28 +0000)]
This function doesn't need external linkage either.

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

13 years agoBetter solution: calculate the visibility of functions and variables
John McCall [Sat, 30 Oct 2010 11:50:40 +0000 (11:50 +0000)]
Better solution:  calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations.  Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093

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

13 years agoGCC faithfully calculates visibility for variables independently of
John McCall [Sat, 30 Oct 2010 09:18:49 +0000 (09:18 +0000)]
GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given.  It's not totally clear
how that should be mapped into a sane system, but make an effort.

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

13 years agoUse the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
Benjamin Kramer [Sat, 30 Oct 2010 08:28:42 +0000 (08:28 +0000)]
Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.

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

13 years agoPreserve the template type parameter name when instantiating a templace.
Nick Lewycky [Sat, 30 Oct 2010 06:48:20 +0000 (06:48 +0000)]
Preserve the template type parameter name when instantiating a templace.
Fixes PR8489.

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

13 years agoRename alignof -> alignOf to avoid irritating C++'0x compilers,
Chris Lattner [Sat, 30 Oct 2010 05:14:06 +0000 (05:14 +0000)]
Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423

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

13 years agoFlush statements after writing each DECL_CXX_BASE_SPECIFIERS node
Douglas Gregor [Sat, 30 Oct 2010 04:28:16 +0000 (04:28 +0000)]
Flush statements after writing each DECL_CXX_BASE_SPECIFIERS node

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

13 years agoDon't remove the init expression from the initializer list if it had a semantic error.
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:26 +0000 (01:06 +0000)]
Don't remove the init expression from the initializer list if it had a semantic error.

We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily.
Fixes rdar://8605381.

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

13 years agoAdd test/SemaCXX/crash-PR7625.cpp into test/SemaCXX/crashes.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:23 +0000 (01:06 +0000)]
Add test/SemaCXX/crash-PR7625.cpp into test/SemaCXX/crashes.cpp

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

13 years agotest/SemaCXX/crash-8124080.cpp -> test/SemaCXX/crashes.cpp
Argyrios Kyrtzidis [Sat, 30 Oct 2010 01:06:21 +0000 (01:06 +0000)]
test/SemaCXX/crash-8124080.cpp -> test/SemaCXX/crashes.cpp

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

13 years agoAdd test case for <rdar://problem/8610363> (a bogus report of using an uninitialized...
Ted Kremenek [Sat, 30 Oct 2010 00:43:15 +0000 (00:43 +0000)]
Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized field).  This was
already fixed, but this serves for detecting regressions.

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

13 years agoMake the deserialization of macro definitions lazy, so that we can
Douglas Gregor [Sat, 30 Oct 2010 00:23:06 +0000 (00:23 +0000)]
Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.

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

13 years agoWhen list-initializing a vector, try to copy-initialize from vectors instead
John McCall [Sat, 30 Oct 2010 00:11:39 +0000 (00:11 +0000)]
When list-initializing a vector, try to copy-initialize from vectors instead
of descending into the subelements.

rdar://problem/8345836

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

13 years agoDon't test isRegularFile before calling eraseFromDisk, since
Dan Gohman [Fri, 29 Oct 2010 23:26:14 +0000 (23:26 +0000)]
Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

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

13 years agoHandle Type.h a better way.
Dale Johannesen [Fri, 29 Oct 2010 23:24:33 +0000 (23:24 +0000)]
Handle Type.h a better way.

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

13 years agoImprove diagnostics reporting of un-implemented
Fariborz Jahanian [Fri, 29 Oct 2010 23:20:05 +0000 (23:20 +0000)]
Improve diagnostics reporting of un-implemented
methods in protocols when protocols are in system
headers and thus ignored. //rdar: //8227199

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

13 years agoGenerate bitcasts going in and out of MMX parameters
Dale Johannesen [Fri, 29 Oct 2010 23:12:32 +0000 (23:12 +0000)]
Generate bitcasts going in and out of MMX parameters
in asm's.  PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?

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

13 years agoUse CodeGenFunction's getContext(), for consistency.
Dan Gohman [Fri, 29 Oct 2010 22:47:07 +0000 (22:47 +0000)]
Use CodeGenFunction's getContext(), for consistency.

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

13 years agoThese functions don't need external linkage.
Dan Gohman [Fri, 29 Oct 2010 22:41:35 +0000 (22:41 +0000)]
These functions don't need external linkage.

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

13 years agoMake the deserialization of C++ base class specifiers lazy, improving
Douglas Gregor [Fri, 29 Oct 2010 22:39:52 +0000 (22:39 +0000)]
Make the deserialization of C++ base class specifiers lazy, improving
the performance of C++ PCH and reducing stack depth in the reader.

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

13 years agoRestore r117644, this time properly ignoring -fvisibility and type visibility
John McCall [Fri, 29 Oct 2010 22:22:43 +0000 (22:22 +0000)]
Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

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

13 years agoUse objdir != srcdir in the getting started doc.
Rafael Espindola [Fri, 29 Oct 2010 22:05:17 +0000 (22:05 +0000)]
Use objdir != srcdir in the getting started doc.

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

13 years agoUpdate tests to not search of as.
Rafael Espindola [Fri, 29 Oct 2010 21:18:11 +0000 (21:18 +0000)]
Update tests to not search of as.

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

13 years agoSwitch to using the integrated assembler by default on x86 and x86-64 ELF
Rafael Espindola [Fri, 29 Oct 2010 20:14:02 +0000 (20:14 +0000)]
Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

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

13 years agoIf Consumer object failed to create due to some
Fariborz Jahanian [Fri, 29 Oct 2010 19:49:13 +0000 (19:49 +0000)]
If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.

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

13 years agoQualified 'id' should implement all of static class type's
Fariborz Jahanian [Fri, 29 Oct 2010 18:26:21 +0000 (18:26 +0000)]
Qualified 'id' should implement all of static class type's
protocols, including those added to class, super class
and categories; otherewise issue a warning. This fixes
pr8453.

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

13 years agoAfter processing named unions do not fall through to handle anonymous unions.
Devang Patel [Fri, 29 Oct 2010 16:21:19 +0000 (16:21 +0000)]
After processing named unions do not fall through to handle anonymous unions.
This is tested by funcargs.exp in gdb testsuite.

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

13 years agoWhen doing name lookup for members don't look into global/namespace scope.
Argyrios Kyrtzidis [Fri, 29 Oct 2010 16:12:50 +0000 (16:12 +0000)]
When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569.

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

13 years agoRevert r117644, "Apply visibility in IR gen to variables that are merely
Daniel Dunbar [Fri, 29 Oct 2010 15:19:36 +0000 (15:19 +0000)]
Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

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

13 years agoDon't assert on attempts to throw 'bool'. I wonder if in the history of C++
John McCall [Fri, 29 Oct 2010 08:14:02 +0000 (08:14 +0000)]
Don't assert on attempts to throw 'bool'.  I wonder if in the history of C++
anyone has ever intentionally done this outside of a compiler test case.

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

13 years agoApply visibility in IR gen to variables that are merely declared
John McCall [Fri, 29 Oct 2010 07:49:41 +0000 (07:49 +0000)]
Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

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

13 years agoAdded CFGTerminator class, that holds information about CFGBlock terminator statement.
Marcin Swiderski [Fri, 29 Oct 2010 05:21:47 +0000 (05:21 +0000)]
Added CFGTerminator class, that holds information about CFGBlock terminator statement.

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

13 years agoAdd a hook to the CXXABI object to get the default method calling convention.
Charles Davis [Fri, 29 Oct 2010 03:25:11 +0000 (03:25 +0000)]
Add a hook to the CXXABI object to get the default method calling convention.
This isn't used yet, because someone more experienced than I needs to look
at the type system about gutting getCanonicalCallConv().

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

13 years agoDon't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false...
Ted Kremenek [Fri, 29 Oct 2010 01:06:54 +0000 (01:06 +0000)]
Don't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false positives).

Fixes <rdar://problem/8601243>.

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

13 years agoRemove old CrashTracer cruft from CIndex.
Ted Kremenek [Fri, 29 Oct 2010 01:06:50 +0000 (01:06 +0000)]
Remove old CrashTracer cruft from CIndex.

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

13 years agoWhen computing the visibility of a class member, calculate the visibility
John McCall [Fri, 29 Oct 2010 00:29:13 +0000 (00:29 +0000)]
When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.

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

13 years agoexpand discussion of __block C++ on-stack objects
Blaine Garst [Thu, 28 Oct 2010 23:30:10 +0000 (23:30 +0000)]
expand discussion of __block C++ on-stack objects

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

13 years agoBasic types are language defined builtins. They are always defined at top most level.
Devang Patel [Thu, 28 Oct 2010 22:03:20 +0000 (22:03 +0000)]
Basic types are language defined builtins. They are always defined at top most level.

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

13 years agoWhen emitting l-values for bool non-__block decl references, make a pointer
John McCall [Thu, 28 Oct 2010 21:37:57 +0000 (21:37 +0000)]
When emitting l-values for bool non-__block decl references, make a pointer
using the memory type;  fixes an assert.

Fixes rdar://problem/8605032

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

13 years agoDriver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.
Daniel Dunbar [Thu, 28 Oct 2010 20:36:23 +0000 (20:36 +0000)]
Driver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.

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

13 years agoDirectly use NamespaceDecl->getLocation() to find the source file.
Devang Patel [Thu, 28 Oct 2010 19:12:46 +0000 (19:12 +0000)]
Directly use NamespaceDecl->getLocation() to find the source file.

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

13 years agoDon't apply -fvisibility-inlines-hidden to extern templates.
John McCall [Thu, 28 Oct 2010 18:10:36 +0000 (18:10 +0000)]
Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231

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

13 years agoStay within 80 columns.
Devang Patel [Thu, 28 Oct 2010 17:27:32 +0000 (17:27 +0000)]
Stay within 80 columns.

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

13 years agoSimplify ASTUnit's internal timers, by not trying to keep a pile of
Douglas Gregor [Thu, 28 Oct 2010 15:44:59 +0000 (15:44 +0000)]
Simplify ASTUnit's internal timers, by not trying to keep a pile of
timers to be dumped whenever the ASTUnit is destroyed. Instead, just
print the time elapsed for each operation after we perform the
operation.

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

13 years agoInitialize the ASTMutationListener. Thanks goes to Abramo Bagnara!
Argyrios Kyrtzidis [Thu, 28 Oct 2010 09:29:35 +0000 (09:29 +0000)]
Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!

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

13 years agoSwitch case IDs conflict between chained PCHs; since there is no need to be global...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 09:29:32 +0000 (09:29 +0000)]
Switch case IDs conflict between chained PCHs; since there is no need to be global, make them local to a decl.

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

13 years agoImplement an indirect-goto optimization for goto *&&lbl and respect this
John McCall [Thu, 28 Oct 2010 08:53:48 +0000 (08:53 +0000)]
Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker.  With that done, turn an indirect goto into a
protected scope into a hard error;  otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.

If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.

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

13 years agoRemove an assertion that hit on legitimate cases. A redeclaration may have location...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:53 +0000 (07:38 +0000)]
Remove an assertion that hit on legitimate cases. A redeclaration may have location before the
first one if the redeclaration comes from a friend decl.

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

13 years agoUse the ASTMutationListener to track when a named decl gets added to a DeclContext,
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:51 +0000 (07:38 +0000)]
Use the ASTMutationListener to track when a named decl gets added to a DeclContext,
meaning we need to rewrite its name lookup table in a chained PCH.

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

13 years agoProperly add chained template specializations.
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:47 +0000 (07:38 +0000)]
Properly add chained template specializations.

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

13 years agoFix the re-serializing decls in a chained PCH mechanism.
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:45 +0000 (07:38 +0000)]
Fix the re-serializing decls in a chained PCH mechanism.

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

13 years agoUse the ASTMutationListener to track added template specializations in a chained...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:42 +0000 (07:38 +0000)]
Use the ASTMutationListener to track added template specializations in a chained PCH.

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

13 years agoAbandon the type-visibility optimization for functions. GCC doesn't do it,
John McCall [Thu, 28 Oct 2010 07:07:52 +0000 (07:07 +0000)]
Abandon the type-visibility optimization for functions.  GCC doesn't do it,
and it's too much trouble to push for.  Fixes PR8478.

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

13 years agoWhen computing visibility, use the latest declaration's explicit visibility
John McCall [Thu, 28 Oct 2010 04:18:25 +0000 (04:18 +0000)]
When computing visibility, use the latest declaration's explicit visibility
attribute.

Part of rdar://problem/8595231

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

13 years agoAdd test case for <rdar://problem/8356342>.
Ted Kremenek [Thu, 28 Oct 2010 02:50:32 +0000 (02:50 +0000)]
Add test case for <rdar://problem/8356342>.

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

13 years agoImplement the newest status quo for method override checking. The idea now
John McCall [Thu, 28 Oct 2010 02:34:38 +0000 (02:34 +0000)]
Implement the newest status quo for method override checking.  The idea now
is that we need more information to decide the exact conditions for whether
one ObjCObjectPointer is an acceptable return/parameter override for another,
so we're going to disable that entire class of warning for now.  The
"forward developement" warning category, -Wmethod-signatures, can receive
unrestricted feature work, and when we're happy with how it acts, we'll
turn it on by default.

This is a pretty conservative change, and nobody's totally content with it.

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

13 years agomake it really clear that vla != flexible arrays
Chris Lattner [Thu, 28 Oct 2010 02:20:32 +0000 (02:20 +0000)]
make it really clear that vla != flexible arrays

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

13 years agoDon't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker. Fixes <rdar...
Ted Kremenek [Thu, 28 Oct 2010 02:16:22 +0000 (02:16 +0000)]
Don't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker.  Fixes <rdar://problem/8481311>.

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

13 years agoAhem. Add rest of D and Q registers to ARM inline asm handling.
Dale Johannesen [Thu, 28 Oct 2010 01:05:37 +0000 (01:05 +0000)]
Ahem.  Add rest of D and Q registers to ARM inline asm handling.

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

13 years agoTest passes on Darwin; try to XFAIL on freebsd, linux, xp/msvc9.
Stuart Hastings [Thu, 28 Oct 2010 00:47:58 +0000 (00:47 +0000)]
Test passes on Darwin; try to XFAIL on freebsd, linux, xp/msvc9.

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

13 years agoAdd D and Q register names to ARM inline asm handling.
Dale Johannesen [Wed, 27 Oct 2010 23:34:42 +0000 (23:34 +0000)]
Add D and Q register names to ARM inline asm handling.
No aliasing is needed, these work as given in the BE.

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

13 years agoFix context info for enums.
Devang Patel [Wed, 27 Oct 2010 23:23:58 +0000 (23:23 +0000)]
Fix context info for enums.
Radar 8595129

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

13 years agosmall tweaks to reflect statements of what really ever shipped. ABI is, and has...
Blaine Garst [Wed, 27 Oct 2010 22:59:01 +0000 (22:59 +0000)]
small tweaks to reflect statements of what really ever shipped.  ABI is, and has been, accurate for what we ship.

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

13 years agoDon't override explicit visibility attributes on class members with
John McCall [Wed, 27 Oct 2010 22:31:22 +0000 (22:31 +0000)]
Don't override explicit visibility attributes on class members with
type-based visibility.

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

13 years agoMake AST deserialization for class template specializations lazier, by
Douglas Gregor [Wed, 27 Oct 2010 22:21:36 +0000 (22:21 +0000)]
Make AST deserialization for class template specializations lazier, by
not loading the specializations of a class template until some AST
consumer needs them.

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

13 years agoreconcile missing typos & delete obsolete pre-SnowLeopard section w.r.t. prior reposi...
Blaine Garst [Wed, 27 Oct 2010 21:22:46 +0000 (21:22 +0000)]
reconcile missing typos & delete obsolete pre-SnowLeopard section w.r.t. prior repository for this document

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