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

14 years agoProvide code completion results for the context-sensitive Objective-C
Douglas Gregor [Tue, 24 Aug 2010 01:06:58 +0000 (01:06 +0000)]
Provide code completion results for the context-sensitive Objective-C
keywords "in", "out", "inout", "byref", "bycopy", and "oneway".

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

14 years agoAdd testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.
Sebastian Redl [Tue, 24 Aug 2010 00:50:16 +0000 (00:50 +0000)]
Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.

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

14 years agoWrite visible update blocks. No regressions in normal PCH functionality, but no tests...
Sebastian Redl [Tue, 24 Aug 2010 00:50:09 +0000 (00:50 +0000)]
Write visible update blocks. No regressions in normal PCH functionality, but no tests for the chain yet.

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

14 years agoRead the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also...
Sebastian Redl [Tue, 24 Aug 2010 00:50:04 +0000 (00:50 +0000)]
Read the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also, free the lookup tables when destructing the ASTReader.

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

14 years agoCorrectly initialize the visible decls pointer if there are no visible decls for...
Sebastian Redl [Tue, 24 Aug 2010 00:50:00 +0000 (00:50 +0000)]
Correctly initialize the visible decls pointer if there are no visible decls for a record.

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

14 years agoBaby step towards supporting namespaces in chained PCH.
Sebastian Redl [Tue, 24 Aug 2010 00:49:55 +0000 (00:49 +0000)]
Baby step towards supporting namespaces in chained PCH.

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

14 years agoSilence warning about C++-style comments.
Peter Collingbourne [Tue, 24 Aug 2010 00:31:37 +0000 (00:31 +0000)]
Silence warning about C++-style comments.

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

14 years agoAdd Serialization dependency to clang-interpreter
Peter Collingbourne [Tue, 24 Aug 2010 00:31:31 +0000 (00:31 +0000)]
Add Serialization dependency to clang-interpreter

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

14 years agoMove ExecuteCompilerInvocation to a new library FrontendTool
Peter Collingbourne [Tue, 24 Aug 2010 00:31:22 +0000 (00:31 +0000)]
Move ExecuteCompilerInvocation to a new library FrontendTool

r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.

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

14 years agoWhen calling a function or messaging a method marked "sentinel", add
Douglas Gregor [Mon, 23 Aug 2010 23:51:41 +0000 (23:51 +0000)]
When calling a function or messaging a method marked "sentinel", add
the ", nil", ", NULL", or ", (void*)0" to the end of the code
completion, since it always has to be there anyway.

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