]> granicus.if.org Git - clang/log
clang
14 years agofix a bug in SourceManager::getInstantiationLocSlowCase, where
Chris Lattner [Fri, 12 Feb 2010 19:31:35 +0000 (19:31 +0000)]
fix a bug in SourceManager::getInstantiationLocSlowCase, where
we'd add an offset from the spelling location space to the
instantiation location, which doesn't make sense and would
lead up to the text diagnostics crashing when presented with
non-sensical locations.

This fixes rdar://7597492, a crash on 255.vortex.

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

14 years agoPatch to fix a warning which exposed a bug in building
Fariborz Jahanian [Fri, 12 Feb 2010 19:27:33 +0000 (19:27 +0000)]
Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).

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

14 years agorestructure code a bit: there are two potential issues
Chris Lattner [Fri, 12 Feb 2010 18:52:52 +0000 (18:52 +0000)]
restructure code a bit: there are two potential issues
worth asserting about in this code: 1) if the source range
is bogus (begin loc after end loc), and 2) if the client
is trying to highlight a range that is purely whitespace.

It is possible to just silently ignore #2, but it seems like
it is always a bug, so lets keep asserting on this condition,
but with a better assert message.

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

14 years agoFix a refacto that broke the clang-on-clang build.
Anders Carlsson [Fri, 12 Feb 2010 18:14:46 +0000 (18:14 +0000)]
Fix a refacto that broke the clang-on-clang build.

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

14 years agoFixes a rewriter bug rewriting function decl.
Fariborz Jahanian [Fri, 12 Feb 2010 17:52:31 +0000 (17:52 +0000)]
Fixes a rewriter bug rewriting function decl.
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.

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

14 years agoImprove representation of tag declarations first declared or defined
Douglas Gregor [Fri, 12 Feb 2010 17:40:34 +0000 (17:40 +0000)]
Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!

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

14 years agoStart stubbing out more of the covariant thunk support.
Anders Carlsson [Fri, 12 Feb 2010 17:37:14 +0000 (17:37 +0000)]
Start stubbing out more of the covariant thunk support.

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

14 years agoImprove documentation for DependentTypeOfExprType, DependentDecltypeType. No function...
Douglas Gregor [Fri, 12 Feb 2010 17:28:41 +0000 (17:28 +0000)]
Improve documentation for DependentTypeOfExprType, DependentDecltypeType. No functionality change.

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

14 years agoSimplify incomplete-array merging code in the AST importer, thanks to
Douglas Gregor [Fri, 12 Feb 2010 17:23:39 +0000 (17:23 +0000)]
Simplify incomplete-array merging code in the AST importer, thanks to
Daniel's suggestion.

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

14 years agoFix a latent bug found by Ahmed Charles, where we were calling
Douglas Gregor [Fri, 12 Feb 2010 17:17:28 +0000 (17:17 +0000)]
Fix a latent bug found by Ahmed Charles, where we were calling
ASTContext::getFunctionType with the wrong set of arguments.

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

14 years agoKeep track of whether a final overrider needs a return type adjustment.
Anders Carlsson [Fri, 12 Feb 2010 17:13:23 +0000 (17:13 +0000)]
Keep track of whether a final overrider needs a return type adjustment.

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

14 years agoMove overrider out into a separate struct.
Anders Carlsson [Fri, 12 Feb 2010 16:55:34 +0000 (16:55 +0000)]
Move overrider out into a separate struct.

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

14 years agoFix PR6282: the include guard optimization cannot happen if the
Chris Lattner [Fri, 12 Feb 2010 08:03:27 +0000 (08:03 +0000)]
Fix PR6282: the include guard optimization cannot happen if the
guard macro is already defined for the first occurrence of the
header.  If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.

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

14 years agoKeep track of the address points for all primary bases, and add the ability to dump...
Anders Carlsson [Fri, 12 Feb 2010 07:43:48 +0000 (07:43 +0000)]
Keep track of the address points for all primary bases, and add the ability to dump multiple address points for a single offset.

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

14 years agoWork around an annoying, non-standard optimization in the glibc
Douglas Gregor [Fri, 12 Feb 2010 07:32:17 +0000 (07:32 +0000)]
Work around an annoying, non-standard optimization in the glibc
headers, where malloc (and many other libc functions) are declared
with empty throw specifications, e.g.,

  extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__
  ((__malloc__)) ;

The C++ standard doesn't seem to allow this, and redeclaring malloc as
the standard permits (as follows) resulted in Clang (rightfully!)
complaining about mis-matched exception specifications.

  void *malloc(size_t size);

We work around this by silently propagating an empty throw
specification "throw()" from a function with C linkage declared in a
system header to a redeclaration that has no throw specifier.

Ick.

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

14 years agoFix a bug causing an assertion when a covariant return type differed from
John McCall [Fri, 12 Feb 2010 06:15:07 +0000 (06:15 +0000)]
Fix a bug causing an assertion when a covariant return type differed from
an overriden type only by reduced qualification.

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

14 years agoImprove a test slightly
Douglas Gregor [Fri, 12 Feb 2010 06:08:51 +0000 (06:08 +0000)]
Improve a test slightly

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

14 years agoIn C++, allow builtins to be referred to via qualified name lookup, e.g.,
Douglas Gregor [Fri, 12 Feb 2010 05:48:04 +0000 (05:48 +0000)]
In C++, allow builtins to be referred to via qualified name lookup, e.g.,

  ::__builtin_va_copy

Fixes one of the Firefox issues in PR5511.

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

14 years agoMore work on vtable layout. We can now layout vtables with primary bases.
Anders Carlsson [Fri, 12 Feb 2010 05:25:12 +0000 (05:25 +0000)]
More work on vtable layout. We can now layout vtables with primary bases.

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

14 years agoWaste two bits in every clang::Type so that the type class can be read
John McCall [Fri, 12 Feb 2010 03:41:30 +0000 (03:41 +0000)]
Waste two bits in every clang::Type so that the type class can be read
in a single byte-load rather than some crazy bitmunging operation.

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

14 years agoWhen dumping vtables, dump whether a virtual member function is pure or not.
Anders Carlsson [Fri, 12 Feb 2010 02:38:13 +0000 (02:38 +0000)]
When dumping vtables, dump whether a virtual member function is pure or not.

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

14 years agoMore work on the final overriders.
Anders Carlsson [Fri, 12 Feb 2010 01:40:03 +0000 (01:40 +0000)]
More work on the final overriders.

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

14 years agoDo not ignore anonymous records.
Devang Patel [Fri, 12 Feb 2010 01:31:06 +0000 (01:31 +0000)]
Do not ignore anonymous records.

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

14 years agoCache new compile unit.
Devang Patel [Fri, 12 Feb 2010 01:30:31 +0000 (01:30 +0000)]
Cache new compile unit.

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

14 years agoTwo changes to scan-build:
Ted Kremenek [Fri, 12 Feb 2010 00:12:25 +0000 (00:12 +0000)]
Two changes to scan-build:

(1) When no 'clang' is found with 'scan-build', remember the one from
the path as scan-build sees it, not the build system.  This prevents
us from finding different clangs during the build.

(2) Don't set LDPLUSPLUS when running xcodebuild; instead rely on the
clang driver to do the right thing.

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

14 years agoAdd comments.
Ted Kremenek [Fri, 12 Feb 2010 00:10:34 +0000 (00:10 +0000)]
Add comments.

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

14 years agoHandle AST merges of incomplete class types.
Douglas Gregor [Fri, 12 Feb 2010 00:09:27 +0000 (00:09 +0000)]
Handle AST merges of incomplete class types.

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

14 years agoImplementing unused function warning.
Tanya Lattner [Fri, 12 Feb 2010 00:07:30 +0000 (00:07 +0000)]
Implementing unused function warning.

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

14 years agoWarn about using the new force_align_arg_pointer attribute on a function
Charles Davis [Thu, 11 Feb 2010 23:57:08 +0000 (23:57 +0000)]
Warn about using the new force_align_arg_pointer attribute on a function
pointer. If you don't like the new warning, you can turn it off with
-Wno-force-align-arg-pointer.

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

14 years agoFixes a rewriting bug where order of constructor expression arguments did not match
Fariborz Jahanian [Thu, 11 Feb 2010 23:35:57 +0000 (23:35 +0000)]
Fixes a rewriting bug where order of constructor expression arguments did not match
order of constructor arguments (all block API specific). This was exposed only in
a large block literal expression in a large file where PtrSet container size
execceded its limit and required reallocation.  Fixes radar 7638294

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

14 years agoWhen we have a dependent direct initializer but not a dependent
Douglas Gregor [Thu, 11 Feb 2010 22:55:30 +0000 (22:55 +0000)]
When we have a dependent direct initializer but not a dependent
variable type, we can (and should) still check for completeness of the
variable's type. Do so, to work around an assertion that shows up in
Boost's shared_ptr.

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

14 years agoFix leak in CXXNewExpr where the SubExprs array would get allocated directly using...
Ted Kremenek [Thu, 11 Feb 2010 22:51:03 +0000 (22:51 +0000)]
Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.

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

14 years agoMake this test not rely on the system <limits.h>. Hopefully fixes the
John McCall [Thu, 11 Feb 2010 22:45:16 +0000 (22:45 +0000)]
Make this test not rely on the system <limits.h>.  Hopefully fixes the
MSVC build.

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

14 years agoFix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated...
Ted Kremenek [Thu, 11 Feb 2010 22:44:22 +0000 (22:44 +0000)]
Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.

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

14 years agoAllocate the SubExprs array in ObjCMessageExpr using the allocator associated with...
Ted Kremenek [Thu, 11 Feb 2010 22:41:21 +0000 (22:41 +0000)]
Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext.  This fixes yet another leak (<rdar://problem/7639260>).

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

14 years agoStub out the final overriders class.
Anders Carlsson [Thu, 11 Feb 2010 21:24:32 +0000 (21:24 +0000)]
Stub out the final overriders class.

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

14 years agoUse getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this).
Anders Carlsson [Thu, 11 Feb 2010 19:45:15 +0000 (19:45 +0000)]
Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this).

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

14 years agoMove two functions to the top. No functionality change.
Anders Carlsson [Thu, 11 Feb 2010 19:39:49 +0000 (19:39 +0000)]
Move two functions to the top. No functionality change.

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

14 years agoUncomment lines I never meant to have left commented in a commit.
Ted Kremenek [Thu, 11 Feb 2010 19:37:25 +0000 (19:37 +0000)]
Uncomment lines I never meant to have left commented in a commit.

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

14 years agoWhen AST merging for record declarations fails, warn about the
Douglas Gregor [Thu, 11 Feb 2010 19:21:55 +0000 (19:21 +0000)]
When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
       ^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
                                ^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
                                ^

There are a few changes to make this work:
  - ASTImporter now has only a single Diagnostic object, not multiple
  diagnostic objects. Otherwise, having a warning/error printed via
  one Diagnostic and its note printed on the other Diagnostic could
  cause the note to be suppressed.
  - Implemented import functionality for IntegerLiteral (along with
  general support for statements and expressions)

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

14 years agoAdd builtins from PR5255. Implementations coming soon.
Eli Friedman [Thu, 11 Feb 2010 19:02:42 +0000 (19:02 +0000)]
Add builtins from PR5255.  Implementations coming soon.

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

14 years agoTest case for warnings with carets inside macro instantiations.
John McCall [Thu, 11 Feb 2010 18:52:49 +0000 (18:52 +0000)]
Test case for warnings with carets inside macro instantiations.

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

14 years agoAdd virtual operator= example.
Anders Carlsson [Thu, 11 Feb 2010 18:21:49 +0000 (18:21 +0000)]
Add virtual operator= example.

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

14 years agoMore vtable layout dumper improvements. Handle destructors, dump the complete functio...
Anders Carlsson [Thu, 11 Feb 2010 18:20:28 +0000 (18:20 +0000)]
More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.

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

14 years agoAdd missing test cases for AST merging of structures.
Douglas Gregor [Thu, 11 Feb 2010 18:18:11 +0000 (18:18 +0000)]
Add missing test cases for AST merging of structures.

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

14 years agoDriver: Fix clang -ccc-no-clang -x c++-header foo.h on Darwin.
Daniel Dunbar [Thu, 11 Feb 2010 17:33:45 +0000 (17:33 +0000)]
Driver: Fix clang -ccc-no-clang -x c++-header foo.h on Darwin.

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

14 years agoKeep track of, and dump, vtable address points.
Anders Carlsson [Thu, 11 Feb 2010 17:18:51 +0000 (17:18 +0000)]
Keep track of, and dump, vtable address points.

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

14 years agoRemove noisy semicolon.
Benjamin Kramer [Thu, 11 Feb 2010 11:33:47 +0000 (11:33 +0000)]
Remove noisy semicolon.

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

14 years agoSuppress warnings if their instantiation location is in a system header, not
John McCall [Thu, 11 Feb 2010 10:04:29 +0000 (10:04 +0000)]
Suppress warnings if their instantiation location is in a system header, not
their spelling location.  This prevents warnings from being swallowed just
because the caret is on the first parenthesis in, say, NULL.

This is an experiment;  the risk is that there might be a substantial number
of system headers which #define symbols to expressions which inherently cause
warnings.  My theory is that that's rare enough that it can be worked
around case-by-case, and that producing useful warnings around NULL is worth
it.  But I'm willing to accept that I might be empirically wrong.

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

14 years agoPatch by Cristian Draghici:
Ted Kremenek [Thu, 11 Feb 2010 09:27:41 +0000 (09:27 +0000)]
Patch by Cristian Draghici:

Enhance the printf format string checking when using the format
specifier flags ' ', '0', '+' with the 'p' or 's' conversions (since
they are nonsensical and undefined).  This is similar to GCC's
checking.

Also warning when a precision is used with the 'p' conversin
specifier, since it has no meaning.

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

14 years agoCheck in the beginnings of my new vtable layout builder idea.
Anders Carlsson [Thu, 11 Feb 2010 08:02:13 +0000 (08:02 +0000)]
Check in the beginnings of my new vtable layout builder idea.

Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.

I've also added a very simple new vtable layout test case.

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

14 years agoAttempt to always dispose of the CXIndex object in c-index-test.
Ted Kremenek [Thu, 11 Feb 2010 07:41:25 +0000 (07:41 +0000)]
Attempt to always dispose of the CXIndex object in c-index-test.

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

14 years agoUse the allocator associated with ASTContext to allocate the args
Ted Kremenek [Thu, 11 Feb 2010 07:31:47 +0000 (07:31 +0000)]
Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr.  This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHave ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
Ted Kremenek [Thu, 11 Feb 2010 07:12:28 +0000 (07:12 +0000)]
Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
storing the set of StoredDeclsMaps in an internal vector of void*.
This isn't an ideal solution, but for the time being this fixes a
major memory leak with these DenseMaps not being freed.

Fixes: <rdar://problem/7634755>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95861 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove use of 'std::string' from Attr objects, using instead a byte
Ted Kremenek [Thu, 11 Feb 2010 05:28:37 +0000 (05:28 +0000)]
Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext.  This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.
Daniel Dunbar [Thu, 11 Feb 2010 03:16:21 +0000 (03:16 +0000)]
Driver: Add -rewrite-objc, which is an interface to clang -cc1 -rewrite-objc.

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

14 years agoDriver: Fix infinite loop and wrong message on invalid -ccc-clang-arch argument.
Daniel Dunbar [Thu, 11 Feb 2010 03:16:07 +0000 (03:16 +0000)]
Driver: Fix infinite loop and wrong message on invalid -ccc-clang-arch argument.

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

14 years agoClean up ownership of 'AttributeList' objects in Parser. Apparently
Ted Kremenek [Thu, 11 Feb 2010 02:19:13 +0000 (02:19 +0000)]
Clean up ownership of 'AttributeList' objects in Parser.  Apparently
we would just leak them all over the place, with no clear ownership of
these objects at all.  AttributeList objects would get leaked on both
error and non-error paths.

Note: I introduced the usage of llvm::OwningPtr<AttributeList> to
manage these objects, which is particularly useful for methods with
multiple return sites.  In at least one method I used them even when
they weren't strictly necessary because it clarified the ownership
semantics and made the code easier to read.  Should the excessive
'take()' and 'reset()' calls become a performance issue we can always
re-evaluate.

Note+1: I believe I have not introduced any double-frees, but it would
be nice for someone to review this.

This fixes <rdar://problem/7635046>.

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

14 years agoStrip attributes and 'inline' off the "previous declaration" of a
John McCall [Thu, 11 Feb 2010 01:33:53 +0000 (01:33 +0000)]
Strip attributes and 'inline' off the "previous declaration" of a
template explicit specialization.  Complete an apparently stalled refactor
towards using CheckSpecializationInstantiationRedecl().

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

14 years agoRemove another redundant ASTContext parameter
Douglas Gregor [Thu, 11 Feb 2010 01:30:34 +0000 (01:30 +0000)]
Remove another redundant ASTContext parameter

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

14 years agoEliminate a bunch of unnecessary ASTContexts from members functions of
Douglas Gregor [Thu, 11 Feb 2010 01:19:42 +0000 (01:19 +0000)]
Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.

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

14 years agoDiagnose when user provided getter is being used as lvalue
Fariborz Jahanian [Thu, 11 Feb 2010 01:11:34 +0000 (01:11 +0000)]
Diagnose when user provided getter is being used as lvalue
using property dot-syntax. Fixes radar 7628953.

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

14 years agoEliminate the ASTContext parameter from RecordDecl::getDefinition()
Douglas Gregor [Thu, 11 Feb 2010 01:04:33 +0000 (01:04 +0000)]
Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.

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

14 years agoAllocate 'ObjCMethodList' objects (owned by Sema) using Sema's BumpPtrAllocator....
Ted Kremenek [Thu, 11 Feb 2010 00:53:01 +0000 (00:53 +0000)]
Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's BumpPtrAllocator.  Previously they were not getting freed.  Fixes <rdar://problem/7635663>.

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

14 years agoImplement basic AST merging for classes, structs, and unions in C.
Douglas Gregor [Thu, 11 Feb 2010 00:48:18 +0000 (00:48 +0000)]
Implement basic AST merging for classes, structs, and unions in C.

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

14 years agoGenerate the objc_read_weak API when calling
Fariborz Jahanian [Wed, 10 Feb 2010 23:34:57 +0000 (23:34 +0000)]
Generate the objc_read_weak API when calling
a __weak block. Fixes radar 7628591.

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

14 years agoFix a potential null-pointer use, and fix the style of my new function.
Charles Davis [Wed, 10 Feb 2010 23:26:12 +0000 (23:26 +0000)]
Fix a potential null-pointer use, and fix the style of my new function.
Thanks, Anton!

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

14 years agoAdd support for the force_align_arg_pointer attribute. This is an x86-specific
Charles Davis [Wed, 10 Feb 2010 23:06:52 +0000 (23:06 +0000)]
Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.

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

14 years agohopefully silence a warning on the clang-i386-darwin9 tester.
Chris Lattner [Wed, 10 Feb 2010 21:41:43 +0000 (21:41 +0000)]
hopefully silence a warning on the clang-i386-darwin9 tester.

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

14 years agoMove TypedefDecl importer to match the ordering in DeclNodes. No functionality change.
Douglas Gregor [Wed, 10 Feb 2010 21:10:29 +0000 (21:10 +0000)]
Move TypedefDecl importer to match the ordering in DeclNodes. No functionality change.

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

14 years agoc-index-test: Add "none" filter, useful for performance testing.
Daniel Dunbar [Wed, 10 Feb 2010 20:42:40 +0000 (20:42 +0000)]
c-index-test: Add "none" filter, useful for performance testing.

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

14 years agoPatch to rewrite blocks into unique api names.
Fariborz Jahanian [Wed, 10 Feb 2010 20:18:25 +0000 (20:18 +0000)]
Patch to rewrite blocks into unique api names.
Fixes radar 7630551

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

14 years agoImplement basic support for merging function declarations across
Douglas Gregor [Wed, 10 Feb 2010 19:54:31 +0000 (19:54 +0000)]
Implement basic support for merging function declarations across
translation units.

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

14 years agoProvide rewriting suppport for use of __typeof__
Fariborz Jahanian [Wed, 10 Feb 2010 18:54:22 +0000 (18:54 +0000)]
Provide rewriting suppport for use of __typeof__
in a declaration statement. Fixes radar 7628153.

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

14 years agoSwitch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
Daniel Dunbar [Wed, 10 Feb 2010 18:49:11 +0000 (18:49 +0000)]
Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.

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

14 years agoRefactor code that generates debug info for variables that has BlocksAttr.
Devang Patel [Wed, 10 Feb 2010 18:49:08 +0000 (18:49 +0000)]
Refactor code that generates debug info for variables that has BlocksAttr.

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

14 years agoclang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.
Daniel Dunbar [Wed, 10 Feb 2010 18:48:44 +0000 (18:48 +0000)]
clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.

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

14 years agoImplement AST importing and merging for typedefs. As part of this, provide a lame...
Douglas Gregor [Wed, 10 Feb 2010 17:47:19 +0000 (17:47 +0000)]
Implement AST importing and merging for typedefs. As part of this, provide a lame implementation for importing TypeSourceInfos.

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

14 years agoTeach AST merging that variables with incomplete array types can be
Douglas Gregor [Wed, 10 Feb 2010 17:16:49 +0000 (17:16 +0000)]
Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.

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

14 years agoImprove access control diagnostics. Perform access control on member-pointer
John McCall [Wed, 10 Feb 2010 09:31:12 +0000 (09:31 +0000)]
Improve access control diagnostics.  Perform access control on member-pointer
conversions.  Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path.  Prepare for friends.

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

14 years agoDon't display border around images (in Firefox).
Ted Kremenek [Wed, 10 Feb 2010 06:43:43 +0000 (06:43 +0000)]
Don't display border around images (in Firefox).

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

14 years agoConvert tabs to spaces.
Ted Kremenek [Wed, 10 Feb 2010 02:16:30 +0000 (02:16 +0000)]
Convert tabs to spaces.

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

14 years agoAdd comment.
Zhongxing Xu [Wed, 10 Feb 2010 02:02:10 +0000 (02:02 +0000)]
Add comment.

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

14 years agoAdd missing header file
Douglas Gregor [Wed, 10 Feb 2010 01:35:04 +0000 (01:35 +0000)]
Add missing header file

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

14 years agoComment out category's property decls. in rewrite.
Fariborz Jahanian [Wed, 10 Feb 2010 01:15:09 +0000 (01:15 +0000)]
Comment out category's property decls. in rewrite.
Fixes radar 7630636.

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

14 years agoUse current location as the location of compiler generated arguments, e.g. self,...
Devang Patel [Wed, 10 Feb 2010 01:09:50 +0000 (01:09 +0000)]
Use current location as the location of compiler generated arguments, e.g. self, _cmd etc.

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

14 years agoReverse a partial fix patch for radar 7214820. It broke some code and
Fariborz Jahanian [Wed, 10 Feb 2010 00:32:12 +0000 (00:32 +0000)]
Reverse a partial fix patch for radar 7214820. It broke some code and
I don't have time to refix it for now.

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

14 years agoImplement basic support for importing source locations from one AST
Douglas Gregor [Wed, 10 Feb 2010 00:15:17 +0000 (00:15 +0000)]
Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
    ^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
       ^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).

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

14 years agoPull header into side column.
Ted Kremenek [Tue, 9 Feb 2010 23:42:00 +0000 (23:42 +0000)]
Pull header into side column.

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

14 years agoIncrease page width for more modern displays.
Ted Kremenek [Tue, 9 Feb 2010 23:40:10 +0000 (23:40 +0000)]
Increase page width for more modern displays.

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

14 years agoTweak CSS for options table.
Ted Kremenek [Tue, 9 Feb 2010 23:32:46 +0000 (23:32 +0000)]
Tweak CSS for options table.

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

14 years agoEven more menu tweaking...
Ted Kremenek [Tue, 9 Feb 2010 23:21:49 +0000 (23:21 +0000)]
Even more menu tweaking...

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

14 years agoMore menu tweaking.
Ted Kremenek [Tue, 9 Feb 2010 23:21:00 +0000 (23:21 +0000)]
More menu tweaking.

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

14 years agoAdjust height of main content.
Ted Kremenek [Tue, 9 Feb 2010 23:18:43 +0000 (23:18 +0000)]
Adjust height of main content.

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

14 years agoFix grammar.
Ted Kremenek [Tue, 9 Feb 2010 23:18:00 +0000 (23:18 +0000)]
Fix grammar.

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

14 years agoChange text alignment in menus.
Ted Kremenek [Tue, 9 Feb 2010 23:16:24 +0000 (23:16 +0000)]
Change text alignment in menus.

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

14 years agoMove file-specific styling to after the menu.
Ted Kremenek [Tue, 9 Feb 2010 23:10:47 +0000 (23:10 +0000)]
Move file-specific styling to after the menu.

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

14 years agoInvert css inclusion order.
Ted Kremenek [Tue, 9 Feb 2010 23:09:48 +0000 (23:09 +0000)]
Invert css inclusion order.

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

14 years agoMore analyzer website tweaking in preparation for additional content.
Ted Kremenek [Tue, 9 Feb 2010 23:05:59 +0000 (23:05 +0000)]
More analyzer website tweaking in preparation for additional content.

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

14 years agoComplain about types and declarations that we don't know how to import.
Douglas Gregor [Tue, 9 Feb 2010 22:48:33 +0000 (22:48 +0000)]
Complain about types and declarations that we don't know how to import.

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