]> granicus.if.org Git - clang/log
clang
13 years agoRe-land r124768, with a fix for PR9130.
Anders Carlsson [Sat, 5 Feb 2011 04:35:53 +0000 (04:35 +0000)]
Re-land r124768, with a fix for PR9130.

We now emit everything except unused implicit virtual member functions when building the vtable.

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

13 years agoDon't suggest -Wuninitialized fixits for uninitialized enum types.
Ted Kremenek [Sat, 5 Feb 2011 01:18:18 +0000 (01:18 +0000)]
Don't suggest -Wuninitialized fixits for uninitialized enum types.

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

13 years agoDon't crash when generating USRs for ObjC methods in protocols.
Ted Kremenek [Sat, 5 Feb 2011 01:10:26 +0000 (01:10 +0000)]
Don't crash when generating USRs for ObjC methods in protocols.

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

13 years agoRestore a test which I accientally overwrote in my last
Fariborz Jahanian [Fri, 4 Feb 2011 23:30:23 +0000 (23:30 +0000)]
Restore a test which I accientally overwrote in my last
patch.

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

13 years ago-Wselector should warn on implemented selectors only
Fariborz Jahanian [Fri, 4 Feb 2011 23:19:27 +0000 (23:19 +0000)]
-Wselector should warn on implemented selectors only
when selector metadata is generated, which is triggered
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.

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

13 years agoAssert during instantiation of blocks that we've captured everything that
John McCall [Fri, 4 Feb 2011 18:33:18 +0000 (18:33 +0000)]
Assert during instantiation of blocks that we've captured everything that
we captured in the dependent case.

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

13 years agoAdd better support for ARM EABI triples.
Bob Wilson [Fri, 4 Feb 2011 17:59:28 +0000 (17:59 +0000)]
Add better support for ARM EABI triples.
Patch by Renato Golin!

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

13 years agoDriver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.
Daniel Dunbar [Fri, 4 Feb 2011 17:24:47 +0000 (17:24 +0000)]
Driver: Fix spurious warning (from -cc1) about unused -fapple-kext on C inputs.

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

13 years agobuild: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
Daniel Dunbar [Fri, 4 Feb 2011 17:12:27 +0000 (17:12 +0000)]
build: Prevent duplicate inclusion of Makefile.rules, which causes make to warn
like crazy.
 - How no one else is bothered by this I can't understand!

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

13 years agoImprove our handling of the current instantiation for qualified
Douglas Gregor [Fri, 4 Feb 2011 13:35:07 +0000 (13:35 +0000)]
Improve our handling of the current instantiation for qualified
id-expression, e.g.,

  CurrentClass<T>::member

Previously, if CurrentClass<T> was dependent and not complete, we
would treat it as a dependent-scoped declaration reference expression,
even if CurrentClass<T> referred to the current instantiation.

Fixes PR8966 and improves type checking of templates.

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

13 years agoBefore checking bitfield initialization, make sure that neither the
Douglas Gregor [Fri, 4 Feb 2011 13:09:01 +0000 (13:09 +0000)]
Before checking bitfield initialization, make sure that neither the
bit-field width nor the initializer value are type- or
value-dependent. Fixes PR8712.

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

13 years agoWhen calling a bound pointer to member function, check the
Douglas Gregor [Fri, 4 Feb 2011 12:57:49 +0000 (12:57 +0000)]
When calling a bound pointer to member function, check the
cv-qualifiers on the object against the cv-qualifiers on the member
function. Fixes PR8315.

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

13 years agoTweak my fix for PR8748, and update the incorrect PR number in the test case.
Douglas Gregor [Fri, 4 Feb 2011 12:22:53 +0000 (12:22 +0000)]
Tweak my fix for PR8748, and update the incorrect PR number in the test case.

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

13 years agoImplement proper (de-)serialization for explicit template argument
Douglas Gregor [Fri, 4 Feb 2011 12:01:24 +0000 (12:01 +0000)]
Implement proper (de-)serialization for explicit template argument
lists with zero template arguments. Fixes some seriously scary
crashers in C++ PCH.

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

13 years agoFix test for previous commit
Douglas Gregor [Fri, 4 Feb 2011 11:59:47 +0000 (11:59 +0000)]
Fix test for previous commit

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

13 years agoFix a crash-on-invalid where we were trying to parse C++ constructs in
Douglas Gregor [Fri, 4 Feb 2011 11:57:16 +0000 (11:57 +0000)]
Fix a crash-on-invalid where we were trying to parse C++ constructs in
C, then hitting an assertion because C code shouldn't try to parse
optional nested-name-specifiers. Fixes PR9137.

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

13 years agoUSRs for Objective-C methods use the USR of the @interface as their base, not the...
Ted Kremenek [Fri, 4 Feb 2011 07:13:40 +0000 (07:13 +0000)]
USRs for Objective-C methods use the USR of the @interface as their base, not the USR of the class category or extension.

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

13 years agoDowngrade error about attribute 'iboutlet' and 'ibaction' being applied to anything...
Ted Kremenek [Fri, 4 Feb 2011 06:54:16 +0000 (06:54 +0000)]
Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything but a instance method to a warning.

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

13 years agoTighten up the semantics of default template arguments, per C++0x
Douglas Gregor [Fri, 4 Feb 2011 04:20:44 +0000 (04:20 +0000)]
Tighten up the semantics of default template arguments, per C++0x
[temp.param]p9 and C++ DR226. Fixes PR8747.

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

13 years agoWhen a function template's template parameter has a default argument,
Douglas Gregor [Fri, 4 Feb 2011 03:57:22 +0000 (03:57 +0000)]
When a function template's template parameter has a default argument,
it's okay for the following template parameters to not have default
arguments (since those template parameters can still be
deduced). Also, downgrade the error about default template arguments
in function templates to an extension warning, since this is a
harmless C++0x extension.

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

13 years agobuild: Add support for DISABLE_DEFAULT_STRICT_ALIASING, which does what one
Daniel Dunbar [Fri, 4 Feb 2011 02:20:39 +0000 (02:20 +0000)]
build: Add support for DISABLE_DEFAULT_STRICT_ALIASING, which does what one
might expect.

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

13 years agoFix 80-col violins.
Daniel Dunbar [Fri, 4 Feb 2011 02:20:34 +0000 (02:20 +0000)]
Fix 80-col violins.

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

13 years agominor refactoring of -fapple-kext stuff.
Fariborz Jahanian [Fri, 4 Feb 2011 00:32:39 +0000 (00:32 +0000)]
minor refactoring of -fapple-kext stuff.

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

13 years agoWhat was I thinking?
Fariborz Jahanian [Fri, 4 Feb 2011 00:08:13 +0000 (00:08 +0000)]
What was I thinking?

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

13 years ago-fapple-kext cannot have 'weak' visibility in this
Fariborz Jahanian [Fri, 4 Feb 2011 00:01:24 +0000 (00:01 +0000)]
-fapple-kext cannot have 'weak' visibility in this
abi.

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

13 years agoIf any Fix-Its attached to a diagnostic have invalid source locations
Douglas Gregor [Thu, 3 Feb 2011 23:41:12 +0000 (23:41 +0000)]
If any Fix-Its attached to a diagnostic have invalid source locations
or source locations that refer into a macro instantiation, delete all
of the Fix-Its on that diagnostic.

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

13 years agoMoved here from LLVM Clang's configuration options and related macros.
Oscar Fuentes [Thu, 3 Feb 2011 22:48:20 +0000 (22:48 +0000)]
Moved here from LLVM Clang's configuration options and related macros.

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

13 years ago[analyzer] Fix a crash until we can handle temporary struct objects properly.
Argyrios Kyrtzidis [Thu, 3 Feb 2011 22:01:32 +0000 (22:01 +0000)]
[analyzer] Fix a crash until we can handle temporary struct objects properly.

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

13 years agoAdd __has_feature() for each of the type traits
Douglas Gregor [Thu, 3 Feb 2011 21:57:35 +0000 (21:57 +0000)]
Add __has_feature() for each of the type traits

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

13 years agoOptionally, Clang now builds using LLVM as an external library.
Oscar Fuentes [Thu, 3 Feb 2011 20:57:53 +0000 (20:57 +0000)]
Optionally, Clang now builds using LLVM as an external library.

The user sets the variable CLANG_PATH_TO_LLVM_BUILD pointing to a LLVM
build directory or to a directory where LLVM was installed. When using
a non-installed LLVM build, it is necessary to set
CLANG_PATH_TO_LLVM_SOURCE as well.

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

13 years agoClean up of -fapple-kext abi code. No change otherwise.
Fariborz Jahanian [Thu, 3 Feb 2011 19:27:17 +0000 (19:27 +0000)]
Clean up of -fapple-kext abi code. No change otherwise.

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

13 years agoImplement -Woverloaded-virtual.
Argyrios Kyrtzidis [Thu, 3 Feb 2011 18:01:15 +0000 (18:01 +0000)]
Implement -Woverloaded-virtual.

The difference with gcc is that it warns if you overload virtual methods only if
the method doesn't also override any method. This is to cut down on the number of warnings
and make it more useful like reported here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20423.
If we want to warn that not all overloads are overriden we can have an additional
warning like -Wpartial-override.

-Woverloaded-virtual, unlike gcc, is added to -Wmost. Addresses rdar://8757630.

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

13 years agoTeach SourceManager::getLocation() how to cope with a source file
Douglas Gregor [Thu, 3 Feb 2011 17:17:35 +0000 (17:17 +0000)]
Teach SourceManager::getLocation() how to cope with a source file
whose inode has changed since the file was first created and that is
being seen through a different path name (e.g., due to symlinks or
relative path elements), such that its FileEntry pointer doesn't match
a known FileEntry pointer. Since this requires a system call (to
stat()), we only perform this deeper checking if we can't find the
file by comparing FileEntry pointers.

Also, add a micro-optimization where we don't bother to compute line
numbers when given the location (1, 1). This improves the
efficiency of clang_getLocationForOffset().

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

13 years agoRemove unnecessary RUN: directive.
Axel Naumann [Thu, 3 Feb 2011 14:05:55 +0000 (14:05 +0000)]
Remove unnecessary RUN: directive.

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

13 years agoMore tweaks to the compatibility page.
John McCall [Thu, 3 Feb 2011 11:29:18 +0000 (11:29 +0000)]
More tweaks to the compatibility page.

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

13 years agoMore minor documentation tweaks.
John McCall [Thu, 3 Feb 2011 11:05:04 +0000 (11:05 +0000)]
More minor documentation tweaks.

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

13 years agoRework the __block jump-checking section, including a justification of
John McCall [Thu, 3 Feb 2011 10:56:31 +0000 (10:56 +0000)]
Rework the __block jump-checking section, including a justification of
why this bug can go uncaught.

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

13 years agoRework and embellish the C99 inline compatibility section.
John McCall [Thu, 3 Feb 2011 10:16:40 +0000 (10:16 +0000)]
Rework and embellish the C99 inline compatibility section.

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

13 years agoCMake: Fix test. CMake has not built unittests yet.
NAKAMURA Takumi [Thu, 3 Feb 2011 09:01:12 +0000 (09:01 +0000)]
CMake: Fix test. CMake has not built unittests yet.

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

13 years agoCapture a few implicit references to 'self'.
John McCall [Thu, 3 Feb 2011 09:00:02 +0000 (09:00 +0000)]
Capture a few implicit references to 'self'.

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

13 years agoMore capturing of 'this': implicit member expressions. Getting that
John McCall [Thu, 3 Feb 2011 08:15:49 +0000 (08:15 +0000)]
More capturing of 'this':  implicit member expressions.  Getting that
right for anonymous struct/union members led to me discovering some
seemingly broken code in that area of Sema, which I fixed, partly by
changing the representation of member pointer constants so that
IndirectFieldDecls aren't expanded.  This led to assorted cleanups with
member pointers in CodeGen, and while I was doing that I saw some random
other things to clean up.

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

13 years agoReenable -Wuninitialized warning for captured block variables.
Ted Kremenek [Thu, 3 Feb 2011 06:51:50 +0000 (06:51 +0000)]
Reenable -Wuninitialized warning for captured block variables.

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

13 years agoAdd test from PR9130.
Rafael Espindola [Thu, 3 Feb 2011 06:36:50 +0000 (06:36 +0000)]
Add test from PR9130.

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

13 years agoRevert 124768.
Rafael Espindola [Thu, 3 Feb 2011 06:30:58 +0000 (06:30 +0000)]
Revert 124768.
This reopens PR99114, but that one at least can be avoided with an #include.
PR9130 cannot.

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

13 years agoAdd gTest unittests to clang, and write the first one.
Jeffrey Yasskin [Thu, 3 Feb 2011 04:51:52 +0000 (04:51 +0000)]
Add gTest unittests to clang, and write the first one.
This is the Makefile version only; the cmake implementation is coming soon.

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

13 years agoRevert 124754 and 124760 as they made clang unusable in the presence of symbolic
Rafael Espindola [Thu, 3 Feb 2011 04:35:45 +0000 (04:35 +0000)]
Revert 124754 and 124760 as they made clang unusable in the presence of symbolic
links.

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

13 years agoFrontend: Switch -header-include-file output to use unbuffered raw_ostreams with
Daniel Dunbar [Thu, 3 Feb 2011 03:45:00 +0000 (03:45 +0000)]
Frontend: Switch -header-include-file output to use unbuffered raw_ostreams with
the atomic writes option, since the intent is that this option be set for an
entire build, which may have any number of compiler instances writing to the
same output file.

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

13 years agoDon't try to mark virtual members referenced for classes where the key function
Anders Carlsson [Thu, 3 Feb 2011 02:08:44 +0000 (02:08 +0000)]
Don't try to mark virtual members referenced for classes where the key function
is not defined in the current translation unit. Doing so lead to compile errors
such as PR9114.

Instead, when CodeGen is building the vtable, don't try to emit a definition
for functions that aren't marked used in the current translation unit.
Fixes PR9114.

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

13 years agoFix Microsoft bit field problem. This resolves the Index\complete-exprs.c regression...
Francois Pichet [Thu, 3 Feb 2011 02:02:42 +0000 (02:02 +0000)]
Fix Microsoft bit field problem. This resolves the Index\complete-exprs.c regression on Win32.

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

13 years agoImprove the performance of filename canonicalization by avoiding
Douglas Gregor [Thu, 3 Feb 2011 00:18:12 +0000 (00:18 +0000)]
Improve the performance of filename canonicalization by avoiding
redundant searches in the string. No functionality change.

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

13 years agoBased on user feedback, swap -Wuninitialized diagnostics to have the warning refer...
Ted Kremenek [Wed, 2 Feb 2011 23:35:53 +0000 (23:35 +0000)]
Based on user feedback, swap -Wuninitialized diagnostics to have the warning refer to the bad use, and the note to the variable declaration.

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

13 years ago-fapple-kext, elimination of all direct calls to virtual dtors.
Fariborz Jahanian [Wed, 2 Feb 2011 23:12:46 +0000 (23:12 +0000)]
-fapple-kext, elimination of all direct calls to virtual dtors.

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

13 years agoEmit debug info for template value parameters.
Devang Patel [Wed, 2 Feb 2011 22:36:18 +0000 (22:36 +0000)]
Emit debug info for template value parameters.

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

13 years agoCanonicalize path names in the file manager before performing a lookup
Douglas Gregor [Wed, 2 Feb 2011 22:30:17 +0000 (22:30 +0000)]
Canonicalize path names in the file manager before performing a lookup
on that name. Canonicalization eliminates silliness such as "." and
"foo/.." that breaks the uniquing of files in the presence of virtual
files or files whose inode numbers have changed during
parsing/re-parsing. c-index-test isn't able to create this crazy
situation, so I've resorted to testing outside of the Clang
tree. Fixes <rdar://problem/8928220>.

Note that this hackery will go away once we have a real virtual file
system on which we can layer FileManager; the virtual-files hack is
showing cracks.

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

13 years agoEmit debug info for template type parameters.
Devang Patel [Wed, 2 Feb 2011 21:38:49 +0000 (21:38 +0000)]
Emit debug info for template type parameters.

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

13 years agoclang: Add support for a CC_PRINT_HEADERS environment variable, which mirrors
Daniel Dunbar [Wed, 2 Feb 2011 21:11:35 +0000 (21:11 +0000)]
clang: Add support for a CC_PRINT_HEADERS environment variable, which mirrors
CC_PRINT_OPTIONS and can be used to get some out-of-band information on header
usage from a build.

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

13 years agoFrontend: Add -header-include-file option, for allowing saving header include
Daniel Dunbar [Wed, 2 Feb 2011 21:11:31 +0000 (21:11 +0000)]
Frontend: Add -header-include-file option, for allowing saving header include
information to a file.

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

13 years agoFrontend: Add support (unused) for showing all "interesting" headers, not just
Daniel Dunbar [Wed, 2 Feb 2011 21:11:24 +0000 (21:11 +0000)]
Frontend: Add support (unused) for showing all "interesting" headers, not just
ones outside the predefines buffer (which is what -H does).

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

13 years agoTurn test for // rdar://8945175 into a sema test.
Fariborz Jahanian [Wed, 2 Feb 2011 21:10:07 +0000 (21:10 +0000)]
Turn test for // rdar://8945175 into a sema test.

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

13 years agoFor gcc compatibility, size of a class which is zero
Fariborz Jahanian [Wed, 2 Feb 2011 19:36:18 +0000 (19:36 +0000)]
For gcc compatibility, size of a class which is zero
but has non-empty data fields, such as array of zero length,
remains zero.
// rdar://8945175

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

13 years agoRevert r124704, which uniqued code-completion strings. The space
Douglas Gregor [Wed, 2 Feb 2011 19:04:30 +0000 (19:04 +0000)]
Revert r124704, which uniqued code-completion strings. The space
savings of 25% sounds impressive, except that this amounted to only
about 360k in our standard "large" completion result set (40,000
results). Since code completion is performance-sensitive, the 4%
slowdown due to uniquing outweighs the 360k benefit.

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

13 years agoAdd NetBSD target support. Patch by Joerg Sonnenberger.
Benjamin Kramer [Wed, 2 Feb 2011 18:59:27 +0000 (18:59 +0000)]
Add NetBSD target support. Patch by Joerg Sonnenberger.

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

13 years agoDon't warn for -Wnon-virtual-dtor for dependent classes.
Argyrios Kyrtzidis [Wed, 2 Feb 2011 18:47:41 +0000 (18:47 +0000)]
Don't warn for -Wnon-virtual-dtor for dependent classes.

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

13 years agoFrontend: Factor out header include dumping (-H) into its own preprocessor
Daniel Dunbar [Wed, 2 Feb 2011 15:41:17 +0000 (15:41 +0000)]
Frontend: Factor out header include dumping (-H) into its own preprocessor
callbacks class.
 - Aside from being generally cleaner, this also allows -H to work correctly in
   modes other than standard preprocessing (e.g., -c, -MM, etc.)

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

13 years agoAn insomniac stab at making block declarations list the variables they close
John McCall [Wed, 2 Feb 2011 13:00:07 +0000 (13:00 +0000)]
An insomniac stab at making block declarations list the variables they close
on, as well as more reliably limiting invalid references to locals from
nested scopes.

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

13 years agoFix test by fully specifying the platform.
Nick Lewycky [Wed, 2 Feb 2011 07:17:02 +0000 (07:17 +0000)]
Fix test by fully specifying the platform.

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

13 years agoTurn on -momit-leaf-frame-pointer by default on all non-Darwin platforms.
Nick Lewycky [Wed, 2 Feb 2011 06:43:03 +0000 (06:43 +0000)]
Turn on -momit-leaf-frame-pointer by default on all non-Darwin platforms.
Fixes PR9121!

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

13 years agoUpdate this test following recent optimizer changes.
Dan Gohman [Wed, 2 Feb 2011 02:21:10 +0000 (02:21 +0000)]
Update this test following recent optimizer changes.

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

13 years agoRemove redundant check to not warn for warn_equality_with_extra_parens if we are...
Ted Kremenek [Wed, 2 Feb 2011 02:20:30 +0000 (02:20 +0000)]
Remove redundant check to not warn for warn_equality_with_extra_parens if we are in a macro.  This is checked twice.

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

13 years agoUnique code-completion strings. On Cocoa.h, this costs us about 4% in
Douglas Gregor [Tue, 1 Feb 2011 23:59:42 +0000 (23:59 +0000)]
Unique code-completion strings. On Cocoa.h, this costs us about 4% in
speed but saves us about 25% of the memory usage for strings.

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

13 years agoWhen diagnosing address-space changes, apply array-to-pointer decay first.
John McCall [Tue, 1 Feb 2011 23:28:01 +0000 (23:28 +0000)]
When diagnosing address-space changes, apply array-to-pointer decay first.

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

13 years ago-fapple-kext support for indirect call to virtuals dtors - wip.
Fariborz Jahanian [Tue, 1 Feb 2011 23:22:34 +0000 (23:22 +0000)]
-fapple-kext support for indirect call to virtuals dtors - wip.

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

13 years agoFix name lookup issue
Douglas Gregor [Tue, 1 Feb 2011 23:14:23 +0000 (23:14 +0000)]
Fix name lookup issue

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

13 years agoAdd support for x86-64 Mandriva 2010.2. Reported by 'rindolf' on IRC!
Nick Lewycky [Tue, 1 Feb 2011 23:03:29 +0000 (23:03 +0000)]
Add support for x86-64 Mandriva 2010.2. Reported by 'rindolf' on IRC!

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

13 years agoCreate a special allocator class for code completion, so that all of
Douglas Gregor [Tue, 1 Feb 2011 22:57:45 +0000 (22:57 +0000)]
Create a special allocator class for code completion, so that all of
the string copying goes through a single place that can have
associated state.

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

13 years agoUse tempfiles for the .o outputs.
Matt Beaumont-Gay [Tue, 1 Feb 2011 22:44:06 +0000 (22:44 +0000)]
Use tempfiles for the .o outputs.

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

13 years agoEnable the self-init checker in scan-build.
Ted Kremenek [Tue, 1 Feb 2011 22:36:11 +0000 (22:36 +0000)]
Enable the self-init checker in scan-build.

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

13 years agoDon't warn about extraneous '()' around a comparison if it occurs within a macro.
Ted Kremenek [Tue, 1 Feb 2011 22:36:09 +0000 (22:36 +0000)]
Don't warn about extraneous '()' around a comparison if it occurs within a macro.

Macros frequently contain extra '()' to make instantiation less error prone.
This warning was flagging a ton of times on postgresql because of its use of macros.

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

13 years agoDon't warn for "if ((a == b))" if the parens came from a macro. Thanks to Fariborz...
Argyrios Kyrtzidis [Tue, 1 Feb 2011 22:23:56 +0000 (22:23 +0000)]
Don't warn for "if ((a == b))" if the parens came from a macro. Thanks to Fariborz for the hint!

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

13 years agoDo the right thing for zero-initializing VLAs that don't have a zero
John McCall [Tue, 1 Feb 2011 21:35:06 +0000 (21:35 +0000)]
Do the right thing for zero-initializing VLAs that don't have a zero
bit-pattern.  It's not clear that this is actually useful given current
language restrictions.

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

13 years agoAdd updated Debian ARM include path.
Nick Lewycky [Tue, 1 Feb 2011 21:32:14 +0000 (21:32 +0000)]
Add updated Debian ARM include path.

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

13 years agoProvide constant strings for certain common code completion strings,
Douglas Gregor [Tue, 1 Feb 2011 21:15:40 +0000 (21:15 +0000)]
Provide constant strings for certain common code completion strings,
eliminating the need to copy those strings.

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

13 years agoAdd test case for dead stores checker to not flag dead assignments to 'self' within...
Ted Kremenek [Tue, 1 Feb 2011 20:45:26 +0000 (20:45 +0000)]
Add test case for dead stores checker to not flag dead assignments to 'self' within a nested assignment.

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

13 years agoFix the message. Thanks to Thomas Clement for noticing.
Argyrios Kyrtzidis [Tue, 1 Feb 2011 20:33:05 +0000 (20:33 +0000)]
Fix the message. Thanks to Thomas Clement for noticing.

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

13 years agoFor "if ((a == b))" only warn if 'a' is a modifiable l-value. Caught by John!
Argyrios Kyrtzidis [Tue, 1 Feb 2011 19:32:59 +0000 (19:32 +0000)]
For "if ((a == b))" only warn if 'a' is a modifiable l-value. Caught by John!

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

13 years ago[analyzer] Slightly improve the diagnostic message of ObjCSelfInitChecker.
Argyrios Kyrtzidis [Tue, 1 Feb 2011 19:32:55 +0000 (19:32 +0000)]
[analyzer] Slightly improve the diagnostic message of ObjCSelfInitChecker.

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

13 years agoAllocate CodeCompletionString and all of its components in a
Douglas Gregor [Tue, 1 Feb 2011 19:23:04 +0000 (19:23 +0000)]
Allocate CodeCompletionString and all of its components in a
BumpPtrAllocator, rather than manually new/delete'ing them. This
optimization also allows us to avoid allocating memory for and copying
constant strings (e.g., "return", "class").

This also required embedding the priority and availability of results
within the code completion string, to avoid extra memory allocation
within libclang.

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

13 years agoWarn for "if ((a == b))" where the equality expression is needlessly wrapped inside...
Argyrios Kyrtzidis [Tue, 1 Feb 2011 18:24:22 +0000 (18:24 +0000)]
Warn for "if ((a == b))" where the equality expression is needlessly wrapped inside parentheses.
It's highly likely that the user intended an assignment used as condition.

Addresses rdar://8848646.

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

13 years agoAdd temporary hack to -Wuninitialize to create a separate CFG (for C++ code) that...
Ted Kremenek [Tue, 1 Feb 2011 17:43:21 +0000 (17:43 +0000)]
Add temporary hack to -Wuninitialize to create a separate CFG (for C++ code) that doesn't include implicit dtors.

Implicit dtors confuse the ad hoc path-sensitivity of UninitializedValuesV2.cpp.  This isn't
the ideal solution, as it will directly impact compile time, but should significantly reduce
the noise of -Wuninitialized on some code bases.

This immediately "fixes" the false positive reported in PR 9063, although this
isn't the right fix in the long run.

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

13 years agoEnhance -Wuninitialized to better reason about || and &&, tracking dual dataflow...
Ted Kremenek [Tue, 1 Feb 2011 17:43:18 +0000 (17:43 +0000)]
Enhance -Wuninitialized to better reason about || and &&, tracking dual dataflow facts and properly merging them.

Fixes PR 9076.

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

13 years agoImplement access checking for the "delete" operator. Fixes PR9050,
Douglas Gregor [Tue, 1 Feb 2011 15:50:11 +0000 (15:50 +0000)]
Implement access checking for the "delete" operator. Fixes PR9050,
from Alex Miller!

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

13 years agoFix a thinko where I didn't update a consistency check for
Douglas Gregor [Tue, 1 Feb 2011 15:24:58 +0000 (15:24 +0000)]
Fix a thinko where I didn't update a consistency check for
PackExpansionType in the AST reader. We need more testing for variadic
templates + PCH, but this fixes PR9073.

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

13 years agoBasic support for -mms-bitfields, from Carl Norum!
Douglas Gregor [Tue, 1 Feb 2011 15:15:22 +0000 (15:15 +0000)]
Basic support for -mms-bitfields, from Carl Norum!

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

13 years agoSupport EFI target triple, from Carl Norum!
Douglas Gregor [Tue, 1 Feb 2011 15:06:18 +0000 (15:06 +0000)]
Support EFI target triple, from Carl Norum!

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

13 years agoMake that test case actually test something, and add another test.
John McCall [Tue, 1 Feb 2011 08:30:38 +0000 (08:30 +0000)]
Make that test case actually test something, and add another test.

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

13 years agoThe code trying to assign a typedef to an anonymous tag declaration was
John McCall [Tue, 1 Feb 2011 08:20:08 +0000 (08:20 +0000)]
The code trying to assign a typedef to an anonymous tag declaration was
extremely rambunctious, both on parsing and on template instantiation.
Calm it down, fixing an internal consistency assert on anonymous enum
instantiation manglings.

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

13 years agoRevert 124633. The linker has been told how to merge available_externally.
Rafael Espindola [Tue, 1 Feb 2011 05:45:26 +0000 (05:45 +0000)]
Revert 124633. The linker has been told how to merge available_externally.

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

13 years agoCorrect units in doxygen comment for NonVirtualSize.
Ken Dyck [Tue, 1 Feb 2011 02:03:12 +0000 (02:03 +0000)]
Correct units in doxygen comment for NonVirtualSize.

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

13 years agoConvert RecordLayout::NonVirtualSize from bit units to CharUnits.
Ken Dyck [Tue, 1 Feb 2011 01:52:10 +0000 (01:52 +0000)]
Convert RecordLayout::NonVirtualSize from bit units to CharUnits.

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

13 years agoWhen initializing struct members, the important thing is that the "initializing"...
Argyrios Kyrtzidis [Tue, 1 Feb 2011 00:52:10 +0000 (00:52 +0000)]
When initializing struct members, the important thing is that the "initializing" expression is
compatible, not having the same type.

Fix rdar://8183908 in which compatible vector types weren't initialized properly leading to a crash.

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