]> granicus.if.org Git - clang/log
clang
12 years agoThread safety analysis: additional support for smart pointers in lock expressions.
DeLesley Hutchins [Wed, 2 May 2012 22:18:42 +0000 (22:18 +0000)]
Thread safety analysis: additional support for smart pointers in lock expressions.

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

12 years agoFix some doxycomments using \class instead of \brief.
David Blaikie [Wed, 2 May 2012 21:58:03 +0000 (21:58 +0000)]
Fix some doxycomments using \class instead of \brief.

Patches by Csaba Raduly (rcsaba@gmail.com)

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

12 years ago[python] Add testcase for annotation cursor
Anders Waldenborg [Wed, 2 May 2012 21:28:34 +0000 (21:28 +0000)]
[python] Add testcase for annotation cursor

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

12 years ago[python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValue
Anders Waldenborg [Wed, 2 May 2012 20:57:33 +0000 (20:57 +0000)]
[python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValue

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

12 years agoWalk the decls looking for the last one that has an attribute. We do have to walk
Rafael Espindola [Wed, 2 May 2012 20:36:57 +0000 (20:36 +0000)]
Walk the decls looking for the last one that has an attribute. We do have to walk
them, otherwise we cannot produce an error for both

struct HIDDEN test4; // canonical
struct test4;
struct DEFAULT test4;

and

struct test5; // canonical
struct HIDDEN test5;
struct DEFAULT test5;

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

12 years ago[python] Add testcase for enum with specified underlaying type
Anders Waldenborg [Wed, 2 May 2012 19:39:46 +0000 (19:39 +0000)]
[python] Add testcase for enum with specified underlaying type

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

12 years ago[python] Run tests for c++ with std=c++11
Anders Waldenborg [Wed, 2 May 2012 19:37:16 +0000 (19:37 +0000)]
[python] Run tests for c++ with std=c++11

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

12 years ago[python] Fix warning in c-code inside testcase
Anders Waldenborg [Wed, 2 May 2012 19:35:37 +0000 (19:35 +0000)]
[python] Fix warning in c-code inside testcase

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

12 years agoThread Safety Analysis: fixed attribute handling for lock_returned attribute.
DeLesley Hutchins [Wed, 2 May 2012 17:38:37 +0000 (17:38 +0000)]
Thread Safety Analysis: fixed attribute handling for lock_returned attribute.

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

12 years agoModern objective-c translation: Fixing couple of bugs
Fariborz Jahanian [Wed, 2 May 2012 17:34:59 +0000 (17:34 +0000)]
Modern objective-c translation: Fixing couple of bugs
related to laying out ivar structs and accessing non-fragile-ivar
in more compilated cases. // rdar://11323187

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

12 years agoReplace the StringSwitch in AttributeList::getKind() with a
Douglas Gregor [Wed, 2 May 2012 17:33:51 +0000 (17:33 +0000)]
Replace the StringSwitch in AttributeList::getKind() with a
TableGen-generated StringMatcher, for a 1.2% speedup in -fparse-only
time in <rdar://problem/11004361>. Thanks to Benjamin for pointing me
at StringMatcher!

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

12 years agoIntroduce the notion of 'ignored' attributes, so that all attributes
Douglas Gregor [Wed, 2 May 2012 16:18:45 +0000 (16:18 +0000)]
Introduce the notion of 'ignored' attributes, so that all attributes
we accept are not modeled somehow via Attr.td.

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

12 years agoIntroduce the notion of an attribute that has no direct representation
Douglas Gregor [Wed, 2 May 2012 15:56:52 +0000 (15:56 +0000)]
Introduce the notion of an attribute that has no direct representation
as an AST node, and fold a number of such attributes into Attr.td.

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

12 years agoFix same line doxycomments so they comment the adjacent field.
David Blaikie [Wed, 2 May 2012 15:24:47 +0000 (15:24 +0000)]
Fix same line doxycomments so they comment the adjacent field.

Without the '<' prefix in the doxycomment these comments were incorrectly
attached to the proceeding comment on the next line, rather than the
preceeding one.

Fixes PR12722

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

12 years agoImplement the alternate spellings of attributes aligned (as "align")
Douglas Gregor [Wed, 2 May 2012 15:16:13 +0000 (15:16 +0000)]
Implement the alternate spellings of attributes aligned (as "align")
and const (as "__const") using tblgen, rather than explicitly hacking
them in.

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

12 years agoDriver: Turn the default value for -fmath-errno into a proper target hook and disable...
Benjamin Kramer [Wed, 2 May 2012 14:55:48 +0000 (14:55 +0000)]
Driver: Turn the default value for -fmath-errno into a proper target hook and disable it by default on more platforms.

For now -fno-math-errno is the default on BSD-derived platforms (Darwin,
DragonFlyBSD, FreeBSD, NetBSD, OpenBSD). If the default is not right for
your platform, please yell. I only verified the result with the default
compilers on Darwin and FreeBSD.

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

12 years agoRevert my optimization to AttributeList::getKind() in r155987;
Douglas Gregor [Wed, 2 May 2012 14:50:50 +0000 (14:50 +0000)]
Revert my optimization to AttributeList::getKind() in r155987;
Benjamin has suggested a better approach.

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

12 years agoReplace a ConsumeAnyToken() call with ConsumeToken() when we know
Douglas Gregor [Wed, 2 May 2012 14:34:16 +0000 (14:34 +0000)]
Replace a ConsumeAnyToken() call with ConsumeToken() when we know
we're looking at a normal token. Tiny positive impact -fsyntax-only
time for <rdar://problem/11004361>.

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

12 years agoReplace the StringSwitch in AttributeList::getKind(const
Douglas Gregor [Wed, 2 May 2012 14:24:30 +0000 (14:24 +0000)]
Replace the StringSwitch in AttributeList::getKind(const
IdentifierInfo *) with a static StringMap, improving -fsyntax-only
performance by 1% for the example in <rdar://problem/11004361>.

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

12 years agoFix forwarding of -fpack-struct from driver to CC1, and add a test.
James Molloy [Wed, 2 May 2012 07:56:14 +0000 (07:56 +0000)]
Fix forwarding of -fpack-struct from driver to CC1, and add a test.

-fpack-struct's handling has changed in CC1 (one of only two flags that needed changing) because the driver treats "-fpack-struct" as a boolean flag, and CC1 (did) treat it as an option with a separated value.

This change causes -fpack-struct=X to be forwarded correctly to -fpack-struct=X instead of erroneously to "-fpack-struct X"

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

12 years agoDon't try to instantiate std::list at an incomplete type; it's not
John McCall [Wed, 2 May 2012 05:44:20 +0000 (05:44 +0000)]
Don't try to instantiate std::list at an incomplete type;  it's not
allowed, and it'll blow up in unfortunate ways when using a proper
C++11 library.

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

12 years agoFix cmake. Remaining two ClangCC1Options deps.
Andrew Trick [Wed, 2 May 2012 05:31:31 +0000 (05:31 +0000)]
Fix cmake. Remaining two ClangCC1Options deps.

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

12 years agoDisable our non-standard delayed parsing of exception specifications. Delaying
Richard Smith [Wed, 2 May 2012 01:29:43 +0000 (01:29 +0000)]
Disable our non-standard delayed parsing of exception specifications. Delaying
the parsing of such things appears to be a conforming extension, but it breaks
libstdc++4.7's std::pair.

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

12 years agoSpeculatively fix windows cmake builders.
Andrew Trick [Wed, 2 May 2012 01:23:51 +0000 (01:23 +0000)]
Speculatively fix windows cmake builders.

Really just a wild stab in the dark.

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

12 years agoRefine analyzer diagnostics by adding an expression "cone-of-influence" to reverse...
Ted Kremenek [Wed, 2 May 2012 00:31:29 +0000 (00:31 +0000)]
Refine analyzer diagnostics by adding an expression "cone-of-influence" to reverse track interesting
values through interesting expressions.  This allows us to map from interesting values in a caller
to interesting values in a caller, thus recovering some precision in diagnostics lost from IPA.

Fixes <rdar://problem/11327497>

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

12 years agoUnrevert r155951, reverted in r155962, with two changes:
Richard Smith [Wed, 2 May 2012 00:30:48 +0000 (00:30 +0000)]
Unrevert r155951, reverted in r155962, with two changes:
 * Work around build failures due to gcc 4.2 bugs.
 * Remove BodyIndexer::TraverseCXXOperatorCallExpr, which was not being called
   prior to this change, and whose presence disables a RecursiveASTVisitor
   stack space optimization after this change.

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

12 years ago[analyzer] RetainRelease: Self assignment should not suppress a leak
Anna Zaks [Wed, 2 May 2012 00:15:40 +0000 (00:15 +0000)]
[analyzer] RetainRelease: Self assignment should not suppress a leak
warning.

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

12 years agoTry harder to recognize hidden tag type names in potential declarations instead
Kaelyn Uhrain [Wed, 2 May 2012 00:11:40 +0000 (00:11 +0000)]
Try harder to recognize hidden tag type names in potential declarations instead
of giving unhelpful errors about undeclared identifers and missing semicolons.

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

12 years ago[analyzer] Fix an assertion failure triggered by the analyzer buildbot.
Anna Zaks [Wed, 2 May 2012 00:05:23 +0000 (00:05 +0000)]
[analyzer] Fix an assertion failure triggered by the analyzer buildbot.

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

12 years ago[analyzer] Fix the 'ptr = ptr' false negative in the Malloc checker.
Anna Zaks [Wed, 2 May 2012 00:05:20 +0000 (00:05 +0000)]
[analyzer] Fix the 'ptr = ptr' false negative in the Malloc checker.

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

12 years agoRevert "Fix RecursiveASTVisitor's data recursion to call the Traverse* functions...
Andrew Trick [Tue, 1 May 2012 23:47:36 +0000 (23:47 +0000)]
Revert "Fix RecursiveASTVisitor's data recursion to call the Traverse* functions if they"

FAIL: Clang :: Index/index-many-call-ops.cpp

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

12 years agoEliminate Sema::CompareMethodParamsInBaseAndSuper() entirely, by
Douglas Gregor [Tue, 1 May 2012 23:37:00 +0000 (23:37 +0000)]
Eliminate Sema::CompareMethodParamsInBaseAndSuper() entirely, by
folding its one check into the normal path for checking overridden
Objective-C methods. Good for another 3.6% speedup on the test case in
<rdar://problem/11004361>.

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

12 years agoThe semantic checking that verifies whether an Objective-C method
Douglas Gregor [Tue, 1 May 2012 23:07:34 +0000 (23:07 +0000)]
The semantic checking that verifies whether an Objective-C method
declared in a subclass has consistent parameter types with a method
having the same selector in a superclass performs a significant number
of lookups into the class hierarchy. In the example in
<rdar://problem/11004361>, we spend 4.7% of -fsyntax-only time in
these lookups.

Optimize away most of the calls to this routine
(Sema::CompareMethodParamsInBaseAndSuper) by first checking whether we
have ever seen *any* method with that selector (using the global
selector table). Since most selectors are unique, we can avoid the
cost of this name lookup in many cases, for a 3.3% speedup.

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

12 years agoAdd a missing RequireCompleteType call when synthesizing properties. <rdar://problem...
Eli Friedman [Tue, 1 May 2012 22:26:06 +0000 (22:26 +0000)]
Add a missing RequireCompleteType call when synthesizing properties.  <rdar://problem/11333367>.

While I'm here, fix source locations for other diagnostics related to property synthesis.

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

12 years agoUtilize getLocStart()/getLocEnd() on my recent change.
Argyrios Kyrtzidis [Tue, 1 May 2012 22:19:11 +0000 (22:19 +0000)]
Utilize getLocStart()/getLocEnd() on my recent change.

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

12 years agoFix RecursiveASTVisitor's data recursion to call the Traverse* functions if they
Richard Smith [Tue, 1 May 2012 21:58:31 +0000 (21:58 +0000)]
Fix RecursiveASTVisitor's data recursion to call the Traverse* functions if they
have been overridden in the derived class. Also, remove a non-functional
implementation of an incorrect optimization for ParenExprs.

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

12 years agoTeach SValBuilder to handle casts of symbolic pointer values to an integer twice...
Ted Kremenek [Tue, 1 May 2012 21:58:29 +0000 (21:58 +0000)]
Teach SValBuilder to handle casts of symbolic pointer values to an integer twice.  Fixes <rdar://problem/11212866>.

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

12 years agoClean up changes suggested by Douglas Gregor:
Patrick Beard [Tue, 1 May 2012 21:47:19 +0000 (21:47 +0000)]
Clean up changes suggested by Douglas Gregor:

BuildObjCNumericLiteral() and BuildObjCBoxedExpr() now both using
PerformCopyInitialization() rather than PerformImplicitConversion(),
which suppresses errors.

In BuildObjCBoxedExpr(): no longer calling .getCanonicalType(),
ValueType->getAs() will remove the minimal amount of sugar.
Using ValueType->isBuiltinType() instead of isa<BuiltinType>(ValueType).

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

12 years agoFix test cases broken by 155936.
David Blaikie [Tue, 1 May 2012 21:29:03 +0000 (21:29 +0000)]
Fix test cases broken by 155936.

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

12 years ago[analyzer] Test case reported for a reported false positive, now fixed.
Anna Zaks [Tue, 1 May 2012 21:10:29 +0000 (21:10 +0000)]
[analyzer] Test case reported for a reported false positive, now fixed.

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

12 years ago[analyzer] Construct a SymExpr even when the constraint solver cannot
Anna Zaks [Tue, 1 May 2012 21:10:26 +0000 (21:10 +0000)]
[analyzer] Construct a SymExpr even when the constraint solver cannot
reason about the expression.

This essentially keeps more history about how symbolic values were
constructed. As an optimization, previous to this commit, we only kept
the history if one of the symbols was tainted, but it's valuable keep
the history around for other purposes as well: it allows us to avoid
constructing conjured symbols.

Specifically, we need to identify the value of ptr as
ElementRegion (result of pointer arithmetic) in the following code.
However, before this commit '(2-x)' evaluated to Unknown value, and as
the result, 'p + (2-x)' evaluated to Unknown value as well.

int *p = malloc(sizeof(int));
ptr = p + (2-x);

This change brings 2% slowdown on sqlite. Fixes radar://11329382.

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

12 years agoExtend the error about incompatible visibility attributes in different
Rafael Espindola [Tue, 1 May 2012 20:58:29 +0000 (20:58 +0000)]
Extend the error about incompatible visibility attributes in different
decls to work on function templates specializations.

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

12 years agoWe don't need a lengthy quote from the wrong standard.
Douglas Gregor [Tue, 1 May 2012 20:44:16 +0000 (20:44 +0000)]
We don't need a lengthy quote from the wrong standard.

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

12 years agoAdd test cases for r155935.
Douglas Gregor [Tue, 1 May 2012 20:31:53 +0000 (20:31 +0000)]
Add test cases for r155935.

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

12 years agoRevert r155933
Douglas Gregor [Tue, 1 May 2012 20:30:48 +0000 (20:30 +0000)]
Revert r155933

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

12 years agoWorkaround a miscompile in 483.xalancbmk while we figure it out.
David Blaikie [Tue, 1 May 2012 20:28:45 +0000 (20:28 +0000)]
Workaround a miscompile in 483.xalancbmk while we figure it out.

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

12 years agoDuring block layout, after padding up to the max field alignment,
John McCall [Tue, 1 May 2012 20:28:00 +0000 (20:28 +0000)]
During block layout, after padding up to the max field alignment,
the alignment might actually exceed the max field alignment;  don't
assert in this case.

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

12 years agoDiagnostics should start with a lower-case letter.
Patrick Beard [Tue, 1 May 2012 20:27:10 +0000 (20:27 +0000)]
Diagnostics should start with a lower-case letter.

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

12 years agoIn C++11 mode, implement the C++11 semantics for
Douglas Gregor [Tue, 1 May 2012 20:23:02 +0000 (20:23 +0000)]
In C++11 mode, implement the C++11 semantics for
[basic.lookup.classref]p1 and p4, which concerns name lookup for
nested-name-specifiers and template names, respectively, in a member
access expression. C++98/03 forces us to look both in the scope of the
object and in the current scope, then compare the results. C++11 just
takes the result from the scope of the object, if something is
found. Fixes <rdar://problem/11328502>.

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

12 years agoFix CMake build
Douglas Gregor [Tue, 1 May 2012 20:08:24 +0000 (20:08 +0000)]
Fix CMake build

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

12 years agoTest verified.
John McCall [Tue, 1 May 2012 19:57:05 +0000 (19:57 +0000)]
Test verified.

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

12 years agoSpacing.
Chad Rosier [Tue, 1 May 2012 19:53:37 +0000 (19:53 +0000)]
Spacing.

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

12 years agoImplement simplify_type traits for redecl_iterator.
David Blaikie [Tue, 1 May 2012 19:49:42 +0000 (19:49 +0000)]
Implement simplify_type traits for redecl_iterator.

Based on Chandler Carruth's feedback on r155869.

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

12 years agoRemove variables made dead by r155923
David Blaikie [Tue, 1 May 2012 19:49:38 +0000 (19:49 +0000)]
Remove variables made dead by r155923

This makes Clang's build warning free again.

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

12 years agoGet rid of storelv4si builtin as it can be expressed directly. This is general
Chad Rosier [Tue, 1 May 2012 18:11:51 +0000 (18:11 +0000)]
Get rid of storelv4si builtin as it can be expressed directly.  This is general
goodness because it provides opportunites to cleanup things.  For example,

uint64_t t1(__m128i vA)
{
  uint64_t Alo;
  _mm_storel_epi64((__m128i*)&Alo, vA);
  return Alo;
}

was generating

movq %xmm0, -8(%rbp)
movq -8(%rbp), %rax

and now generates

movd %xmm0, %rax

rdar://11282581

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

12 years agoRemove dead code found by static analyzer.
Ted Kremenek [Tue, 1 May 2012 17:56:57 +0000 (17:56 +0000)]
Remove dead code found by static analyzer.

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

12 years agoPush variable declaration into nested scope (the only place where it is used). Found...
Ted Kremenek [Tue, 1 May 2012 17:56:53 +0000 (17:56 +0000)]
Push variable declaration into nested scope (the only place where it is used).  Found by static analyzer.

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

12 years agomodern objective-c translation of private ivars.
Fariborz Jahanian [Tue, 1 May 2012 17:46:45 +0000 (17:46 +0000)]
modern objective-c translation of private ivars.
// rdar://11351299

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

12 years agoRestructure some of the member-pointer tests, implicitly
John McCall [Tue, 1 May 2012 17:32:20 +0000 (17:32 +0000)]
Restructure some of the member-pointer tests, implicitly
removing some that were added without a triple (and moving
their tests into files that appropriately test multiple
architectures).

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

12 years agoUnify Options.td and CC1Options.td, in a first step towards unifying the serializatio...
James Molloy [Tue, 1 May 2012 14:57:16 +0000 (14:57 +0000)]
Unify Options.td and CC1Options.td, in a first step towards unifying the serialization logic in Frontend and Driver.

Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/

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

12 years agoMake some helper functions static.
Benjamin Kramer [Tue, 1 May 2012 14:34:11 +0000 (14:34 +0000)]
Make some helper functions static.

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

12 years agoclang/test/CodeGenCXX: Fix two tests, destructors.cpp and microsoft-abi-array-cookies...
NAKAMURA Takumi [Tue, 1 May 2012 11:13:04 +0000 (11:13 +0000)]
clang/test/CodeGenCXX: Fix two tests, destructors.cpp and microsoft-abi-array-cookies.cpp, for -Asserts.

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

12 years agoclang/test/Rewriter: Remove XFAIL and add -U__declspec to other 9 tests. mingw32...
NAKAMURA Takumi [Tue, 1 May 2012 10:52:06 +0000 (10:52 +0000)]
clang/test/Rewriter: Remove XFAIL and add -U__declspec to other 9 tests. mingw32 tends to define built-in __declspec.

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

12 years agoclang/test/Rewriter/rewrite-modern-extern-c-func-decl.mm: Remove XFAIL and add -U__de...
NAKAMURA Takumi [Tue, 1 May 2012 10:51:55 +0000 (10:51 +0000)]
clang/test/Rewriter/rewrite-modern-extern-c-func-decl.mm: Remove XFAIL and add -U__declspec. mingw32 tends to define built-in __declspec.

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

12 years agoAdd a disclaimer to the new test, plus a user-declared ctor
John McCall [Tue, 1 May 2012 08:59:06 +0000 (08:59 +0000)]
Add a disclaimer to the new test, plus a user-declared ctor
to force the emission of vtordisps.

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

12 years agoAdd support for laying out vtordisps according to our current
John McCall [Tue, 1 May 2012 08:55:32 +0000 (08:55 +0000)]
Add support for laying out vtordisps according to our current
working knowledge of the Microsoft ABI.  Based on a patch by
Dmitry Sokolov.

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

12 years agoFix compilation with mingw-w64.
Abramo Bagnara [Tue, 1 May 2012 08:38:19 +0000 (08:38 +0000)]
Fix compilation with mingw-w64.

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

12 years agoEnable AVX on AMD Bulldozer processors.
Craig Topper [Tue, 1 May 2012 07:18:03 +0000 (07:18 +0000)]
Enable AVX on AMD Bulldozer processors.

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

12 years agoAbstract the emission of global destructors into ABI-specific code
John McCall [Tue, 1 May 2012 06:13:13 +0000 (06:13 +0000)]
Abstract the emission of global destructors into ABI-specific code
and only consider using __cxa_atexit in the Itanium logic.  The
default logic is to use atexit().

Emit "guarded" initializers in Microsoft mode unconditionally.
This is definitely not correct, but it's closer to correct than
just not emitting the initializer.

Based on a patch by Timur Iskhodzhanov!

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

12 years agoPR12710 - broken default argument handling for templates.
David Blaikie [Tue, 1 May 2012 06:05:57 +0000 (06:05 +0000)]
PR12710 - broken default argument handling for templates.

I broke this in r155838 by not actually instantiating non-dependent default arg
expressions. The motivation for that change was to avoid producing duplicate
conversion warnings for such default args (we produce them once when we parse
the template - there's no need to produce them at each instantiation) but
without actually instantiating the default arg, things break in weird ways.

Technically, I think we could still get the right diagnostic experience without
the bugs if we instantiated the non-dependent args (for non-dependent params
only) immediately, rather than lazily. But I'm not sure if such a refactoring/
change would be desirable so here's the conservative fix for now.

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

12 years agoPlace several uncovered warnings under warning flags, and tweak diagnostic output...
Ted Kremenek [Tue, 1 May 2012 05:56:02 +0000 (05:56 +0000)]
Place several uncovered warnings under warning flags, and tweak diagnostic output including the term "gc" (in lowercase).

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

12 years agoRemove some not-very-stable assumptions from this testcase.
John McCall [Tue, 1 May 2012 05:29:32 +0000 (05:29 +0000)]
Remove some not-very-stable assumptions from this testcase.

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

12 years agoTeach RetainCountchecker about IORegistryEntrySearchCFProperty returning retained...
Ted Kremenek [Tue, 1 May 2012 05:28:27 +0000 (05:28 +0000)]
Teach RetainCountchecker about IORegistryEntrySearchCFProperty returning retained objects.  I know there is an SDK enhancement request for this to have the cf_returns_retained annotation, so this is just a stop gap.

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

12 years agoRefactor the C++ ABI code a little bit to take advantage of
John McCall [Tue, 1 May 2012 05:23:51 +0000 (05:23 +0000)]
Refactor the C++ ABI code a little bit to take advantage of
what I'm going to treat as basically universal properties of
array-cookie code.  Implement MS array cookies on top of that.
Based on a patch by Timur Iskhodzhanov!

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

12 years agoFix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.
David Blaikie [Tue, 1 May 2012 02:45:39 +0000 (02:45 +0000)]
Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.

Review by Doug Gregor.

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

12 years agoWhen mangling a synthetic function declaration, we might not have
John McCall [Tue, 1 May 2012 02:33:44 +0000 (02:33 +0000)]
When mangling a synthetic function declaration, we might not have
type-source information for its parameters.  Don't crash when
mangling them in the MS C++ ABI.  Patch by Timur Iskhodzhanov!

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

12 years agoRevert r155874.
Douglas Gregor [Tue, 1 May 2012 02:04:03 +0000 (02:04 +0000)]
Revert r155874.

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

12 years agoRemove the unused DestroyAttrs, noticed by Michael Han.
Douglas Gregor [Tue, 1 May 2012 01:56:29 +0000 (01:56 +0000)]
Remove the unused DestroyAttrs, noticed by Michael Han.

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

12 years agoTurn the mixed-sign-comparison diagnostic into a runtime behavior
Douglas Gregor [Tue, 1 May 2012 01:53:49 +0000 (01:53 +0000)]
Turn the mixed-sign-comparison diagnostic into a runtime behavior
diagnostic, from Eitan Adler!

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

12 years agoPrint inline for inline namespaces, from Faisal Vali
Douglas Gregor [Tue, 1 May 2012 01:43:38 +0000 (01:43 +0000)]
Print inline for inline namespaces, from Faisal Vali

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

12 years agoMove a non portable test to FileCheck, from Jonathan Gray!
Douglas Gregor [Tue, 1 May 2012 01:42:40 +0000 (01:42 +0000)]
Move a non portable test to FileCheck, from Jonathan Gray!

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

12 years agoMove warn_cxx0x_right_shift_in_template_arg to CXX11Compat group, from
Douglas Gregor [Tue, 1 May 2012 01:32:13 +0000 (01:32 +0000)]
Move warn_cxx0x_right_shift_in_template_arg to CXX11Compat group, from
Dmitri Gribenko!

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

12 years agoLet's use the correct bool this time.
Kaelyn Uhrain [Tue, 1 May 2012 01:17:53 +0000 (01:17 +0000)]
Let's use the correct bool this time.

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

12 years agoA couple of very small tweaks suggested by Doug in reply to r155580 and r155163.
Kaelyn Uhrain [Tue, 1 May 2012 01:16:25 +0000 (01:16 +0000)]
A couple of very small tweaks suggested by Doug in reply to r155580 and r155163.

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

12 years agoRemove ref/value inconsistency in redecl_iterator.
David Blaikie [Tue, 1 May 2012 00:48:43 +0000 (00:48 +0000)]
Remove ref/value inconsistency in redecl_iterator.

Similar to r155808 - this mistake has been made in a few iterators.

Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.

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

12 years agoMy first effort to do this more subtly failed, so elaborately
John McCall [Tue, 1 May 2012 00:38:49 +0000 (00:38 +0000)]
My first effort to do this more subtly failed, so elaborately
test for an invalid declaration at every single place in the
constant evaluator that's about to request a struct layout.

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

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