]> granicus.if.org Git - clang/log
clang
14 years agochange Scope::WithinElse to be a normal scope flag, widen the
Chris Lattner [Mon, 12 Apr 2010 06:12:50 +0000 (06:12 +0000)]
change Scope::WithinElse to be a normal scope flag, widen the
fields to two 16-bit values instead of using bitfields.

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

14 years agofix this test.
Chris Lattner [Mon, 12 Apr 2010 05:47:20 +0000 (05:47 +0000)]
fix this test.

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

14 years agoxfail this test for now.
Chris Lattner [Mon, 12 Apr 2010 05:44:13 +0000 (05:44 +0000)]
xfail this test for now.

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

14 years agofix an invalid use of super, you can't use super like this in a block!
Chris Lattner [Mon, 12 Apr 2010 05:43:31 +0000 (05:43 +0000)]
fix an invalid use of super, you can't use super like this in a block!

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

14 years agoHave the parser decide whether a message to super is a variable or
Chris Lattner [Mon, 12 Apr 2010 05:38:43 +0000 (05:38 +0000)]
Have the parser decide whether a message to super is a variable or
type, instead of having sema do it.

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

14 years agoTypo.
Nick Lewycky [Mon, 12 Apr 2010 05:32:01 +0000 (05:32 +0000)]
Typo.

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

14 years agofix a fixme, stop evaluating getCurMethodDecl() repeatedly
Chris Lattner [Mon, 12 Apr 2010 05:10:17 +0000 (05:10 +0000)]
fix a fixme, stop evaluating getCurMethodDecl() repeatedly
in "LookupInObjCMethod".

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

14 years agoother half of r101005
Chris Lattner [Mon, 12 Apr 2010 02:18:49 +0000 (02:18 +0000)]
other half of r101005

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

14 years agofix PR6287 by accepting and ignoring the returns_twice attribute.
Chris Lattner [Mon, 12 Apr 2010 02:18:38 +0000 (02:18 +0000)]
fix PR6287 by accepting and ignoring the returns_twice attribute.

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

14 years agoHave the CXXBaseOrMemberInitializer keep track of whether an initializer initializes...
Anders Carlsson [Mon, 12 Apr 2010 00:51:03 +0000 (00:51 +0000)]
Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

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

14 years agoUnbreak test on windows.
Ted Kremenek [Sun, 11 Apr 2010 22:25:18 +0000 (22:25 +0000)]
Unbreak test on windows.

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

14 years agoFix another bug where we wouldn't generate secondary vtables for construction vtables...
Anders Carlsson [Sun, 11 Apr 2010 22:20:36 +0000 (22:20 +0000)]
Fix another bug where we wouldn't generate secondary vtables for construction vtables in some cases.

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

14 years agoAdd initial USR support for macro definitions.
Ted Kremenek [Sun, 11 Apr 2010 22:20:34 +0000 (22:20 +0000)]
Add initial USR support for macro definitions.

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

14 years agoAugment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does...
Ted Kremenek [Sun, 11 Apr 2010 22:20:26 +0000 (22:20 +0000)]
Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does the right
thing if the cursor is not a decl (such as in the case of macros).

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

14 years agoMore renames.
Anders Carlsson [Sun, 11 Apr 2010 22:07:06 +0000 (22:07 +0000)]
More renames.

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

14 years agoRename a function parameter.
Anders Carlsson [Sun, 11 Apr 2010 22:03:57 +0000 (22:03 +0000)]
Rename a function parameter.

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

14 years agoAdd CIndex support for blocks.
Ted Kremenek [Sun, 11 Apr 2010 21:47:37 +0000 (21:47 +0000)]
Add CIndex support for blocks.

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

14 years agoUpdate checker build.
Ted Kremenek [Sun, 11 Apr 2010 21:02:52 +0000 (21:02 +0000)]
Update checker build.

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

14 years agoClarify an assertion.
Anders Carlsson [Sun, 11 Apr 2010 20:23:06 +0000 (20:23 +0000)]
Clarify an assertion.

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

14 years agoFix a bug where we were adding too many vcall offsets in some cases.
Anders Carlsson [Sun, 11 Apr 2010 20:04:11 +0000 (20:04 +0000)]
Fix a bug where we were adding too many vcall offsets in some cases.

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

14 years agoadd haiku support, patch by Paul Davey!
Chris Lattner [Sun, 11 Apr 2010 19:29:39 +0000 (19:29 +0000)]
add haiku support, patch by Paul Davey!

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

14 years agoavoid double negatives
Chris Lattner [Sun, 11 Apr 2010 18:53:08 +0000 (18:53 +0000)]
avoid double negatives

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

14 years agoFix CFG bug where bases of member expressions were not always evaluated in a lvalue...
Ted Kremenek [Sun, 11 Apr 2010 17:02:10 +0000 (17:02 +0000)]
Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context.  Fixes <rdar://problem/7813989>.

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

14 years agoFix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated...
Ted Kremenek [Sun, 11 Apr 2010 17:02:04 +0000 (17:02 +0000)]
Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.

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

14 years agoSort visitor methods. No functionality change.
Ted Kremenek [Sun, 11 Apr 2010 17:01:59 +0000 (17:01 +0000)]
Sort visitor methods.  No functionality change.

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

14 years agoFix run line so this test actually tests something.
Benjamin Kramer [Sun, 11 Apr 2010 09:39:39 +0000 (09:39 +0000)]
Fix run line so this test actually tests something.

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

14 years agofix PR6811 by not parsing 'super' as a magic expression in
Chris Lattner [Sun, 11 Apr 2010 08:28:14 +0000 (08:28 +0000)]
fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod.  Doing so allows all sorts of invalid code
to slip through to codegen.  This patch does not change the
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.

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

14 years agoactually the interface grossness in the previous patch was due to
Chris Lattner [Sun, 11 Apr 2010 07:51:10 +0000 (07:51 +0000)]
actually the interface grossness in the previous patch was due to
typo correction.  However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to
LookupMemberExpr!  Remove grossness.

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

14 years agofactor the code that handles "expr.field" when expr is a
Chris Lattner [Sun, 11 Apr 2010 07:45:24 +0000 (07:45 +0000)]
factor the code that handles "expr.field" when expr is a
pointer to an objc interface out to a method in SemaExprObjC.
This is *much* uglier than it should be due to grossness in
LookupMemberExpr :(

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

14 years agofix a problem causing us to lose the ''s around objc interface names
Chris Lattner [Sun, 11 Apr 2010 07:04:01 +0000 (07:04 +0000)]
fix a problem causing us to lose the ''s around objc interface names
in a diagnostic.

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

14 years agoSimplify test, in the hopes of making linux happy.
Daniel Dunbar [Sun, 11 Apr 2010 01:10:44 +0000 (01:10 +0000)]
Simplify test, in the hopes of making linux happy.

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

14 years agoEnable an assert and remove a now unnecessary assert.
Anders Carlsson [Sat, 10 Apr 2010 21:50:08 +0000 (21:50 +0000)]
Enable an assert and remove a now unnecessary assert.

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

14 years agoFix another vbase layout bug.
Anders Carlsson [Sat, 10 Apr 2010 21:35:33 +0000 (21:35 +0000)]
Fix another vbase layout bug.

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

14 years agoAdd a simple debug-only verification pass to the record layout builder.
Anders Carlsson [Sat, 10 Apr 2010 21:24:48 +0000 (21:24 +0000)]
Add a simple debug-only verification pass to the record layout builder.

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

14 years agoFix a bug where we would add the same function twice in a vtable.
Anders Carlsson [Sat, 10 Apr 2010 20:39:29 +0000 (20:39 +0000)]
Fix a bug where we would add the same function twice in a vtable.

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

14 years agorevert 100942, pending discussion.
Chris Lattner [Sat, 10 Apr 2010 19:33:39 +0000 (19:33 +0000)]
revert 100942, pending discussion.

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

14 years agoRename VtableComponent and VtableBuilder.
Anders Carlsson [Sat, 10 Apr 2010 19:13:06 +0000 (19:13 +0000)]
Rename VtableComponent and VtableBuilder.

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

14 years agoRename -dump-record-layouts to -fdump-record-layouts now that the option behaves...
Anders Carlsson [Sat, 10 Apr 2010 19:09:13 +0000 (19:09 +0000)]
Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.

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

14 years agoFix for PR6811.
David Chisnall [Sat, 10 Apr 2010 19:06:38 +0000 (19:06 +0000)]
Fix for PR6811.

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

14 years agoSimplify the virtual base layout code and fix a bug where we wouldn't store the offse...
Anders Carlsson [Sat, 10 Apr 2010 18:42:27 +0000 (18:42 +0000)]
Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.

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

14 years agofix PR6805: llvm.objectsize changed to take an i1 instead of an i32.
Chris Lattner [Sat, 10 Apr 2010 18:34:14 +0000 (18:34 +0000)]
fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.

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

14 years agoDriver: Only add extra -L paths on darwin if they exist. Unfortunately, this
Daniel Dunbar [Sat, 10 Apr 2010 18:18:57 +0000 (18:18 +0000)]
Driver: Only add extra -L paths on darwin if they exist. Unfortunately, this
means it isn't really possible to write the test case for this code, but this is
the kind of thing that really requires testing against the installed compiler
anyway.

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

14 years agoTweak test for portability.
Daniel Dunbar [Sat, 10 Apr 2010 17:45:01 +0000 (17:45 +0000)]
Tweak test for portability.

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

14 years agoDriver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.
Daniel Dunbar [Sat, 10 Apr 2010 16:20:23 +0000 (16:20 +0000)]
Driver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.

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

14 years agoA bunch of string-related microoptimizations in Mangler.
Benjamin Kramer [Sat, 10 Apr 2010 16:03:31 +0000 (16:03 +0000)]
A bunch of string-related microoptimizations in Mangler.

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

14 years agoFix use after free. Incrementing an use_iterator after its user is erased is unsafe.
Benjamin Kramer [Sat, 10 Apr 2010 11:02:40 +0000 (11:02 +0000)]
Fix use after free. Incrementing an use_iterator after its user is erased is unsafe.

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

14 years agoWhen a member pointer is dereferenced, the class it points into must be complete...
Sebastian Redl [Sat, 10 Apr 2010 10:14:54 +0000 (10:14 +0000)]
When a member pointer is dereferenced, the class it points into must be complete. Enforce this.

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

14 years agoDoug pointed out that we have a perfectly reasonable expression here to
John McCall [Sat, 10 Apr 2010 09:39:25 +0000 (09:39 +0000)]
Doug pointed out that we have a perfectly reasonable expression here to
serve as a source of source locations for the can't-yet-mangle diagnostic.

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

14 years agoDiagnose more cases of initializing distinct members of an anonymous union
John McCall [Sat, 10 Apr 2010 09:28:51 +0000 (09:28 +0000)]
Diagnose more cases of initializing distinct members of an anonymous union
member.  Use a better diagnostic for this case.  Also fix a bug with nested
anonymous structs/unions for -Wreorder;  this last was PR6575.

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

14 years agoDiagnose misordered initializers in constructor templates immediately instead of
John McCall [Sat, 10 Apr 2010 07:37:23 +0000 (07:37 +0000)]
Diagnose misordered initializers in constructor templates immediately instead of
when they're instantiated.  Merge the note into the -Wreorder warning;  it
doesn't really contribute much, and it was splitting a thought across diagnostics
anyway.  Don't crash in the parser when a constructor's initializers end in a
comma and there's no body;  the recovery here is still terrible, but anything's
better than a crash.

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

14 years agorely even less on CallInst internals
Gabor Greif [Sat, 10 Apr 2010 03:45:50 +0000 (03:45 +0000)]
rely even less on CallInst internals

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

14 years agodo not rely on CallInst interna, use CallSite to access arguments
Gabor Greif [Sat, 10 Apr 2010 02:56:12 +0000 (02:56 +0000)]
do not rely on CallInst interna, use CallSite to access arguments

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

14 years agoDriver/Darwin/x86: When linking, incorporate -L paths based on the path where
Daniel Dunbar [Sat, 10 Apr 2010 01:24:22 +0000 (01:24 +0000)]
Driver/Darwin/x86: When linking, incorporate -L paths based on the path where
Clang is installed. This is designed to match gcc, and is important when
installed in a non-standard location.
 - This is gross, but no worse than ever. It will die when we finally move to
   the compiler-rt based toolchain, any day now.

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

14 years agoDisable diag::err_file_modified on Win32 completely, until someone cares to fix
Daniel Dunbar [Sat, 10 Apr 2010 01:17:16 +0000 (01:17 +0000)]
Disable diag::err_file_modified on Win32 completely, until someone cares to fix
it. PR6812.
 - This is another attempt at silencing annoying buildbot failures.

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

14 years agoMangle some expressions with codegen implications but no mangling "overhead".
John McCall [Fri, 9 Apr 2010 22:54:09 +0000 (22:54 +0000)]
Mangle some expressions with codegen implications but no mangling "overhead".

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

14 years agoProvide an extremely unsatisfactory diagnostic (instead of crashing) when
John McCall [Fri, 9 Apr 2010 22:26:14 +0000 (22:26 +0000)]
Provide an extremely unsatisfactory diagnostic (instead of crashing) when
mangling an unknown expression kind.  Also conveniently tells the user what
kind of expression they should add to the mangler!

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

14 years agoProvide manglings for bool and character literal expressions. These are
John McCall [Fri, 9 Apr 2010 21:48:08 +0000 (21:48 +0000)]
Provide manglings for bool and character literal expressions.  These are
just integer-literal expressions with special case implementations in the AST.

Fixes rdar://problem/7825453.

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

14 years agoWhen upgrading an Objective-C class from a forward declaration to a
Douglas Gregor [Fri, 9 Apr 2010 21:30:38 +0000 (21:30 +0000)]
When upgrading an Objective-C class from a forward declaration to a
full-fledged @interface, be sure that the declaration has the right
lexical context. <rdar://problem/7827709>

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

14 years agoOnly complain about explicit instantiations following explicit
Douglas Gregor [Fri, 9 Apr 2010 21:02:29 +0000 (21:02 +0000)]
Only complain about explicit instantiations following explicit
specializations when the explicit instantiation was... explicitly
written, i.e., not the product of an explicit instantiation of an
enclosing class. Fixes this spurious warning when Clang builds LLVM:

/Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1:
warning: explicit instantiation of 'addRoot' that occurs after an
explicit specialization will be ignored (C++0x extension) [-pedantic]

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

14 years agoRemove copy of 'Optional' in Clang tree, and convert clients to use the one now in...
Ted Kremenek [Fri, 9 Apr 2010 20:26:58 +0000 (20:26 +0000)]
Remove copy of 'Optional' in Clang tree, and convert clients to use the one now in the LLVM tree.

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

14 years agoRemove fixit for string literal comparison. Telling the user to use 'strcmp' is...
Ted Kremenek [Fri, 9 Apr 2010 20:26:53 +0000 (20:26 +0000)]
Remove fixit for string literal comparison.  Telling the user to use 'strcmp' is bad, and
we don't have enough information to tell them how to use 'strncmp'.  Instead, change the
diagnostic to indicate they should use 'strncmp'.

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

14 years agoFix typo.
Benjamin Kramer [Fri, 9 Apr 2010 19:40:47 +0000 (19:40 +0000)]
Fix typo.

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

14 years agoTurn access control on by default in the driver.
John McCall [Fri, 9 Apr 2010 19:12:06 +0000 (19:12 +0000)]
Turn access control on by default in the driver.

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

14 years agoArgh, I modified the .inc file locally, not the .td.
John McCall [Fri, 9 Apr 2010 19:09:08 +0000 (19:09 +0000)]
Argh, I modified the .inc file locally, not the .td.

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

14 years agoTurn access control on by default in -cc1.
John McCall [Fri, 9 Apr 2010 19:03:51 +0000 (19:03 +0000)]
Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.

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

14 years agoSuppress access control diagnostics when looking up a base or member name
John McCall [Fri, 9 Apr 2010 19:01:14 +0000 (19:01 +0000)]
Suppress access control diagnostics when looking up a base or member name
fails to find a type.  There are no cases where it's valid for this to produce
an error.

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

14 years agoImprove diagnostics like "initializing <type> from an expression of
Douglas Gregor [Fri, 9 Apr 2010 17:53:29 +0000 (17:53 +0000)]
Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.

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

14 years agoRemove all "used" static functions *after* we have performed all of
Douglas Gregor [Fri, 9 Apr 2010 17:41:13 +0000 (17:41 +0000)]
Remove all "used" static functions *after* we have performed all of
the implicit template instantiations we need to perform. Otherwise, we
end up erroneously diagnosing static functions as used if they were
only used within an implicit template instantiation. Fixes a bunch of
spurious failures when building Clang with Clang.

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

14 years agoInstantiate default argument expressions even if their associated parameter
John McCall [Fri, 9 Apr 2010 17:38:44 +0000 (17:38 +0000)]
Instantiate default argument expressions even if their associated parameter
type isn't dependent.  Fixes rdar://problem/7838962.

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

14 years agoDon't warn about unused static functions if they are marked with
Chris Lattner [Fri, 9 Apr 2010 17:25:05 +0000 (17:25 +0000)]
Don't warn about unused static functions if they are marked with
attr constructor or destructor.  Patch by Jean-Daniel Dupas!

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

14 years agoOn Windows, disable the modification-time check for files used in
Douglas Gregor [Fri, 9 Apr 2010 15:54:22 +0000 (15:54 +0000)]
On Windows, disable the modification-time check for files used in
precompiled headers and/or when reading the contents of the file into
memory. These checks seem to be causing spurious regression-test
failures on Windows.

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

14 years agoFixes a regression caused by implementing cstyle methods
Fariborz Jahanian [Fri, 9 Apr 2010 15:40:42 +0000 (15:40 +0000)]
Fixes a regression caused by implementing cstyle methods
for objc.

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

14 years agoForcibly disable test/PCH/pr4489.c, it is flaky on one of the buildbots.
Daniel Dunbar [Fri, 9 Apr 2010 15:30:57 +0000 (15:30 +0000)]
Forcibly disable test/PCH/pr4489.c, it is flaky on one of the buildbots.

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

14 years agoAdd a note to the C++ compatibility page about templates with no
John McCall [Fri, 9 Apr 2010 01:07:07 +0000 (01:07 +0000)]
Add a note to the C++ compatibility page about templates with no
valid instantiations.

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

14 years agoImprove diagnostics when we fail to convert from a source type to a
Douglas Gregor [Fri, 9 Apr 2010 00:35:39 +0000 (00:35 +0000)]
Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
      expected 'char *' [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
      'char const [2]' discards qualifiers [-pedantic]
  char *name = __func__;
        ^      ~~~~~~~~

Fixes <rdar://problem/7447179>.

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

14 years agoUse '%clang_cc1' instead of '%clang' to make the warning output more consistent across
Ted Kremenek [Thu, 8 Apr 2010 23:17:16 +0000 (23:17 +0000)]
Use '%clang_cc1' instead of '%clang' to make the warning output more consistent across
platforms (for this test).

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

14 years agoFor 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.
Ted Kremenek [Thu, 8 Apr 2010 22:15:34 +0000 (22:15 +0000)]
For 'open' check in UnixAPIChecker, hard code value of 'O_CREAT' on Darwin.
This is still not an ideal solution, but should disable the check for other
targets where the value of O_CREAT is different.

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

14 years agoReorder diagnostics to separate the Sema::AssignmentAction diagnostics from other...
Douglas Gregor [Thu, 8 Apr 2010 22:07:57 +0000 (22:07 +0000)]
Reorder diagnostics to separate the Sema::AssignmentAction diagnostics from other diagnostics

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

14 years agoTemporarily only enable 'open' check on Mac OS X to unbreak Windows buildbot. I'm
Ted Kremenek [Thu, 8 Apr 2010 21:54:13 +0000 (21:54 +0000)]
Temporarily only enable 'open' check on Mac OS X to unbreak Windows buildbot.  I'm
looking into an alternate fix right now.

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

14 years agoDowngrade the "declaration does not declare anything" error to a
Douglas Gregor [Thu, 8 Apr 2010 21:33:23 +0000 (21:33 +0000)]
Downgrade the "declaration does not declare anything" error to a
warning. It's not harmful to have such pointless declarations, and GCC
does not diagnose this issue consistently.

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

14 years agoImplement method type encoding in the presense
Fariborz Jahanian [Thu, 8 Apr 2010 21:29:11 +0000 (21:29 +0000)]
Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.

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

14 years agoMatch GCC's behavior and do not include '-Wunused-parameter' in '-Wunused'.
Ted Kremenek [Thu, 8 Apr 2010 21:10:56 +0000 (21:10 +0000)]
Match GCC's behavior and do not include '-Wunused-parameter' in '-Wunused'.

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

14 years agoExplain that a template needs arguments to make it into a type, for
Jeffrey Yasskin [Thu, 8 Apr 2010 21:04:54 +0000 (21:04 +0000)]
Explain that a template needs arguments to make it into a type, for
variable declarations.

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

14 years agoSet access properly on instantiated friend class template declarations.
John McCall [Thu, 8 Apr 2010 20:25:50 +0000 (20:25 +0000)]
Set access properly on instantiated friend class template declarations.
Fixes PR6752.

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

14 years agoAdd static analyzer check for calls to 'pthread_once()' where the control-flow has
Ted Kremenek [Thu, 8 Apr 2010 19:53:31 +0000 (19:53 +0000)]
Add static analyzer check for calls to 'pthread_once()' where the control-flow has
automatic storage.  This matches the corresponding check for 'dispatch_once()'.

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

14 years agoUpdate test case.
Ted Kremenek [Thu, 8 Apr 2010 18:51:47 +0000 (18:51 +0000)]
Update test case.

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

14 years agoRemove micro-optimization for not issueing CFG-based warnings for 'static inline...
Ted Kremenek [Thu, 8 Apr 2010 18:51:44 +0000 (18:51 +0000)]
Remove micro-optimization for not issueing CFG-based warnings for 'static inline' functions
unless they are used.  I discussed this with Daniel Dunbar, and we agreed that this
provides an inconsistent warnings experience for the user and that there were
genuine cases where we wouldn't want to do this optimization.

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

14 years agoIntroduce an egregious hack to work around a bug in libstdc++ 4.2.x's
Douglas Gregor [Thu, 8 Apr 2010 18:16:15 +0000 (18:16 +0000)]
Introduce an egregious hack to work around a bug in libstdc++ 4.2.x's
<tr1/hashtable> header, where a friend class template
std::tr1::__detail::_Map_base is declared with the wrong template
parameters. GCC doesn't catch the problem, so Clang does a little
back-flip to avoid diagnosing just this one instance of the problem.

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

14 years agoFix a misuse of iterators when iterating through block's
Fariborz Jahanian [Thu, 8 Apr 2010 18:06:22 +0000 (18:06 +0000)]
Fix a misuse of iterators when iterating through block's
parameters list for encoding.

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

14 years agoInclude all warnings under '-Wunused' in '-Wmost' and '-Wall'.
Ted Kremenek [Thu, 8 Apr 2010 17:54:28 +0000 (17:54 +0000)]
Include all warnings under '-Wunused' in '-Wmost' and '-Wall'.

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

14 years agoSort entries in diagnostic group "Most".
Ted Kremenek [Thu, 8 Apr 2010 17:54:24 +0000 (17:54 +0000)]
Sort entries in diagnostic group "Most".

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

14 years agoMaybe we should store template arguments in the position we allocated for them
John McCall [Thu, 8 Apr 2010 17:47:15 +0000 (17:47 +0000)]
Maybe we should store template arguments in the position we allocated for them
instead of scribbling over random memory.  Maybe.

Hopefully this fixes the -vg buildbot.

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

14 years agoMake CXXScopeSpec invalid when incomplete, and propagate that into any
Jeffrey Yasskin [Thu, 8 Apr 2010 16:38:48 +0000 (16:38 +0000)]
Make CXXScopeSpec invalid when incomplete, and propagate that into any
Declarator that depends on it.  This fixes several redundant errors and bad
recoveries.

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

14 years agoRename CGVtable files to CGVTables.
Anders Carlsson [Thu, 8 Apr 2010 16:30:25 +0000 (16:30 +0000)]
Rename CGVtable files to CGVTables.

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

14 years agoClarify an assert.
Anders Carlsson [Thu, 8 Apr 2010 16:18:36 +0000 (16:18 +0000)]
Clarify an assert.

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

14 years agoUnbreak the build
Douglas Gregor [Thu, 8 Apr 2010 16:07:47 +0000 (16:07 +0000)]
Unbreak the build

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

14 years agoCIndex: move extractUSRSuffix out of extern "C" and simplify it.
Benjamin Kramer [Thu, 8 Apr 2010 15:54:07 +0000 (15:54 +0000)]
CIndex: move extractUSRSuffix out of extern "C" and simplify it.

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

14 years agoEliminate excessive PCH deserialization caused by the search for
Douglas Gregor [Thu, 8 Apr 2010 15:52:03 +0000 (15:52 +0000)]
Eliminate excessive PCH deserialization caused by the search for
__cxxabiv1::__fundamental_type_info in every translation
unit. Previously, we would perform name lookup for
__cxxabiv1::__fundamental_type_info at the end of IRGen for a each
translation unit, to determine whether it was present. If so, we we
produce type information for all of the fundamental types. However,
this name lookup causes PCH deserialization of a significant part of the
translation unit, which has a woeful impact on performance.

With this change, we now look at each record type after we've
generated its vtable to see if it is
__cxxabiv1::__fundamental_type_info. If so, we generate type info for
all of the fundamental types. This works because
__cxxabiv1::__fundamental_type_info should always have a key function
(typically the virtual destructor), that will be defined once in the
support library. The fundamental type information will end up there.

Fixes <rdar://problem/7840011>.

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

14 years agoRemove caseless switch.
Benjamin Kramer [Thu, 8 Apr 2010 15:44:22 +0000 (15:44 +0000)]
Remove caseless switch.

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

14 years agoImplement dependent friend function template specializations.
John McCall [Thu, 8 Apr 2010 09:05:18 +0000 (09:05 +0000)]
Implement dependent friend function template specializations.

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