]> granicus.if.org Git - clang/log
clang
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

14 years agoRemoved unused object.
Ted Kremenek [Thu, 8 Apr 2010 07:30:50 +0000 (07:30 +0000)]
Removed unused object.

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

14 years agoFronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts...
Daniel Dunbar [Thu, 8 Apr 2010 02:59:56 +0000 (02:59 +0000)]
Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.

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

14 years agoAST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.
Daniel Dunbar [Thu, 8 Apr 2010 02:59:49 +0000 (02:59 +0000)]
AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.

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

14 years agoIRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValu...
Daniel Dunbar [Thu, 8 Apr 2010 02:59:45 +0000 (02:59 +0000)]
IRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValues to just store the base address of object containing the bit-field.

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

14 years agoPatch to implement gcc's cstyle arguments in objc
Fariborz Jahanian [Thu, 8 Apr 2010 00:30:06 +0000 (00:30 +0000)]
Patch to implement gcc's cstyle arguments in objc
methods. wip.

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

14 years agorefactor out a function.
Chris Lattner [Thu, 8 Apr 2010 00:23:06 +0000 (00:23 +0000)]
refactor out a function.

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

14 years agoFix a (bogus) uninitialized-member-of-local warning.
John McCall [Thu, 8 Apr 2010 00:13:37 +0000 (00:13 +0000)]
Fix a (bogus) uninitialized-member-of-local warning.

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

14 years agoUse SmallVector instead of an std::queue.
Ted Kremenek [Thu, 8 Apr 2010 00:05:00 +0000 (00:05 +0000)]
Use SmallVector instead of an std::queue.

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

14 years agoWhen a template (without arguments) is passed as a template type
Jeffrey Yasskin [Thu, 8 Apr 2010 00:03:06 +0000 (00:03 +0000)]
When a template (without arguments) is passed as a template type
parameter, explicitly ask the user to give it arguments.  We used to
complain that it wasn't a type and expect the user to figure it out.

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

14 years agoFix some redundant errors by changing CXXScopeSpec::isSet calls into
Jeffrey Yasskin [Wed, 7 Apr 2010 23:29:58 +0000 (23:29 +0000)]
Fix some redundant errors by changing CXXScopeSpec::isSet calls into
isNotEmpty calls.

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

14 years agoupdate for api change.
Chris Lattner [Wed, 7 Apr 2010 23:12:35 +0000 (23:12 +0000)]
update for api change.

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

14 years agoImplement checking for template literal operator functions. This
Sean Hunt [Wed, 7 Apr 2010 23:11:06 +0000 (23:11 +0000)]
Implement checking for template literal operator functions. This
code won't actually get used yet because we don't handle non-type
parameter packs, but when we do, this code should jump in and work.

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

14 years agoAdd support for stpncpy_chk.
Eric Christopher [Wed, 7 Apr 2010 23:00:44 +0000 (23:00 +0000)]
Add support for stpncpy_chk.

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

14 years agorename llvm::llvm_report_error -> llvm::report_fatal_error
Chris Lattner [Wed, 7 Apr 2010 22:58:06 +0000 (22:58 +0000)]
rename llvm::llvm_report_error -> llvm::report_fatal_error

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

14 years agoUpdated comment to reflect changes made in the most recent draft.
Sean Hunt [Wed, 7 Apr 2010 22:57:35 +0000 (22:57 +0000)]
Updated comment to reflect changes made in the most recent draft.

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

14 years agoFixed 80-cols violation
Sean Hunt [Wed, 7 Apr 2010 22:52:07 +0000 (22:52 +0000)]
Fixed 80-cols violation

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

14 years agoadd a new driver-level -ferror-limit=412 option, which causes clang to stop
Chris Lattner [Wed, 7 Apr 2010 20:49:23 +0000 (20:49 +0000)]
add a new driver-level -ferror-limit=412 option, which causes clang to stop
emitting diagnostics after it has produced that many errors.  Give this a
default value of 20 which produces plenty of errors for people to fix before
recompiling but not so many that their entire console scrolls away when the
compiler gets confused.  The experience looks like this:

$ clang foo.c
<tons of crap>
foo.c:102:3: error: unknown type name 'somethingbad'
  somethingbad x;
  ^
fatal error: too many errors emitted, stopping now
36 warnings and 20 errors generated.

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

14 years agoadd clang -cc1 level support for "-ferror-limit 42"
Chris Lattner [Wed, 7 Apr 2010 20:37:06 +0000 (20:37 +0000)]
add clang -cc1 level support for "-ferror-limit 42"

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

14 years agoReturn early from Sema::MarkDeclarationReferenced when we know there
Douglas Gregor [Wed, 7 Apr 2010 20:29:57 +0000 (20:29 +0000)]
Return early from Sema::MarkDeclarationReferenced when we know there
isn't any extra work to perform. Also, don't check for unused
parameters when the warnings will be suppressed anyway. Improves
performance of -fsyntax-only on 403.gcc's combine.c by ~2.5%.
<rdar://problem/7836787>

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

14 years agoadd capabilities to stop emitting errors after some limit.
Chris Lattner [Wed, 7 Apr 2010 20:21:58 +0000 (20:21 +0000)]
add capabilities to stop emitting errors after some limit.
Right now the limit is 0 (aka disabled)

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

14 years agoDon't emit an 'unused expression' warning for '||' and '&&' expressions that contain...
Ted Kremenek [Wed, 7 Apr 2010 18:49:21 +0000 (18:49 +0000)]
Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

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

14 years agoInstead of counting totally diagnostics, split the count into a count
Chris Lattner [Wed, 7 Apr 2010 18:47:42 +0000 (18:47 +0000)]
Instead of counting totally diagnostics, split the count into a count
of errors and warnings.  This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.

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

14 years agoconvert to -verify mode.
Chris Lattner [Wed, 7 Apr 2010 18:43:41 +0000 (18:43 +0000)]
convert to -verify mode.

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

14 years agoImprove handling of friend types in several ways:
Douglas Gregor [Wed, 7 Apr 2010 17:57:12 +0000 (17:57 +0000)]
Improve handling of friend types in several ways:
  - When instantiating a friend type template, perform semantic
  analysis on the resulting type.
  - Downgrade the errors concerning friend type declarations that do
  not refer to classes to ExtWarns in C++98/03. C++0x allows
  practically any type to be befriended, and ignores the friend
  declaration if the type is not a class.

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

14 years agoSplit Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
Douglas Gregor [Wed, 7 Apr 2010 16:53:43 +0000 (16:53 +0000)]
Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
semantic analysis) and Sema::ActOnFriendTypeDecl (the action
callback). This is a prerequisite for improving template instantiation
of friend type declarations.

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

14 years ago@llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
John McCall [Wed, 7 Apr 2010 08:20:20 +0000 (08:20 +0000)]
@llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
to the intrinsic, even when math-errno is off.

Fixes rdar://problem/7828230 by falling back on the library function.

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

14 years agoa ridiculous amount of propagation through the backend later,
Chris Lattner [Wed, 7 Apr 2010 05:46:54 +0000 (05:46 +0000)]
a ridiculous amount of propagation through the backend later,
have the code generate slap a srcloc metadata on inline asm nodes.
This allows us to diagnose invalid inline asms with such nice
diagnostics as:

<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
asm.c:2:12: note: generated from here
  __asm__ ("abc incl    %0" : "+r" (X));
           ^
2 diagnostics generated.

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

14 years agoFix comment.
Zhongxing Xu [Wed, 7 Apr 2010 04:40:26 +0000 (04:40 +0000)]
Fix comment.

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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 7 Apr 2010 04:09:49 +0000 (04:09 +0000)]
Update checker build.

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

14 years agoDeprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().
Jeffrey Yasskin [Wed, 7 Apr 2010 01:55:59 +0000 (01:55 +0000)]
Deprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().

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

14 years agoTeach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
John McCall [Wed, 7 Apr 2010 01:14:35 +0000 (01:14 +0000)]
Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
Fixes a spurious warning in LLVM.

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

14 years agoFix crash in StoreManager::CastRegion() when the base region is a type with 0 size.
Ted Kremenek [Wed, 7 Apr 2010 00:46:49 +0000 (00:46 +0000)]
Fix crash in StoreManager::CastRegion() when the base region is a type with 0 size.

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

14 years agoCheck access for the implicit calls to destructors that occur when we
John McCall [Wed, 7 Apr 2010 00:41:46 +0000 (00:41 +0000)]
Check access for the implicit calls to destructors that occur when we
have a temporary object in C++.

Also fix a tag mismatch that Doug noticed.

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

14 years agoFix CIndex crash on invalid code reported in <rdar://problem/7833619>.
Ted Kremenek [Wed, 7 Apr 2010 00:27:13 +0000 (00:27 +0000)]
Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.

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

14 years agoImprove on diagnostics when an objc class is used as
Fariborz Jahanian [Wed, 7 Apr 2010 00:22:00 +0000 (00:22 +0000)]
Improve on diagnostics when an objc class is used as
a stand-alone type declaration.

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

14 years agoImplement code completion for Objective-C method declarations and
Douglas Gregor [Wed, 7 Apr 2010 00:21:17 +0000 (00:21 +0000)]
Implement code completion for Objective-C method declarations and
definitions, e.g., after

  -

or

  - (id)

we'll find all of the "likely" instance methods that one would want to
declare or define at this point. In the latter case, we only produce
results whose return types match "id".

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

14 years agoMinor clean up.
Fariborz Jahanian [Tue, 6 Apr 2010 23:43:59 +0000 (23:43 +0000)]
Minor clean up.

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

14 years agodefault access for synthesize ivar is @protect.
Fariborz Jahanian [Tue, 6 Apr 2010 23:36:17 +0000 (23:36 +0000)]
default access for synthesize ivar is @protect.
Fixes radar 7823675.

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

14 years agoPatch to not build ivar ASTs when they are ilegally
Fariborz Jahanian [Tue, 6 Apr 2010 22:43:48 +0000 (22:43 +0000)]
Patch to not build ivar ASTs when they are ilegally
declared in categories.

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

14 years agoDevote a special diagnostic to the typo
John McCall [Tue, 6 Apr 2010 22:24:14 +0000 (22:24 +0000)]
Devote a special diagnostic to the typo
  (void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.

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

14 years agoTeach MemRegion::getBaseRegion() about ObjCIvarRegions. We want to treat
Ted Kremenek [Tue, 6 Apr 2010 22:06:03 +0000 (22:06 +0000)]
Teach MemRegion::getBaseRegion() about ObjCIvarRegions.  We want to treat
them the same way as fields.  This fixes a regression in RegionStore::RemoveDeadbindings()
that emerged from going to the cluster-based analysis.

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

14 years agoImplement the protected access restriction ([class.protected]), which requires
John McCall [Tue, 6 Apr 2010 21:38:20 +0000 (21:38 +0000)]
Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup.  My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.

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

14 years agoWhen code completion produces an overload set as its results (e.g.,
Douglas Gregor [Tue, 6 Apr 2010 20:19:47 +0000 (20:19 +0000)]
When code completion produces an overload set as its results (e.g.,
while we're completing in the middle of a function call), also produce
"ordinary" name results that show what can be typed at that point.

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

14 years agoDo not produce semicolons at the end of code-completion results
Douglas Gregor [Tue, 6 Apr 2010 20:11:37 +0000 (20:11 +0000)]
Do not produce semicolons at the end of code-completion results

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

14 years agoOnly prove macros as code-completion results when we're in a case
Douglas Gregor [Tue, 6 Apr 2010 20:02:15 +0000 (20:02 +0000)]
Only prove macros as code-completion results when we're in a case
statement or for ordinary names. This means that we won't show macros
when completing, e.g., member expressions such as "p->".

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

14 years agoFix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
Ted Kremenek [Tue, 6 Apr 2010 19:41:24 +0000 (19:41 +0000)]
Fix ccc-analyzer's handling of quoted arguments in the build command.  Fixes PR 6791.[B

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

14 years agoWhen sending a message to "id", apply some heuristics to try to narrow
Douglas Gregor [Tue, 6 Apr 2010 19:22:33 +0000 (19:22 +0000)]
When sending a message to "id", apply some heuristics to try to narrow
down the set of code-completion results based on Objective-C
conventions.

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