]> granicus.if.org Git - clang/log
clang
12 years agoSupport deducing template arguments from nested initializer lists. PR12119.
Sebastian Redl [Thu, 15 Mar 2012 21:40:51 +0000 (21:40 +0000)]
Support deducing template arguments from nested initializer lists. PR12119.

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

12 years agoSupport '%p' format specifier with block pointers.
Ted Kremenek [Thu, 15 Mar 2012 21:22:27 +0000 (21:22 +0000)]
Support '%p' format specifier with block pointers.

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

12 years agoIt was pointed out that a checking version of strdup isn't needed. So much for late...
Bill Wendling [Thu, 15 Mar 2012 21:18:47 +0000 (21:18 +0000)]
It was pointed out that a checking version of strdup isn't needed. So much for late-night hacking. :)

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

12 years ago[analyzer] Allow checkers to supply call stack diagnostic hints for the
Anna Zaks [Thu, 15 Mar 2012 21:13:02 +0000 (21:13 +0000)]
[analyzer] Allow checkers to supply call stack diagnostic hints for the
BugVisitor DiagnosticPieces.

When checkers create a DiagnosticPieceEvent, they can supply an extra
string, which will be concatenated with the call exit message for every
call on the stack between the diagnostic event and the final bug report.
(This is a simple version, which could be/will be further enhanced.)

For example, this is used in Malloc checker to produce the ",
which allocated memory" in the following example:

static char *malloc_wrapper() { // 2. Entered call from 'use'
    return malloc(12);    // 3. Memory is allocated
}

void use() {
    char *v;
    v = malloc_wrapper(); // 1. Calling 'malloc_wrappers'
        // 4. Returning from 'malloc_wrapper', which allocated memory
}                         // 5. Memory is never released; potential
memory leak

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

12 years agoProvide the specific target type in the -Wnull-conversion warning.
David Blaikie [Thu, 15 Mar 2012 20:48:26 +0000 (20:48 +0000)]
Provide the specific target type in the -Wnull-conversion warning.

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

12 years agomodern objective-c translator: rewriting of @catch-stmt.
Fariborz Jahanian [Thu, 15 Mar 2012 20:11:10 +0000 (20:11 +0000)]
modern objective-c translator: rewriting of @catch-stmt.

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

12 years agoDocument RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate().
Douglas Gregor [Thu, 15 Mar 2012 19:32:20 +0000 (19:32 +0000)]
Document RedeclarableTemplateDecl::getInstantiatedFromMemberTemplate().

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

12 years ago[c-index-test] Make it C90 compliant.
Argyrios Kyrtzidis [Thu, 15 Mar 2012 18:48:52 +0000 (18:48 +0000)]
[c-index-test] Make it C90 compliant.

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

12 years ago[libclang] A couple of enhancements to c-index-test.
Argyrios Kyrtzidis [Thu, 15 Mar 2012 18:07:22 +0000 (18:07 +0000)]
[libclang] A couple of enhancements to c-index-test.

-When printing location avoid printing the filename if it is
same as the main file, not just if it has '.h' extension.
-Make sure we allocate enough bytes for storing as string a
huge line number.

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

12 years agoMake RecursiveASTVisitor to traverse certain statements using data recursion
Argyrios Kyrtzidis [Thu, 15 Mar 2012 18:07:19 +0000 (18:07 +0000)]
Make RecursiveASTVisitor to traverse certain statements using data recursion
to avoid a stack overflow with extreme cases.

Part of rdar://10941790.

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

12 years ago[Sema] Introduce a data recursive evaluator specific to binary operators.
Argyrios Kyrtzidis [Thu, 15 Mar 2012 18:07:16 +0000 (18:07 +0000)]
[Sema] Introduce a data recursive evaluator specific to binary operators.

This allows us to handle extreme cases of chained binary operators without causing stack
overflow.
The binary operators that are handled with the data recursive evaluator are
comma, logical, or operators that have operands with integral or enumeration type.

Part of rdar://10941790.

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

12 years agoRemove hacky temporary fix of r151585.
Argyrios Kyrtzidis [Thu, 15 Mar 2012 18:07:13 +0000 (18:07 +0000)]
Remove hacky temporary fix of r151585.

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

12 years agomodern objective-c translator: please symbols generated
Fariborz Jahanian [Thu, 15 Mar 2012 17:05:33 +0000 (17:05 +0000)]
modern objective-c translator: please symbols generated
for @protocol expression into their own section.

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

12 years agoWhen laying out an Objective-C object, consult
Sean Callanan [Thu, 15 Mar 2012 16:33:08 +0000 (16:33 +0000)]
When laying out an Objective-C object, consult
the external source to complete the Decl if it
hasn't been completed already.

This fixes a crash in LLDB.

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

12 years agofix link
Kostya Serebryany [Thu, 15 Mar 2012 16:22:06 +0000 (16:22 +0000)]
fix link

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

12 years ago[asan] update asan docs: mention CMake problem and to explain the status of MacOS...
Kostya Serebryany [Thu, 15 Mar 2012 16:20:29 +0000 (16:20 +0000)]
[asan] update asan docs: mention CMake problem and to explain the status of MacOS 10.7 and 32-bit Linux

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

12 years agoAdding in newer MinGW header paths.
Aaron Ballman [Thu, 15 Mar 2012 14:31:30 +0000 (14:31 +0000)]
Adding in newer MinGW header paths.

Patch thanks to Nikola Smiljanic

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

12 years agoAdd the object size checking support for a few other builtins.
Bill Wendling [Thu, 15 Mar 2012 09:27:30 +0000 (09:27 +0000)]
Add the object size checking support for a few other builtins.

The functions memccpy, strdup, strndup, strlcat, and strlcpy should also have
object size checking support. Of course, this is only good if the C library also
supports these functions.
<rdar://problem/10528974>

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

12 years agoFix codegen for vld{3,4}_dup intrinsics.
James Molloy [Thu, 15 Mar 2012 09:12:01 +0000 (09:12 +0000)]
Fix codegen for vld{3,4}_dup intrinsics.

Patch by Silviu Baranga!

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

12 years agoUnpluralize -Wfoo-conversions warnings for consistency.
David Blaikie [Thu, 15 Mar 2012 05:09:31 +0000 (05:09 +0000)]
Unpluralize -Wfoo-conversions warnings for consistency.

Err on the side of brevity and rename (while providing aliases for the original
name) -Wbool-conversions, -Wint-conversions, and -Wvector-conversions for
consistency with constant, literal, string, and sign conversion warnings. And
name the diagnostic groups explicitly while I'm here rather than rewriting the
string in the groups and sema td files.

Curiously, vector-conversion is not under -Wconversion. Perhaps it should be.

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

12 years agoUnrevert r152761 (reverted in r152772) with a fix for the issue which was
Richard Smith [Thu, 15 Mar 2012 04:53:45 +0000 (04:53 +0000)]
Unrevert r152761 (reverted in r152772) with a fix for the issue which was
breaking bootstrap. No test yet: it's quite hard to tickle the failure case.
The specific testcase for this wouldn't be useful for testing anything more
general than a reintroduction of this precise bug in any case.

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

12 years agoReapply r152745 (reverted in 152765) now that compiler-rt is fixed.
David Blaikie [Thu, 15 Mar 2012 04:50:32 +0000 (04:50 +0000)]
Reapply r152745 (reverted in 152765) now that compiler-rt is fixed.

Original commit message:

Provide -Wnull-conversion separately from -Wconversion.

Like GCC, provide a NULL conversion to non-pointer conversion as a separate
flag, on by default. GCC's flag is "conversion-null" which we provide for
cross compatibility, but in the interests of consistency (with
-Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called
-Wnull-conversion.

Patch by Lubos Lunak.
Review feedback by myself, Chandler Carruth, and Chad Rosier.

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

12 years agoRevert r152761 "Minor optimization to constant evaluation: don't bother
Daniel Dunbar [Thu, 15 Mar 2012 03:04:21 +0000 (03:04 +0000)]
Revert r152761 "Minor optimization to constant evaluation: don't bother
computing expr source...", it breaks bootstrap.

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

12 years agoSmall cleanup: move trailing-return-type special-casing into
Richard Smith [Thu, 15 Mar 2012 01:02:11 +0000 (01:02 +0000)]
Small cleanup: move trailing-return-type special-casing into
getDeclSpecContextFromDeclaratorContext.

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

12 years agoRevert r152745 as it's breaking the internal buildbots.
Chad Rosier [Thu, 15 Mar 2012 01:00:38 +0000 (01:00 +0000)]
Revert r152745 as it's breaking the internal buildbots.

Abbreviated commit message:
Provide -Wnull-conversion separately from -Wconversion.

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

12 years agoMinor optimization to constant evaluation: don't bother computing expr source
Richard Smith [Thu, 15 Mar 2012 00:41:48 +0000 (00:41 +0000)]
Minor optimization to constant evaluation: don't bother computing expr source
locations for diagnostics we're not going to emit, and don't track the subobject
designator outside C++11 (since we're not going to use it anyway).

This seems to give about a 0.5% speedup on 403.gcc/combine.c, but the results
were sufficiently noisy that I can't reject the null hypothesis.

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

12 years agoRemove a variable rendered unused by r152750.
Richard Smith [Thu, 15 Mar 2012 00:22:18 +0000 (00:22 +0000)]
Remove a variable rendered unused by r152750.

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

12 years agoAdding some more specific tests for enum declspec parsing, to prove that it really...
Aaron Ballman [Thu, 15 Mar 2012 00:20:05 +0000 (00:20 +0000)]
Adding some more specific tests for enum declspec parsing, to prove that it really works.

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

12 years ago[frontend] Add support for disabling the "inline" keyword using
Chad Rosier [Wed, 14 Mar 2012 23:32:11 +0000 (23:32 +0000)]
[frontend] Add support for disabling the "inline" keyword using
-fno-inline-functions.

This behaves much like -fno-inline in gcc, but based on a discussion with
Daniel it was decided that -fno-inline-functions should subsume -fno-inline.
Please speak up if you object.  The -fno-inline flag remains ignored.
Final part of rdar://10972766

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

12 years agomodern objective-c translator: section info.
Fariborz Jahanian [Wed, 14 Mar 2012 23:18:19 +0000 (23:18 +0000)]
modern objective-c translator: section info.
and metadata for "non-lazy" class and categories.

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

12 years agoInstantiating a class template should not instantiate the definition of any
Richard Smith [Wed, 14 Mar 2012 23:13:10 +0000 (23:13 +0000)]
Instantiating a class template should not instantiate the definition of any
scoped enumeration members. Later uses of an enumeration temploid as a nested
name specifier should cause its instantiation. Plus some groundwork for
explicit specialization of member enumerations of class templates.

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

12 years ago'#if 0' out a variable that's only used in other preprocessor-disabled code.
Matt Beaumont-Gay [Wed, 14 Mar 2012 23:12:42 +0000 (23:12 +0000)]
'#if 0' out a variable that's only used in other preprocessor-disabled code.

(Why are we keeping all of this code around anyway? Say the word and I'll
start swinging the delete hammer.)

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

12 years agoProvide -Wnull-conversion separately from -Wconversion.
David Blaikie [Wed, 14 Mar 2012 22:28:22 +0000 (22:28 +0000)]
Provide -Wnull-conversion separately from -Wconversion.

Like GCC, provide a NULL conversion to non-pointer conversion as a separate
flag, on by default. GCC's flag is "conversion-null" which we provide for
cross compatibility, but in the interests of consistency (with
-Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called
-Wnull-conversion.

Patch by Lubos Lunak.
Review feedback by myself, Chandler Carruth, and Chad Rosier.

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

12 years agoobjective-c modern tranaltor. More section info.
Fariborz Jahanian [Wed, 14 Mar 2012 21:44:09 +0000 (21:44 +0000)]
objective-c modern tranaltor. More section info.
for misc. objc meta-data.

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

12 years ago[analyzer] A fixup to r152734. Always initialize the flag.
Anna Zaks [Wed, 14 Mar 2012 21:24:14 +0000 (21:24 +0000)]
[analyzer] A fixup to r152734. Always initialize the flag.

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

12 years agoNo longer defining LP64 in 64-bit builds on platforms which are not LP64.
Aaron Ballman [Wed, 14 Mar 2012 20:50:57 +0000 (20:50 +0000)]
No longer defining LP64 in 64-bit builds on platforms which are not LP64.

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

12 years agoWhen emitting a diagnostic about two-phase name lookup, don't do useless
Nick Lewycky [Wed, 14 Mar 2012 20:41:00 +0000 (20:41 +0000)]
When emitting a diagnostic about two-phase name lookup, don't do useless
qualified name lookups into transparent contexts.

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

12 years agoFix dereference of end iterator. Spotted by ASan.
Matt Beaumont-Gay [Wed, 14 Mar 2012 20:21:25 +0000 (20:21 +0000)]
Fix dereference of end iterator. Spotted by ASan.

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

12 years ago[analyzer] Diagnostics: Supply Caller information even if the bug occurs
Anna Zaks [Wed, 14 Mar 2012 18:58:28 +0000 (18:58 +0000)]
[analyzer] Diagnostics: Supply Caller information even if the bug occurs
in the callee.

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

12 years agoobjective-c modern translator.
Fariborz Jahanian [Wed, 14 Mar 2012 18:09:23 +0000 (18:09 +0000)]
objective-c modern translator.
Add the _class_ro_t.reserved field for 64bit targets.
// rdar://11040024

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

12 years ago[Analyser] Remove unnecessary recursive visits for ExprWithCleanups and
Erik Verbruggen [Wed, 14 Mar 2012 18:01:43 +0000 (18:01 +0000)]
[Analyser] Remove unnecessary recursive visits for ExprWithCleanups and
MaterializeTemporaryExpr.

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

12 years agoRemove clang-wpa example, which has been unmaintained for quite a while.
Douglas Gregor [Wed, 14 Mar 2012 17:29:44 +0000 (17:29 +0000)]
Remove clang-wpa example, which has been unmaintained for quite a while.

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

12 years agoMinor cleanup in attribute-related diagnostics, from Alexander Kornienko!
Douglas Gregor [Wed, 14 Mar 2012 16:55:17 +0000 (16:55 +0000)]
Minor cleanup in attribute-related diagnostics, from Alexander Kornienko!

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

12 years agoParse brace initializers as default arguments. PR12236.
Sebastian Redl [Wed, 14 Mar 2012 15:54:00 +0000 (15:54 +0000)]
Parse brace initializers as default arguments. PR12236.

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

12 years ago[Analyser] Removes more recursive visitations in ExprEngine that are no
Erik Verbruggen [Wed, 14 Mar 2012 15:38:55 +0000 (15:38 +0000)]
[Analyser] Removes more recursive visitations in ExprEngine that are no
longer needed as the CFG is fully linearized.

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

12 years ago[Basic] Change DiagnosticBuilder to use a separate status variable to track whether...
Daniel Dunbar [Wed, 14 Mar 2012 09:49:36 +0000 (09:49 +0000)]
[Basic] Change DiagnosticBuilder to use a separate status variable to track whether the builder is active.
 - This may seem superflous, but actually this allows the optimizer to more
   easily eliminate the isActive() checks needed by the SemaDiagnosticBuilder
   and DiagnosticBuilder dtors. And by more easily, I mean the current LLVM is
   actually able to do one and not the other. :)

This is good for another 20k code size reduction.

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

12 years ago[Sema] Fix SemaDiagnosticBuilder to be inline.
Daniel Dunbar [Wed, 14 Mar 2012 09:49:32 +0000 (09:49 +0000)]
[Sema] Fix SemaDiagnosticBuilder to be inline.
 - As with DiagnosticBuilder, it is very important that SemaDiagnosticBuilder be
   completely inline to ensure that the compiler can rip it apart and sink it to
   registers.

This is good for another 30k reduction in code size.

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

12 years agoRemove trailing whitespace (especially after a \ which should be trailing)
Matt Beaumont-Gay [Wed, 14 Mar 2012 01:23:41 +0000 (01:23 +0000)]
Remove trailing whitespace (especially after a \ which should be trailing)

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

12 years ago-arch is a darwin-only feature, use -target instead to make the linux buildbots happy...
Benjamin Kramer [Wed, 14 Mar 2012 01:17:52 +0000 (01:17 +0000)]
-arch is a darwin-only feature, use -target instead to make the linux buildbots happy again.

Also check the error message.

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

12 years agoAdd support to mangle templated member function names with template
Eric Christopher [Wed, 14 Mar 2012 00:25:46 +0000 (00:25 +0000)]
Add support to mangle templated member function names with template
args.

Fixes rdar://11042577

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

12 years agoTypo.
Chad Rosier [Tue, 13 Mar 2012 23:48:50 +0000 (23:48 +0000)]
Typo.

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

12 years agoobjective-c modern rewriter. Do not add _class_ro_t.reserved
Fariborz Jahanian [Tue, 13 Mar 2012 23:48:09 +0000 (23:48 +0000)]
objective-c modern rewriter. Do not add _class_ro_t.reserved
field. // rdar://11040024

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

12 years ago[driver] Clang should report an error for -faltivec on non-ppc.
Chad Rosier [Tue, 13 Mar 2012 23:45:51 +0000 (23:45 +0000)]
[driver] Clang should report an error for -faltivec on non-ppc.
rdar://10963572

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

12 years agoWhen adding member functions to a class add any specializations of
Eric Christopher [Tue, 13 Mar 2012 23:40:48 +0000 (23:40 +0000)]
When adding member functions to a class add any specializations of
function templates as well.

A future commit will mangle the added name with the template args
like classes are mangled.

Fixes rdar://10986010

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

12 years agoAdd a test case for PR8385.
David Blaikie [Tue, 13 Mar 2012 23:33:06 +0000 (23:33 +0000)]
Add a test case for PR8385.

"struct{template struct{" would fail an assertion.

This assertion failure seems to have gone away somewhere along the line so
here's a test to make sure we don't regress. We still accept some very weird
explicit template 'instantiations' ("template int;", anyone) but at least we're
not asserting/crashing here.

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

12 years ago[analyser] Refactor shouldInline logic into a helper.
Anna Zaks [Tue, 13 Mar 2012 22:15:58 +0000 (22:15 +0000)]
[analyser] Refactor shouldInline logic into a helper.

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

12 years ago[analyzer] Call enter/exit diagnostic should refer to caller/callee,
Anna Zaks [Tue, 13 Mar 2012 22:15:55 +0000 (22:15 +0000)]
[analyzer] Call enter/exit diagnostic should refer to caller/callee,
respectively.

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

12 years ago[Basic] Fix up DiagnosticBuilder::{FlushCounts,Emit} to be inline.
Daniel Dunbar [Tue, 13 Mar 2012 21:02:14 +0000 (21:02 +0000)]
[Basic] Fix up DiagnosticBuilder::{FlushCounts,Emit} to be inline.

 - This is much more important than it appears at first glance...

The intended design of DiagnosticBuilder was that it never escape and that all
its members would get lowered to registers by the compiler. By fixing Emit here,
the compiler can completely eliminate the DiagnosticBuilder object and never
need to push those registers back into it.

Unfortunately, Sema has broken DiagnosticBuilder in other ways (by introducing
SemaDiagnosticBuilder), so we don't get the fill impact of this, but it is still
good for 30k reduction in code size. I'll work on fixing the
SemaDiagnosticBuilder problems next.

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

12 years agoAllow vectors to be constructed from constexpr function arguments in
Richard Smith [Tue, 13 Mar 2012 20:58:32 +0000 (20:58 +0000)]
Allow vectors to be constructed from constexpr function arguments in
constant expressions.

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

12 years agoUpdate test case to use not tool.
Chad Rosier [Tue, 13 Mar 2012 20:31:40 +0000 (20:31 +0000)]
Update test case to use not tool.

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

12 years ago[driver] Parse diagnostic args in the driver.
Chad Rosier [Tue, 13 Mar 2012 20:09:56 +0000 (20:09 +0000)]
[driver] Parse diagnostic args in the driver.

Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.

Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.

Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:

clang-3: warning: argument unused during compilation: '-verify'

Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.

Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.

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

12 years ago[analyzer] Change the order in which we analyze the functions under
Anna Zaks [Tue, 13 Mar 2012 19:32:19 +0000 (19:32 +0000)]
[analyzer] Change the order in which we analyze the functions under
inlining to be the reverse of their declaration.

This optimizes running time under inlining up to 20% since we do not
re-analyze the utility functions which are usually defined first in the
translation unit if they have already been analyzed while inlined into
the root functions.

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

12 years ago[analyzer] Use BFS over call graph when analysing functions.
Anna Zaks [Tue, 13 Mar 2012 19:32:13 +0000 (19:32 +0000)]
[analyzer] Use BFS over call graph when analysing functions.

BFS should give slightly better performance. Ex: Suppose, we have two
roots R1 and R2. A callee function C is reachable through both. However,
C is not inlined when analyzing R1 due to inline stack depth limit. With
DFS, C will be analyzed as top level even though it would be analyzed as
inlined through R2. On the other hand, BFS could avoid analyzing C as
top level.

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

12 years ago[analyzer] Refactor CallGraph to use Recursive AST visitor when
Anna Zaks [Tue, 13 Mar 2012 19:32:08 +0000 (19:32 +0000)]
[analyzer] Refactor CallGraph to use Recursive AST visitor when
collecting function Decls.

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

12 years ago[analyzer] Use recursive AST visitor to drive simple visitation order in
Anna Zaks [Tue, 13 Mar 2012 19:32:00 +0000 (19:32 +0000)]
[analyzer] Use recursive AST visitor to drive simple visitation order in
AnalysisConsumer.

As a result:
 - We now analyze the C++ methods which are defined within the
class body. These were completely skipped before.

- Ensure that AST checkers are called on functions in the
order they are defined in the Translation unit.

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

12 years ago[analyzer] Minor: factor out logic for determining if we should skip a
Anna Zaks [Tue, 13 Mar 2012 19:31:54 +0000 (19:31 +0000)]
[analyzer] Minor: factor out logic for determining if we should skip a
function.

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

12 years ago[analyzer] Move the check for parser errors out of the loop over Decls.
Anna Zaks [Tue, 13 Mar 2012 19:31:47 +0000 (19:31 +0000)]
[analyzer] Move the check for parser errors out of the loop over Decls.

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

12 years agoFix the long double to be of width/align 64. Rename va_list_test to
Roman Divacky [Tue, 13 Mar 2012 19:20:17 +0000 (19:20 +0000)]
Fix the long double to be of width/align 64. Rename va_list_test to
powerpc_types and add testing for the (long) double there.

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

12 years agoSpelling.
Daniel Dunbar [Tue, 13 Mar 2012 18:30:54 +0000 (18:30 +0000)]
Spelling.

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

12 years ago[Basic] Make DiagnosticBuilder::{Clear,Emit} protected.
Daniel Dunbar [Tue, 13 Mar 2012 18:30:50 +0000 (18:30 +0000)]
[Basic] Make DiagnosticBuilder::{Clear,Emit} protected.

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

12 years ago[Basic] Eliminate DiagnosticBuilder::Suppress and matching ctor, this stuff is
Daniel Dunbar [Tue, 13 Mar 2012 18:30:46 +0000 (18:30 +0000)]
[Basic] Eliminate DiagnosticBuilder::Suppress and matching ctor, this stuff is
not used anymore (good thing we are still paying for it!).

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

12 years ago[Basic] Make DiagnosticBuilder::{isActive,getLocation,getDiagID} protected.
Daniel Dunbar [Tue, 13 Mar 2012 18:30:42 +0000 (18:30 +0000)]
[Basic] Make DiagnosticBuilder::{isActive,getLocation,getDiagID} protected.

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

12 years ago[Basic] Fix ~Diagnostic() to not call Emit() when there is no diag obj (most
Daniel Dunbar [Tue, 13 Mar 2012 18:30:38 +0000 (18:30 +0000)]
[Basic] Fix ~Diagnostic() to not call Emit() when there is no diag obj (most
commonly when the diag has been copied).
 - This eliminates a completely spurious call to Emit() which was in
   Sema::Diag(). Sob.

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

12 years ago[Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary size
Daniel Dunbar [Tue, 13 Mar 2012 18:21:17 +0000 (18:21 +0000)]
[Basic] Stop using a SmallVector<> for Diagnostic. This drops Clang binary size
by ~%.3/~100k in my build -- simply by eliminating the horrible code bloat coming
from the .clear() of the SmallVector<FixItHint>, which does a std::~string, etc.
 - My understanding is we don't ever emit arbitrary numbers of fixits, so I just
   moved us to using a statically sized array like we do for arguments and
   ranges.

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

12 years agoRemove unused-but-set variable.
Benjamin Kramer [Tue, 13 Mar 2012 17:05:43 +0000 (17:05 +0000)]
Remove unused-but-set variable.

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

12 years agoLong double is just double on FreeBSD/{PPC,PPC64}.
Roman Divacky [Tue, 13 Mar 2012 16:53:54 +0000 (16:53 +0000)]
Long double is just double on FreeBSD/{PPC,PPC64}.

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

12 years agoTweak linkage order for solaris.
David Chisnall [Tue, 13 Mar 2012 14:14:54 +0000 (14:14 +0000)]
Tweak linkage order for solaris.

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

12 years agoEnsure that default arguments are handled correctly in sub scopes. For example:
James Molloy [Tue, 13 Mar 2012 08:55:35 +0000 (08:55 +0000)]
Ensure that default arguments are handled correctly in sub scopes. For example:

void f () {
  int g (int a, int b=4);
  {
    int g(int a, int b=5);
  }
}

should compile.

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

12 years agoImplement [temp.param]p5: the top-level cv-qualifiers on a non-type template
Richard Smith [Tue, 13 Mar 2012 07:21:50 +0000 (07:21 +0000)]
Implement [temp.param]p5: the top-level cv-qualifiers on a non-type template
parameter's declaration are ignored when determining the parameter's type.

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

12 years agoPR11850 + duplicates: don't assume that a function parameter pack expansion is
Richard Smith [Tue, 13 Mar 2012 06:56:52 +0000 (06:56 +0000)]
PR11850 + duplicates: don't assume that a function parameter pack expansion is
at the end of the parameter list.

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

12 years agoPR11925: A function can't have a variably-modified return type. Not even in C++.
Richard Smith [Tue, 13 Mar 2012 05:56:40 +0000 (05:56 +0000)]
PR11925: A function can't have a variably-modified return type. Not even in C++.

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

12 years agoIt never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
Nick Lewycky [Tue, 13 Mar 2012 04:12:34 +0000 (04:12 +0000)]
It never makes sense to do a lookup into a LinkageSpecDecl, so assert that we
don't, and clean up the places that do it.

The change to ASTWriter is surprising, but the deleted code is a no-op as of
r152608.

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

12 years agoFix PR10447: lazily building name lookup tables for DeclContexts was broken.
Richard Smith [Tue, 13 Mar 2012 03:12:56 +0000 (03:12 +0000)]
Fix PR10447: lazily building name lookup tables for DeclContexts was broken.
The deferred lookup table building step couldn't accurately tell which Decls
should be included in the lookup table, and consequently built different tables
in some cases.

Fix this by removing lazy building of DeclContext name lookup tables. In
practice, the laziness was frequently not worthwhile in C++, because we
performed lookup into most DeclContexts. In C, it had a bit more value,
since there is no qualified lookup.

In the place of lazy lookup table building, we simply don't build lookup tables
for function DeclContexts at all. Such name lookup tables are not useful, since
they don't capture the scoping information required to correctly perform name
lookup in a function scope.

The resulting performance delta is within the noise on my testing, but appears
to be a very slight win for C++ and a very slight loss for C. The C performance
can probably be recovered (if it is a measurable problem) by avoiding building
the lookup table for the translation unit.

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

12 years ago[libclang] When there's a file error when saving the PCH, make sure to
Argyrios Kyrtzidis [Tue, 13 Mar 2012 02:17:06 +0000 (02:17 +0000)]
[libclang] When there's a file error when saving the PCH, make sure to
clear the error from raw_fd_ostream, otherwise we will crash.

rdar://10976410

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

12 years agoMake the error about assigning to lambda-captured variables
John McCall [Tue, 13 Mar 2012 01:10:51 +0000 (01:10 +0000)]
Make the error about assigning to lambda-captured variables
clearer, and mention the existence of mutable lambdas.

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

12 years ago[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators...
Argyrios Kyrtzidis [Tue, 13 Mar 2012 01:09:41 +0000 (01:09 +0000)]
[Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() iterators instead of
ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use
even if the caller did not check that the interface is a definition.

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

12 years agoFix crash at @implementation with a forward reference as base class.
Argyrios Kyrtzidis [Tue, 13 Mar 2012 01:09:36 +0000 (01:09 +0000)]
Fix crash at @implementation with a forward reference as base class.

rdar://11020003

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

12 years agoAlternate fix to PR12248: put Sema in charge of special-casing
John McCall [Tue, 13 Mar 2012 00:37:01 +0000 (00:37 +0000)]
Alternate fix to PR12248:  put Sema in charge of special-casing
the diagnostic for assigning to a copied block capture.  This has
the pleasant side-effect of letting us special-case the diagnostic
for assigning to a copied lambda capture as well, without introducing
a new non-modifiable enumerator for it.

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

12 years ago[msvc] Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat.
NAKAMURA Takumi [Tue, 13 Mar 2012 00:02:21 +0000 (00:02 +0000)]
[msvc] Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat.

FYI,

On VS10, %INCLUDE% contains;
(VS10)\VC\INCLUDE
(VS10)\VC\ATLMFC\INCLUDE
(SDK70A)\include

On VS11,
(VS11)\VC\INCLUDE
(VS11)\VC\ATLMFC\INCLUDE
(SDK80)\include\shared
(SDK80)\include\um
(SDK80)\include\winrt

FIXME: It may be enabled also on mingw.

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

12 years agomodern objective-c translator. @try/@catch translation. wip.
Fariborz Jahanian [Mon, 12 Mar 2012 23:58:28 +0000 (23:58 +0000)]
modern objective-c translator. @try/@catch translation. wip.

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

12 years agoAdd new analyzer diagnostic mode where plists can have bugs that span multiple files.
Ted Kremenek [Mon, 12 Mar 2012 23:14:53 +0000 (23:14 +0000)]
Add new analyzer diagnostic mode where plists can have bugs that span multiple files.

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

12 years ago[analyzer] Include inlining call stack depth in plist output.
Ted Kremenek [Mon, 12 Mar 2012 22:10:57 +0000 (22:10 +0000)]
[analyzer] Include inlining call stack depth in plist output.

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

12 years agoAddress some of the concerns by Chandler.
Bill Wendling [Mon, 12 Mar 2012 22:10:06 +0000 (22:10 +0000)]
Address some of the concerns by Chandler.

* s/AddDirectoryList/addDirectoryList/
* Move the call to ::getenv into the function.
* FileCheck-ize the testcase.

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

12 years agoUpdate FIXME.
Bill Wendling [Mon, 12 Mar 2012 21:24:57 +0000 (21:24 +0000)]
Update FIXME.

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

12 years agoHave clang pay attention to the LIBRARY_PATH environment variable.
Bill Wendling [Mon, 12 Mar 2012 21:22:35 +0000 (21:22 +0000)]
Have clang pay attention to the LIBRARY_PATH environment variable.

The LIBRARY_PATH environment variable should be honored by clang. Have the
driver pass the directories to the linker.
<rdar://problem/9743567> and PR10296.

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

12 years agoC++11 [temp.deduct.call]p6 tweak: when given a set of overlaoded
Douglas Gregor [Mon, 12 Mar 2012 21:09:16 +0000 (21:09 +0000)]
C++11 [temp.deduct.call]p6 tweak: when given a set of overlaoded
functions that includes an explicit template argument list, perform
an inner deduction against each of the function templates in that list
and, if successful, use the result of that deduction for the outer
template argument deduction. Fixes PR11713.

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

12 years agoMake sure we treat variables captured by reference in lambda as modifiable lvalues...
Eli Friedman [Mon, 12 Mar 2012 20:57:19 +0000 (20:57 +0000)]
Make sure we treat variables captured by reference in lambda as modifiable lvalues.  Regression from r152491.  Fixes PR12248.

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

12 years ago[Sema] -Add an invalid objc category to the DeclContext so that it can be
Argyrios Kyrtzidis [Mon, 12 Mar 2012 18:34:26 +0000 (18:34 +0000)]
[Sema] -Add an invalid objc category to the DeclContext so that it can be
serialized
-Don't add methods of invalid objc containers to the global method pool.
 This protects us from trying to serialize a method whose container was not
 serialized.

Part of rdar://11007039.

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

12 years agoObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They...
Jordy Rose [Mon, 12 Mar 2012 17:53:02 +0000 (17:53 +0000)]
ObjCBoolLiterals (__objc_yes/__objc_no) behave like C++ booleans (true/false). They are NOT objects.

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

12 years agoobjective-c modern translator: ivar offset symbols
Fariborz Jahanian [Mon, 12 Mar 2012 16:46:58 +0000 (16:46 +0000)]
objective-c modern translator: ivar offset symbols
will reside in .objc_ivar$B sections. // rdar://11023490

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