Commit Graph

15539 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis dfffabd0e9 Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.
llvm-svn: 112045
2010-08-25 10:34:54 +00:00
John McCall 2536c6da0e More incremental progress towards not including Expr.h in Sema.h.
llvm-svn: 112044
2010-08-25 10:28:54 +00:00
Argyrios Kyrtzidis b50a088122 Make sure volatile variables are emitted even if static. Fixes rdar://8315219
llvm-svn: 112043
2010-08-25 10:15:24 +00:00
Chandler Carruth 5408017356 Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.

llvm-svn: 112040
2010-08-25 08:44:16 +00:00
John McCall aab3e41eb2 Split FunctionScopeInfo and BlockScopeInfo into their own header.
llvm-svn: 112038
2010-08-25 08:40:02 +00:00
Chandler Carruth cfe41db403 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.

llvm-svn: 112037
2010-08-25 08:27:02 +00:00
John McCall 28a0cf7825 Remove Sema.h's dependency on DeclCXX.h.
llvm-svn: 112032
2010-08-25 07:42:41 +00:00
John McCall a1e130be25 Remove the DenseSet dependency from Sema.h.
llvm-svn: 112030
2010-08-25 07:03:20 +00:00
John McCall 276321a9ec Teach Sema to live without CodeCompleteConsumer.h.
llvm-svn: 112028
2010-08-25 06:19:51 +00:00
John McCall 1d570a7e16 Remove AnalysisBasedWarnings.h's dependency on Type.h
llvm-svn: 112027
2010-08-25 05:56:39 +00:00
John McCall 19c1bfd1b0 Move more stuff out of Sema.h.
llvm-svn: 112026
2010-08-25 05:32:35 +00:00
Daniel Dunbar ead6824c3c IRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
as a truncation not a comparison to null.

llvm-svn: 112021
2010-08-25 03:32:38 +00:00
John McCall 8d75243029 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.

llvm-svn: 112019
2010-08-25 02:50:31 +00:00
John McCall 6caebb15ed Reformatting.
llvm-svn: 112018
2010-08-25 02:45:51 +00:00
Douglas Gregor 416b575edc 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.

llvm-svn: 112013
2010-08-25 01:08:01 +00:00
Argyrios Kyrtzidis 96dbfa2e65 Plug leak. The DenseMaps of CXXRecordLayoutInfo weren't freed.
llvm-svn: 112006
2010-08-25 00:32:19 +00:00
Argyrios Kyrtzidis 3c6cd17c8a Use a smart pointer instead of delete.
llvm-svn: 112005
2010-08-25 00:32:14 +00:00
Fariborz Jahanian 54d75f6925 No need to default synthesize property if implementation
has its own getter and setter methods declared.
Fixed 8349319 (nonfragile-abi2).

llvm-svn: 112003
2010-08-25 00:31:58 +00:00
Devang Patel 356e3e0c6a Fix 'for' loop variables' scope.
llvm-svn: 112002
2010-08-25 00:28:56 +00:00
Douglas Gregor 4d755e86b4 Give a slight preference to functions returning "void" when we're
performing code completion at the statement level (rather than in an
arbitrary expression).

llvm-svn: 112001
2010-08-24 23:58:17 +00:00
John McCall 3669c80de9 Preserve invalidity of typeof operands in C++.
llvm-svn: 111999
2010-08-24 23:41:43 +00:00
John McCall 7d46051eea Catch the case of trying to turn '&(X::a)' into a member pointer as well.
llvm-svn: 111997
2010-08-24 23:26:21 +00:00
John McCall 24d189484b 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.

llvm-svn: 111987
2010-08-24 22:52:39 +00:00
Sebastian Redl 401b39a736 AST writer support for having specializations of templates from earlier in the chain. This ought to finish C++ chained PCH support.
llvm-svn: 111986
2010-08-24 22:50:24 +00:00
Sebastian Redl aba202b430 AST reader support for having specializations of templates from earlier in the chain.
llvm-svn: 111985
2010-08-24 22:50:19 +00:00
Daniel Dunbar d435275c59 Frontend: Add basic -H support.
- I didn't implement the GCC "multiple include guard" detection parts, because
   it doesn't seem useful or obvious.

llvm-svn: 111983
2010-08-24 22:44:13 +00:00
Dale Johannesen 46742a4771 Add some missing X86-specific asm constraint letters, and fix
some bugs in setting allowsRegister on the ones there.
8348447.

llvm-svn: 111980
2010-08-24 22:33:12 +00:00
Chris Lattner 576048657e correct the -isystem option to not add the -isysroot path. Only the weird
-iwithsysroot flag should do that.  This fixes rdar://8345942

llvm-svn: 111979
2010-08-24 22:27:37 +00:00
Ted Kremenek 5f0c066062 Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.
llvm-svn: 111978
2010-08-24 22:24:51 +00:00
Fariborz Jahanian e0fd5a9299 It is not error in c++ to take address of
register variable (c++03 7.1.1P3). radar 8108252.

llvm-svn: 111977
2010-08-24 22:21:48 +00:00
Douglas Gregor ec00a26855 Implement code completion for preprocessor expressions and in macro
arguments.

llvm-svn: 111976
2010-08-24 22:20:20 +00:00
Chris Lattner 4b2164cab8 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.

llvm-svn: 111966
2010-08-24 21:09:16 +00:00
Tom Care a460311710 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

llvm-svn: 111965
2010-08-24 21:09:07 +00:00
John McCall 5c32be0053 Move some of SemaOverload's API to various places in Overload.h, and kill
some of it off completely.

llvm-svn: 111957
2010-08-24 20:38:10 +00:00
Douglas Gregor 127851084d 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.

llvm-svn: 111954
2010-08-24 20:21:13 +00:00
Douglas Gregor 3a7ad25eb6 Introduce basic code-completion support for preprocessor directives,
e.g., after a "#" we'll suggest #if, #ifdef, etc.

llvm-svn: 111943
2010-08-24 19:08:16 +00:00
Fariborz Jahanian 76b35379f5 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.

llvm-svn: 111940
2010-08-24 18:48:05 +00:00
Devang Patel 22e99c2bad Fix enum size and align. Tested by setvar.exp in gdb testsuite.
llvm-svn: 111936
2010-08-24 18:14:06 +00:00
Daniel Dunbar 64c222a6bc 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.

llvm-svn: 111927
2010-08-24 17:41:09 +00:00
John McCall afad82e4d0 Sema doesn't need these STL headers.
llvm-svn: 111926
2010-08-24 17:40:45 +00:00
Daniel Dunbar fe6c97b443 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.

llvm-svn: 111921
2010-08-24 16:47:49 +00:00
Douglas Gregor e90dd00c3c When providing completions for a function or method argument that
corresponds to a block pointer, provide the skeleton of a block
literal.

llvm-svn: 111918
2010-08-24 16:15:59 +00:00
Douglas Gregor 117db7e95a Parse all kinds of declarations as part of a linkage-specification,
from Francois Pichet! Fixes PR7754. 

llvm-svn: 111912
2010-08-24 14:14:45 +00:00
John McCall c5990644b0 It turns out that this template is only instantiated at one type.
llvm-svn: 111908
2010-08-24 09:05:15 +00:00
John McCall cc14d1fd23 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.

llvm-svn: 111907
2010-08-24 08:50:51 +00:00
John McCall bfd822ce64 Remove a header dependency from Sema.h at the cost of some type safety.
If someone wants to fix this some other way....

llvm-svn: 111905
2010-08-24 07:32:53 +00:00
John McCall de6836a384 Struggle mightily against header inclusion in Sema.h.
llvm-svn: 111904
2010-08-24 07:21:54 +00:00
John McCall dadc575b1e OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result

llvm-svn: 111903
2010-08-24 06:29:42 +00:00
John McCall e172be555d Fold ASTOwningResult back into ActionResult.
llvm-svn: 111902
2010-08-24 06:09:16 +00:00
John McCall ba7bf59503 Abstract out passing around types and kill off ActionBase.
llvm-svn: 111901
2010-08-24 05:47:05 +00:00