]> granicus.if.org Git - clang/log
clang
13 years agoDon't test isRegularFile before calling eraseFromDisk, since
Dan Gohman [Fri, 29 Oct 2010 23:26:14 +0000 (23:26 +0000)]
Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

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

13 years agoHandle Type.h a better way.
Dale Johannesen [Fri, 29 Oct 2010 23:24:33 +0000 (23:24 +0000)]
Handle Type.h a better way.

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

13 years agoImprove diagnostics reporting of un-implemented
Fariborz Jahanian [Fri, 29 Oct 2010 23:20:05 +0000 (23:20 +0000)]
Improve diagnostics reporting of un-implemented
methods in protocols when protocols are in system
headers and thus ignored. //rdar: //8227199

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

13 years agoGenerate bitcasts going in and out of MMX parameters
Dale Johannesen [Fri, 29 Oct 2010 23:12:32 +0000 (23:12 +0000)]
Generate bitcasts going in and out of MMX parameters
in asm's.  PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?

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

13 years agoUse CodeGenFunction's getContext(), for consistency.
Dan Gohman [Fri, 29 Oct 2010 22:47:07 +0000 (22:47 +0000)]
Use CodeGenFunction's getContext(), for consistency.

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

13 years agoThese functions don't need external linkage.
Dan Gohman [Fri, 29 Oct 2010 22:41:35 +0000 (22:41 +0000)]
These functions don't need external linkage.

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

13 years agoMake the deserialization of C++ base class specifiers lazy, improving
Douglas Gregor [Fri, 29 Oct 2010 22:39:52 +0000 (22:39 +0000)]
Make the deserialization of C++ base class specifiers lazy, improving
the performance of C++ PCH and reducing stack depth in the reader.

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

13 years agoRestore r117644, this time properly ignoring -fvisibility and type visibility
John McCall [Fri, 29 Oct 2010 22:22:43 +0000 (22:22 +0000)]
Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.

Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

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

13 years agoUse objdir != srcdir in the getting started doc.
Rafael Espindola [Fri, 29 Oct 2010 22:05:17 +0000 (22:05 +0000)]
Use objdir != srcdir in the getting started doc.

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

13 years agoUpdate tests to not search of as.
Rafael Espindola [Fri, 29 Oct 2010 21:18:11 +0000 (21:18 +0000)]
Update tests to not search of as.

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

13 years agoSwitch to using the integrated assembler by default on x86 and x86-64 ELF
Rafael Espindola [Fri, 29 Oct 2010 20:14:02 +0000 (20:14 +0000)]
Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

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

13 years agoIf Consumer object failed to create due to some
Fariborz Jahanian [Fri, 29 Oct 2010 19:49:13 +0000 (19:49 +0000)]
If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.

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

13 years agoQualified 'id' should implement all of static class type's
Fariborz Jahanian [Fri, 29 Oct 2010 18:26:21 +0000 (18:26 +0000)]
Qualified 'id' should implement all of static class type's
protocols, including those added to class, super class
and categories; otherewise issue a warning. This fixes
pr8453.

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

13 years agoAfter processing named unions do not fall through to handle anonymous unions.
Devang Patel [Fri, 29 Oct 2010 16:21:19 +0000 (16:21 +0000)]
After processing named unions do not fall through to handle anonymous unions.
This is tested by funcargs.exp in gdb testsuite.

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

13 years agoWhen doing name lookup for members don't look into global/namespace scope.
Argyrios Kyrtzidis [Fri, 29 Oct 2010 16:12:50 +0000 (16:12 +0000)]
When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569.

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

13 years agoRevert r117644, "Apply visibility in IR gen to variables that are merely
Daniel Dunbar [Fri, 29 Oct 2010 15:19:36 +0000 (15:19 +0000)]
Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

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

13 years agoDon't assert on attempts to throw 'bool'. I wonder if in the history of C++
John McCall [Fri, 29 Oct 2010 08:14:02 +0000 (08:14 +0000)]
Don't assert on attempts to throw 'bool'.  I wonder if in the history of C++
anyone has ever intentionally done this outside of a compiler test case.

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

13 years agoApply visibility in IR gen to variables that are merely declared
John McCall [Fri, 29 Oct 2010 07:49:41 +0000 (07:49 +0000)]
Apply visibility in IR gen to variables that are merely declared
and never defined.  We were previously emitting these with default
visibility unless they were declared with private_extern.

Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.

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

13 years agoAdded CFGTerminator class, that holds information about CFGBlock terminator statement.
Marcin Swiderski [Fri, 29 Oct 2010 05:21:47 +0000 (05:21 +0000)]
Added CFGTerminator class, that holds information about CFGBlock terminator statement.

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

13 years agoAdd a hook to the CXXABI object to get the default method calling convention.
Charles Davis [Fri, 29 Oct 2010 03:25:11 +0000 (03:25 +0000)]
Add a hook to the CXXABI object to get the default method calling convention.
This isn't used yet, because someone more experienced than I needs to look
at the type system about gutting getCanonicalCallConv().

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

13 years agoDon't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false...
Ted Kremenek [Fri, 29 Oct 2010 01:06:54 +0000 (01:06 +0000)]
Don't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false positives).

Fixes <rdar://problem/8601243>.

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

13 years agoRemove old CrashTracer cruft from CIndex.
Ted Kremenek [Fri, 29 Oct 2010 01:06:50 +0000 (01:06 +0000)]
Remove old CrashTracer cruft from CIndex.

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

13 years agoWhen computing the visibility of a class member, calculate the visibility
John McCall [Fri, 29 Oct 2010 00:29:13 +0000 (00:29 +0000)]
When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.

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

13 years agoexpand discussion of __block C++ on-stack objects
Blaine Garst [Thu, 28 Oct 2010 23:30:10 +0000 (23:30 +0000)]
expand discussion of __block C++ on-stack objects

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

13 years agoBasic types are language defined builtins. They are always defined at top most level.
Devang Patel [Thu, 28 Oct 2010 22:03:20 +0000 (22:03 +0000)]
Basic types are language defined builtins. They are always defined at top most level.

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

13 years agoWhen emitting l-values for bool non-__block decl references, make a pointer
John McCall [Thu, 28 Oct 2010 21:37:57 +0000 (21:37 +0000)]
When emitting l-values for bool non-__block decl references, make a pointer
using the memory type;  fixes an assert.

Fixes rdar://problem/8605032

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

13 years agoDriver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.
Daniel Dunbar [Thu, 28 Oct 2010 20:36:23 +0000 (20:36 +0000)]
Driver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.

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

13 years agoDirectly use NamespaceDecl->getLocation() to find the source file.
Devang Patel [Thu, 28 Oct 2010 19:12:46 +0000 (19:12 +0000)]
Directly use NamespaceDecl->getLocation() to find the source file.

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

13 years agoDon't apply -fvisibility-inlines-hidden to extern templates.
John McCall [Thu, 28 Oct 2010 18:10:36 +0000 (18:10 +0000)]
Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231

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

13 years agoStay within 80 columns.
Devang Patel [Thu, 28 Oct 2010 17:27:32 +0000 (17:27 +0000)]
Stay within 80 columns.

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

13 years agoSimplify ASTUnit's internal timers, by not trying to keep a pile of
Douglas Gregor [Thu, 28 Oct 2010 15:44:59 +0000 (15:44 +0000)]
Simplify ASTUnit's internal timers, by not trying to keep a pile of
timers to be dumped whenever the ASTUnit is destroyed. Instead, just
print the time elapsed for each operation after we perform the
operation.

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

13 years agoInitialize the ASTMutationListener. Thanks goes to Abramo Bagnara!
Argyrios Kyrtzidis [Thu, 28 Oct 2010 09:29:35 +0000 (09:29 +0000)]
Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!

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

13 years agoSwitch case IDs conflict between chained PCHs; since there is no need to be global...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 09:29:32 +0000 (09:29 +0000)]
Switch case IDs conflict between chained PCHs; since there is no need to be global, make them local to a decl.

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

13 years agoImplement an indirect-goto optimization for goto *&&lbl and respect this
John McCall [Thu, 28 Oct 2010 08:53:48 +0000 (08:53 +0000)]
Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker.  With that done, turn an indirect goto into a
protected scope into a hard error;  otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.

If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.

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

13 years agoRemove an assertion that hit on legitimate cases. A redeclaration may have location...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:53 +0000 (07:38 +0000)]
Remove an assertion that hit on legitimate cases. A redeclaration may have location before the
first one if the redeclaration comes from a friend decl.

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

13 years agoUse the ASTMutationListener to track when a named decl gets added to a DeclContext,
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:51 +0000 (07:38 +0000)]
Use the ASTMutationListener to track when a named decl gets added to a DeclContext,
meaning we need to rewrite its name lookup table in a chained PCH.

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

13 years agoProperly add chained template specializations.
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:47 +0000 (07:38 +0000)]
Properly add chained template specializations.

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

13 years agoFix the re-serializing decls in a chained PCH mechanism.
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:45 +0000 (07:38 +0000)]
Fix the re-serializing decls in a chained PCH mechanism.

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

13 years agoUse the ASTMutationListener to track added template specializations in a chained...
Argyrios Kyrtzidis [Thu, 28 Oct 2010 07:38:42 +0000 (07:38 +0000)]
Use the ASTMutationListener to track added template specializations in a chained PCH.

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

13 years agoAbandon the type-visibility optimization for functions. GCC doesn't do it,
John McCall [Thu, 28 Oct 2010 07:07:52 +0000 (07:07 +0000)]
Abandon the type-visibility optimization for functions.  GCC doesn't do it,
and it's too much trouble to push for.  Fixes PR8478.

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

13 years agoWhen computing visibility, use the latest declaration's explicit visibility
John McCall [Thu, 28 Oct 2010 04:18:25 +0000 (04:18 +0000)]
When computing visibility, use the latest declaration's explicit visibility
attribute.

Part of rdar://problem/8595231

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

13 years agoAdd test case for <rdar://problem/8356342>.
Ted Kremenek [Thu, 28 Oct 2010 02:50:32 +0000 (02:50 +0000)]
Add test case for <rdar://problem/8356342>.

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

13 years agoImplement the newest status quo for method override checking. The idea now
John McCall [Thu, 28 Oct 2010 02:34:38 +0000 (02:34 +0000)]
Implement the newest status quo for method override checking.  The idea now
is that we need more information to decide the exact conditions for whether
one ObjCObjectPointer is an acceptable return/parameter override for another,
so we're going to disable that entire class of warning for now.  The
"forward developement" warning category, -Wmethod-signatures, can receive
unrestricted feature work, and when we're happy with how it acts, we'll
turn it on by default.

This is a pretty conservative change, and nobody's totally content with it.

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

13 years agomake it really clear that vla != flexible arrays
Chris Lattner [Thu, 28 Oct 2010 02:20:32 +0000 (02:20 +0000)]
make it really clear that vla != flexible arrays

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

13 years agoDon't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker. Fixes <rdar...
Ted Kremenek [Thu, 28 Oct 2010 02:16:22 +0000 (02:16 +0000)]
Don't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker.  Fixes <rdar://problem/8481311>.

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

13 years agoAhem. Add rest of D and Q registers to ARM inline asm handling.
Dale Johannesen [Thu, 28 Oct 2010 01:05:37 +0000 (01:05 +0000)]
Ahem.  Add rest of D and Q registers to ARM inline asm handling.

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

13 years agoTest passes on Darwin; try to XFAIL on freebsd, linux, xp/msvc9.
Stuart Hastings [Thu, 28 Oct 2010 00:47:58 +0000 (00:47 +0000)]
Test passes on Darwin; try to XFAIL on freebsd, linux, xp/msvc9.

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

13 years agoAdd D and Q register names to ARM inline asm handling.
Dale Johannesen [Wed, 27 Oct 2010 23:34:42 +0000 (23:34 +0000)]
Add D and Q register names to ARM inline asm handling.
No aliasing is needed, these work as given in the BE.

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

13 years agoFix context info for enums.
Devang Patel [Wed, 27 Oct 2010 23:23:58 +0000 (23:23 +0000)]
Fix context info for enums.
Radar 8595129

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

13 years agosmall tweaks to reflect statements of what really ever shipped. ABI is, and has...
Blaine Garst [Wed, 27 Oct 2010 22:59:01 +0000 (22:59 +0000)]
small tweaks to reflect statements of what really ever shipped.  ABI is, and has been, accurate for what we ship.

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

13 years agoDon't override explicit visibility attributes on class members with
John McCall [Wed, 27 Oct 2010 22:31:22 +0000 (22:31 +0000)]
Don't override explicit visibility attributes on class members with
type-based visibility.

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

13 years agoMake AST deserialization for class template specializations lazier, by
Douglas Gregor [Wed, 27 Oct 2010 22:21:36 +0000 (22:21 +0000)]
Make AST deserialization for class template specializations lazier, by
not loading the specializations of a class template until some AST
consumer needs them.

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

13 years agoreconcile missing typos & delete obsolete pre-SnowLeopard section w.r.t. prior reposi...
Blaine Garst [Wed, 27 Oct 2010 21:22:46 +0000 (21:22 +0000)]
reconcile missing typos & delete obsolete pre-SnowLeopard section w.r.t. prior repository for this document

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

13 years agoRestore r117403 (fixing IR gen for bool atomics), this time being less
John McCall [Wed, 27 Oct 2010 20:58:56 +0000 (20:58 +0000)]
Restore r117403 (fixing IR gen for bool atomics), this time being less
aggressive about the form we expect bools to be in.  I don't really have
time to fix all the sources right now.

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

13 years agoDecay array/function types of a statement-expression.
Fariborz Jahanian [Wed, 27 Oct 2010 20:44:00 +0000 (20:44 +0000)]
Decay array/function types of a statement-expression.
// rdar: // 8600553.

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

13 years agoLazily load the next friend in the chain of FriendDecls, to eliminate
Douglas Gregor [Wed, 27 Oct 2010 20:23:41 +0000 (20:23 +0000)]
Lazily load the next friend in the chain of FriendDecls, to eliminate
some excessive recursion and deserialization.

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

13 years agopatch to do array-to-pointer conversion in a
Fariborz Jahanian [Wed, 27 Oct 2010 20:10:28 +0000 (20:10 +0000)]
patch to do array-to-pointer conversion in a
statement-expression. // rdar: //8600553

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

13 years agoLazily load the "next" namespace in the chain of NamespaceDecls, to
Douglas Gregor [Wed, 27 Oct 2010 19:49:05 +0000 (19:49 +0000)]
Lazily load the "next" namespace in the chain of NamespaceDecls, to
eliminate some excessive recursion and deserialization.

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

13 years agoIntroduce libclang-level options for C++ precompiled preambles,
Douglas Gregor [Wed, 27 Oct 2010 17:24:53 +0000 (17:24 +0000)]
Introduce libclang-level options for C++ precompiled preambles,
separating out chaining precompiled preambles from non-chaining ones.

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

13 years agoRevert r117403 as it caused PR8480.
Rafael Espindola [Wed, 27 Oct 2010 17:13:49 +0000 (17:13 +0000)]
Revert r117403 as it caused PR8480.

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

13 years agoDo the guarding of instantiated static data members
Fariborz Jahanian [Wed, 27 Oct 2010 16:21:54 +0000 (16:21 +0000)]
Do the guarding of instantiated static data members
on if its linkage is weak. Currently this is the
case but may change in the future. (part of radar
8562966).

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

13 years agoDocument how source ranges work
Douglas Gregor [Wed, 27 Oct 2010 16:02:28 +0000 (16:02 +0000)]
Document how source ranges work

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

13 years agoAdd an environment variable that allows us to turn off threading in c-index-test
Douglas Gregor [Wed, 27 Oct 2010 16:00:01 +0000 (16:00 +0000)]
Add an environment variable that allows us to turn off threading in c-index-test

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

13 years agoRemove redundant test
Douglas Gregor [Wed, 27 Oct 2010 14:20:34 +0000 (14:20 +0000)]
Remove redundant test

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

13 years agoAlso devirtualize calls to a member functions where the containing class has been...
Anders Carlsson [Wed, 27 Oct 2010 13:34:43 +0000 (13:34 +0000)]
Also devirtualize calls to a member functions where the containing class has been marked final.

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

13 years agoIf a virtual member function has the 'final' attribute, we can devirtualize calls...
Anders Carlsson [Wed, 27 Oct 2010 13:28:46 +0000 (13:28 +0000)]
If a virtual member function has the 'final' attribute, we can devirtualize calls to it.

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

13 years agoAdd helper for extracting the CXXRecordDecl for the implicit argument to
Chandler Carruth [Wed, 27 Oct 2010 06:55:41 +0000 (06:55 +0000)]
Add helper for extracting the CXXRecordDecl for the implicit argument to
a member call expression. This has proved to be a common pattern for users of
RecursiveASTVisitor.

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

13 years agoIf visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExpr
Zhongxing Xu [Wed, 27 Oct 2010 03:23:10 +0000 (03:23 +0000)]
If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExpr
containing a DoStmt, and the LHS doesn't create a new block, then we should
return RBlock.  Otherwise we'll incorrectly return NULL.

Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished.

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

13 years agoAvoid calculating linkage until the more obvious checks have run when
John McCall [Wed, 27 Oct 2010 01:41:35 +0000 (01:41 +0000)]
Avoid calculating linkage until the more obvious checks have run when
deciding whether to queue a decl for unused-declaration warnings.

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

13 years agoDon't compute linkage for a declaration as part of the #pragma weak
John McCall [Wed, 27 Oct 2010 00:59:00 +0000 (00:59 +0000)]
Don't compute linkage for a declaration as part of the #pragma weak
forward-declaration support unless there's really a mapping for that
name.

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

13 years agoDisable this test until we figure out what madness it causes
Douglas Gregor [Tue, 26 Oct 2010 23:34:31 +0000 (23:34 +0000)]
Disable this test until we figure out what madness it causes

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

13 years agoAdd support for code completion on stdin.
Dan Gohman [Tue, 26 Oct 2010 23:21:25 +0000 (23:21 +0000)]
Add support for code completion on stdin.

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

13 years agoPatch to provide guard when initializing instances
Fariborz Jahanian [Tue, 26 Oct 2010 22:47:47 +0000 (22:47 +0000)]
Patch to provide guard when initializing instances
of static data member of a class template.
Fixes //rdar :// 8562966 and pr8409.

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

13 years agoExtract procedures to do scalar-to-memory and memory-to-scalar conversions
John McCall [Tue, 26 Oct 2010 22:09:15 +0000 (22:09 +0000)]
Extract procedures to do scalar-to-memory and memory-to-scalar conversions
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics.  rdar://problem/8461234

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

13 years agoSign
Douglas Gregor [Tue, 26 Oct 2010 21:25:18 +0000 (21:25 +0000)]
Sign

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

13 years agoSimplify this code: don't check for the same error two
Dan Gohman [Tue, 26 Oct 2010 21:13:51 +0000 (21:13 +0000)]
Simplify this code: don't check for the same error two
different ways. Check once, and use an assert to handle
consistency checking.

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

13 years agogetOrCreateContentCache never returns null, so overrideFileContents
Dan Gohman [Tue, 26 Oct 2010 20:47:28 +0000 (20:47 +0000)]
getOrCreateContentCache never returns null, so overrideFileContents
doesn't need its return value.

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

13 years agoI hate this test
Douglas Gregor [Tue, 26 Oct 2010 19:36:20 +0000 (19:36 +0000)]
I hate this test

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

13 years agoFactor out the code for emitting code to load vtable pointer members
Dan Gohman [Tue, 26 Oct 2010 18:44:08 +0000 (18:44 +0000)]
Factor out the code for emitting code to load vtable pointer members
so that it's done in one place.

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

13 years agoSomething is seriously wonky with this test
Douglas Gregor [Tue, 26 Oct 2010 18:25:19 +0000 (18:25 +0000)]
Something is seriously wonky with this test

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

13 years agoFix silly typo
Douglas Gregor [Tue, 26 Oct 2010 17:32:59 +0000 (17:32 +0000)]
Fix silly typo

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

13 years agoTeach typo correction not to return the same keyword that matches a
Douglas Gregor [Tue, 26 Oct 2010 17:18:00 +0000 (17:18 +0000)]
Teach typo correction not to return the same keyword that matches a
typo. This can happen with context-sensitive keywords like "super",
when typo correction didn't know that "super" wasn't permitted in this
context.

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

13 years agoOptimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
John McCall [Tue, 26 Oct 2010 08:39:16 +0000 (08:39 +0000)]
Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
There's probably still significant padding waste on x86-64 UNIXen, but
the difference in 32-bit compiles should be significant.

There are a lot of Expr nodes left that could lose a word this way.

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

13 years agoNo really, we don't have a retain/release system for statements/expressions
John McCall [Tue, 26 Oct 2010 07:05:15 +0000 (07:05 +0000)]
No really, we don't have a retain/release system for statements/expressions
anymore.

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

13 years agoCookie crumbs.
John McCall [Tue, 26 Oct 2010 06:41:10 +0000 (06:41 +0000)]
Cookie crumbs.

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

13 years agoActually, that doesn't really work, and anyway we should choose
John McCall [Tue, 26 Oct 2010 06:40:27 +0000 (06:40 +0000)]
Actually, that doesn't really work, and anyway we should choose
conversion to id over conversion to void*.

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

13 years agoConsider conversions of Objective-C pointers to 'id' to be basically of
John McCall [Tue, 26 Oct 2010 06:23:29 +0000 (06:23 +0000)]
Consider conversions of Objective-C pointers to 'id' to be basically of
the same rank as conversions of normal pointers to 'void*'.

Also, resurrect a test case.

Fixes rdar://problem/8592139

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

13 years agoDelay complete-type checking for arguments to no-prototype functions
Douglas Gregor [Tue, 26 Oct 2010 05:45:40 +0000 (05:45 +0000)]
Delay complete-type checking for arguments to no-prototype functions
until after we've checked/promoted the argument. Hopefully fixes the
Emacs regression due to my recent change that expanded type-checking
in the presence of K&R function definitions.

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

13 years agoA couple of tweaks to the visibility rules:
John McCall [Tue, 26 Oct 2010 04:59:26 +0000 (04:59 +0000)]
A couple of tweaks to the visibility rules:
  - tags with C linkage should ignore visibility=hidden
  - functions and variables with explicit visibility attributes should
    ignore the linkage of their types
Either of these should be sufficient to fix PR8457.

Also, FileCheck-ize a test case.

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

13 years agoPending further discussion, re-enable warnings for Objective C
John McCall [Tue, 26 Oct 2010 00:53:53 +0000 (00:53 +0000)]
Pending further discussion, re-enable warnings for Objective C
covariant/contravariant overrides and implementations, but do so under
control of a new flag (-Wno-objc-covariant-overrides, which yes does cover
contravariance too).

*At least* the covariance cases will probably be enabled by default shortly,
but that's not totally uncontroversial.

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

13 years agoWhen de-serializing a type that is supposed to be canonical, call
Douglas Gregor [Tue, 26 Oct 2010 00:51:02 +0000 (00:51 +0000)]
When de-serializing a type that is supposed to be canonical, call
getCanonicalType() to make sure that the type we got back is actually
canonical. This is the case for most types, which always build a
canonical type when given canonical components. However, some types that
involve expressions in their canonicalization (e.g., array types with
dependent sizes) don't always build canonical types from canonical
components, because there is no such thing as a "canonical"
expression. Therefore, we do this extra mapping to ensure that the
canonical types we store are actually canonical.

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

13 years agoFix lazy symbolication bug in RegionStore involving fields of global variables. ...
Ted Kremenek [Tue, 26 Oct 2010 00:06:17 +0000 (00:06 +0000)]
Fix lazy symbolication bug in RegionStore involving fields of global variables.  When invalidated, the entire
globals memory space gets assigned a symbolic value, but that value was not being used for lazy symbolication
of fields of globals.  This could result in cases where bogus null dereferences were being reported.

Fixes PR 8440.

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

13 years agoMove 'includeGlobals' as a field into ClusterAnalysis.
Ted Kremenek [Tue, 26 Oct 2010 00:06:15 +0000 (00:06 +0000)]
Move 'includeGlobals' as a field into ClusterAnalysis.

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

13 years agoTweak null dereference checker to give better diagnostics for null dereferences resul...
Ted Kremenek [Tue, 26 Oct 2010 00:06:13 +0000 (00:06 +0000)]
Tweak null dereference checker to give better diagnostics for null dereferences resulting from array accesses.

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

13 years agoAdd infrastructure for emitting TBAA metadata with the "constant" flag.
Dan Gohman [Mon, 25 Oct 2010 23:51:23 +0000 (23:51 +0000)]
Add infrastructure for emitting TBAA metadata with the "constant" flag.

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

13 years agoPatch for mis-compile of statement expressions with
Fariborz Jahanian [Mon, 25 Oct 2010 23:27:26 +0000 (23:27 +0000)]
Patch for mis-compile of statement expressions with
non-trivial copy constructors. // rdar: //8540501.
A test will be added to llvm nightly tests.

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

13 years agoTrim an unnecessary #include.
Dan Gohman [Mon, 25 Oct 2010 21:59:29 +0000 (21:59 +0000)]
Trim an unnecessary #include.

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

13 years agoFactor out the code for creating the Root and Char nodes, so that
Dan Gohman [Mon, 25 Oct 2010 21:48:30 +0000 (21:48 +0000)]
Factor out the code for creating the Root and Char nodes, so that
they can be used outside of the main getTBAAInfo function.

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

13 years agoAdd and describe a quick script to migrate gcc builtins that clang doesn't
Eric Christopher [Mon, 25 Oct 2010 21:17:59 +0000 (21:17 +0000)]
Add and describe a quick script to migrate gcc builtins that clang doesn't
know about to the default APIs for x86 vector operations.

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

13 years agoLook through the address-of operator to find the function being
Douglas Gregor [Mon, 25 Oct 2010 20:48:33 +0000 (20:48 +0000)]
Look through the address-of operator to find the function being
called. Fixes another aspect of PR8314.

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