]>
granicus.if.org Git - clang/log
Kaelyn Uhrain [Wed, 10 Jul 2013 17:34:22 +0000 (17:34 +0000)]
Offer typo suggestions for 'using' declarations.
Patch courtesy of Luke Zarko <zarko@google.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186019
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Wed, 10 Jul 2013 14:02:49 +0000 (14:02 +0000)]
Add experimental flag for adaptive parameter bin-packing.
This is not activated for any style, might change or go away
completely.
For those that want to play around with it, set
ExperimentalAutoDetectBinPacking to true.
clang-format will then:
Look at whether function calls/declarations/definitions are currently
formatted with one parameter per line (on a case-by-case basis). If so,
clang-format will avoid bin-packing the parameters. If all parameters
are on one line (thus that line is "inconclusive"), clang-format will
make the choice dependent on whether there are other bin-packed
calls/declarations in the same file.
The reason for this change is that bin-packing in some situations can be
really bad and an author might opt to put one parameter on each line. If
the author does that, he might want clang-format not to mess with that.
If the author is unhappy with the one-per-line formatting, clang-format
can easily be convinced to bin-pack by putting any two parameters on the
same line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186003
91177308 -0d34-0410-b5e6-
96231b3b80d8
Serge Pavlov [Wed, 10 Jul 2013 04:59:14 +0000 (04:59 +0000)]
Fixed comment of Sema::FindInstantiatedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185997
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 10 Jul 2013 01:33:19 +0000 (01:33 +0000)]
Finish off mangling locals in block literals.
Specifically, handle the case where the block is in a default argument
in a class method. The mangling here follows what we do for lambdas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185991
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 10 Jul 2013 01:13:27 +0000 (01:13 +0000)]
Get rid of dead/useless code for block mangling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185989
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 10 Jul 2013 00:30:46 +0000 (00:30 +0000)]
More local mangling fixes.
Compute mangling numbers for externally visible local variables and tags.
Change the mangler to consistently use discriminators where necessary.
Tweak the scheme we use to number decls which are not externally visible
to avoid unnecessary discriminators in common cases now that we request
them more consistently.
Fixes <rdar://problem/
14204721 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185986
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 10 Jul 2013 00:20:11 +0000 (00:20 +0000)]
objc migrator: More refinment of property
attributes in migration. Specialli use of
'copy' attribute for retainable object types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185985
91177308 -0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 9 Jul 2013 22:03:30 +0000 (22:03 +0000)]
Apply BlackList -> SpecialCaseList rename in Clang.
Differential Revision: http://llvm-reviews.chandlerc.com/D1095
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185979
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 9 Jul 2013 22:02:20 +0000 (22:02 +0000)]
Objective-C: merge objc_requires_super attribute of
method declaration into its implementation to
prevent a bogus warning about mismatched attributes.
then make sure the warning about missing call to super comes out
of the method implementation. // rdar://
14251387
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185974
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 9 Jul 2013 20:29:03 +0000 (20:29 +0000)]
Reapply an improved version of r180816/180817.
Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.
(Paired commit with LLVM: r185966)
rdar://problem/
13658587
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185967
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 9 Jul 2013 16:59:14 +0000 (16:59 +0000)]
ObjC migrator: Add -objcmt-migrate-property to do property
migration. Also, fixes an old bug where older migration
flags were not being checked for properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 9 Jul 2013 14:36:48 +0000 (14:36 +0000)]
Initial support for formatting trailing return types.
This fixes llvm.org/PR15170.
For now, the basic formatting rules are (based on the C++11 standard):
* Surround the "->" with spaces.
* Break before "->".
Also fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185938
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 9 Jul 2013 12:05:01 +0000 (12:05 +0000)]
ArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup and
Sema::ActOnDocumentableDecls.
Patch by Robert Wilhelm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185931
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 9 Jul 2013 11:57:27 +0000 (11:57 +0000)]
Avoid confusing indentations for chained function calls.
Basically treat a function with a trailing call similar to a function
with multiple parameters.
Before:
aaaaaaaaaaaaaaaaaaaa (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (
aaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaa ))
.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ();
After:
aaaaaaaaaaaaaaaaaaaa (
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (
aaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaa ))
.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ();
Also fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185930
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:30 +0000 (11:14 +0000)]
c-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with include_directories(SYSTEM).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185928
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:24 +0000 (11:14 +0000)]
c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.
-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.
FIXME: Could autoconf detect clang or availability of -isystem?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185927
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 9 Jul 2013 09:06:29 +0000 (09:06 +0000)]
Fix alignment of closing brace in braced initializers.
Before:
someFunction(OtherParam, BracedList{
// comment 1 (Forcing intersting break)
param1, param2,
// comment 2
param3, param4
});
After:
someFunction(OtherParam, BracedList{
// comment 1 (Forcing intersting break)
param1, param2,
// comment 2
param3, param4
});
To do so, the UnwrappedLineParser now stores the information about the
kind of brace in the FormatToken.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185914
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 9 Jul 2013 07:43:55 +0000 (07:43 +0000)]
Format overloaded operators like other functions.
This fixes llvm.org/PR16328 (at least partially).
Before:
SomeLoooooooooooooooooooooooooooooogType operator<<(
const SomeLooooooooogType &a, const SomeLooooooooogType &b);
After:
SomeLoooooooooooooooooooooooooooooogType
operator<<(const SomeLooooooooogType &a, const SomeLooooooooogType &b);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185908
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Tue, 9 Jul 2013 01:55:00 +0000 (01:55 +0000)]
[analyzer] Fixup for r185609: actually do suppress warnings coming out of std::list.
list is the name of a class, not a namespace. Change the test as well - the previous
version did not test properly.
Fixes radar://
14317928 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185898
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 9 Jul 2013 01:38:07 +0000 (01:38 +0000)]
Fix recovery for missing * in objc property.
<rdar://problem/
14354144 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185897
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 9 Jul 2013 01:00:29 +0000 (01:00 +0000)]
Don't give # and ## special treatment when in -traditional-cpp mode. Patch by
Austin Seipp!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185896
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 9 Jul 2013 00:57:56 +0000 (00:57 +0000)]
Generalize hack allowing 'const' in __has_attribute (etc) to allow any token
with identifier info. This covers most identifier-like entities (other than
the ISO646 keywords).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185895
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 8 Jul 2013 23:35:04 +0000 (23:35 +0000)]
Fix crash typo-correcting dependent member func.
PR16561.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185887
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 8 Jul 2013 23:29:51 +0000 (23:29 +0000)]
ObjC migration: more test for migration to
properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185884
91177308 -0d34-0410-b5e6-
96231b3b80d8
Kaelyn Uhrain [Mon, 8 Jul 2013 23:13:44 +0000 (23:13 +0000)]
Attempt typo correction for function calls with the wrong number of arguments.
Combined with typo correction's new ability to apply global/absolute nested
name specifiers to possible corrections, cases such as in PR12287 where the
desired function is being shadowed by a lexically closer function with the
same name but a different number of parameters will now include a FixIt.
On a side note, since the test for this change caused
test/SemaCXX/typo-correction.cpp to exceed the typo correction limit for
a single file, I've included a test case for exceeding the limit and added
some comments to both the original and part two of typo-correction.cpp
warning future editors of the files about the limit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185881
91177308 -0d34-0410-b5e6-
96231b3b80d8
Kaelyn Uhrain [Mon, 8 Jul 2013 23:13:39 +0000 (23:13 +0000)]
Make a couple of useful typo correction callbacks more widely available.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185880
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 8 Jul 2013 22:49:25 +0000 (22:49 +0000)]
ObjC migration: Skip over setter/getter with attributes
for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185879
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 8 Jul 2013 21:42:08 +0000 (21:42 +0000)]
[Objective-C migrator] replace candidate user setter/getter with
their equivalent property declaration. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185873
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 8 Jul 2013 20:20:06 +0000 (20:20 +0000)]
Fix Sema for compares with _Atomic vars.
Use UsualArithmeticConversions unconditionally in analysis of
comparisons and conditional operators: the method performs
the usual arithmetic conversions if both sides are arithmetic, and
usual unary conversions if they are not. This is just a cleanup
for conditional operators; for comparisons, it fixes the issue that
we would try to check isArithmetic() on an atomic type.
Also, fix GetExprRange() in SemaChecking.cpp so it deals with variables
of atomic type correctly.
Fixes PR15537.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185857
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 8 Jul 2013 14:58:01 +0000 (14:58 +0000)]
Fix incorrect incorrect cast identification in clang-format.
This fixes llvm.org/PR16534.
Before:
aaaaa& operator+(const aaaaa&)LLVM_DELETED_FUNCTION;
After:
aaaaa& operator+(const aaaaa&) LLVM_DELETED_FUNCTION;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185828
91177308 -0d34-0410-b5e6-
96231b3b80d8
Enea Zaffanella [Mon, 8 Jul 2013 14:50:30 +0000 (14:50 +0000)]
Fixed testcase failing under MS by adding "-fno-delayed-template-parsing",
as suggested by Takumi. To this end, added a MatchVerifier::match()
overload accepting a vector of invocation arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185827
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 8 Jul 2013 14:34:09 +0000 (14:34 +0000)]
Reformat clang-format's source files after r185822 and others.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185823
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 8 Jul 2013 14:25:23 +0000 (14:25 +0000)]
Prefer similar line breaks.
This adds a penalty for clang-format for each break that occurs in
a set of parentheses (including fake parenthesis that determine
the range of certain operator precendences) that have not yet been
broken. Thereby, clang-format prefers similar line breaks.
This fixes llvm.org/PR15506.
Before:
const int kTrackingOptions =
NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited |
NSTrackingActiveAlways;
After:
const int kTrackingOptions = NSTrackingMouseMoved |
NSTrackingMouseEnteredAndExited |
NSTrackingActiveAlways;
Also removed ParenState::ForFakeParenthesis which has become unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185822
91177308 -0d34-0410-b5e6-
96231b3b80d8
Manuel Klimek [Mon, 8 Jul 2013 14:16:30 +0000 (14:16 +0000)]
Fix use of invalidated iterator bug in AST match finder.
Pulled out the cache clearing in the case of descendant matching, too,
for consistency, also it is not technically needed there.
FIXME: Make cache size configurable and add unit test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185820
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Mon, 8 Jul 2013 14:12:07 +0000 (14:12 +0000)]
Fix for corner cases in code handling leading "* " decorations in block comments
Summary:
Fixes problems that lead to incorrect formatting of these and similar snippets:
/*
**
*/
/*
**/
/*
* */
/*
*test
*/
Clang-format used to think that all the cases above use "* " decoration, and
failed to calculate insertion position properly. It also used to remove leading
"* " in the last line.
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1113
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185818
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 12:00:36 +0000 (12:00 +0000)]
clang/include/clang/AST/ExprCXX.h:260:5: Fix a warning -- unknown command tag name 'cc'; did you mean 'c'? [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185810
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 12:00:29 +0000 (12:00 +0000)]
clang/test/Index/comment-custom-block-command.cpp: This has not been failing since r175892 on valgrind.
That said, it fails with --vg-leak. Mark it as XFAIL: vg_leak instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185809
91177308 -0d34-0410-b5e6-
96231b3b80d8
James Dennett [Mon, 8 Jul 2013 07:29:35 +0000 (07:29 +0000)]
Documentation cleanup for include/clang/AST/ExprCXX.h.
This is mostly Doxygen formatting, but also updates some C++0x references
to C++11 and clarifies some wording.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185798
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 06:45:16 +0000 (06:45 +0000)]
clang/test/Misc/permissions.cpp: Suppress this on MSYS with the feature 'shell-preserves-root'.
FIXME: Could we introduce another feature for it?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185797
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 06:38:51 +0000 (06:38 +0000)]
clang/test/CodeGen/2008-01-25-ByValReadNone.c: Add explicit -triple x86_64-unknown-unknown.
It would emit @llvm.memcpy with "-triple x86_64-(mingw32|win32)" and had been failing since Nick's r185735.
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #1
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185796
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 8 Jul 2013 06:38:46 +0000 (06:38 +0000)]
AST/SourceLocationTest.cpp: Appease MS hosts to suppress CXXUnresolvedConstructExpr.SourceRange, for now.
FIXME: It could pass if MS-compatible mode were disabled with Args.push_back("-fno-delayed-template-parsing").
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185795
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 04:47:18 +0000 (04:47 +0000)]
Simplify code. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185792
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 04:44:01 +0000 (04:44 +0000)]
Introduce a typedef for the type of NewlyDeducedPacks to avoid repeating the small size of the inner SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185789
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 04:24:47 +0000 (04:24 +0000)]
Remove 'else' after 'return'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185787
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 04:16:49 +0000 (04:16 +0000)]
Function argument formatting fixes. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185786
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 04:13:06 +0000 (04:13 +0000)]
Function argument formatting fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185785
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jul 2013 03:55:09 +0000 (03:55 +0000)]
Use SmallVectorImpl::reverse_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185784
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 7 Jul 2013 23:49:50 +0000 (23:49 +0000)]
Sema: Do not merge new decls with invalid, old decls
Sema::MergeFunctionDecl attempts merging two decls even if the old decl
is invalid. This can lead to interesting circumstances where we
successfully merge the decls but the result makes no sense.
Take the following for example:
template <typename T>
int main(void);
int main(void);
Sema will not consider these to be overloads of the same name because
main can't be overloaded, which means that this must be a redeclaration.
In this case the templated decl is compatible with the non-templated
decl allowing the Sema::CheckFunctionDeclaration machinery to move on
and do bizarre things like setting the previous decl of a non-templated
decl to a templated decl!
The way I see it, we should just bail from MergeFunctionDecl if the old
decl is invalid.
This fixes PR16531.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185779
91177308 -0d34-0410-b5e6-
96231b3b80d8
Enea Zaffanella [Sun, 7 Jul 2013 06:41:54 +0000 (06:41 +0000)]
Fixed source range for functional cast and unresolved construct expr nodes.
Added testcases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185773
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sun, 7 Jul 2013 06:15:42 +0000 (06:15 +0000)]
Rename test to match C++1y paragraph number per N3690, and add additional test
case inspired by a stackoverflow question.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185772
91177308 -0d34-0410-b5e6-
96231b3b80d8
James Dennett [Sun, 7 Jul 2013 05:19:50 +0000 (05:19 +0000)]
Documentation cleanup for include/clang/AST/DeclCXX.h, no substantive changes.
* Fix up \brief documentation;
* Update C++0x references to C++11;
* Doxygen formatting: bulleted lists start with a single hyphen, not two;
* Fix a typo, "assosiate" -> "associate".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185771
91177308 -0d34-0410-b5e6-
96231b3b80d8
Enea Zaffanella [Sat, 6 Jul 2013 18:54:58 +0000 (18:54 +0000)]
Fixed source location info for UnaryTransformTypeLoc nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185765
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 6 Jul 2013 18:04:13 +0000 (18:04 +0000)]
Objective-C: Warn when fast enumeration variable isn't used.
// rdar://
14182680 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185762
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sylvestre Ledru [Sat, 6 Jul 2013 08:00:09 +0000 (08:00 +0000)]
Remove some useless declarations (found by scan-build)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185752
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jul 2013 02:13:46 +0000 (02:13 +0000)]
Sema: Fix a crash when main is redeclared as a function-template.
This boils down to us sending invalid function decls to
CheckFunctionDeclaration becauswe we did not consider that CheckMain
could cause the decl to be invalid. Instead, interogate the new decl's
main-validity and *then* send it over to get CheckFunctionDeclaration'd
if it was still valid after calling CheckMain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185745
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 6 Jul 2013 00:30:27 +0000 (00:30 +0000)]
Update test for change in r185735.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185736
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 5 Jul 2013 23:50:55 +0000 (23:50 +0000)]
Remove referece type onproperty of abstract
class type. // rdar://
14261999
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185734
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 5 Jul 2013 23:20:55 +0000 (23:20 +0000)]
[comment parsing]: Removes an unsafe API whose
use can cause crash. No test is available. It is uncovered
by code browsing. // rdar://
14348205
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185732
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 21:13:58 +0000 (21:13 +0000)]
Use llvm::sys::fs::createUniqueFile.
Include a test that clang now produces output files with permissions matching
the umask.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185727
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 5 Jul 2013 20:51:44 +0000 (20:51 +0000)]
[libclang] Add the new function to libclang.exports
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185725
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 5 Jul 2013 20:46:03 +0000 (20:46 +0000)]
[objc migrator]: More knobs to do migration to
use of objc's properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185724
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 5 Jul 2013 20:44:37 +0000 (20:44 +0000)]
[libclang] Introduce clang_Cursor_isObjCOptional, which returns whether the declaration was affected by "@optional"
rdar://
14348525 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185722
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 5 Jul 2013 20:27:40 +0000 (20:27 +0000)]
Don't use mangleCXXRTTIName in TBAA for C code.
This changes the TBAA code so it doesn't use mangleCXXRTTIName in C,
because it doesn't really make sense there. Also, as sort of a
defense-in-depth change, fix the mangler so it handles C RecordDecls
correctly.
No tests because I don't know the TBAA code well enough to write a test,
and I don't know how else to trigger mangling a local struct in C.
Fixes a crash with r185450 reported by Joerg Sonnenberger.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185721
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 20:00:06 +0000 (20:00 +0000)]
Use llvm::sys::fs::createTemporaryFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185717
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jul 2013 19:34:19 +0000 (19:34 +0000)]
Use SmallVectorImpl& for function arguments instead of SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 5 Jul 2013 18:41:30 +0000 (18:41 +0000)]
Fix regression from r185450.
As it turns out, the NoFunction bit for local class mangling needed to be
propagated into more places. r185450 turned what used to be an incorrect
mangling into an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185713
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 5 Jul 2013 17:18:11 +0000 (17:18 +0000)]
Objective-C: diagnose when synthesizing an ivar of
abstract class type. // rdar://
14261999
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185710
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 5 Jul 2013 15:51:00 +0000 (15:51 +0000)]
Add a test case for r185707/PR16547.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185708
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 15:05:40 +0000 (15:05 +0000)]
Fix PR16547.
We should not be asking unique_file to prepend the system temporary directory
when creating the html report. Unfortunately I don't think we can test this
with the current infrastructure since unique_file ignores MakeAbsolute if the
directory is already absolute and the paths provided by lit are.
I will take a quick look at making this api a bit less error prone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185707
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 14:15:24 +0000 (14:15 +0000)]
We don't need to check for windows' error codes in here.
The operator== calls equivalent which calls default_error_condition which
handles windows to posix conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185702
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Fri, 5 Jul 2013 13:30:40 +0000 (13:30 +0000)]
Fix formatting for allocation of new pointer variables.
Before:
T **t = new T * ;
T **q = new T * ();
After:
T **t = new T *;
T **q = new T *();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185699
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Fri, 5 Jul 2013 09:14:35 +0000 (09:14 +0000)]
Improve detection for preventing certain kind of formatting patterns.
This is a better implementation of r183097. The main purpose is to
prevent certain constructs to be formatted "like a block of text".
Before:
aaaaaaaaaaaaa <
aaaaaaaaaa ,
aaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >* aaaa = new
aaaaaaaaaaaaa <
aaaaaaaaaa ,
aaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >(
bbbbbbbbbbbbbbbbbbbbbbbb );
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ] = (*
cccccccccccccccc )[
dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ];
After:
aaaaaaaaaaaaa <
aaaaaaaaaa ,
aaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >* aaaa =
new
aaaaaaaaaaaaa <
aaaaaaaaaa ,
aaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >(
bbbbbbbbbbbbbbbbbbbbbbbb );
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ] =
(*
cccccccccccccccc )[
dddddddddddddddddddddddddddddddddddddddddddddddddddddddd ];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185687
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Fri, 5 Jul 2013 07:58:34 +0000 (07:58 +0000)]
Don't break after a "(" following a binary operator.
Additionally, allow breaking after c-style casts, but with a high
penalty.
Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (
aaaaaaaaaaaaaaaaa *)
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ;
After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (
aaaaaaaaaaaaaaaaa *)
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ;
This fixes llvm.org/PR16049.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185685
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 5 Jul 2013 06:23:33 +0000 (06:23 +0000)]
Sema: Call IgnoreParens fewer times in CheckAddressOfOperand
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185684
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jul 2013 04:43:31 +0000 (04:43 +0000)]
Use typedef for Densemap contraining SmallVector passed to a function to avoid repeating SmallVector size.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185683
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 5 Jul 2013 04:33:53 +0000 (04:33 +0000)]
Add typedefs for Densemaps containing SmallVectors to avoid repeating the SmallVector size when creating iterators for the DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185682
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jul 2013 02:53:30 +0000 (02:53 +0000)]
Use the new --crash option in commands that are expected to crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185679
91177308 -0d34-0410-b5e6-
96231b3b80d8
James Dennett [Thu, 4 Jul 2013 22:15:44 +0000 (22:15 +0000)]
Add some more documentation on how to navigate from a LambdaExpr::Capture
to the associated FieldDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185674
91177308 -0d34-0410-b5e6-
96231b3b80d8
James Dennett [Thu, 4 Jul 2013 22:14:20 +0000 (22:14 +0000)]
Minor documentation cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185672
91177308 -0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Thu, 4 Jul 2013 21:29:24 +0000 (21:29 +0000)]
Add test for r185584.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185668
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 16:23:44 +0000 (16:23 +0000)]
Require a shell for this test.
Some versions of python will expand the glob used in the test, others wont,
causing the test to fail when run with LIT_USE_INTERNAL_SHELL=1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185653
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 16:16:58 +0000 (16:16 +0000)]
Add 'not' to commands that are expected to fail.
This is at least good documentation, but also opens the possibility of
using pipefail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:29:20 +0000 (15:29 +0000)]
Looks like {{.*}} doesn't match the empty string. Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185650
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:25:05 +0000 (15:25 +0000)]
Relax pattern to accept a signext on ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185649
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:22:16 +0000 (15:22 +0000)]
Replace 'grep foo | count 0' with 'not grep foo'.
This avoids depending on pipefail not being used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185648
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:14:31 +0000 (15:14 +0000)]
Remove test for the old debug format which was XFAILed since 2009.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185647
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:08:20 +0000 (15:08 +0000)]
Convert test to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185645
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 15:04:25 +0000 (15:04 +0000)]
Add missing expected-warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185644
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:58:42 +0000 (14:58 +0000)]
Remove more unused uses of -verify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185643
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:51:11 +0000 (14:51 +0000)]
Remove unused -verify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185641
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 4 Jul 2013 14:47:51 +0000 (14:47 +0000)]
Fixed typo: NoneComment -> NonComment, no other changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185640
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:42:44 +0000 (14:42 +0000)]
clang -cc1 has no -fno-unit-at-a-time or -funit-at-a-time. Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185639
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:36:22 +0000 (14:36 +0000)]
Use a clang -cc1 option instead of -m32 and remove tcl quotes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185637
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:30:41 +0000 (14:30 +0000)]
Remove tcl quotes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185636
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:28:33 +0000 (14:28 +0000)]
Convert test to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185635
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:25:25 +0000 (14:25 +0000)]
Replace void with int to make this a valid C++ file.
The test was passing because clang would still print the ast before exiting
with an error. Since that didn't seem to be the intent of the test, I change
the test instead of adding 'not' to the command line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185634
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:20:52 +0000 (14:20 +0000)]
Remove old test.
It was trivially passing because of the tcl quotes and we have better datalayout
tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185630
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:18:32 +0000 (14:18 +0000)]
Remove old test.
It was not clear what was being tested and the test was trivially passing
by getting grep confused with tcl quotes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185629
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 4 Jul 2013 14:13:53 +0000 (14:13 +0000)]
Clang has no nested function support. Delete this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185628
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 4 Jul 2013 13:11:33 +0000 (13:11 +0000)]
Use SmallVectorImpl::const_iterator instead of SmallVector to avoid specifying the vector size.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185623
91177308 -0d34-0410-b5e6-
96231b3b80d8