]> granicus.if.org Git - clang/log
clang
11 years agoAdd support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
John McCall [Tue, 18 Jun 2013 02:46:29 +0000 (02:46 +0000)]
Add support for -fpcc-struct-return.  Patch by Arthur O'Dwyer!

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

11 years agor184100 Fix -- Updated test cases for contextual conversion
Larisse Voufo [Tue, 18 Jun 2013 01:27:47 +0000 (01:27 +0000)]
r184100 Fix -- Updated test cases for contextual conversion

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

11 years agoRemove an ugly hack that was meant to eliminate the breakpoint ambiguity
Adrian Prantl [Tue, 18 Jun 2013 00:27:36 +0000 (00:27 +0000)]
Remove an ugly hack that was meant to eliminate the breakpoint ambiguity
between a block assignment and the entry of the block function. In reality
this wouldn't work anyway because blocks are predominantly created
on-the-fly inside of an ObjC method invocation.
The proper fix for the ambiguity is to use -gcolumn-info to differentiate
the breakpoints.

This is expected to break some block-related darwin-gdb tests.

rdar://problem/14039866

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

11 years agoDelete dead code.
Eli Friedman [Tue, 18 Jun 2013 00:22:17 +0000 (00:22 +0000)]
Delete dead code.

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

11 years agoAccept and ignore -fdebug-types-section for now. This will be used
Eric Christopher [Tue, 18 Jun 2013 00:03:50 +0000 (00:03 +0000)]
Accept and ignore -fdebug-types-section for now. This will be used
later with dwarf4 type hashing.

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

11 years agoFileCheck-ize.
Eric Christopher [Tue, 18 Jun 2013 00:03:46 +0000 (00:03 +0000)]
FileCheck-ize.

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

11 years agoAdd a missing testcase for ObjC ivar encoding for a C++ class with a vptr.
Eli Friedman [Mon, 17 Jun 2013 23:57:41 +0000 (23:57 +0000)]
Add a missing testcase for ObjC ivar encoding for a C++ class with a vptr.
Found by skimming over lcov report.

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

11 years agoTurn Clang 3.3 boxes on C++ status from yellow to green now we're releasing it.
Richard Smith [Mon, 17 Jun 2013 23:54:23 +0000 (23:54 +0000)]
Turn Clang 3.3 boxes on C++ status from yellow to green now we're releasing it.

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

11 years agoPoint link at correct location for Clang 3.3 release notes.
Richard Smith [Mon, 17 Jun 2013 23:53:08 +0000 (23:53 +0000)]
Point link at correct location for Clang 3.3 release notes.

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

11 years agoFix source range of CXXNewExpr with parentheses around the type. PR15569.
Eli Friedman [Mon, 17 Jun 2013 22:35:10 +0000 (22:35 +0000)]
Fix source range of CXXNewExpr with parentheses around the type.  PR15569.

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

11 years agoCompute the visibility of static local variables consistently. Fixes PR16208.
Eli Friedman [Mon, 17 Jun 2013 21:51:45 +0000 (21:51 +0000)]
Compute the visibility of static local variables consistently.  Fixes PR16208.

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

11 years agoFix Expr::Classify to correctly classify ExtVectorElementExprs. PR16204.
Eli Friedman [Mon, 17 Jun 2013 21:09:57 +0000 (21:09 +0000)]
Fix Expr::Classify to correctly classify ExtVectorElementExprs.  PR16204.

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

11 years agoCleanup linkage computation for static locals.
Rafael Espindola [Mon, 17 Jun 2013 20:04:51 +0000 (20:04 +0000)]
Cleanup linkage computation for static locals.

With this patch we assign VisibleNoLinkage to static locals in inline functions.
This lets us simplify CodeGen a bit.

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

11 years agoUse atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
Rafael Espindola [Mon, 17 Jun 2013 20:00:15 +0000 (20:00 +0000)]
Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.

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

11 years agoX86 intrinsics: cmpge|gt|nge|ngt_ss|_sd
Manman Ren [Mon, 17 Jun 2013 19:42:49 +0000 (19:42 +0000)]
X86 intrinsics: cmpge|gt|nge|ngt_ss|_sd

These intrinsics should return the comparision result in the low bits and keep
the high bits of the first source operand.

When calling to builtin functions, the source operands are swapped and the high
bits of the second source operand are kept. To fix the issue, an extra
shufflevector is used.

rdar://14153896

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

11 years agoRevert "Updated test cases for contextual conversion"
Rafael Espindola [Mon, 17 Jun 2013 19:26:19 +0000 (19:26 +0000)]
Revert "Updated test cases for contextual conversion"

This reverts commit r184100.

It was faling on some bots:
http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/1973/steps/test_clang/logs/Clang%20%3A%3A%20SemaCXX__cxx1y-contextual-conversion-tweaks.cpp

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

11 years agoUpdated test cases for contextual conversion
Larisse Voufo [Mon, 17 Jun 2013 18:41:38 +0000 (18:41 +0000)]
Updated test cases for contextual conversion

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

11 years agoAvoid using __SIZE_TYPE__ in a -std=c++98 -pedantic-errors test, because that
Richard Smith [Mon, 17 Jun 2013 18:05:42 +0000 (18:05 +0000)]
Avoid using __SIZE_TYPE__ in a -std=c++98 -pedantic-errors test, because that
triggers an error on MS targets where __SIZE_TYPE__ expands to 'long long'.

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

11 years agounbreak buildbot for now.
Fariborz Jahanian [Mon, 17 Jun 2013 17:41:13 +0000 (17:41 +0000)]
unbreak buildbot for now.

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

11 years agoInclude PathV1.h only where it is used.
Rafael Espindola [Mon, 17 Jun 2013 17:23:47 +0000 (17:23 +0000)]
Include PathV1.h only where it is used.

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

11 years agoClean up empty struct/union recognition.
Serge Pavlov [Mon, 17 Jun 2013 17:18:51 +0000 (17:18 +0000)]
Clean up empty struct/union recognition.
Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows
more accurate detection of types of zero size. It however has a side effect -
sequence of used types may change, that is why the test 'override-layout' was
modified.

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

11 years agoObjective-C [qoi]: Provide fixit hint when message with typo
Fariborz Jahanian [Mon, 17 Jun 2013 17:10:54 +0000 (17:10 +0000)]
Objective-C [qoi]: Provide fixit hint when message with typo
is sent to a receiver object. This is wip. // rdar://7853549

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

11 years ago[Driver] Remove the using namespace directives from headers
Reid Kleckner [Mon, 17 Jun 2013 13:59:19 +0000 (13:59 +0000)]
[Driver] Remove the using namespace directives from headers

This adds a bunch of llvm::opt name specifiers to all the uses of types
from that namespace.

Reviewers: espindola

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

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

11 years agoFix a problem in ExpressionParser leading to trailing comments affecting indentation...
Alexander Kornienko [Mon, 17 Jun 2013 13:19:53 +0000 (13:19 +0000)]
Fix a problem in ExpressionParser leading to trailing comments affecting indentation of an expression after a line break.

Summary:
E.g. the second line in

return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
           b; //

is indented 4 characters more than in

return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
       b;

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D984

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

11 years agoTry to fix the bots with a forward decl.
Reid Kleckner [Mon, 17 Jun 2013 13:05:47 +0000 (13:05 +0000)]
Try to fix the bots with a forward decl.

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

11 years agoFixes incorrect indentation of line comments after break and re-alignment.
Alexander Kornienko [Mon, 17 Jun 2013 12:59:44 +0000 (12:59 +0000)]
Fixes incorrect indentation of line comments after break and re-alignment.

Summary:
Selectively propagate the information about token kind in
WhitespaceManager::replaceWhitespaceInToken.For correct alignment of new
segments of line comments in order to align them correctly. Don't set
BreakBeforeParameter in breakProtrudingToken for line comments, as it introduces
a break after the _next_ parameter. Added tests for related functions.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D980

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

11 years ago[AST] Don't include RecursiveASTVisitor.h in ASTContext.h
Reid Kleckner [Mon, 17 Jun 2013 12:56:08 +0000 (12:56 +0000)]
[AST] Don't include RecursiveASTVisitor.h in ASTContext.h

The untemplated implementation of getParents() doesn't need to be in a
header file.

RecursiveASTVisitor.h is full of repeated macro expansion.  Moving this
include to ASTContext.cpp speeds up compilation of
LambdaMangleContext.cpp, a small C++ file with few includes, from 3.7s
to 2.8s for me locally.  I haven't measured a full build, but it can't
hurt.

I had to fix a few static analyzer files that were depending on
transitive includes of C++ AST headers.

Reviewers: rsmith, klimek

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

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

11 years agoCorrected status of support for contextual conversion from full to SVN
Larisse Voufo [Mon, 17 Jun 2013 05:37:15 +0000 (05:37 +0000)]
Corrected status of support for contextual conversion from full to SVN

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

11 years agoRemove unused file.
Richard Smith [Mon, 17 Jun 2013 01:34:23 +0000 (01:34 +0000)]
Remove unused file.

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

11 years agoC++11: don't warn about the deprecated 'register' keyword if it's combined with
Richard Smith [Mon, 17 Jun 2013 01:34:01 +0000 (01:34 +0000)]
C++11: don't warn about the deprecated 'register' keyword if it's combined with
an asm label.

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

11 years agoAdd warning group -Wdeprecated-register for C++11 warning on 'register' being
Richard Smith [Mon, 17 Jun 2013 00:01:58 +0000 (00:01 +0000)]
Add warning group -Wdeprecated-register for C++11 warning on 'register' being
deprecated.

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

11 years agoAdd tests for C++ DR100-150.
Richard Smith [Sun, 16 Jun 2013 08:00:51 +0000 (08:00 +0000)]
Add tests for C++ DR100-150.

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

11 years agoAdd testcase for DR39 from PR5916.
Richard Smith [Sun, 16 Jun 2013 05:11:56 +0000 (05:11 +0000)]
Add testcase for DR39 from PR5916.

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

11 years agoPR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'
Richard Smith [Sun, 16 Jun 2013 05:05:39 +0000 (05:05 +0000)]
PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'
and a '!defined(X)' if we find a broken header guard. This is suboptimal; we
should point the diagnostic at the 'X' token not the 'if' token, but it fixes
the crash.

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

11 years agoFixed one buildbot-failure-causing bug...
Larisse Voufo [Sun, 16 Jun 2013 04:34:07 +0000 (04:34 +0000)]
Fixed one buildbot-failure-causing bug...

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

11 years agoArrayRef'ize Sema::CodeComplete*
Dmitri Gribenko [Sun, 16 Jun 2013 03:47:57 +0000 (03:47 +0000)]
ArrayRef'ize Sema::CodeComplete*

Patch by Robert Wilhelm.

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

11 years agoUpdated status of support for contextual conversion from partial to full
Larisse Voufo [Sat, 15 Jun 2013 20:26:23 +0000 (20:26 +0000)]
Updated status of support for contextual conversion from partial to full

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

11 years agoUpdated the support for contextual conversion tweaks (n3323) with a previously overlo...
Larisse Voufo [Sat, 15 Jun 2013 20:17:46 +0000 (20:17 +0000)]
Updated the support for contextual conversion tweaks (n3323) with a previously overlooked part: implicitly converting array sizes to size_t, rather than contextually converting them to some unique type.

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

11 years agoA quick fix to allow return type deduction on member templates
Faisal Vali [Sat, 15 Jun 2013 11:54:37 +0000 (11:54 +0000)]
A quick fix to allow return type deduction on member templates
by ensuring DiagnoseUseOfDecl is called both on the found decl and the
decl being used (i.e the specialization in the case of member templates) whenever they are different.
Per the exchange captured in
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130610/081636.html
a more comprehensive fix that allows both decls to be passed into DiagnoseUseOfDecl is (or should be) forthcoming relatively soon.

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

11 years agoEmit native implementations of atomic operations on FreeBSD/armv6.
Ed Schouten [Sat, 15 Jun 2013 09:40:14 +0000 (09:40 +0000)]
Emit native implementations of atomic operations on FreeBSD/armv6.

Just like on Linux, FreeBSD/armv6 assumes the system supports
ldrex/strex unconditionally. It is also used by the kernel. We can
therefore enable support for it, like we do on Linux.

While there, change one of the unit tests to explicitly test against
armv5 instead of armv7, as it actually tests whether libcalls are
emitted.

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

11 years agoPR16263: Implement current direction of core issue 1376. Binding a reference to
Richard Smith [Sat, 15 Jun 2013 00:30:29 +0000 (00:30 +0000)]
PR16263: Implement current direction of core issue 1376. Binding a reference to
the result of a cast-to-reference-type lifetime-extends the object to which the
reference inside the cast binds.

This requires us to look for subobject adjustments on both the inside and the
outside of the MaterializeTemporaryExpr when looking for a temporary to
lifetime-extend (which we also need for core issue 616, and possibly 1213).

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

11 years agoFix handling of const_cast from prvalue to rvalue reference: such a cast is
Richard Smith [Fri, 14 Jun 2013 22:27:52 +0000 (22:27 +0000)]
Fix handling of const_cast from prvalue to rvalue reference: such a cast is
only permitted if the source object is of class type, and should materialize a
temporary for the reference to bind to.

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

11 years agoFix comments referring to non-existent types.
Eli Friedman [Fri, 14 Jun 2013 21:28:56 +0000 (21:28 +0000)]
Fix comments referring to non-existent types.

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

11 years agoUnify return type checking for functions and ObjC methods. Move all the
Eli Friedman [Fri, 14 Jun 2013 21:14:10 +0000 (21:14 +0000)]
Unify return type checking for functions and ObjC methods.  Move all the
random checks for ObjC object return types to SemaType.cpp.

Fixes issue with ObjC method type checking reported on cfe-dev.

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

11 years agoSuppress the c++11 -Wdeprecated warning for 'register' if it is expanded from a
Richard Smith [Fri, 14 Jun 2013 21:05:24 +0000 (21:05 +0000)]
Suppress the c++11 -Wdeprecated warning for 'register' if it is expanded from a
macro defined in a system header. glibc uses it in macros, apparently.

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

11 years ago[Driver] Refactor clang driver to use LLVM's Option library
Reid Kleckner [Fri, 14 Jun 2013 17:17:23 +0000 (17:17 +0000)]
[Driver] Refactor clang driver to use LLVM's Option library

The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

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

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

11 years agoDon't remove backslashes from block comments.
Alexander Kornienko [Fri, 14 Jun 2013 11:46:10 +0000 (11:46 +0000)]
Don't remove backslashes from block comments.

Summary:
Don't remove backslashes from block comments. Previously this
/* \    \ \ \ \ \
*/
would be turned to this:
/*
*/
which spoils some kinds of ASCII-art, people use in their comments. The behavior
was related to handling escaped newlines in block comments inside preprocessor
directives. This patch makes handling it in a more civilized way.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D979

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

11 years agoFix the warning for divide by zero to be a bit more robust. ;]
Chandler Carruth [Fri, 14 Jun 2013 08:57:18 +0000 (08:57 +0000)]
Fix the warning for divide by zero to be a bit more robust. ;]

Previously, it only ever fired for zeros which formed null pointers.
Now, hilariously, in C++98 this was almost anything. Including tricks
like warning on the divisor in this code:

typedef char c3[3];
size_t f(c3* ptr) {
  return (sizeof(ptr) / sizeof(*ptr)) / (size_t)(!(sizeof(ptr) % sizeof(*ptr)));
}

Why the RHS of the outer divide is a null pointer constant is a sordid
tale of sorrow. Anyways, the committee fixed this for C++11 and onward
as part of core isssue 903, and Richard recently implemented this fix
causing the warning to go away here (and elsewhere).

This patch restores the warning here and adds it for numerous other
somewhat obvious gaffes:

int g(int x) {
  return x / (int)(0.0);
}

The patch is essentially just using the full power of our constant
folding in Clang to produce the warning, but insisting that it must fold
to an *integer* which is zero so that we don't get false positives
anywhere.

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

11 years agoEmit initializers for static-storage-duration temporaries as constants where
Richard Smith [Fri, 14 Jun 2013 03:07:01 +0000 (03:07 +0000)]
Emit initializers for static-storage-duration temporaries as constants where
possible.

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

11 years ago[docs] Fix wrong clang-format example.
Rui Ueyama [Fri, 14 Jun 2013 02:12:06 +0000 (02:12 +0000)]
[docs] Fix wrong clang-format example.

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

11 years agoRemove implicit fallthrough from AArch64 to Mips in lib selection
Tim Northover [Thu, 13 Jun 2013 22:54:55 +0000 (22:54 +0000)]
Remove implicit fallthrough from AArch64 to Mips in lib selection

Nothing useful to AArch64 will (should!) be found in any Mips-specific
directories.

Patch by Luke Zarko.

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

11 years agoAvoid fallthrough in header, to allow external users of Clang libraries to
Richard Smith [Thu, 13 Jun 2013 22:07:02 +0000 (22:07 +0000)]
Avoid fallthrough in header, to allow external users of Clang libraries to
build with Clang's -Wimplicit-fallthrough warning enabled. The fallthrough
was not making this code better.

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

11 years agoFix the linkage of static locals inside a CapturedStmt. (Found in the
Eli Friedman [Thu, 13 Jun 2013 21:50:44 +0000 (21:50 +0000)]
Fix the linkage of static locals inside a CapturedStmt.  (Found in the
process of trying to fix the related issue for block literals.)

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

11 years agoDon't depend on the transitive inclusion of PathV1.h.
Rafael Espindola [Thu, 13 Jun 2013 21:09:29 +0000 (21:09 +0000)]
Don't depend on the transitive inclusion of PathV1.h.

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

11 years agoUse the sys::RemoveFileOnSignal that takes a StringRef.
Rafael Espindola [Thu, 13 Jun 2013 21:02:40 +0000 (21:02 +0000)]
Use the sys::RemoveFileOnSignal that takes a StringRef.

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

11 years agoFollowup to r183931 to fix the lambda conversion-to-block-pointer member.
Eli Friedman [Thu, 13 Jun 2013 20:56:27 +0000 (20:56 +0000)]
Followup to r183931 to fix the lambda conversion-to-block-pointer member.

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

11 years agoUse the sys::ExecuteAndWait that takes StringRefs.
Rafael Espindola [Thu, 13 Jun 2013 20:08:52 +0000 (20:08 +0000)]
Use the sys::ExecuteAndWait that takes StringRefs.

Also don't depend on Program.h including PathV1.h.

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

11 years agoFix a small bug in the linkage computation for the lambda conversion-to-function...
Eli Friedman [Thu, 13 Jun 2013 19:39:48 +0000 (19:39 +0000)]
Fix a small bug in the linkage computation for the lambda conversion-to-function-pointer member.

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

11 years agoUpdate for llvm change.
Rafael Espindola [Thu, 13 Jun 2013 19:25:45 +0000 (19:25 +0000)]
Update for llvm change.

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

11 years agoAllow clang to build __clear_cache on ARM.
Rafael Espindola [Thu, 13 Jun 2013 18:34:17 +0000 (18:34 +0000)]
Allow clang to build __clear_cache on ARM.

__clear_cache is special. It needs no signature, but is a real function in
compiler_rt or libgcc.

Patch by Andrew Turner.

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

11 years agoClean up test to appease NDEBUG builds.
Richard Smith [Thu, 13 Jun 2013 18:07:12 +0000 (18:07 +0000)]
Clean up test to appease NDEBUG builds.

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

11 years agoInheritViz.cpp uses sys::Path, include PathV1.h
Rafael Espindola [Thu, 13 Jun 2013 17:35:20 +0000 (17:35 +0000)]
InheritViz.cpp uses sys::Path, include PathV1.h

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

11 years agoUse version of DisplayGraph that takes a StringRef.
Rafael Espindola [Thu, 13 Jun 2013 16:57:07 +0000 (16:57 +0000)]
Use version of DisplayGraph that takes a StringRef.

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

11 years agoTeach clang about the armv4/armv4t distinction
Tim Northover [Thu, 13 Jun 2013 15:02:46 +0000 (15:02 +0000)]
Teach clang about the armv4/armv4t distinction

When choosing a default CPU, clang used to pick ARM7TDMI (which has Thumb) even
when the more restrictive armv4 triple was specified. This should fix that.

Patch by Jeroen Hofstee.

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

11 years agoModernize some low-hanging PathV1 uses.
Benjamin Kramer [Thu, 13 Jun 2013 14:26:04 +0000 (14:26 +0000)]
Modernize some low-hanging PathV1 uses.

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

11 years agolibclang: Remove clang::RemapFiles, it's dead code.
Benjamin Kramer [Thu, 13 Jun 2013 13:57:48 +0000 (13:57 +0000)]
libclang: Remove clang::RemapFiles, it's dead code.

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

11 years agolibclang: Port CIndexer::getClangResourcesPath to PathV2. No functionality change.
Benjamin Kramer [Thu, 13 Jun 2013 13:56:37 +0000 (13:56 +0000)]
libclang: Port CIndexer::getClangResourcesPath to PathV2. No functionality change.

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

11 years agoAdd Ubuntu Saucy to the list of known Ubuntu releases
Sylvestre Ledru [Thu, 13 Jun 2013 11:52:27 +0000 (11:52 +0000)]
Add Ubuntu Saucy to the list of known Ubuntu releases
Thanks to Dmitry Shachnev for the patch
See bug #16317

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

11 years agoMake it clear in Decl::hasBody that it can return true on redeclarations.
Manuel Klimek [Thu, 13 Jun 2013 09:05:19 +0000 (09:05 +0000)]
Make it clear in Decl::hasBody that it can return true on redeclarations.

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

11 years agoMore for PR12457: fix handling of __builtin_isinf_sign and test.
Richard Smith [Thu, 13 Jun 2013 06:31:13 +0000 (06:31 +0000)]
More for PR12457: fix handling of __builtin_isinf_sign and test.

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

11 years agoTowards PR12457: constant expression evaluation support for __builtin_parity{,l,ll...
Richard Smith [Thu, 13 Jun 2013 06:26:32 +0000 (06:26 +0000)]
Towards PR12457: constant expression evaluation support for __builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify.

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

11 years agoUpdated C++1y status for contextual conversions to 'partial' (without review)
Larisse Voufo [Thu, 13 Jun 2013 06:04:33 +0000 (06:04 +0000)]
Updated C++1y status for contextual conversions to 'partial' (without review)

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

11 years agoFix part of PR12457. Patch by Justin Bogner!
Richard Smith [Thu, 13 Jun 2013 05:04:16 +0000 (05:04 +0000)]
Fix part of PR12457. Patch by Justin Bogner!

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

11 years agoFix some confusing diagnostic wording. s/implicit default/implicit/ if we're
Richard Smith [Thu, 13 Jun 2013 03:34:55 +0000 (03:34 +0000)]
Fix some confusing diagnostic wording. s/implicit default/implicit/ if we're
not actually talking about a default constructor.

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

11 years agoC++11: If a class has a user-declared copy operation or destructor, the
Richard Smith [Thu, 13 Jun 2013 03:23:42 +0000 (03:23 +0000)]
C++11: If a class has a user-declared copy operation or destructor, the
implicit definition of a copy operation is deprecated. Add a warning for this
to -Wdeprecated. This warning is disabled by default for now, pending
investigation into how common this situation is.

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

11 years agoImplement core issue 903: only integer literals with value 0 and prvalues of
Richard Smith [Thu, 13 Jun 2013 02:46:14 +0000 (02:46 +0000)]
Implement core issue 903: only integer literals with value 0 and prvalues of
type std::nullptr_t are null pointer constants from C++11 onwards.

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

11 years agoIn C++11, promote access declaration diagnostic from warning to error. There
Richard Smith [Thu, 13 Jun 2013 02:12:17 +0000 (02:12 +0000)]
In C++11, promote access declaration diagnostic from warning to error. There
doesn't seem to be any value in even adding a -W flag for this.

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

11 years agoAdd -Wdeprecated warnings and fixits for things deprecated in C++11:
Richard Smith [Thu, 13 Jun 2013 02:02:51 +0000 (02:02 +0000)]
Add -Wdeprecated warnings and fixits for things deprecated in C++11:
 - 'register' storage class
 - dynamic exception specifications

Only the former check is enabled by default for now (the latter might be quite noisy).

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

11 years agoWhen copy-initializing a temporary for a reference binding, don't allow use of
Richard Smith [Thu, 13 Jun 2013 00:57:57 +0000 (00:57 +0000)]
When copy-initializing a temporary for a reference binding, don't allow use of
explicit constructors.

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

11 years agoInclude the unexpanded packs in the initializer expression when checking a
Nick Lewycky [Thu, 13 Jun 2013 00:45:47 +0000 (00:45 +0000)]
Include the unexpanded packs in the initializer expression when checking a
pack expanded constructor initializer list. Fixes PR16303!

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

11 years agoSimplify: we don't need any special-case lifetime extension when initializing
Richard Smith [Wed, 12 Jun 2013 23:38:09 +0000 (23:38 +0000)]
Simplify: we don't need any special-case lifetime extension when initializing
declarations of reference type; they're handled by the general case handling of
MaterializeTemporaryExpr.

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

11 years agoDon't suggest putting 'operator new' or 'operator delete' in a namespace to fix a...
Richard Smith [Wed, 12 Jun 2013 22:56:54 +0000 (22:56 +0000)]
Don't suggest putting 'operator new' or 'operator delete' in a namespace to fix a two-phase lookup issue. That's not permitted.

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

11 years agoPR12086, PR15117
Richard Smith [Wed, 12 Jun 2013 22:31:48 +0000 (22:31 +0000)]
PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.

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

11 years agoMove detection of reference members binding to temporaries from building of
Richard Smith [Wed, 12 Jun 2013 21:51:50 +0000 (21:51 +0000)]
Move detection of reference members binding to temporaries from building of
CXXCtorInitializers to the point where we perform the questionable lifetime
extension. This exposed a selection of false negatives in the warning.

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

11 years agoIntroducing -Wheader-guard, a warning that checks header guards actually work
Richard Trieu [Wed, 12 Jun 2013 21:20:57 +0000 (21:20 +0000)]
Introducing -Wheader-guard, a warning that checks header guards actually work
properly.  This warning checks that the #ifndef and #define directives at
the beginning of a header refer to the same macro name.  Includes a fix-it
hint to correct the header guard.

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

11 years agoUse the global functions instead of the Program methods.
Rafael Espindola [Wed, 12 Jun 2013 20:44:26 +0000 (20:44 +0000)]
Use the global functions instead of the Program methods.

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

11 years agoReapply r183721, reverted in r183776, with a fix for a bug in the former (we
Richard Smith [Wed, 12 Jun 2013 20:42:33 +0000 (20:42 +0000)]
Reapply r183721, reverted in r183776, with a fix for a bug in the former (we
were lacking ExprWithCleanups nodes in some cases where the new approach to
lifetime extension needed them).

Original commit message:

Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.

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

11 years agoRetain linker flags specified on cmake command line.
Andy Gibbs [Wed, 12 Jun 2013 20:02:59 +0000 (20:02 +0000)]
Retain linker flags specified on cmake command line.

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

11 years agoPreserve newlines before block comments in static initializers.
Alexander Kornienko [Wed, 12 Jun 2013 19:04:12 +0000 (19:04 +0000)]
Preserve newlines before block comments in static initializers.

Summary:
Basically, don't special-case line comments in this regard. And fixed
an incorrect test, that relied on the wrong behavior.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D962

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

11 years agoPort HTMLDiagnostics to PathV2. No intended functionality change.
Benjamin Kramer [Wed, 12 Jun 2013 18:13:05 +0000 (18:13 +0000)]
Port HTMLDiagnostics to PathV2. No intended functionality change.

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

11 years agoFix buildbot breakage on PPC64.
Eli Friedman [Wed, 12 Jun 2013 17:31:32 +0000 (17:31 +0000)]
Fix buildbot breakage on PPC64.

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

11 years agoSilencing a signed vs unsigned comparison mismatch in MSVC.
Aaron Ballman [Wed, 12 Jun 2013 15:03:45 +0000 (15:03 +0000)]
Silencing a signed vs unsigned comparison mismatch in MSVC.

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

11 years agoFix memory corruption in CStringChecker
Pavel Labath [Wed, 12 Jun 2013 07:45:04 +0000 (07:45 +0000)]
Fix memory corruption in CStringChecker

Summary:
"register" functions for the checker were caching the checker objects in a
static variable. This caused problems when the function is called with a
different CheckerManager.

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D955

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

11 years agoAdd support for complex compound assignments where the LHS is a scalar.
Eli Friedman [Wed, 12 Jun 2013 01:40:06 +0000 (01:40 +0000)]
Add support for complex compound assignments where the LHS is a scalar.

Fixes <rdar://problem/11224126> and PR12790.

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

11 years agoMake va_arg and argument passing to varargs functions work correctly with
Eli Friedman [Wed, 12 Jun 2013 00:13:45 +0000 (00:13 +0000)]
Make va_arg and argument passing to varargs functions work correctly with
AVX vectors when AVX is turned on.

Fixes <rdar://problem/10513611>.

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

11 years agoTweak r183791 so we don't print a note without a source location.
Eli Friedman [Tue, 11 Jun 2013 22:26:34 +0000 (22:26 +0000)]
Tweak r183791 so we don't print a note without a source location.

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

11 years agoInclude Path.h instead of PathV2.h.
Rafael Espindola [Tue, 11 Jun 2013 22:15:02 +0000 (22:15 +0000)]
Include Path.h instead of PathV2.h.

I am about to move PathV2.h to Path.h.

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

11 years agoCorrectly handle designated initializers which modify an array initialized
Eli Friedman [Tue, 11 Jun 2013 21:48:11 +0000 (21:48 +0000)]
Correctly handle designated initializers which modify an array initialized
with a string.  This case is sort of tricky because we can't modify the
StringLiteral used to represent such initializers.
We are forced to decompose the string into individual characters.

Fixes <rdar://problem/10465114>.

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

11 years agoAdd a testcase for PR7434, which is a bug we no longer appear to have.
Richard Smith [Tue, 11 Jun 2013 20:38:45 +0000 (20:38 +0000)]
Add a testcase for PR7434, which is a bug we no longer appear to have.

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

11 years agoInclude PathV1.h in a file that uses it.
Rafael Espindola [Tue, 11 Jun 2013 20:31:32 +0000 (20:31 +0000)]
Include PathV1.h in a file that uses it.

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