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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Chris Lattner [Mon, 23 Aug 2010 23:50:42 +0000 (23:50 +0000)]
fix PR7953 - Windows filename are case insensitive:
#pragma once wasn't working on win32 if the header file was included
using a different case.
I tracked down the problem to the fact that clang::FileManager was
caching files using case sensitive string (UniqueFiles) on Windows.
I changed FileManager to cache filename in lower case only.
Doesn't affect UNIX because UNIX uses Inode to uniquely identify files.
unix doesn't use this codepath.
Analysis and patch by Francois Pichet!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111866
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 23:46:51 +0000 (23:46 +0000)]
Don't call this field 'Expr', it changes lookup in illegal ways that
GCC diagnoses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111865
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 23:25:46 +0000 (23:25 +0000)]
Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 23:00:57 +0000 (23:00 +0000)]
Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 23 Aug 2010 22:46:52 +0000 (22:46 +0000)]
Handling remaining rule for synthesize bitfields in
class extensions (nonfragile-abi2).For every class @interface and class
extension @interface, if the last ivar is a bitfield of any type,
then add an implicit `char :0` ivar to the end of that interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111857
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 23 Aug 2010 22:35:37 +0000 (22:35 +0000)]
Driver: Move Clang "triple" computation routines to method on the
ToolChain. This fixes a potenial bad cast when running Clang on PPC code, since
the tool chain in effect is not a subclass of the Darwin one, but we were
treating it like it was.
- This introduces some gross code duplication, but the right fix for it is to
just move the Driver to start depending on the targets in libBasic, so I am
not planning on fixing it immediately.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111856
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 23 Aug 2010 22:35:34 +0000 (22:35 +0000)]
libclang: Print more information when recovering from crashes in
clang_parseTranslationUnit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111855
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 Aug 2010 22:07:25 +0000 (22:07 +0000)]
Emit debug info for enum constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111852
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 21:54:33 +0000 (21:54 +0000)]
Include __FUNCTION__, __PRETTY_FUNCTION_, __func__ in code-completion
results for expression contexts within a function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111851
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 21:17:50 +0000 (21:17 +0000)]
Introduce a code-completion hook for the Objective-C collection
argument in a for-each statement (e.g., "for (id x in <blah>)"), which
restricts the expression completions provided to Objective-C types (or
class types in C++).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111843
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 23 Aug 2010 21:15:56 +0000 (21:15 +0000)]
Reinstate the code for emitting an initial debug type for a struct,
to handle the case where the struct is only forward-declared. In
this case, a temporary MDNode is not needed and not desired.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111842
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 23 Aug 2010 20:58:55 +0000 (20:58 +0000)]
Driver/Darwin: Switch to using simplified tool chain by default -- what better
way to see what will break! :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111840
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 23 Aug 2010 20:58:52 +0000 (20:58 +0000)]
Driver/Darwin: When using the simplified Clang toolchain, make sure to also pass
the arch specific gcc lib path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111839
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Mon, 23 Aug 2010 20:58:50 +0000 (20:58 +0000)]
Driver: Update -ccc-install-dir to also set the installed dir. Totally
non-obvious.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111838
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Care [Mon, 23 Aug 2010 19:57:25 +0000 (19:57 +0000)]
Modified pseudoconstant test case to make it a bit clearer and fix a missing line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111833
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Care [Mon, 23 Aug 2010 19:51:57 +0000 (19:51 +0000)]
Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 19:33:40 +0000 (19:33 +0000)]
Don't include macro results when we're completing a declarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111830
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 23 Aug 2010 18:51:39 +0000 (18:51 +0000)]
Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar
7824380).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111823
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 23 Aug 2010 18:26:10 +0000 (18:26 +0000)]
test case for PR7920.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111821
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 18:23:48 +0000 (18:23 +0000)]
Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111818
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 14:50:27 +0000 (14:50 +0000)]
Emit an error noting that Clang does not support code generation for
the ternary operator without a left-hand side in C++ (PR7726), from
Jean-Daniel Dupas!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111809
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 14:44:46 +0000 (14:44 +0000)]
Add XML for CXXConstructExpr, from Benoit Belley!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111808
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 14:34:43 +0000 (14:34 +0000)]
When complaining about a duplicate declspec, provide a Fix-It that
removes the copy. Patch from Eelis van der Weegen, tweaked/updated by
me.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111807
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 23 Aug 2010 14:03:03 +0000 (14:03 +0000)]
Clarify documentation of escaping for backslash
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111806
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 23 Aug 2010 08:37:21 +0000 (08:37 +0000)]
Add a virtual destructor to the base of another class hierarchy with virtual
methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111804
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 23 Aug 2010 07:55:51 +0000 (07:55 +0000)]
Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.
We add explicit code to the default initialization path to ensure the
definition is both present and valid.
Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111802
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 07:28:44 +0000 (07:28 +0000)]
Push DeclGroupRefs and TemplateNames in an opaque but type-safe way
through the parser.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111800
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 23 Aug 2010 07:12:16 +0000 (07:12 +0000)]
In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also contain a ObjCObjectPointerType since r111699.
Don't assume that they are only PointerTypes or we will crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111798
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 06:56:36 +0000 (06:56 +0000)]
chandlerc pointed out that ending a line with /\ is not very friendly. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111797
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 06:53:58 +0000 (06:53 +0000)]
Kill off Parser::TemplateParameterList to avoid misparses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111796
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 06:44:23 +0000 (06:44 +0000)]
Sundry incremental steps towards killing off Action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111795
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Mon, 23 Aug 2010 05:26:13 +0000 (05:26 +0000)]
fix rdar://
8340348, a miscompile of boost that was exposed by r109848.
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'. The call code
turns around and allocates space for the ignored argument with
GetUndefRValue. The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but
undefined contents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111794
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 23 Aug 2010 01:37:32 +0000 (01:37 +0000)]
Adjust code placement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111790
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 23 Aug 2010 01:21:21 +0000 (01:21 +0000)]
Abstract out everything having to do with member pointers into the ABI
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.
Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789
91177308-0d34-0410-b5e6-
96231b3b80d8