Граф коммитов

36629 Коммитов

Автор SHA1 Сообщение Дата
Benjamin Kramer 769aa2d46f 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
2012-05-02 14:55:48 +00:00
Douglas Gregor d6268ffe94 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
2012-05-02 14:50:50 +00:00
Douglas Gregor fb5825dca4 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
2012-05-02 14:34:16 +00:00
Douglas Gregor b6dd6055a4 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
2012-05-02 14:24:30 +00:00
James Molloy 8049c44d97 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
2012-05-02 07:56:14 +00:00
John McCall 3ecafe4d7d 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
2012-05-02 05:44:20 +00:00
Andrew Trick 6d89b4bcb2 Fix cmake. Remaining two ClangCC1Options deps.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 05:31:31 +00:00
Richard Smith 6deb820a1d 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
2012-05-02 01:29:43 +00:00
Andrew Trick 168d317818 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
2012-05-02 01:23:51 +00:00
Ted Kremenek 11abcecc8c 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
2012-05-02 00:31:29 +00:00
Richard Smith c8c222830a 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
2012-05-02 00:30:48 +00:00
Anna Zaks e7958da55e [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
2012-05-02 00:15:40 +00:00
Kaelyn Uhrain 12f3297fbe 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
2012-05-02 00:11:40 +00:00
Anna Zaks 2a6e30d9ec [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
2012-05-02 00:05:23 +00:00
Anna Zaks 93c5a24b51 [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
2012-05-02 00:05:20 +00:00
Andrew Trick b51c7f3fe6 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
2012-05-01 23:47:36 +00:00
Douglas Gregor ff310c763e 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
2012-05-01 23:37:00 +00:00
Douglas Gregor 8722ae8f60 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
2012-05-01 23:07:34 +00:00
Eli Friedman e4c043d3fd 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
2012-05-01 22:26:06 +00:00
Argyrios Kyrtzidis 3539b0c5a3 Utilize getLocStart()/getLocEnd() on my recent change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155952 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 22:19:11 +00:00
Richard Smith e3ba2987b9 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
2012-05-01 21:58:31 +00:00
Ted Kremenek 140d0c6441 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
2012-05-01 21:58:29 +00:00
Patrick Beard e0fdadfd51 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
2012-05-01 21:47:19 +00:00
David Blaikie d8a1361ab4 Fix test cases broken by 155936.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155948 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 21:29:03 +00:00
Anna Zaks 33e4a1d3f0 [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
2012-05-01 21:10:29 +00:00
Anna Zaks e2241cbb04 [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
2012-05-01 21:10:26 +00:00
Rafael Espindola 4e31b4d6cf 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
2012-05-01 20:58:29 +00:00
Douglas Gregor 294fe20bfa 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
2012-05-01 20:44:16 +00:00
Douglas Gregor 587e812b6e Add test cases for r155935.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155940 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 20:31:53 +00:00
Douglas Gregor 10601a36d1 Revert r155933
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155939 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 20:30:48 +00:00
David Blaikie ca2e1b7990 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
2012-05-01 20:28:45 +00:00
John McCall 6c803f7f46 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
2012-05-01 20:28:00 +00:00
Patrick Beard edb45f092e 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
2012-05-01 20:27:10 +00:00
Douglas Gregor 05e6076f0a 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
2012-05-01 20:23:02 +00:00
Douglas Gregor d53f6971a7 Fix CMake build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 20:08:24 +00:00
John McCall 6df1fa92a3 Test verified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155932 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 19:57:05 +00:00
Chad Rosier d1c0c940eb Spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 19:53:37 +00:00
David Blaikie 8165605dfb 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
2012-05-01 19:49:42 +00:00
David Blaikie f720a2bd5a 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
2012-05-01 19:49:38 +00:00
Chad Rosier c5713cfd87 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
2012-05-01 18:11:51 +00:00
Ted Kremenek 1b9a688fba Remove dead code found by static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155923 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 17:56:57 +00:00
Ted Kremenek cf18ae5717 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
2012-05-01 17:56:53 +00:00
Fariborz Jahanian b68258fba6 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
2012-05-01 17:46:45 +00:00
John McCall 2a7b09db93 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
2012-05-01 17:32:20 +00:00
James Molloy bfd7a525bc 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
2012-05-01 14:57:16 +00:00
Benjamin Kramer d1fda0393b Make some helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01 14:34:11 +00:00
NAKAMURA Takumi 287ab9fe92 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
2012-05-01 11:13:04 +00:00
NAKAMURA Takumi 9ff009faec 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
2012-05-01 10:52:06 +00:00
NAKAMURA Takumi bb1a899dd5 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
2012-05-01 10:51:55 +00:00
John McCall c2244f6aa1 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
2012-05-01 08:59:06 +00:00