]> granicus.if.org Git - clang/log
clang
12 years agomalloc size checker: Ignore const'ness of pointer types when determining of a sizeof...
Ted Kremenek [Tue, 1 May 2012 00:10:19 +0000 (00:10 +0000)]
malloc size checker: Ignore const'ness of pointer types when determining of a sizeof() type is compatible with a pointed type.

Fixes <rdar://problem/11292586>.

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

12 years agoAdd support for openSUSE 12.2, from Ismail Donmez!
Douglas Gregor [Mon, 30 Apr 2012 23:42:57 +0000 (23:42 +0000)]
Add support for openSUSE 12.2, from Ismail Donmez!

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

12 years agoclang_getCursorLexicalParent should return a translation unit cursor for declarations...
Douglas Gregor [Mon, 30 Apr 2012 23:41:16 +0000 (23:41 +0000)]
clang_getCursorLexicalParent should return a translation unit cursor for declarations at the global scope, from Evan P. Fixes PR9083.

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

12 years agoRemove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'
Richard Smith [Mon, 30 Apr 2012 23:33:33 +0000 (23:33 +0000)]
Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'
being used in an exception specification in a way which isn't otherwise
ill-formed in C++98: this warning also incorrectly triggered on uses of 'this'
inside thread-safety attributes, and the mechanism required to tell these cases
apart is more complex than can be justified by the (minimal) value of this part
of -Wc++98-compat.

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

12 years agoWhen going through references to check if the function returns the address
Argyrios Kyrtzidis [Mon, 30 Apr 2012 23:23:55 +0000 (23:23 +0000)]
When going through references to check if the function returns the address
of a local variable, make sure we don't infinitely recurse when the
reference binds to itself.

e.g:

int* func() {
    int& i = i;    // assign non-exist variable to a reference which has same name.
    return &i;    // return pointer
}

rdar://11345441

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

12 years agomodern objective-c translator. named aggregate types
Fariborz Jahanian [Mon, 30 Apr 2012 23:20:30 +0000 (23:20 +0000)]
modern objective-c translator. named aggregate types
defined inside the objc class belong to class's
decl. scope. This is to conform to objective-c
rules. // rdar://11351299

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

12 years agoFor RecursiveASTVisitor, do data recursion for CXXOperatorCallExpr.
Argyrios Kyrtzidis [Mon, 30 Apr 2012 22:12:26 +0000 (22:12 +0000)]
For RecursiveASTVisitor, do data recursion for CXXOperatorCallExpr.

rdar://11289247

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

12 years agoStore the source range of a CXXOperatorCallExpr in the Expr object instead of
Argyrios Kyrtzidis [Mon, 30 Apr 2012 22:12:22 +0000 (22:12 +0000)]
Store the source range of a CXXOperatorCallExpr in the Expr object instead of
calculating it recursively.

boost::assign::tuple_list_of uses the trick of chaining call operator expressions in order to declare a "list of tuples", e.g:
    std::vector<tuple> v = boost::assign::tuple_list_of(1, "foo")(2, "bar")(3, "qqq");

Due to CXXOperatorCallExpr calculating its source range recursively we would get
significant slowdowns with a large number of chained call operator expressions and the
potential for stack overflow.

rdar://11350116

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

12 years agominor refactoring of modern objc translator.
Fariborz Jahanian [Mon, 30 Apr 2012 19:46:53 +0000 (19:46 +0000)]
minor refactoring of modern objc translator.

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

12 years agoFix C versus C++ linkage issue.
Ted Kremenek [Mon, 30 Apr 2012 19:33:45 +0000 (19:33 +0000)]
Fix C versus C++ linkage issue.

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

12 years agoReduce malloc() traffic of clang_getOverridenCursors() by using a pool of SmallVector...
Ted Kremenek [Mon, 30 Apr 2012 19:06:49 +0000 (19:06 +0000)]
Reduce malloc() traffic of clang_getOverridenCursors() by using a pool of SmallVector<CXCursor> objects
under the covers.

Fixes <rdar://problem/11289160>.

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

12 years agoAdd FixItHint for -Wnull-conversion to initialize with an appropriate literal.
David Blaikie [Mon, 30 Apr 2012 18:27:22 +0000 (18:27 +0000)]
Add FixItHint for -Wnull-conversion to initialize with an appropriate literal.

Reviewed by Doug Gregor.

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

12 years agoFix PR12378: provide conversion warnings on default args of function templates
David Blaikie [Mon, 30 Apr 2012 18:21:31 +0000 (18:21 +0000)]
Fix PR12378: provide conversion warnings on default args of function templates

Apparently we weren't checking default arguments when they were instantiated.
This adds the check, fixes the lack of instantiation caching (which seems like
it was mostly implemented but just missed the last step), and avoids
implementing non-dependent default args (for non-dependent parameter types) as
uninstantiated default arguments (so that we don't warn once for every
instantiation when it's not instantiation dependent).

Reviewed by Richard Smith.

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

12 years agoHandleDeclarator() returns NULL for semantic disasters. Deal with it
Douglas Gregor [Mon, 30 Apr 2012 18:13:01 +0000 (18:13 +0000)]
HandleDeclarator() returns NULL for semantic disasters. Deal with it
when we're in an Objective-C container context. Fixes
<rdar://problem/11286701>.

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

12 years agoAdd -Wloop-analysis. This warning will fire on for loops which the variables
Richard Trieu [Mon, 30 Apr 2012 18:01:30 +0000 (18:01 +0000)]
Add -Wloop-analysis.  This warning will fire on for loops which the variables
in the loop conditional do not change.

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

12 years agomodern objective-c translation: de-virtualize all
Fariborz Jahanian [Mon, 30 Apr 2012 16:57:52 +0000 (16:57 +0000)]
modern objective-c translation: de-virtualize all
local rewriting functions.

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

12 years agoRestore paren, bracket and brace counts in parser when
Douglas Gregor [Mon, 30 Apr 2012 16:20:27 +0000 (16:20 +0000)]
Restore paren, bracket and brace counts in parser when
TentativeParsingAction is reverted, from Pasi Parviainen! Fixes
PR12480 / <rdar://problem/11341251>.

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

12 years agoRemove the ref/value inconsistency in filter_decl_iterator.
David Blaikie [Mon, 30 Apr 2012 02:36:29 +0000 (02:36 +0000)]
Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

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

12 years agoCorrect CFGBlock's front() and back() to return by const ref rather than value.
David Blaikie [Mon, 30 Apr 2012 00:42:50 +0000 (00:42 +0000)]
Correct CFGBlock's front() and back() to return by const ref rather than value.

This ought to fix PR11926, a crash when when running Clang built with GCC 4.7

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

12 years agoPR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like
Richard Smith [Mon, 30 Apr 2012 00:16:51 +0000 (00:16 +0000)]
PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like
g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs
returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf!

No test: this code has the same observable behavior as the old code when built
with most compilers, and the tests were already failing when built with a
compiler for which this produced a broken binary.

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

12 years agoPR9546, DR1268: A prvalue cannot be reinterpret_cast to an rvalue reference
Richard Smith [Sun, 29 Apr 2012 08:24:44 +0000 (08:24 +0000)]
PR9546, DR1268: A prvalue cannot be reinterpret_cast to an rvalue reference
type. But a glvalue can be reinterpret_cast to either flavor of reference.

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

12 years agoPR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes another
Richard Smith [Sun, 29 Apr 2012 07:31:09 +0000 (07:31 +0000)]
PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes another
victim. Don't crash if we have a delay-parsed exception specification for a
class member which is invalid in a way which precludes building a FunctionDecl.

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

12 years ago[class.copy]p23: Fix an assertion caused by incorrect argument numbering in a
Richard Smith [Sun, 29 Apr 2012 06:32:34 +0000 (06:32 +0000)]
[class.copy]p23: Fix an assertion caused by incorrect argument numbering in a
diagnostic, add a test for this paragraph, and tighten up the diagnostic wording
a little.

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

12 years agoCurrently __builtin_annotation() only annotates an i32.
Julien Lerouge [Sat, 28 Apr 2012 17:39:16 +0000 (17:39 +0000)]
Currently __builtin_annotation() only annotates an i32.

        i32 __builtin_annotation(i32, string);

Applying it to i64 (e.g., long long) generates the following IR.

        trunc i64 {{.*}} to i32
        call i32 @llvm.annotation.i32
        zext i32 {{.*}} to i64

The redundant truncation and extension make the result difficult to use.

This patch makes __builtin_annotation() generic.

        type __builtin_annotation(type, string);

For the i64 example, it simplifies the generated IR to:

        call i64 @llvm.annotation.i64

Patch by Xi Wang!

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

12 years agoimprove error recovery for extra ')'s after a if/switch/while condition. Before:
Chris Lattner [Sat, 28 Apr 2012 16:24:20 +0000 (16:24 +0000)]
improve error recovery for extra ')'s after a if/switch/while condition.  Before:

t.c:3:9: error: expected expression
  if (x)) {
        ^

.. which isn't even true - a statement or expression is fine.  After:

t.c:3:9: error: extraneous ')' after condition, expected a statement
  if (x)) {
        ^

This is the second part of PR12595

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

12 years agoswitch some uses of ExpectAndConsume(tok::semi to use ExpectAndConsumeSemi. This...
Chris Lattner [Sat, 28 Apr 2012 16:12:17 +0000 (16:12 +0000)]
switch some uses of ExpectAndConsume(tok::semi to use ExpectAndConsumeSemi.  This allows
us to improve this diagnostic (telling us to insert another ")":

t.c:2:19: error: expected ';' at end of declaration
  int x = 4+(5-12));
                  ^
                  ;
to:
t.c:2:19: error: extraneous ')' before ';'
  int x = 4+(5-12));
                  ^

...telling us to remove the ")".  This is PR12595.  There are more uses of ExpectAndConsumeSemi
that could be switched over, but I don't hit them on a daily basis :)

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

12 years agoisCXX98PODType: Avoid dispatch on the language standard when recursing.
Benjamin Kramer [Sat, 28 Apr 2012 13:37:45 +0000 (13:37 +0000)]
isCXX98PODType: Avoid dispatch on the language standard when recursing.

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

12 years agoC++11 weakens the requirement for types used with offsetof from POD to standard layou...
Benjamin Kramer [Sat, 28 Apr 2012 11:14:51 +0000 (11:14 +0000)]
C++11 weakens the requirement for types used with offsetof from POD to standard layout type.

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

12 years agoRename isPODType (using the C++98 rules) into isCXX98PODType and make isPODType decid...
Benjamin Kramer [Sat, 28 Apr 2012 10:00:42 +0000 (10:00 +0000)]
Rename isPODType (using the C++98 rules) into isCXX98PODType and make isPODType decide which one to use based on LangOptions.

- -Wc++98-compat depends on the c++98 definition
- Now __is_pod returns the right thing in c++11 and c++98 mode
- All changes to the type traits test are validated against g++ 4.7

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

12 years agoRevert "Use the C++11 definition of PODness for __is_pod in C++11 mode."
Benjamin Kramer [Sat, 28 Apr 2012 10:00:33 +0000 (10:00 +0000)]
Revert "Use the C++11 definition of PODness for __is_pod in C++11 mode."

This is just papering over a major bug in isPODType, real fix coming up soon.

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

12 years agoUse the C++11 definition of PODness for __is_pod in C++11 mode.
Benjamin Kramer [Sat, 28 Apr 2012 09:07:58 +0000 (09:07 +0000)]
Use the C++11 definition of PODness for __is_pod in C++11 mode.

Keep the old definition for C++98 so we don't break tr1::is_pod.

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

12 years ago[analyzer] Remove references to idx::TranslationUnit. Index is dead, cross-TU inlinin...
Jordy Rose [Sat, 28 Apr 2012 01:58:08 +0000 (01:58 +0000)]
[analyzer] Remove references to idx::TranslationUnit. Index is dead, cross-TU inlining never panned out.

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

12 years agoMake the diagnostic for "unexpected ':' in nested name specifier" a bit easier on...
Nico Weber [Fri, 27 Apr 2012 22:50:22 +0000 (22:50 +0000)]
Make the diagnostic for "unexpected ':' in nested name specifier" a bit easier on the eyes.

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

12 years agoobjective-c modern translator: Correctly translate
Fariborz Jahanian [Fri, 27 Apr 2012 22:48:54 +0000 (22:48 +0000)]
objective-c modern translator: Correctly translate
nonfragile ivar access code when ivar type is a
locally defined struct/union type. // rdar://11323187

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

12 years agoWhen @encode'ing a C++ class that has empty base classes, we can end
Douglas Gregor [Fri, 27 Apr 2012 22:30:01 +0000 (22:30 +0000)]
When @encode'ing a C++ class that has empty base classes, we can end
up with gaps when the class inherits from the same empty base class
more than once. Fixes <rdar://problem/11324167>.

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

12 years agoBump up the MaxDepth in the BalancedDelimiterTracker.
Chad Rosier [Fri, 27 Apr 2012 22:14:13 +0000 (22:14 +0000)]
Bump up the MaxDepth in the BalancedDelimiterTracker.

The Avida Project (http://avida.devosoft.org) exceeds the 256 limit.
rdar://11289131

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

12 years agomodern objective-c translator: _OBJC_PROTOCOL_REFERENCE_*
Fariborz Jahanian [Fri, 27 Apr 2012 21:39:49 +0000 (21:39 +0000)]
modern objective-c translator: _OBJC_PROTOCOL_REFERENCE_*
symbols should be static. // rdar://11337074

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

12 years ago[driver] Don't try to set the deployment target when there is no bound
Chad Rosier [Fri, 27 Apr 2012 19:51:11 +0000 (19:51 +0000)]
[driver] Don't try to set the deployment target when there is no bound
architecture; this was happening for tools such as lipo and dsymutil.
Also, if no -arch option has been specified, set the architecture based
on the TC default.
rdar://11329656

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

12 years agoPR12224 (sort of): Diagnose inheriting constructor declarations in C++11 mode.
Richard Smith [Fri, 27 Apr 2012 19:33:05 +0000 (19:33 +0000)]
PR12224 (sort of): Diagnose inheriting constructor declarations in C++11 mode.
We do not support IRGen for these, and get some parts of the semantic analysis
wrong.

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

12 years agoImrpove the note text for when a non-type decl hides a tag type
Kaelyn Uhrain [Fri, 27 Apr 2012 18:26:49 +0000 (18:26 +0000)]
Imrpove the note text for when a non-type decl hides a tag type

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

12 years agoFix logic such that we only call getToolChain once. No functional change
Chad Rosier [Fri, 27 Apr 2012 16:50:38 +0000 (16:50 +0000)]
Fix logic such that we only call getToolChain once.  No functional change
intended.

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

12 years agoRemove redundant calls to BAA->getArchName(). No functional change
Chad Rosier [Fri, 27 Apr 2012 16:48:16 +0000 (16:48 +0000)]
Remove redundant calls to BAA->getArchName().  No functional change
intended.

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

12 years agoRevert 155679; Not a typo.
Chad Rosier [Fri, 27 Apr 2012 14:58:16 +0000 (14:58 +0000)]
Revert 155679; Not a typo.

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

12 years agoUse enum to set debug info size generated by Clang
Alexey Samsonov [Fri, 27 Apr 2012 07:24:20 +0000 (07:24 +0000)]
Use enum to set debug info size generated by Clang

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

12 years agoUse a deque instead of an ImmutableList in AnalysisConsumer to preserve the file...
Ted Kremenek [Fri, 27 Apr 2012 04:54:28 +0000 (04:54 +0000)]
Use a deque instead of an ImmutableList in AnalysisConsumer to preserve the file order that functions are visited.  Should fix the buildbots.

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

12 years agotest/Rewriter: Mark 4 tests as XFAIL:mingw32, due to predefined __declspec(a) issue.
NAKAMURA Takumi [Fri, 27 Apr 2012 04:36:34 +0000 (04:36 +0000)]
test/Rewriter: Mark 4 tests as XFAIL:mingw32, due to predefined __declspec(a) issue.

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

12 years agotest/Driver/fast-math.c: Mark this as XFAIL:cygming. They use gcc driver for as.
NAKAMURA Takumi [Fri, 27 Apr 2012 04:36:27 +0000 (04:36 +0000)]
test/Driver/fast-math.c: Mark this as XFAIL:cygming. They use gcc driver for as.

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

12 years agoAdd test case for rdar://11293995
Argyrios Kyrtzidis [Fri, 27 Apr 2012 04:31:46 +0000 (04:31 +0000)]
Add test case for rdar://11293995

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

12 years agoAdd a missing check in CodeGen of packed classes with vtables. <rdar://problem/11324...
Eli Friedman [Fri, 27 Apr 2012 02:34:46 +0000 (02:34 +0000)]
Add a missing check in CodeGen of packed classes with vtables.  <rdar://problem/11324125>.

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

12 years agoThe release notes are no place for modesty.
Richard Smith [Fri, 27 Apr 2012 00:40:44 +0000 (00:40 +0000)]
The release notes are no place for modesty.

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

12 years agoChange FunctionSummary.h's definition of SetOfDecls to be an ImmutableList instead
Ted Kremenek [Fri, 27 Apr 2012 00:38:33 +0000 (00:38 +0000)]
Change FunctionSummary.h's definition of SetOfDecls to be an ImmutableList instead
of a mutable SmallPtrSet.  While iterating over LocalTUDecls, there were cases
where we could modify LocalTUDecls, which could result in invalidating an iterator
and an analyzer crash.  Along the way, switch some uses of std::queue to std::dequeue,
which should be slightly more efficient.

Unfortunately, this is a difficult case to create a test case for.

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

12 years agoTypo.
Chad Rosier [Fri, 27 Apr 2012 00:35:50 +0000 (00:35 +0000)]
Typo.

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

12 years agoAdd note to help explain why a tag such as 'struct' is needed to refer
Kaelyn Uhrain [Thu, 26 Apr 2012 23:36:17 +0000 (23:36 +0000)]
Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with
the same name.

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

12 years agomodern objective-c transltion: Fixes a translation bug
Fariborz Jahanian [Thu, 26 Apr 2012 23:20:25 +0000 (23:20 +0000)]
modern objective-c transltion: Fixes a translation bug
of writing a __block variable being initialized with
a constructed object. // rdar://11326988

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

12 years agoAdd a missing ExpressionEvaluationContext for template default arguments. Fixes...
Eli Friedman [Thu, 26 Apr 2012 22:43:24 +0000 (22:43 +0000)]
Add a missing ExpressionEvaluationContext for template default arguments.  Fixes PR12581.

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

12 years agoRemove svn:eol-style from the test I just added. Sorry :-/
Nico Weber [Thu, 26 Apr 2012 21:43:56 +0000 (21:43 +0000)]
Remove svn:eol-style from the test I just added. Sorry :-/

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

12 years agoRevert r154981, because it caused PR12674.
Nico Weber [Thu, 26 Apr 2012 21:39:46 +0000 (21:39 +0000)]
Revert r154981, because it caused PR12674.

Add a test for PR12674.

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

12 years agoTest case for previosu patch.
Fariborz Jahanian [Thu, 26 Apr 2012 21:34:02 +0000 (21:34 +0000)]
Test case for previosu patch.
// rdar://11323676

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

12 years agoobjective-c IRGen. Fixes a getter synthesis bug
Fariborz Jahanian [Thu, 26 Apr 2012 21:33:14 +0000 (21:33 +0000)]
objective-c IRGen. Fixes a getter synthesis bug
where getter type is super class of its property
type, resulting in an assert. // rdar://11323676

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

12 years agoFix a bug with block layout when the block contains something
John McCall [Thu, 26 Apr 2012 21:14:42 +0000 (21:14 +0000)]
Fix a bug with block layout when the block contains something
more aligned than the block header but also contains something
smaller than the block-header alignment but not exactly half
the difference between the large alignment and the header
alignment.  Got that?

I'm really not sure what I was thinking with the buggy computation
here, but the fix is pretty obvious.

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

12 years agoFix file name in comment.
David Blaikie [Thu, 26 Apr 2012 20:39:46 +0000 (20:39 +0000)]
Fix file name in comment.

Patch by Yang Chen.

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

12 years agoMIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.
Simon Atanasyan [Thu, 26 Apr 2012 19:57:02 +0000 (19:57 +0000)]
MIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.

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

12 years ago[PCH] In ASTReader::completeVisibleDeclsMap, after we loaded all visible decls, mark
Argyrios Kyrtzidis [Thu, 26 Apr 2012 18:34:14 +0000 (18:34 +0000)]
[PCH] In ASTReader::completeVisibleDeclsMap, after we loaded all visible decls, mark
the declaration context as not having external visible storage any more.

This should improve performance as we won't needlessly reload the visible decls multiple times
and seems to fix the i386 crash in rdar://11327522.

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

12 years agoFix a crash-on-invalid where the constant evaluator would try to
John McCall [Thu, 26 Apr 2012 18:10:01 +0000 (18:10 +0000)]
Fix a crash-on-invalid where the constant evaluator would try to
evaluate certain expressions involving invalidly-defined classes.

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

12 years agoRemove the group from -fhonor_infinites/-fno_honor_infinites aliases. Aliases
Chad Rosier [Thu, 26 Apr 2012 16:53:12 +0000 (16:53 +0000)]
Remove the group from -fhonor_infinites/-fno_honor_infinites aliases.  Aliases
with groups are unsupported.
rdar://11324283

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

12 years agoDefine __ANDROID__ macro on -androideabi targets.
Evgeniy Stepanov [Thu, 26 Apr 2012 12:08:09 +0000 (12:08 +0000)]
Define __ANDROID__ macro on -androideabi targets.

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

12 years agoAdds a tutorial on how to write RAV based ASTFrontendActions.
Manuel Klimek [Thu, 26 Apr 2012 08:49:54 +0000 (08:49 +0000)]
Adds a tutorial on how to write RAV based ASTFrontendActions.

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

12 years agoReverted unintentional commit.
Manuel Klimek [Thu, 26 Apr 2012 08:46:12 +0000 (08:46 +0000)]
Reverted unintentional commit.

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

12 years agoMIPS: Add tests to check the debian multiarch stuff for mips and mipsel targets.
Simon Atanasyan [Thu, 26 Apr 2012 08:35:58 +0000 (08:35 +0000)]
MIPS: Add tests to check the debian multiarch stuff for mips and mipsel targets.

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

12 years agoAdds a small tutorial on how to write RAV based ASTFrontendActions.
Manuel Klimek [Thu, 26 Apr 2012 08:35:39 +0000 (08:35 +0000)]
Adds a small tutorial on how to write RAV based ASTFrontendActions.

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

12 years agoEnable AVX/AVX2 for Sandy Bridge, Ivy Bridge, and Haswell CPUs.
Craig Topper [Thu, 26 Apr 2012 07:31:30 +0000 (07:31 +0000)]
Enable AVX/AVX2 for Sandy Bridge, Ivy Bridge, and Haswell CPUs.

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

12 years agoUpdate checker build link, and remove stale links.
Ted Kremenek [Thu, 26 Apr 2012 07:29:14 +0000 (07:29 +0000)]
Update checker build link, and remove stale links.

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

12 years agoPR12647: An alias template instantiation which occurs in a SFINAE context is
Richard Smith [Thu, 26 Apr 2012 07:24:08 +0000 (07:24 +0000)]
PR12647: An alias template instantiation which occurs in a SFINAE context is
itself a SFINAE context.

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

12 years ago[analyzer] check lazy bindings in RegionStore first before looking for default values...
Ted Kremenek [Thu, 26 Apr 2012 05:08:26 +0000 (05:08 +0000)]
[analyzer] check lazy bindings in RegionStore first before looking for default values.  Fixes <rdar://problem/11269741>.

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

12 years agoTeach RetainCountChecker that it doesn't quite understand pthread_setspecific and...
Ted Kremenek [Thu, 26 Apr 2012 04:32:23 +0000 (04:32 +0000)]
Teach RetainCountChecker that it doesn't quite understand pthread_setspecific and it should just give up when it sees it.  Fixes <rdar://problem/11282706>.

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

12 years agoPR12660: Don't crash when initializing a const reference from a braced init list
Richard Smith [Thu, 26 Apr 2012 03:16:45 +0000 (03:16 +0000)]
PR12660: Don't crash when initializing a const reference from a braced init list
which creates a temporary by calling a constructor.

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

12 years agoFix a long-standing bug where Clang had a different default from GCC on
Chandler Carruth [Thu, 26 Apr 2012 02:10:51 +0000 (02:10 +0000)]
Fix a long-standing bug where Clang had a different default from GCC on
Linux and other (non-Darwin) platforms and have it use -fmath-errno by
default (for better or worse).

Darwin has seen the light here and uses -fno-math-errno by default, this
patch preserves that.

If any maintainers for a non-Linux platform would also like to opt-in to
-fno-math-errno by default, I'm happy to add folks, but we're currently
getting buts and misleading comparisons with GCC due to this difference
in behavior on Linux at least.

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

12 years agoTwo missing -Wc++98-compat warnings, for null pointers as non-type template
Richard Smith [Thu, 26 Apr 2012 01:51:03 +0000 (01:51 +0000)]
Two missing -Wc++98-compat warnings, for null pointers as non-type template
arguments, and 'this' in exception-specifications.

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

12 years agoReject cases like
Rafael Espindola [Thu, 26 Apr 2012 01:26:03 +0000 (01:26 +0000)]
Reject cases like

struct __attribute__((visibility("hidden"))) a;
struct __attribute__((visibility("default"))) b;

which gcc already rejects.

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

12 years agoIf a type is non-literal by virtue of being incomplete produce notes
Richard Smith [Wed, 25 Apr 2012 23:23:48 +0000 (23:23 +0000)]
If a type is non-literal by virtue of being incomplete produce notes
explaining that.

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

12 years agoRecursiveASTVisitor: When in 'shouldVisitTemplateInstantiations' mode, visit
Richard Smith [Wed, 25 Apr 2012 22:57:25 +0000 (22:57 +0000)]
RecursiveASTVisitor: When in 'shouldVisitTemplateInstantiations' mode, visit
all instantiations of a template when we visit the canonical declaration of the
primary template, rather than trying to match them up to the partial
specialization from which they are instantiated. This fixes a bug where we
failed to visit instantiations of partial specializations of member templates of
class templates, and naturally extends to allow us to visit instantiations where
we have instantiated only a declaration.

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

12 years agoTypo.
Chad Rosier [Wed, 25 Apr 2012 22:51:41 +0000 (22:51 +0000)]
Typo.

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

12 years agoobjective-c modern translator: more tests.
Fariborz Jahanian [Wed, 25 Apr 2012 20:48:00 +0000 (20:48 +0000)]
objective-c modern translator: more tests.

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

12 years agoAdd an error message with fixit hint for changing '.' to '->'.
Kaelyn Uhrain [Wed, 25 Apr 2012 19:49:54 +0000 (19:49 +0000)]
Add an error message with fixit hint for changing '.' to '->'.

This is mainly for attempting to recover in cases where a class provides
a custom operator-> and a '.' was accidentally used instead of '->' when
accessing a member of the object returned by the current object's
operator->.

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

12 years agoWhen resolving default template arguments, it should be done in the declaration context
Argyrios Kyrtzidis [Wed, 25 Apr 2012 18:39:17 +0000 (18:39 +0000)]
When resolving default template arguments, it should be done in the declaration context
of the template what we are going to instantiate.

Fixes various crashes of rdar://11242625 & http://llvm.org/PR11421.

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

12 years agoPR12625: Cope with classes which have incomplete base or member types:
Richard Smith [Wed, 25 Apr 2012 18:28:49 +0000 (18:28 +0000)]
PR12625: Cope with classes which have incomplete base or member types:
Don't try to query whether an incomplete type has a trivial copy constructor
when determining whether a move constructor should be declared.

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

12 years agoUse a SmallMap for StoredDeclsMap, it's usually sparsely populated so we can avoid...
Benjamin Kramer [Wed, 25 Apr 2012 18:21:27 +0000 (18:21 +0000)]
Use a SmallMap for StoredDeclsMap, it's usually sparsely populated so we can avoid initializing memory for 64 buckets.

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

12 years agoConvert a std::map that usually has between 0 and 10 elements to SmallMap.
Benjamin Kramer [Wed, 25 Apr 2012 18:21:21 +0000 (18:21 +0000)]
Convert a std::map that usually has between 0 and 10 elements to SmallMap.

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

12 years agoimprove a modern objc translator test.
Fariborz Jahanian [Wed, 25 Apr 2012 18:11:57 +0000 (18:11 +0000)]
improve a modern objc translator test.

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

12 years agomodern objc rewriter: fixes a bug writing
Fariborz Jahanian [Wed, 25 Apr 2012 17:56:48 +0000 (17:56 +0000)]
modern objc rewriter: fixes a bug writing
a const qualified static c-function.
// rdar://11314329

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

12 years agoAdds documentation for how to use the tooling library.
Manuel Klimek [Wed, 25 Apr 2012 14:20:13 +0000 (14:20 +0000)]
Adds documentation for how to use the tooling library.

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

12 years agoAdds a document describing the various tooling approaches and their pros and
Manuel Klimek [Wed, 25 Apr 2012 13:57:00 +0000 (13:57 +0000)]
Adds a document describing the various tooling approaches and their pros and
cons.

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

12 years agoMake asan-ld test windows-safe.
Evgeniy Stepanov [Wed, 25 Apr 2012 09:28:10 +0000 (09:28 +0000)]
Make asan-ld test windows-safe.

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

12 years agoFixes the header search logic for tools:
Manuel Klimek [Wed, 25 Apr 2012 09:25:41 +0000 (09:25 +0000)]
Fixes the header search logic for tools:
The driver needs to get the correct path to the executable to deduce
the header search path.

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

12 years agoClang driver support for linking on Android.
Evgeniy Stepanov [Wed, 25 Apr 2012 08:59:22 +0000 (08:59 +0000)]
Clang driver support for linking on Android.

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

12 years agoFix default cpu for -march=armv5e.
Evgeniy Stepanov [Wed, 25 Apr 2012 08:35:56 +0000 (08:35 +0000)]
Fix default cpu for -march=armv5e.

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

12 years agoOpenBSD: Remove incorrect -pthread preprocessor define _POSIX_THREADS and replace
Chris Lattner [Wed, 25 Apr 2012 06:12:24 +0000 (06:12 +0000)]
OpenBSD: Remove incorrect -pthread preprocessor define _POSIX_THREADS and replace
with _REENTRANT. Also remove undef _POSIX_THREADS in phread.h.

Patch by Brad Smith!

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

12 years agodon't use soname on OpenBSD, it doesn't support it. Patch by
Chris Lattner [Wed, 25 Apr 2012 06:09:30 +0000 (06:09 +0000)]
don't use soname on OpenBSD, it doesn't support it.  Patch by
Brad Smith!

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

12 years agoExpand #include_next in float.h from mingw to _msc_ver.
Nico Weber [Tue, 24 Apr 2012 23:43:40 +0000 (23:43 +0000)]
Expand #include_next in float.h from mingw to _msc_ver.

A test for this is checking if this compiles:

    #include <float.h>

    inline bool IsFinite(const double& number) {
     return _finite(number) != 0;
    }

That depends however on either mingw or msvc being installed, and
chapuni tells me there might be issues with float.h on mingw, so
no automated test is added.

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

12 years agoAdd acos, asin, ceil, fabs, floor, fmax, fmin, round, and tan to the builtin
Chad Rosier [Tue, 24 Apr 2012 23:06:26 +0000 (23:06 +0000)]
Add acos, asin, ceil, fabs, floor, fmax, fmin, round, and tan to the builtin
math library functions.
rdar://11251464

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