Commit Graph

16554 Commits

Author SHA1 Message Date
Daniel Dunbar cda8eb7a21 Revert r117678, "Qualified 'id' should implement all of static class type's", it breaks things.
llvm-svn: 117829
2010-10-30 19:22:48 +00:00
John McCall c273f24196 Better solution: calculate the visibility of functions and variables
independently of whether they're definitions, then teach IR generation to
ignore non-explicit visibility when emitting declarations.  Use this to
make sure that RTTI, vtables, and VTTs get the right visibility.

More of rdar://problem/8613093

llvm-svn: 117781
2010-10-30 11:50:40 +00:00
John McCall 36cd5cc150 GCC faithfully calculates visibility for variables independently of
whether it's a declaration or not, then ignores that information for
declarations unless it was explicitly given.  It's not totally clear
how that should be mapped into a sane system, but make an effort.

llvm-svn: 117780
2010-10-30 09:18:49 +00:00
Benjamin Kramer 7d11382b8c Use the expanded form of S_ISREG. Hopefully this unbreaks the MSVC build.
llvm-svn: 117779
2010-10-30 08:28:42 +00:00
Nick Lewycky b9b3927356 Preserve the template type parameter name when instantiating a templace.
Fixes PR8489.

llvm-svn: 117776
2010-10-30 06:48:20 +00:00
Chris Lattner 5c0b40528d Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423

llvm-svn: 117775
2010-10-30 05:14:06 +00:00
Douglas Gregor d58530422f Flush statements after writing each DECL_CXX_BASE_SPECIFIERS node
llvm-svn: 117770
2010-10-30 04:28:16 +00:00
Argyrios Kyrtzidis 93513155e7 Don't remove the init expression from the initializer list if it had a semantic error.
We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily.
Fixes rdar://8605381.

llvm-svn: 117760
2010-10-30 01:06:26 +00:00
Douglas Gregor 5ef9e33137 Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.

llvm-svn: 117750
2010-10-30 00:23:06 +00:00
John McCall 6a16b2f10c When list-initializing a vector, try to copy-initialize from vectors instead
of descending into the subelements.

rdar://problem/8345836

llvm-svn: 117749
2010-10-30 00:11:39 +00:00
Dan Gohman e89c04e518 Don't test isRegularFile before calling eraseFromDisk, since
eraseFromDisk does the same check. This avoids a stat call
in the common case.

llvm-svn: 117744
2010-10-29 23:26:14 +00:00
Dale Johannesen 182addf159 Handle Type.h a better way.
llvm-svn: 117743
2010-10-29 23:24:33 +00:00
Fariborz Jahanian e5c1bda4d1 Improve diagnostics reporting of un-implemented
methods in protocols when protocols are in system
headers and thus ignored. //rdar: //8227199

llvm-svn: 117739
2010-10-29 23:20:05 +00:00
Dale Johannesen 7d3dfc0622 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?

llvm-svn: 117736
2010-10-29 23:12:32 +00:00
Dan Gohman e9e32dcb48 Use CodeGenFunction's getContext(), for consistency.
llvm-svn: 117734
2010-10-29 22:47:07 +00:00
Douglas Gregor d4c5ed038c Make the deserialization of C++ base class specifiers lazy, improving
the performance of C++ PCH and reducing stack depth in the reader.

llvm-svn: 117732
2010-10-29 22:39:52 +00:00
John McCall 37bb6c9832 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.

llvm-svn: 117729
2010-10-29 22:22:43 +00:00
Rafael Espindola acc8709850 Switch to using the integrated assembler by default on x86 and x86-64 ELF
systems.

llvm-svn: 117697
2010-10-29 20:14:02 +00:00
Fariborz Jahanian 2129ccf512 If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.

llvm-svn: 117692
2010-10-29 19:49:13 +00:00
Fariborz Jahanian 531a3707a9 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.

llvm-svn: 117678
2010-10-29 18:26:21 +00:00
Devang Patel 31d1e2153f After processing named unions do not fall through to handle anonymous unions.
This is tested by funcargs.exp in gdb testsuite.

llvm-svn: 117659
2010-10-29 16:21:19 +00:00
Argyrios Kyrtzidis 706bbf84d8 When doing name lookup for members don't look into global/namespace scope.
Better performance and fixes rdar://8603569.

llvm-svn: 117656
2010-10-29 16:12:50 +00:00
Daniel Dunbar df8792128f Revert r117644, "Apply visibility in IR gen to variables that are merely
declared", it breaks things.

llvm-svn: 117653
2010-10-29 15:19:36 +00:00
John McCall 077dc60540 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.

llvm-svn: 117645
2010-10-29 08:14:02 +00:00
John McCall 4af6bf1fdc 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.

llvm-svn: 117644
2010-10-29 07:49:41 +00:00
Marcin Swiderski a7d84a7615 Added CFGTerminator class, that holds information about CFGBlock terminator statement.
llvm-svn: 117642
2010-10-29 05:21:47 +00:00
Charles Davis 31575f758c 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().

llvm-svn: 117638
2010-10-29 03:25:11 +00:00
Ted Kremenek 310c5a8e31 Don't flag idempotent '+' or '-' warnings for pointer arithmetic (typically false positives).
Fixes <rdar://problem/8601243>.

llvm-svn: 117635
2010-10-29 01:06:54 +00:00
John McCall 033caa5895 When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.

llvm-svn: 117628
2010-10-29 00:29:13 +00:00
Devang Patel ed23f18d7e Basic types are language defined builtins. They are always defined at top most level.
llvm-svn: 117613
2010-10-28 22:03:20 +00:00
John McCall 565141612f When emitting l-values for bool non-__block decl references, make a pointer
using the memory type;  fixes an assert.

Fixes rdar://problem/8605032

llvm-svn: 117610
2010-10-28 21:37:57 +00:00
Daniel Dunbar a78e589b08 Driver/IA: Ignore -L for now, which users shouldn't be using for semantic effect.
llvm-svn: 117600
2010-10-28 20:36:23 +00:00
Devang Patel faadd7b72d Directly use NamespaceDecl->getLocation() to find the source file.
llvm-svn: 117576
2010-10-28 19:12:46 +00:00
John McCall 62b6862c5e Don't apply -fvisibility-inlines-hidden to extern templates.
Part 2 of rdar://problem/8595231

llvm-svn: 117567
2010-10-28 18:10:36 +00:00
Devang Patel 8e0073008a Stay within 80 columns.
llvm-svn: 117561
2010-10-28 17:27:32 +00:00
Douglas Gregor 16896c45f3 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.

llvm-svn: 117550
2010-10-28 15:44:59 +00:00
Argyrios Kyrtzidis 440ea32773 Initialize the ASTMutationListener. Thanks goes to Abramo Bagnara!
llvm-svn: 117541
2010-10-28 09:29:35 +00:00
Argyrios Kyrtzidis d9f526fc2e Switch case IDs conflict between chained PCHs; since there is no need to be global, make them local to a decl.
llvm-svn: 117540
2010-10-28 09:29:32 +00:00
John McCall 9de9160d55 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.

llvm-svn: 117539
2010-10-28 08:53:48 +00:00
Argyrios Kyrtzidis 47102d885d 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.

llvm-svn: 117537
2010-10-28 07:38:53 +00:00
Argyrios Kyrtzidis 01c2df45ff 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.

llvm-svn: 117536
2010-10-28 07:38:51 +00:00
Argyrios Kyrtzidis ef80a01d04 Properly add chained template specializations.
llvm-svn: 117535
2010-10-28 07:38:47 +00:00
Argyrios Kyrtzidis 4729972c0f Fix the re-serializing decls in a chained PCH mechanism.
llvm-svn: 117534
2010-10-28 07:38:45 +00:00
Argyrios Kyrtzidis 402dbbbd66 Use the ASTMutationListener to track added template specializations in a chained PCH.
llvm-svn: 117533
2010-10-28 07:38:42 +00:00
John McCall 2efaf11695 Abandon the type-visibility optimization for functions. GCC doesn't do it,
and it's too much trouble to push for.  Fixes PR8478.

llvm-svn: 117532
2010-10-28 07:07:52 +00:00
John McCall b7139c43ae When computing visibility, use the latest declaration's explicit visibility
attribute.

Part of rdar://problem/8595231

llvm-svn: 117526
2010-10-28 04:18:25 +00:00
John McCall 071df46743 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.

llvm-svn: 117524
2010-10-28 02:34:38 +00:00
Ted Kremenek 0abd85c7ae Don't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker. Fixes <rdar://problem/8481311>.
llvm-svn: 117521
2010-10-28 02:16:22 +00:00
Dale Johannesen d2b2ad093c Ahem. Add rest of D and Q registers to ARM inline asm handling.
llvm-svn: 117517
2010-10-28 01:05:37 +00:00
Dale Johannesen 7fd51bc1e6 Add D and Q register names to ARM inline asm handling.
No aliasing is needed, these work as given in the BE.

llvm-svn: 117508
2010-10-27 23:34:42 +00:00