]> granicus.if.org Git - clang/log
clang
14 years agoEmbrace C++ ABI 5.2.6 and consider that template instantiations don't have key functi...
Argyrios Kyrtzidis [Wed, 13 Oct 2010 02:39:41 +0000 (02:39 +0000)]
Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).

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

14 years agoTeach the warning about unnamed/local types in template arguments to
Douglas Gregor [Wed, 13 Oct 2010 00:27:52 +0000 (00:27 +0000)]
Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.

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

14 years agoIntroduce support for emitting diagnostics (warnings + their notes)
Douglas Gregor [Tue, 12 Oct 2010 23:32:35 +0000 (23:32 +0000)]
Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point.

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.

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

14 years agoFix debug info for anon union.
Devang Patel [Tue, 12 Oct 2010 23:24:54 +0000 (23:24 +0000)]
Fix debug info for anon union.
This is tested by anon-union.exp.

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

14 years agoFix anon union member assignment expression's location.
Devang Patel [Tue, 12 Oct 2010 23:23:25 +0000 (23:23 +0000)]
Fix anon union member assignment expression's location.
This is tested by anon-union.exp in gdb testsuite.

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

14 years agoHandle dependent friends more explicitly and deal with the possibility
John McCall [Tue, 12 Oct 2010 23:13:28 +0000 (23:13 +0000)]
Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them.  Fixes a crash, this time
without a broken test case.

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

14 years agoPR8325: don't do destructor checking when a pointer is thrown.
Eli Friedman [Tue, 12 Oct 2010 20:32:36 +0000 (20:32 +0000)]
PR8325: don't do destructor checking when a pointer is thrown.

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

14 years agoEnter the context of the declared function template when performing
John McCall [Tue, 12 Oct 2010 19:40:14 +0000 (19:40 +0000)]
Enter the context of the declared function template when performing
deduction and the final substitution, but not while substituting the
explicit template arguments.  Fixes rdar://problem/8537391

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

14 years agoWhen finalizing a function template specialization following template
Douglas Gregor [Tue, 12 Oct 2010 18:51:08 +0000 (18:51 +0000)]
When finalizing a function template specialization following template
argument deduction, make sure to check the correctness of deduced template
type arguments (which we had previously skipped) along with other
kinds of template arguments. This fixes part of PR6784, but we're
still swallowing the extension warning about unnamed/local template
arguments.

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

14 years agoIf we end up instantiating a function parameter whose default argument
Douglas Gregor [Tue, 12 Oct 2010 18:23:32 +0000 (18:23 +0000)]
If we end up instantiating a function parameter whose default argument
has not yet been parsed, note that the default argument hasn't been
parsed and keep track of all of the instantiations of that function
parameter. When its default argument does get parsed, imbue the
instantiations with that default argument. Fixes PR8245.

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

14 years agofix PR7885, rejecting invalid uses of __builtin_constant_p.
Chris Lattner [Tue, 12 Oct 2010 17:47:42 +0000 (17:47 +0000)]
fix PR7885, rejecting invalid uses of __builtin_constant_p.

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

14 years agoReplace \r\n with \n in this file.
Nick Lewycky [Tue, 12 Oct 2010 16:46:35 +0000 (16:46 +0000)]
Replace \r\n with \n in this file.

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

14 years agoParse default arguments within member functions in source order, from
Douglas Gregor [Tue, 12 Oct 2010 16:25:54 +0000 (16:25 +0000)]
Parse default arguments within member functions in source order, from
Manuel Klimek! Fixes PR7715.

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

14 years agoPacify gcc-4.4.
Duncan Sands [Tue, 12 Oct 2010 14:07:59 +0000 (14:07 +0000)]
Pacify gcc-4.4.

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

14 years agoC's comma operator performs lvalue conversion on both its operands;
John McCall [Tue, 12 Oct 2010 07:14:40 +0000 (07:14 +0000)]
C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.

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

14 years agoFlesh out test.
John McCall [Tue, 12 Oct 2010 03:38:33 +0000 (03:38 +0000)]
Flesh out test.

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

14 years agoI just do what the comments tell me to do.
John McCall [Tue, 12 Oct 2010 02:19:57 +0000 (02:19 +0000)]
I just do what the comments tell me to do.

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

14 years agofix the definition of __builtin_constant_p, the first arg isn't a short.
Chris Lattner [Tue, 12 Oct 2010 02:16:39 +0000 (02:16 +0000)]
fix the definition of __builtin_constant_p, the first arg isn't a short.
Patch by the "pax team"

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

14 years agoProgress.
John McCall [Tue, 12 Oct 2010 02:09:17 +0000 (02:09 +0000)]
Progress.

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

14 years agoThis patch remove the Win32 XFAIL from remap-complete.c
Francois Pichet [Tue, 12 Oct 2010 01:01:43 +0000 (01:01 +0000)]
This patch remove the Win32 XFAIL from remap-complete.c

The problem was that text files were open in text mode and Microsoft implementation of fread and write will try to do nasty line-feed conversion which make the line position no longer valid. The fix is to read and write files in binary mode.

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

14 years agoWhen we load an ASTUnit from command-line arguments, hold on to the
Douglas Gregor [Tue, 12 Oct 2010 00:50:20 +0000 (00:50 +0000)]
When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were
allowing these to either be dropped or to slip through to stderr.

Fixes <rdar://problem/7595339>.

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

14 years agoFix spelling error.
Cameron Esfahani [Tue, 12 Oct 2010 00:21:25 +0000 (00:21 +0000)]
Fix spelling error.

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

14 years agoAdd some infrastructure for dealing with expressions of 'placeholder' type,
John McCall [Tue, 12 Oct 2010 00:20:44 +0000 (00:20 +0000)]
Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.

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

14 years agoFixes a typo which caused byte offset in debug info
Fariborz Jahanian [Mon, 11 Oct 2010 23:55:47 +0000 (23:55 +0000)]
Fixes a typo which caused byte offset in debug info
for ivars to be 0. Fixes pr8353.

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

14 years agoBasic: Tweak attempt to make version tags work from 'svn export's again, clip
Daniel Dunbar [Mon, 11 Oct 2010 23:50:34 +0000 (23:50 +0000)]
Basic: Tweak attempt to make version tags work from 'svn export's again, clip
off the extra parts of the $URL$ SVN keyword.

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

14 years agoBasic: Attempt to make version tags work from 'svn export's again.
Daniel Dunbar [Mon, 11 Oct 2010 23:44:19 +0000 (23:44 +0000)]
Basic: Attempt to make version tags work from 'svn export's again.

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

14 years agoDriver/Darwin: Remove a useless warning about missing runtime libraries. These
Daniel Dunbar [Mon, 11 Oct 2010 23:31:07 +0000 (23:31 +0000)]
Driver/Darwin: Remove a useless warning about missing runtime libraries. These
are almost never needed, so the warning isn't very useful.

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

14 years agoThis test should now work on windows, since we're no longer using temporary files...
Douglas Gregor [Mon, 11 Oct 2010 23:18:55 +0000 (23:18 +0000)]
This test should now work on windows, since we're no longer using temporary files badly

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

14 years agoEliminate CIndexer::getClangPath(), since libclang no longer depends
Douglas Gregor [Mon, 11 Oct 2010 23:17:59 +0000 (23:17 +0000)]
Eliminate CIndexer::getClangPath(), since libclang no longer depends
on the presence of a 'clang' executable. Simplify
CIndexer::getClangResourcesPath() a bit.

Patch up the CMake makefiles to install headers into two locations in
the build tree, for those silly cases where 'clang' will end up
looking into the wrong build directory for headers.

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

14 years agoTest for //rdar: //8493239
Fariborz Jahanian [Mon, 11 Oct 2010 23:15:47 +0000 (23:15 +0000)]
Test for //rdar: //8493239

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

14 years agoSome refactoring of property rewriting stuff
Fariborz Jahanian [Mon, 11 Oct 2010 22:21:03 +0000 (22:21 +0000)]
Some refactoring of property rewriting stuff
in rewriter. No functionality change.

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

14 years agoEliminate the (de-)serialization of code completion results, now that
Douglas Gregor [Mon, 11 Oct 2010 22:12:15 +0000 (22:12 +0000)]
Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.

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

14 years agoEliminate -fdiagnostics-binary and all of the infrastructure for
Douglas Gregor [Mon, 11 Oct 2010 22:02:06 +0000 (22:02 +0000)]
Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.

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

14 years agoFix debug info for functions whose context is a namespace.
Devang Patel [Mon, 11 Oct 2010 21:58:41 +0000 (21:58 +0000)]
Fix debug info for functions whose context is a namespace.
This is tested by namespace.exp in gdb testsuite.

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

14 years agoEliminate clang_codeComplete(). libclang clients should be using the
Douglas Gregor [Mon, 11 Oct 2010 21:51:20 +0000 (21:51 +0000)]
Eliminate clang_codeComplete(). libclang clients should be using the
faster, in-process, more-configurable clang_codeCompleteAt().

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

14 years agoSwitch c-index-test from clang_codeComplete() over to
Douglas Gregor [Mon, 11 Oct 2010 21:37:58 +0000 (21:37 +0000)]
Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

  - ASTUnit wasn't saving/restoring diagnostic state appropriately between
    reparses and code completions.
  - "Overload" completions weren't being passed through to the client

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

14 years agoThis patch does a few things in the area of objective-c
Fariborz Jahanian [Mon, 11 Oct 2010 21:29:12 +0000 (21:29 +0000)]
This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing
   getter/setter methods using dot-syntax notation.
   This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.

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

14 years agoIRgen/Obj-C: Fix encoding of "long double".
Daniel Dunbar [Mon, 11 Oct 2010 21:13:48 +0000 (21:13 +0000)]
IRgen/Obj-C: Fix encoding of "long double".
 - The mind boggles.

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

14 years agoMerge encode-test-1.m into encode-test.m
Daniel Dunbar [Mon, 11 Oct 2010 21:13:46 +0000 (21:13 +0000)]
Merge encode-test-1.m into encode-test.m

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

14 years agoFileCheck'ize test.
Daniel Dunbar [Mon, 11 Oct 2010 21:13:44 +0000 (21:13 +0000)]
FileCheck'ize test.

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

14 years agoEliminate clang_setUseExternalASTGeneration() from libclang. Between
Douglas Gregor [Mon, 11 Oct 2010 16:52:23 +0000 (16:52 +0000)]
Eliminate clang_setUseExternalASTGeneration() from libclang. Between
improvements to the compiler and the introduction of crash recovery,
it no longer makes sense to allow this mode. Moreover, this eliminates
one use of the "clang" executable from within libclang; we'd like them
all to go away.

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

14 years agoAdd parsing support for Microsoft attributes. MS attributes will just be skipped...
Francois Pichet [Mon, 11 Oct 2010 12:59:39 +0000 (12:59 +0000)]
Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.

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

14 years agoAdd 2 Microsoft compiler intrinsics that don't require prototypes:
Francois Pichet [Mon, 11 Oct 2010 12:00:10 +0000 (12:00 +0000)]
Add 2 Microsoft compiler intrinsics that don't require prototypes:
__assume
__noop

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

14 years agoDeclare argv parameters as const char* const* instead of to char** to clarify that...
Axel Naumann [Mon, 11 Oct 2010 09:18:43 +0000 (09:18 +0000)]
Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.

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

14 years agoTighten up constness of argv parameters to allow for string literals as argumants...
Axel Naumann [Mon, 11 Oct 2010 09:13:46 +0000 (09:13 +0000)]
Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.

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

14 years agoPer discussion with Sanjiv, remove the PIC16 target from mainline. When/if
Chris Lattner [Mon, 11 Oct 2010 05:44:49 +0000 (05:44 +0000)]
Per discussion with Sanjiv, remove the PIC16 target from mainline.  When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.

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

14 years agocomment out unused function
Chris Lattner [Mon, 11 Oct 2010 05:38:10 +0000 (05:38 +0000)]
comment out unused function

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

14 years agobe less threatening.
Chris Lattner [Mon, 11 Oct 2010 05:20:49 +0000 (05:20 +0000)]
be less threatening.

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

14 years agoMake sure the VTables for template instantiations are emitted even if the key functio...
Argyrios Kyrtzidis [Mon, 11 Oct 2010 03:25:57 +0000 (03:25 +0000)]
Make sure the VTables for template instantiations are emitted even if the key function doesn't have a body.

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

14 years agoDon't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
Argyrios Kyrtzidis [Mon, 11 Oct 2010 03:25:53 +0000 (03:25 +0000)]
Don't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
with similarly named classes in anonymous namespaces.

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

14 years agolib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:30:56 +0000 (02:30 +0000)]
lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.

It enables clang to compile Mingw's headers.

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

14 years agolib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:28:42 +0000 (02:28 +0000)]
lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.

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

14 years agolib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:27:37 +0000 (02:27 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.

  - lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
  - Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
  - gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
  - Cygwin-1.7: Use 4.3.4.
  - Cygwin-1.5: Use 4.3.2 for gcc-4.

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

14 years agofix PR8217, a silent miscompilation of invalid code.
Chris Lattner [Sun, 10 Oct 2010 18:16:20 +0000 (18:16 +0000)]
fix PR8217, a silent miscompilation of invalid code.

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

14 years agoAllow a string literal to initialize a tail array (PR8217), patch
Chris Lattner [Sun, 10 Oct 2010 17:49:49 +0000 (17:49 +0000)]
Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit!

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

14 years agoUnbreak the CMake build.
Francois Pichet [Sun, 10 Oct 2010 09:17:09 +0000 (09:17 +0000)]
Unbreak the CMake build.

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

14 years agoAdd experimental chroot check which checks improper use of chroot(). Patch by
Zhongxing Xu [Sun, 10 Oct 2010 05:45:30 +0000 (05:45 +0000)]
Add experimental chroot check which checks improper use of chroot(). Patch by
Lei Zhang.

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

14 years agoImplement __builtin_ia32_vec_ext_v2si function (required by Qt).
Argyrios Kyrtzidis [Sun, 10 Oct 2010 03:19:11 +0000 (03:19 +0000)]
Implement __builtin_ia32_vec_ext_v2si function (required by Qt).

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

14 years agolib/Driver/Tools.cpp: Disable cxa_atexit by default also on Cygwin.
NAKAMURA Takumi [Sun, 10 Oct 2010 01:53:03 +0000 (01:53 +0000)]
lib/Driver/Tools.cpp:  Disable cxa_atexit by default also on Cygwin.

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

14 years agoDon't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Benjamin Kramer [Sat, 9 Oct 2010 15:49:00 +0000 (15:49 +0000)]
Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.

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

14 years agoAdd target implementations for the X86 builtins:
Bill Wendling [Sat, 9 Oct 2010 08:47:25 +0000 (08:47 +0000)]
Add target implementations for the X86 builtins:

  __builtin_ia32_vec_init_v8qi
  __builtin_ia32_vec_init_v4hi
  __builtin_ia32_vec_init_v2si

They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.)
<rdar://problem/8529957>

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

14 years agoFixed __builtin_constant_p return type.
Abramo Bagnara [Sat, 9 Oct 2010 04:51:06 +0000 (04:51 +0000)]
Fixed __builtin_constant_p return type.

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

14 years agoFix g++.dg regressions introduced at r115347 (rdar://8529993)
Argyrios Kyrtzidis [Sat, 9 Oct 2010 04:39:54 +0000 (04:39 +0000)]
Fix g++.dg regressions introduced at r115347 (rdar://8529993)

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

14 years agoSecure this test against slightly different number formatters.
John McCall [Sat, 9 Oct 2010 02:28:39 +0000 (02:28 +0000)]
Secure this test against slightly different number formatters.

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

14 years agoPermit constant evaluation of const floating-point variables with
John McCall [Sat, 9 Oct 2010 01:34:31 +0000 (01:34 +0000)]
Permit constant evaluation of const floating-point variables with
constant initializers.

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

14 years agoAdd support for UCNs for character literals
Nico Weber [Sat, 9 Oct 2010 00:27:47 +0000 (00:27 +0000)]
Add support for UCNs for character literals

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

14 years agoImplement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
Douglas Gregor [Fri, 8 Oct 2010 23:50:27 +0000 (23:50 +0000)]
Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me).

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

14 years agoRename test name.
Fariborz Jahanian [Fri, 8 Oct 2010 23:17:27 +0000 (23:17 +0000)]
Rename test name.

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

14 years agoMethod implemented in class's implementation may implement
Fariborz Jahanian [Fri, 8 Oct 2010 22:59:25 +0000 (22:59 +0000)]
Method implemented in class's implementation may implement
one declared in class's extension and not one declared
in class's superclass. This supresses a bogus warning on
method type mismatch.
Fixes //rdar: // 8530080

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

14 years agoWhen dealing with an assignment with LHS being a property reference
Fariborz Jahanian [Fri, 8 Oct 2010 21:12:22 +0000 (21:12 +0000)]
When dealing with an assignment with LHS being a property reference
expression, the entire assignment tree is rewritten into a property
setter messaging. This includes rewriting the RHS.
Do not attempt to rewrite RHS again. Never rewrite a rewritten text!
Fixes //rdar: //8527018.

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

14 years agoImprove XML output for class/struct/union declarations, from Martin Vejnar!
Douglas Gregor [Fri, 8 Oct 2010 21:05:46 +0000 (21:05 +0000)]
Improve XML output for class/struct/union declarations, from Martin Vejnar!

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

14 years agoFix a typo in the Clang man page, from Alexander Best.
Douglas Gregor [Fri, 8 Oct 2010 21:03:07 +0000 (21:03 +0000)]
Fix a typo in the Clang man page, from Alexander Best.

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

14 years agoRevert the hack Chris Lattner added in r97981 to work around
Douglas Gregor [Fri, 8 Oct 2010 20:56:19 +0000 (20:56 +0000)]
Revert the hack Chris Lattner added in r97981 to work around
brokenness in the designated-initializer ASTs. The ASTs were fixed by
Alp Toker's patch (r116098) for PR6955. Fixes PR6537.

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

14 years agoThis patch fixes multiple issues in clang's designated init builder and
Douglas Gregor [Fri, 8 Oct 2010 20:44:28 +0000 (20:44 +0000)]
This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

 * Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).

 * Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.

 * Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.

 * Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.

Fixes PR6955, from Alp Toker!

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

14 years agoFix the mapping of vertical-space cursor kinds to produce a newline,
Douglas Gregor [Fri, 8 Oct 2010 20:39:29 +0000 (20:39 +0000)]
Fix the mapping of vertical-space cursor kinds to produce a newline,
rather than a space.

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

14 years agoTry to disable this again.
Eric Christopher [Fri, 8 Oct 2010 19:36:36 +0000 (19:36 +0000)]
Try to disable this again.

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

14 years agolibclang: Disable LLVM pretty stack trace functionality, which inadvertently
Daniel Dunbar [Fri, 8 Oct 2010 19:30:33 +0000 (19:30 +0000)]
libclang: Disable LLVM pretty stack trace functionality, which inadvertently
sets up signal handlers it shouldn't when we are being used a shared library.

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

14 years agoDisable this test temporarily in an attempt to green the buildbots.
Eric Christopher [Fri, 8 Oct 2010 19:18:57 +0000 (19:18 +0000)]
Disable this test temporarily in an attempt to green the buildbots.

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

14 years agoTighter check in r116060 blcoked enums also. Emit enum const's debug info.
Devang Patel [Fri, 8 Oct 2010 18:24:19 +0000 (18:24 +0000)]
Tighter check in r116060 blcoked enums also. Emit enum const's debug info.

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

14 years ago__attribute__((aligned(n))) directly specifies the alignment of a declaration
John McCall [Fri, 8 Oct 2010 18:24:19 +0000 (18:24 +0000)]
__attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment.  [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).

Fixes rdar://problem/8335865

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

14 years agoDo not repeat debug info for file variable constants.
Devang Patel [Fri, 8 Oct 2010 17:02:40 +0000 (17:02 +0000)]
Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite.

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

14 years agoFix three related, wily issues with the recompilation of precompiled
Douglas Gregor [Fri, 8 Oct 2010 04:03:57 +0000 (04:03 +0000)]
Fix three related, wily issues with the recompilation of precompiled
preambles:

  - When we rebuild a precompiled preamble, make sure to disable
    skipping anything in the main file; we may have had leftover
    preamble-skipping values in the lexer, which leads to very empty
    preamble. This is a correctness issue.

  - When we rebuild a precompiled preamble, clear out any prior state
    in the Diagnostic object. Otherwise, we might think that there
    were errors when we were building the preamble itself, and
    therefore reject the resulting preamble. This is mainly a
    performance issue.

  - Don't remove old remappings when digging out the remapping for the
    main file. Having the old mappings around does not hurt in the
    common case (later remappings will just overwrite them), and is
    important when we fail to find a preamble: we don't want to have
    removed the remapping, because we'll need it later.

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

14 years agoWhen we encounter a '==' in a context expecting a '=', assume the user made a typo:
Argyrios Kyrtzidis [Fri, 8 Oct 2010 02:39:23 +0000 (02:39 +0000)]
When we encounter a '==' in a context expecting a '=', assume the user made a typo:

t.c:1:7: error: invalid '==' at end of declaration; did you mean '='?
int x == 0;
      ^~
      =

Implements rdar://8488464.

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

14 years agoTrack the location of the context requiring an implicit conversion and use it
John McCall [Fri, 8 Oct 2010 02:01:28 +0000 (02:01 +0000)]
Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers.  rdar://problem/8232669

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

14 years agoImplement -fshort-enums (rdar://8490496).
Argyrios Kyrtzidis [Fri, 8 Oct 2010 00:25:19 +0000 (00:25 +0000)]
Implement -fshort-enums (rdar://8490496).

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

14 years agoIdentify functions with prototype appropriately in debug info.
Devang Patel [Thu, 7 Oct 2010 22:03:49 +0000 (22:03 +0000)]
Identify functions with prototype appropriately in debug info.
This is tested by callfuncs.exp in gdb testsuite.

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

14 years agoFix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default...
Argyrios Kyrtzidis [Thu, 7 Oct 2010 21:52:18 +0000 (21:52 +0000)]
Fix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default:' was intended to break out of the while loop).
Fixes rdar://8518859&8520617.

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

14 years agoFix a crash encoding ivars of vector types and
Fariborz Jahanian [Thu, 7 Oct 2010 21:25:25 +0000 (21:25 +0000)]
Fix a crash encoding ivars of vector types and
to match gcc's encoding. Fixes //rdar: // 8519948.

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

14 years agoFixed cast to union with anonymous bitfields.
Abramo Bagnara [Thu, 7 Oct 2010 21:20:44 +0000 (21:20 +0000)]
Fixed cast to union with anonymous bitfields.

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

14 years agoBugs should go to Bugzilla, not the mailing list
Douglas Gregor [Thu, 7 Oct 2010 20:20:57 +0000 (20:20 +0000)]
Bugs should go to Bugzilla, not the mailing list

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

14 years agotests: Force a triple to avoid wchar_t differences.
Daniel Dunbar [Thu, 7 Oct 2010 20:16:00 +0000 (20:16 +0000)]
tests: Force a triple to avoid wchar_t differences.

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

14 years agotests: Tweak test to also match MSVC format.
Daniel Dunbar [Thu, 7 Oct 2010 20:14:30 +0000 (20:14 +0000)]
tests: Tweak test to also match MSVC format.

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

14 years agoStart and end location of a property-dot syntax expression
Fariborz Jahanian [Thu, 7 Oct 2010 18:12:21 +0000 (18:12 +0000)]
Start and end location of a property-dot syntax expression
must match start and end location of the expression
as expected by the rewriter client. Fixes // rdar: // 8520727

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

14 years agoDon't force spell checking when code-completing. Let the client decide
Douglas Gregor [Thu, 7 Oct 2010 18:03:24 +0000 (18:03 +0000)]
Don't force spell checking when code-completing. Let the client decide

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

14 years agoDriver: When clang is built with a VENDOR set, include the base LLVM version in
Daniel Dunbar [Thu, 7 Oct 2010 15:00:30 +0000 (15:00 +0000)]
Driver: When clang is built with a VENDOR set, include the base LLVM version in
the version information, to help prevent user confusion about vendor version
numbers vs. LLVM version numbers.

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

14 years agowww: Grammar, etc.
Daniel Dunbar [Thu, 7 Oct 2010 15:00:19 +0000 (15:00 +0000)]
www: Grammar, etc.

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

14 years agoclang++ sorta works now
Chris Lattner [Thu, 7 Oct 2010 04:28:56 +0000 (04:28 +0000)]
clang++ sorta works now

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

14 years agoPatch for adding message to unavailable attribute.
Fariborz Jahanian [Wed, 6 Oct 2010 23:12:32 +0000 (23:12 +0000)]
Patch for adding message to unavailable attribute.
And its documentation.
Finishes off // rdar: // 6734520.

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

14 years agoUnreachableCodeChecker cleanup and improvements
Tom Care [Wed, 6 Oct 2010 23:02:25 +0000 (23:02 +0000)]
UnreachableCodeChecker cleanup and improvements
- Fixed some iterator style issues
- Don't process blocks that have been visited already
- Fixed a case where a unreachable block cycle was not reported
- Minor test case changes
- Added one test case from flow-sensitive version of the check. More coming.

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

14 years agoSimplified code for deprecated attribute wih message a little.
Fariborz Jahanian [Wed, 6 Oct 2010 22:20:08 +0000 (22:20 +0000)]
Simplified code for deprecated attribute wih message a little.

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