- 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
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
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
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
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
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
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
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
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
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
- 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
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
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
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
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
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
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
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
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