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

30949 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 4017d7378b Objective-C [qoi]: Issue better warning when nsstring literal is missing
the '@'. PR16287 and // rdar://14106083


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 23:51:51 +00:00
Eli Friedman 2ac2fa7726 Make sure we don't emit invalid IR for StmtExprs with complex cleanups.
Fixes <rdar://problem/14074868>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 22:04:49 +00:00
Adrian Prantl 7044668ecb cleanup (address some more review comments for r183474):
- reduce default buffer size to 64, which will still be large enough to
  hold any property names found in the wild.
- get rid of the /*static*/ comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183697 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 21:36:55 +00:00
Reid Kleckner 0567a79130 Use FPT::getArgTypes() instead of manually building ArrayRefs
Made significantly easier with git-clang-format.

Differential Revision: http://llvm-reviews.chandlerc.com/D947

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 20:51:09 +00:00
Richard Trieu ef0e4e6eda Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.
This warning triggers on the logical not of a non-boolean expression on the
left hand side of comparison.  Often, the user meant to negate the comparison,
not just the left hand side of the comparison.  Two notes are also emitted,
the first with a fix-it to add parentheses around the comparison, and the other
to put parenthesis around the not expression to silence the warning.

bool not_equal(int x, int y) {
  return !x == y;  // warn here
}

  return !(x == y);  // first fix-it, to negate comparison.

  return (!x) == y;  // second fix-it, to silence warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 18:52:07 +00:00
Larisse Voufo 7acc5a6482 Support for contextual conversion tweaks (N3323) was added, as Revision 183637
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 08:25:58 +00:00
Larisse Voufo 50b60b35a9 reverted test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183637 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 06:50:24 +00:00
Larisse Voufo 817e01f509 test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-10 06:28:37 +00:00
Reid Kleckner 875e739473 [CodeGen] Make CGCleanup.h include what it now uses
Also move CGCleanup.h to the top of CGCleanup.cpp to verify that
CGCleanup.h really includes what it needs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-09 16:56:53 +00:00
Reid Kleckner 6fe91e448f [CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h
No functionality change.  CGCleanup.cpp provides the implementation for
EHScopeStack, so it seems more consistent to place the class definition
in CGCleanup.h.

This should also help solve a header ordering problem that I have.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183631 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-09 16:45:02 +00:00
Faisal Vali 688f9866c7 Fix the parser's updating of the template depth when parsing local templates and late-parsed templates.
This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.  
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183620 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 19:47:52 +00:00
Faisal Vali 65efd10a5f Revert r183618.
I ran clang-format on my patch but it seemed to have wreaked havoc with new lines  - might have to do with using it on windows :( will resubmit once i've cleaned this issue up. sorry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183619 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 19:39:00 +00:00
Faisal Vali 22bf46a9a3 Fix the parser's updating of the template depth when parsing local templates and late-parsed templates. This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 19:33:09 +00:00
Reid Kleckner c910d4cfa5 Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"
This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 18:19:52 +00:00
Reid Kleckner 63c9a92a80 [Sema] Make FunctionType's TSI use unadjusted argument types
This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

Differential Revision: http://llvm-reviews.chandlerc.com/D883

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 17:28:56 +00:00
Serge Pavlov 122e601886 Recognition of empty structures and unions is moved to semantic stage
Differential Revision: http://llvm-reviews.chandlerc.com/D586


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 13:29:58 +00:00
Jin-Gu Kang cc28eff956 Added a type checking which handle the case of an ext vector and integral scalar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183602 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 02:15:36 +00:00
Anna Zaks 3370859a80 [analyzer] Minor fixups to r183062
Based on feedback from Jordan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 00:29:29 +00:00
Anna Zaks a3f5a5afef [analyzer; alternate edges] Fix the edge locations in presence of macros.
We drew the diagnostic edges to wrong statements in cases the note was on a macro.
The fix is simple, but seems to work just fine for a whole bunch of test cases (plist-macros.cpp).

Also, removes an unnecessary edge in edges-new.mm, when function signature starts with a macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183599 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 00:29:24 +00:00
Michael Gottesman 9aaee92faa Fixed comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183598 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 00:27:19 +00:00
Adrian Prantl 8d378585f6 Debug info: An if condition now creates a lexical scope of its own.
Two variables with the same name declared in two if conditions in the same
scope are no longer coalesced into one.

rdar://problem/14024005

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 00:16:55 +00:00
Richard Smith b6e3808bfe Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183594 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 00:02:08 +00:00
Eric Christopher 61f0868f19 When we're compiling with -pg make sure to link with gcrt1.o on linux. Be
sure to do this always, this matches the behavior for the gcc driver.

Fixes PR16251.

Based on a patch by Qiao Yang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183591 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 23:25:01 +00:00
Eli Friedman eeb0062441 Fix va_arg on x86-64 for a struct containing a single int128_t. PR16248
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183590 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 23:20:55 +00:00
Douglas Gregor f9dbae754b Loosen r178109 even further, to assume that all redefined macros in system headers and system modules are equivalent.
Fixes <rdar://problem/14025673>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183588 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:56:11 +00:00
Eric Christopher 56b108ad2b 80-column fixup after recent change to getOrCreateType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:54:39 +00:00
Douglas Gregor df9835717d Even in a modules world, people will depend on the weird xmmintrin.h -> emmintrin.h forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:49:44 +00:00
Eli Friedman 572ac32bd0 Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183583 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:42:22 +00:00
Adrian Prantl 80e8ea92d6 address some comments on r183474:
- factor the name construction part out from constructSetterName
- rename constructSetterName to the more appropriate constructSetterSelector

no functionality change intended.
rdar://problem/14035789

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183582 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:29:12 +00:00
David Majnemer f9eaf98bf5 Revert "Properly consider the range of enum for range comparisons in C mode"
The approach r183084 took was wrong, back it out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183575 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 22:07:20 +00:00
Eli Friedman d88d7abe0d Add missing file from r183563 (the recommit of 183466).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183564 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 20:33:10 +00:00
Eli Friedman 44ee0a710c Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183563 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 20:31:48 +00:00
Fariborz Jahanian 6071af93f9 Objective-C: Another case of issuing warning about misusing
property auto-synthesis before knowingit it is to be
auto-synthesized. // rdar://14094682


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 20:26:51 +00:00
Richard Smith 33f0faa082 PR16273: Weaken a bogus assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 20:03:01 +00:00
Fariborz Jahanian a6ba40c1e5 Objective-C: Removes a bogus warning about auto-synthesis
of properties. Fixes // rdar://14085456


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183542 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 18:32:55 +00:00
Argyrios Kyrtzidis 4ff3225c1f Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().
Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 17:57:59 +00:00
Alexander Kornienko 54e6c9d1f1 Improved handling of escaped newlines at the token start.
Summary: Remove them from the TokenText as well.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D935

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183536 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 17:45:07 +00:00
Jordan Rose 1f13fbd0c5 Handle Unicode characters in fix-it replacement strings.
Patch by Sukolsak Sakshuwong!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 17:16:01 +00:00
Fariborz Jahanian b165fddec0 fix up recogtion of block pointer type in my last patch.
// rdar://14085217.
e-This line, and those below, will be ignored--

M    lib/Sema/SemaExpr.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183531 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 16:07:38 +00:00
Alexander Kornienko 2785b9aabc Fixed calculation of penalty when breaking tokens.
Summary:
Introduced two new style parameters: PenaltyBreakComment and
PenaltyBreakString. Add penalty for each character of a breakable token beyond
the column limit (this relates mainly to comments, as they are broken only on
whitespace). Tuned PenaltyBreakComment to prefer comment breaking over breaking
inside most binary expressions.
Fixed a bug that prevented *, & and && from being considered TT_BinaryOperator
in the presense of adjacent comments.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D933

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183530 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 16:02:52 +00:00
Manuel Klimek 20387efff0 Reverts r183466: "Perform dynamic alignment computations..."
This introduces bugs in TemplateSpecializationTypeLoc's angle bracket
locations.

Regression test follows in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 11:27:53 +00:00
Richard Smith cafeb948e6 PR16243: Use CXXThisOverride during template instantiation, and fix up the
places which weren't setting it up properly. This allows us to get the right
cv-qualifiers for 'this' when it appears outside a method body in a class
template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183483 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 02:33:37 +00:00
Eli Friedman 8150da3796 When we're synthesizing copy/move-assignment, we can't form a reference to an
invalid field; make sure we don't try.  Fixes <rdar://problem/14084171>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 01:48:56 +00:00
Adrian Prantl 4f97f85335 documentation: remove confusing reference to properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183475 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 01:10:48 +00:00
Adrian Prantl 5ae17a1770 ObjC Debug Info: Emit the names of accessors whenever they diverge from
the default names, not just when the isImplicit flag is set.

rdar://problem/14035789

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183474 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 01:10:45 +00:00
Adrian Prantl b5a50075d8 Improve documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183473 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 01:10:41 +00:00
Fariborz Jahanian 7523606638 blocks: fixes an ast bug when block pointer variable
is evaluated in a condition expression and then
dereferenced to envoke the block. This is
pr15663 and I applied a slight variation of the
patch with a test case. (patch is from
Arthur O'Dwyer). Also // rdar://14085217


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 00:48:14 +00:00
Tim Northover 1bea653e0d Diagnose malformed x86 inline asm using 'y' constraint.
X86's 'y' inline assembly constraint represents an MMX register, this change
prevents Clang from hitting an assertion when passed an incompatible type to
deal with.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183467 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 00:04:50 +00:00
Eli Friedman 86875b11db Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned.  Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc.  As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183466 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 00:04:31 +00:00
David Majnemer 585bee48ba Implement DR7
Disallowing deriving from classes that have private virtual base classes
except in instances where the deriving class would be able to cast
itself to the private virtual base via a different derivation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183462 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-06 23:43:20 +00:00