]> granicus.if.org Git - clang/log
clang
14 years agoRevert r112114, "Pull DelayedDiagnostic and AccessedEntity out into their own
Daniel Dunbar [Thu, 26 Aug 2010 00:52:50 +0000 (00:52 +0000)]
Revert r112114, "Pull DelayedDiagnostic and AccessedEntity out into their own
header.", it is teh broken.

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

14 years agoWith lax vector conversions (the default) make sure we convert between two
Eric Christopher [Thu, 26 Aug 2010 00:42:16 +0000 (00:42 +0000)]
With lax vector conversions (the default) make sure we convert between two
vectors that are the same size. Fix up testcases accordingly and add a new one
to make sure we still error if lax vector conversions are disabled.

Fixes rdar://8328190

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

14 years agoRevert "Move the sorting of code-completion results out of the main path and
Douglas Gregor [Thu, 26 Aug 2010 00:30:24 +0000 (00:30 +0000)]
Revert "Move the sorting of code-completion results out of the main path and
into the clients", because the C standard library sucks. Where's my
stable sort, huh?

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

14 years agoAdd DelayedDiagnostic.h to xcode project file.
Fariborz Jahanian [Thu, 26 Aug 2010 00:17:38 +0000 (00:17 +0000)]
Add DelayedDiagnostic.h to xcode project file.

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

14 years agoMore update of clang.xcodeproj for recent changes.
Fariborz Jahanian [Thu, 26 Aug 2010 00:13:24 +0000 (00:13 +0000)]
More update of clang.xcodeproj for recent changes.

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

14 years agoUpdate clang.xcodeproj for recent refactorings.
Fariborz Jahanian [Thu, 26 Aug 2010 00:06:40 +0000 (00:06 +0000)]
Update clang.xcodeproj for recent refactorings.

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

14 years agoFix typo in error message and testcase.
Eric Christopher [Wed, 25 Aug 2010 23:45:44 +0000 (23:45 +0000)]
Fix typo in error message and testcase.

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

14 years agoPull DelayedDiagnostic and AccessedEntity out into their own header.
John McCall [Wed, 25 Aug 2010 23:44:00 +0000 (23:44 +0000)]
Pull DelayedDiagnostic and AccessedEntity out into their own header.
This works courtesy of the new SmallVector<..., 0> specialization that
doesn't require a complete type.  Note that you'll need to pull at least
SmallVector.h from LLVM to compile successfully.

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

14 years agoRevert r112043, static volatiles are removed by the optimizer. Thanks Chris!
Argyrios Kyrtzidis [Wed, 25 Aug 2010 23:42:51 +0000 (23:42 +0000)]
Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!

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

14 years agoFinally pass "two floats in a 64-bit unit" as a <2 x float> instead of
Chris Lattner [Wed, 25 Aug 2010 23:39:14 +0000 (23:39 +0000)]
Finally pass "two floats in a 64-bit unit" as a <2 x float> instead of
as a double in the x86-64 ABI.  This allows us to generate much better
code for certain things, e.g.:

_Complex float f32(_Complex float A, _Complex float B) {
  return A+B;
}

Used to compile into (look at the integer silliness!):

_f32:                                   ## @f32
## BB#0:                                ## %entry
movd %xmm1, %rax
movd %eax, %xmm1
movd %xmm0, %rcx
movd %ecx, %xmm0
addss %xmm1, %xmm0
movd %xmm0, %edx
shrq $32, %rax
movd %eax, %xmm0
shrq $32, %rcx
movd %ecx, %xmm1
addss %xmm0, %xmm1
movd %xmm1, %eax
shlq $32, %rax
addq %rdx, %rax
movd %rax, %xmm0
ret

Now we get:

_f32:                                   ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $16, %xmm2, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm0
addss %xmm1, %xmm0
pshufd $16, %xmm0, %xmm1
movdqa %xmm2, %xmm0
unpcklps %xmm1, %xmm0
ret

and compile stuff like:

extern float _Complex ccoshf( float _Complex ) ;
float _Complex ccosf ( float _Complex z ) {
 float _Complex iz;
 (__real__ iz) = -(__imag__ z);
 (__imag__ iz) = (__real__ z);
 return ccoshf(iz);
}

into:

_ccosf:                                 ## @ccosf
## BB#0:                                ## %entry
pshufd $1, %xmm0, %xmm1
xorps LCPI4_0(%rip), %xmm1
unpcklps %xmm0, %xmm1
movaps %xmm1, %xmm0
jmp _ccoshf                 ## TAILCALL

instead of:

_ccosf:                                 ## @ccosf
## BB#0:                                ## %entry
movd %xmm0, %rax
movq %rax, %rcx
shlq $32, %rcx
shrq $32, %rax
xorl $-2147483648, %eax      ## imm = 0xFFFFFFFF80000000
addq %rcx, %rax
movd %rax, %xmm0
jmp _ccoshf                 ## TAILCALL

There is still "stuff to be done" here for the struct case,
but this resolves rdar://6379669 - [x86-64 ABI] Pass and return
_Complex float / double efficiently

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

14 years agoFix miscompilation. The custom new[]/delete[] methods were not getting called for...
Argyrios Kyrtzidis [Wed, 25 Aug 2010 23:14:56 +0000 (23:14 +0000)]
Fix miscompilation. The custom new[]/delete[] methods were not getting called for arrays with more than 1 dimension.

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

14 years agoAdd missing null checks in PseudoConstantAnalysis
Tom Care [Wed, 25 Aug 2010 22:46:03 +0000 (22:46 +0000)]
Add missing null checks in PseudoConstantAnalysis

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

14 years agoImproved the handling of blocks and block variables in PseudoConstantAnalysis
Tom Care [Wed, 25 Aug 2010 22:37:26 +0000 (22:37 +0000)]
Improved the handling of blocks and block variables in PseudoConstantAnalysis
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants

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

14 years agoFix RUN line in test.
Ted Kremenek [Wed, 25 Aug 2010 22:16:06 +0000 (22:16 +0000)]
Fix RUN line in test.

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

14 years agoWhen annotating tokens, don't fallback to annotating with a null cursor for cursors...
Ted Kremenek [Wed, 25 Aug 2010 22:16:02 +0000 (22:16 +0000)]
When annotating tokens, don't fallback to annotating with a null cursor for cursors that come before a macro instantiation.  Fixes <rdar://problem/7974151>.

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

14 years agoMove the sorting of code-completion results out of the main path and
Douglas Gregor [Wed, 25 Aug 2010 22:15:42 +0000 (22:15 +0000)]
Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

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

14 years agoSplit out a header to hold APIs meant for the Sema implementation from Sema.h.
John McCall [Wed, 25 Aug 2010 22:03:47 +0000 (22:03 +0000)]
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.

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

14 years agoFix a typo.
Dan Gohman [Wed, 25 Aug 2010 21:59:25 +0000 (21:59 +0000)]
Fix a typo.

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

14 years agoWhen combining the code-completion results from Sema long with the
Douglas Gregor [Wed, 25 Aug 2010 18:41:16 +0000 (18:41 +0000)]
When combining the code-completion results from Sema long with the
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.

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

14 years agoFix horrible white space errors.
Michael J. Spencer [Wed, 25 Aug 2010 18:17:27 +0000 (18:17 +0000)]
Fix horrible white space errors.

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

14 years agoInitialize the translation-unit scope before lexing the first
Douglas Gregor [Wed, 25 Aug 2010 18:07:12 +0000 (18:07 +0000)]
Initialize the translation-unit scope before lexing the first
token. The first token might be something that ends up triggering code
completion, which in turn requires a valid Scope. Test case forthcoming.

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

14 years agoAdd a missing case
Douglas Gregor [Wed, 25 Aug 2010 18:04:30 +0000 (18:04 +0000)]
Add a missing case

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

14 years agoFix an off-by-one error when computing the precompiled preamble for
Douglas Gregor [Wed, 25 Aug 2010 18:04:15 +0000 (18:04 +0000)]
Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.

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

14 years agoMake the cursor kind of macro-name-only completions produced by
Douglas Gregor [Wed, 25 Aug 2010 18:03:13 +0000 (18:03 +0000)]
Make the cursor kind of macro-name-only completions produced by
ASTUnit match those produced directly by code completion. Test case is
forthcoming.

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

14 years agoRobustify test.
Devang Patel [Wed, 25 Aug 2010 17:32:22 +0000 (17:32 +0000)]
Robustify test.

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

14 years agoTest for previous commit
Douglas Gregor [Wed, 25 Aug 2010 17:11:34 +0000 (17:11 +0000)]
Test for previous commit

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

14 years agoAdd a code-completion context for "natural language" completions, so
Douglas Gregor [Wed, 25 Aug 2010 17:10:00 +0000 (17:10 +0000)]
Add a code-completion context for "natural language" completions, so
that ASTUnit knows not to try to provide completions there.

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

14 years agoIntroduce a preprocessor code-completion hook for contexts where we
Douglas Gregor [Wed, 25 Aug 2010 17:04:25 +0000 (17:04 +0000)]
Introduce a preprocessor code-completion hook for contexts where we
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.

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

14 years agoImplement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.
Douglas Gregor [Wed, 25 Aug 2010 15:47:31 +0000 (15:47 +0000)]
Implement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.

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

14 years agoSilence a GCC warning saying that unsigned >= UO_PostInc is always true.
Benjamin Kramer [Wed, 25 Aug 2010 13:24:04 +0000 (13:24 +0000)]
Silence a GCC warning saying that unsigned >= UO_PostInc is always true.

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

14 years agoGCC didn't care for my attempt at API compatibility, so brute-force everything
John McCall [Wed, 25 Aug 2010 11:45:40 +0000 (11:45 +0000)]
GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.

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

14 years agoRandom space optimization.
John McCall [Wed, 25 Aug 2010 10:44:55 +0000 (10:44 +0000)]
Random space optimization.

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

14 years agoRecursive functions should be marked when used from another function. Fixes http...
Argyrios Kyrtzidis [Wed, 25 Aug 2010 10:34:54 +0000 (10:34 +0000)]
Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.

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

14 years agoMore incremental progress towards not including Expr.h in Sema.h.
John McCall [Wed, 25 Aug 2010 10:28:54 +0000 (10:28 +0000)]
More incremental progress towards not including Expr.h in Sema.h.

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

14 years agoMake sure volatile variables are emitted even if static. Fixes rdar://8315219
Argyrios Kyrtzidis [Wed, 25 Aug 2010 10:15:24 +0000 (10:15 +0000)]
Make sure volatile variables are emitted even if static. Fixes rdar://8315219

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

14 years agoRename *PendingImplicitInstantiations to *PendingInstantiations. No
Chandler Carruth [Wed, 25 Aug 2010 08:44:16 +0000 (08:44 +0000)]
Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.

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

14 years agoSplit FunctionScopeInfo and BlockScopeInfo into their own header.
John McCall [Wed, 25 Aug 2010 08:40:02 +0000 (08:40 +0000)]
Split FunctionScopeInfo and BlockScopeInfo into their own header.

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

14 years agoSupport explicit instantiation of function templates and members of class
Chandler Carruth [Wed, 25 Aug 2010 08:27:02 +0000 (08:27 +0000)]
Support explicit instantiation of function templates and members of class
templates when only the declaration is in scope. This requires deferring the
instantiation to be lazy, and ensuring the definition is required for that
translation unit. We re-use the existing pending instantiation queue,
previously only used to track implicit instantiations which were required to be
lazy. Fixes PR7979.

A subsequent change will rename *PendingImplicitInstantiations to
*PendingInstatiations for clarity given its broader role.

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

14 years agoRemove Sema.h's dependency on DeclCXX.h.
John McCall [Wed, 25 Aug 2010 07:42:41 +0000 (07:42 +0000)]
Remove Sema.h's dependency on DeclCXX.h.

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

14 years agoRemove the DenseSet dependency from Sema.h.
John McCall [Wed, 25 Aug 2010 07:03:20 +0000 (07:03 +0000)]
Remove the DenseSet dependency from Sema.h.

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

14 years agoTeach Sema to live without CodeCompleteConsumer.h.
John McCall [Wed, 25 Aug 2010 06:19:51 +0000 (06:19 +0000)]
Teach Sema to live without CodeCompleteConsumer.h.

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

14 years agoRemove AnalysisBasedWarnings.h's dependency on Type.h
John McCall [Wed, 25 Aug 2010 05:56:39 +0000 (05:56 +0000)]
Remove AnalysisBasedWarnings.h's dependency on Type.h

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

14 years agoMove more stuff out of Sema.h.
John McCall [Wed, 25 Aug 2010 05:32:35 +0000 (05:32 +0000)]
Move more stuff out of Sema.h.

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

14 years agoSort the forward declarations.
John McCall [Wed, 25 Aug 2010 04:28:15 +0000 (04:28 +0000)]
Sort the forward declarations.

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

14 years agotests: Disable this test for now, it is overly pessimistic and I am not sure how...
Daniel Dunbar [Wed, 25 Aug 2010 03:40:27 +0000 (03:40 +0000)]
tests: Disable this test for now, it is overly pessimistic and I am not sure how to fix it.

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

14 years agoIRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
Daniel Dunbar [Wed, 25 Aug 2010 03:32:38 +0000 (03:32 +0000)]
IRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
as a truncation not a comparison to null.

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

14 years agoExpression statements undergo lvalue-to-rvalue conversion in C,
John McCall [Wed, 25 Aug 2010 02:50:31 +0000 (02:50 +0000)]
Expression statements undergo lvalue-to-rvalue conversion in C,
but not in C++, so don't emit aggregate loads of volatile references
in null context in C++.  Happens to have been caught by an assertion.
We do not get the scalar case right.  Volatiles are really broken.

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

14 years agoReformatting.
John McCall [Wed, 25 Aug 2010 02:45:51 +0000 (02:45 +0000)]
Reformatting.

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

14 years agoAdd back clang-wpa. It is useful for experimenting with inter-file analysis.
Zhongxing Xu [Wed, 25 Aug 2010 01:15:20 +0000 (01:15 +0000)]
Add back clang-wpa. It is useful for experimenting with inter-file analysis.

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

14 years agoWhen performing completions involving Objective-C method declarations
Douglas Gregor [Wed, 25 Aug 2010 01:08:01 +0000 (01:08 +0000)]
When performing completions involving Objective-C method declarations
(e.g., for message sends or method declaration/definition
completions), adjust methods that come from a base class.

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

14 years agoReorganize and verbosely document some of ASTReader's fields.
Sebastian Redl [Wed, 25 Aug 2010 01:03:37 +0000 (01:03 +0000)]
Reorganize and verbosely document some of ASTReader's fields.

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

14 years agoRemove an unused field in ASTReader
Sebastian Redl [Wed, 25 Aug 2010 01:03:30 +0000 (01:03 +0000)]
Remove an unused field in ASTReader

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

14 years agoPlug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.
Argyrios Kyrtzidis [Wed, 25 Aug 2010 00:32:19 +0000 (00:32 +0000)]
Plug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.

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

14 years agoUse a smart pointer instead of delete.
Argyrios Kyrtzidis [Wed, 25 Aug 2010 00:32:14 +0000 (00:32 +0000)]
Use a smart pointer instead of delete.

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

14 years agoMake sure CXXABI is destroyed.
Argyrios Kyrtzidis [Wed, 25 Aug 2010 00:32:08 +0000 (00:32 +0000)]
Make sure CXXABI is destroyed.

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

14 years agoNo need to default synthesize property if implementation
Fariborz Jahanian [Wed, 25 Aug 2010 00:31:58 +0000 (00:31 +0000)]
No need to default synthesize property if implementation
has its own getter and setter methods declared.
Fixed 8349319 (nonfragile-abi2).

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

14 years agoFix 'for' loop variables' scope.
Devang Patel [Wed, 25 Aug 2010 00:28:56 +0000 (00:28 +0000)]
Fix 'for' loop variables' scope.

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

14 years agoGive a slight preference to functions returning "void" when we're
Douglas Gregor [Tue, 24 Aug 2010 23:58:17 +0000 (23:58 +0000)]
Give a slight preference to functions returning "void" when we're
performing code completion at the statement level (rather than in an
arbitrary expression).

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

14 years agoPreserve invalidity of typeof operands in C++.
John McCall [Tue, 24 Aug 2010 23:41:43 +0000 (23:41 +0000)]
Preserve invalidity of typeof operands in C++.

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

14 years agoIn code-completion contexts where both types and other values are
Douglas Gregor [Tue, 24 Aug 2010 23:40:45 +0000 (23:40 +0000)]
In code-completion contexts where both types and other values are
present, prefer values to types, since it's more common to compute
with values than it is to declare new entities or perform type
casts. So, tweak the ranking of types vs. other declarations and
constants accordingly.

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

14 years agoCatch the case of trying to turn '&(X::a)' into a member pointer as well.
John McCall [Tue, 24 Aug 2010 23:26:21 +0000 (23:26 +0000)]
Catch the case of trying to turn '&(X::a)' into a member pointer as well.

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

14 years agoUSRs for class extensions should "mangle" in the location of the extension. (<rdar...
Ted Kremenek [Tue, 24 Aug 2010 23:13:41 +0000 (23:13 +0000)]
USRs for class extensions should "mangle" in the location of the extension.  (<rdar://problem/8350262>)

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

14 years agoMove the test for radar 8018252 to
Fariborz Jahanian [Tue, 24 Aug 2010 22:55:33 +0000 (22:55 +0000)]
Move the test for radar 8018252 to
SemaCXX/expressions.cpp.

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

14 years agoWhen trying to resolve the address of an overloaded expression,
John McCall [Tue, 24 Aug 2010 22:52:39 +0000 (22:52 +0000)]
When trying to resolve the address of an overloaded expression,
only form pointers-to-member if the expression has the appropriate
form.  This avoids assertions later on on invalid code, but also
allows us to properly resolve mixed-staticity overloads.

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

14 years agoAST writer support for having specializations of templates from earlier in the chain...
Sebastian Redl [Tue, 24 Aug 2010 22:50:24 +0000 (22:50 +0000)]
AST writer support for having specializations of templates from earlier in the chain. This ought to finish C++ chained PCH support.

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

14 years agoAST reader support for having specializations of templates from earlier in the chain.
Sebastian Redl [Tue, 24 Aug 2010 22:50:19 +0000 (22:50 +0000)]
AST reader support for having specializations of templates from earlier in the chain.

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

14 years agoRemove i386 macro check from expected output of preprocessor
Douglas Gregor [Tue, 24 Aug 2010 22:46:25 +0000 (22:46 +0000)]
Remove i386 macro check from expected output of preprocessor

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

14 years agoFrontend: Add basic -H support.
Daniel Dunbar [Tue, 24 Aug 2010 22:44:13 +0000 (22:44 +0000)]
Frontend: Add basic -H support.
 - I didn't implement the GCC "multiple include guard" detection parts, because
   it doesn't seem useful or obvious.

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

14 years agoAdd some missing X86-specific asm constraint letters, and fix
Dale Johannesen [Tue, 24 Aug 2010 22:33:12 +0000 (22:33 +0000)]
Add some missing X86-specific asm constraint letters, and fix
some bugs in setting allowsRegister on the ones there.
8348447.

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

14 years agocorrect the -isystem option to not add the -isysroot path. Only the weird
Chris Lattner [Tue, 24 Aug 2010 22:27:37 +0000 (22:27 +0000)]
correct the -isystem option to not add the -isysroot path.  Only the weird
-iwithsysroot flag should do that.  This fixes rdar://8345942

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

14 years agoFix printf format string checking for '%lc' (which expects a wint_t or compatible...
Ted Kremenek [Tue, 24 Aug 2010 22:24:51 +0000 (22:24 +0000)]
Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument).  Fixes PR 7981.

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

14 years agoIt is not error in c++ to take address of
Fariborz Jahanian [Tue, 24 Aug 2010 22:21:48 +0000 (22:21 +0000)]
It is not error in c++ to take address of
register variable (c++03 7.1.1P3). radar 8108252.

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

14 years agoImplement code completion for preprocessor expressions and in macro
Douglas Gregor [Tue, 24 Aug 2010 22:20:20 +0000 (22:20 +0000)]
Implement code completion for preprocessor expressions and in macro
arguments.

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

14 years agotests: Use REQUIRES: instead of XFAIL: for crash recovery tests; running them on
Daniel Dunbar [Tue, 24 Aug 2010 21:39:55 +0000 (21:39 +0000)]
tests: Use REQUIRES: instead of XFAIL: for crash recovery tests; running them on
Windows breaks things (because it pops up dialogs) since we don't have crash
recovery support there (yet).

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

14 years agoImplement -iwithsysroot, an apple extension which is a close cousin of -isystem.
Chris Lattner [Tue, 24 Aug 2010 21:09:16 +0000 (21:09 +0000)]
Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.
Instead of implementing -isystem, I accidentally implemented this cousin.  Next
up is to implement -isystem right.

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

14 years agoImprovements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
Tom Care [Tue, 24 Aug 2010 21:09:07 +0000 (21:09 +0000)]
Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants

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

14 years agoMove some of SemaOverload's API to various places in Overload.h, and kill
John McCall [Tue, 24 Aug 2010 20:38:10 +0000 (20:38 +0000)]
Move some of SemaOverload's API to various places in Overload.h, and kill
some of it off completely.

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

14 years agoImplement preprocessor code completion where a macro name is expected,
Douglas Gregor [Tue, 24 Aug 2010 20:21:13 +0000 (20:21 +0000)]
Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.

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

14 years agoIntroduce basic code-completion support for preprocessor directives,
Douglas Gregor [Tue, 24 Aug 2010 19:08:16 +0000 (19:08 +0000)]
Introduce basic code-completion support for preprocessor directives,
e.g., after a "#" we'll suggest #if, #ifdef, etc.

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

14 years agoFix a bug in nonfragile-abi2 when attempting to diagnose
Fariborz Jahanian [Tue, 24 Aug 2010 18:48:05 +0000 (18:48 +0000)]
Fix a bug in nonfragile-abi2 when attempting to diagnose
previous use of a synthesized 'ivar' with property of same name
declared as @dynamic. In this case, 'ivar' is in the
inherited class and no diagnostics should be issued.

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

14 years agoFix enum size and align. Tested by setvar.exp in gdb testsuite.
Devang Patel [Tue, 24 Aug 2010 18:14:06 +0000 (18:14 +0000)]
Fix enum size and align. Tested by setvar.exp in gdb testsuite.

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

14 years agoDocument '__clang_analyzer__'.
Ted Kremenek [Tue, 24 Aug 2010 18:12:35 +0000 (18:12 +0000)]
Document '__clang_analyzer__'.

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

14 years agoDebug Info: Put full Clang version into the debug info, to make it easier to
Daniel Dunbar [Tue, 24 Aug 2010 17:41:09 +0000 (17:41 +0000)]
Debug Info: Put full Clang version into the debug info, to make it easier to
identify what version of the compiler was used to build something.

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

14 years agoSema doesn't need these STL headers.
John McCall [Tue, 24 Aug 2010 17:40:45 +0000 (17:40 +0000)]
Sema doesn't need these STL headers.

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

14 years agoDriver/Clang: Forward -Wa, and -Xassembler to clang -cc1 when using the
Daniel Dunbar [Tue, 24 Aug 2010 16:47:49 +0000 (16:47 +0000)]
Driver/Clang: Forward -Wa, and -Xassembler to clang -cc1 when using the
integrated assembler. For now this mostly just means that we will error out if
someone tries to use this mechanism to send an argument to the assembler.

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

14 years agoWhen providing completions for a function or method argument that
Douglas Gregor [Tue, 24 Aug 2010 16:15:59 +0000 (16:15 +0000)]
When providing completions for a function or method argument that
corresponds to a block pointer, provide the skeleton of a block
literal.

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

14 years agoTeach InheritingConcreteTypeLoc to play nicely with dyn_cast.
Douglas Gregor [Tue, 24 Aug 2010 15:53:44 +0000 (15:53 +0000)]
Teach InheritingConcreteTypeLoc to play nicely with dyn_cast.

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

14 years agoParse all kinds of declarations as part of a linkage-specification,
Douglas Gregor [Tue, 24 Aug 2010 14:14:45 +0000 (14:14 +0000)]
Parse all kinds of declarations as part of a linkage-specification,
from Francois Pichet! Fixes PR7754.

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

14 years agoIt turns out that this template is only instantiated at one type.
John McCall [Tue, 24 Aug 2010 09:05:15 +0000 (09:05 +0000)]
It turns out that this template is only instantiated at one type.

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

14 years agoMore header elimination. The goal of all this is to allow Parser to
John McCall [Tue, 24 Aug 2010 08:50:51 +0000 (08:50 +0000)]
More header elimination.  The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque.  That may
not be reasonably attainable, though.

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

14 years agoRemove a header dependency from Sema.h at the cost of some type safety.
John McCall [Tue, 24 Aug 2010 07:32:53 +0000 (07:32 +0000)]
Remove a header dependency from Sema.h at the cost of some type safety.
If someone wants to fix this some other way....

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

14 years agoStruggle mightily against header inclusion in Sema.h.
John McCall [Tue, 24 Aug 2010 07:21:54 +0000 (07:21 +0000)]
Struggle mightily against header inclusion in Sema.h.

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

14 years agoOwningExprResult -> ExprResult. This patch brought to you by
John McCall [Tue, 24 Aug 2010 06:29:42 +0000 (06:29 +0000)]
OwningExprResult -> ExprResult.  This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result

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

14 years agoFold ASTOwningResult back into ActionResult.
John McCall [Tue, 24 Aug 2010 06:09:16 +0000 (06:09 +0000)]
Fold ASTOwningResult back into ActionResult.

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

14 years agoAbstract out passing around types and kill off ActionBase.
John McCall [Tue, 24 Aug 2010 05:47:05 +0000 (05:47 +0000)]
Abstract out passing around types and kill off ActionBase.

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

14 years agoDiagnose the presence of multiple initializations of static data
Douglas Gregor [Tue, 24 Aug 2010 05:27:49 +0000 (05:27 +0000)]
Diagnose the presence of multiple initializations of static data
members, from Faisal Vali! Fixes PR6904.

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

14 years agoPR7971: Compute the correct type for an address-of expression containing an
Eli Friedman [Tue, 24 Aug 2010 05:23:20 +0000 (05:23 +0000)]
PR7971: Compute the correct type for an address-of expression containing an
UnresolvedMemberExpr.

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

14 years agoState explicitly that we are intentionally not providing macro completions for declar...
Douglas Gregor [Tue, 24 Aug 2010 04:59:56 +0000 (04:59 +0000)]
State explicitly that we are intentionally not providing macro completions for declarator name completions

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

14 years agoImprove comments.
Zhongxing Xu [Tue, 24 Aug 2010 04:26:55 +0000 (04:26 +0000)]
Improve comments.

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

14 years agoConsistently switch on PCC_Type
Douglas Gregor [Tue, 24 Aug 2010 01:11:00 +0000 (01:11 +0000)]
Consistently switch on PCC_Type

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