]> granicus.if.org Git - clang/log
clang
11 years agoAdd some comments to r184252.
Adrian Prantl [Tue, 18 Jun 2013 23:32:21 +0000 (23:32 +0000)]
Add some comments to r184252.

rdar://problem/14101097

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

11 years ago[analyzer] Do not create a CompoundVal for lvalue InitListExprs.
Anna Zaks [Tue, 18 Jun 2013 23:16:20 +0000 (23:16 +0000)]
[analyzer] Do not create a CompoundVal for lvalue InitListExprs.

These should be treated like scalars. This fixes a crash reported in radar://14164698.

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

11 years ago[analyzer] Do not report uninitialized value warnings inside swap functions.
Anna Zaks [Tue, 18 Jun 2013 23:16:15 +0000 (23:16 +0000)]
[analyzer] Do not report uninitialized value warnings inside swap functions.

This silences warnings that could occur when one is swapping partially initialized structs. We suppress
not only the assignments of uninitialized members, but any values inside swap because swap could
potentially be used as a subroutine to swap class members.

This silences a warning from std::try::function::swap() on partially initialized objects.

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

11 years agoEmit forward decls for structs with declarations only when we are
Adrian Prantl [Tue, 18 Jun 2013 23:01:56 +0000 (23:01 +0000)]
Emit forward decls for structs with declarations only when we are
limiting debug info.

FIXME: There is still work left to do here, the testcase should work even with -flimit-debug-info.

rdar://problem/14101097

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

11 years agoIntroduce a new mangling for protocol-qualified ObjC types in C++. This allows
Eli Friedman [Tue, 18 Jun 2013 22:41:37 +0000 (22:41 +0000)]
Introduce a new mangling for protocol-qualified ObjC types in C++.  This allows
to provide proper overloading, and also prevents mangling conflicts with
template arguments of protocol-qualified type.

This is a non-backward-compatible mangling change, but per discussion with
John, the benefits outweigh this cost.

Fixes <rdar://problem/14074822>.

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

11 years agodoc. parsing: Allow parameter name "..." for variadic functions/methods.
Fariborz Jahanian [Tue, 18 Jun 2013 22:40:39 +0000 (22:40 +0000)]
doc. parsing: Allow parameter name "..." for variadic functions/methods.
// rdar://14124644

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

11 years agoMake sure the assembler-with-cpp hack for "#" works with multiple "#"s in
Eli Friedman [Tue, 18 Jun 2013 21:33:38 +0000 (21:33 +0000)]
Make sure the assembler-with-cpp hack for "#" works with multiple "#"s in
succession. Fixes PR16363.

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

11 years agoWhen declaring an ObjC interface decl with a @compatibility_alias alias name, change...
Argyrios Kyrtzidis [Tue, 18 Jun 2013 21:26:33 +0000 (21:26 +0000)]
When declaring an ObjC interface decl with a @compatibility_alias alias name, change the class name to the "real" one.

If we have something like

  @class NewImage;
  @compatibility_alias OldImage NewImage;
  @class OldImage;

the lookup for 'OldImage' will return the 'NewImage' decl ("@class NewImage").
In such a case, when creating the decl for "@class OldImage" use the real declaration name ("NewImage"),
instead of the alias one ("OldImage"), otherwise we will break IdentifierResolver and redecls-chain invariants.

Fixes crash of rdar://14112291.

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

11 years agoUse llvm::sys::fs::can_write.
Rafael Espindola [Tue, 18 Jun 2013 20:58:25 +0000 (20:58 +0000)]
Use llvm::sys::fs::can_write.

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

11 years agoPartially revert r184225 test changes and make a smaller and more generic fix.
Stephen Lin [Tue, 18 Jun 2013 20:51:51 +0000 (20:51 +0000)]
Partially revert r184225 test changes and make a smaller and more generic fix.

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

11 years ago[multiprecision-builtins] Added missing builtin __builtin_{add,sub}cb for {add,sub...
Michael Gottesman [Tue, 18 Jun 2013 20:40:40 +0000 (20:40 +0000)]
[multiprecision-builtins] Added missing builtin __builtin_{add,sub}cb for {add,sub} with carry for bytes.

I have had several people ask me about why this builtin was not available in
clang (since it seems like a logical conclusion). This patch implements said
builtins.

Relevant tests are included as well. I also updated the Clang language extension reference.

rdar://14192664.

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

11 years agoFix C++ constructor/destructor tests when run on ARM
Stephen Lin [Tue, 18 Jun 2013 20:24:04 +0000 (20:24 +0000)]
Fix C++ constructor/destructor tests when run on ARM

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

11 years agoDR14, DR101, and part of DR1: fix handling of extern "C" declarations in
Richard Smith [Tue, 18 Jun 2013 20:15:12 +0000 (20:15 +0000)]
DR14, DR101, and part of DR1: fix handling of extern "C" declarations in
namespaces, by treating them just like we treat extern "C" declarations in
function scope.

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

11 years agoUse llvm::sys::fs::GetUniqueID.
Rafael Espindola [Tue, 18 Jun 2013 19:40:07 +0000 (19:40 +0000)]
Use llvm::sys::fs::GetUniqueID.

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

11 years agoCorrectly compute the index of the first string format argument when deciding
Eli Friedman [Tue, 18 Jun 2013 18:10:01 +0000 (18:10 +0000)]
Correctly compute the index of the first string format argument when deciding
whether to emit a -Wformat-security warning.  <rdar://problem/14178260>.

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

11 years agoPR14503: Don't assert if a constexpr constructor temploid instantiates to a
Richard Smith [Tue, 18 Jun 2013 17:51:51 +0000 (17:51 +0000)]
PR14503: Don't assert if a constexpr constructor temploid instantiates to a
constructor that does not initialize all members, and that constructor is used
to initialize a global.

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

11 years agoObjective-C: Fixes a typo correction bug where a
Fariborz Jahanian [Tue, 18 Jun 2013 17:10:58 +0000 (17:10 +0000)]
Objective-C: Fixes a typo correction bug where a
selector would be correted to identical selector name
in certain corner cases. // rdar://7853549

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

11 years agoCodeGen: Have 'this'-returning constructors and destructors to take advantage of...
Stephen Lin [Tue, 18 Jun 2013 17:00:49 +0000 (17:00 +0000)]
CodeGen: Have 'this'-returning constructors and destructors to take advantage of the new backend 'returned' attribute.

The backend will now use the generic 'returned' attribute to form tail calls where possible, as well as avoid save-restores of 'this' in some cases (specifically the cases that matter for the ARM C++ ABI).

This patch also reverts a prior front-end only partial implementation of these optimizations, since it's no longer required.

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

11 years agoFix buildbot failure.
Fariborz Jahanian [Tue, 18 Jun 2013 15:54:30 +0000 (15:54 +0000)]
Fix buildbot failure.

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

11 years agoObjective-C [qoi]: privide typo correction for selectors
Fariborz Jahanian [Tue, 18 Jun 2013 15:31:36 +0000 (15:31 +0000)]
Objective-C [qoi]: privide typo correction for selectors
in addition of receiver having static type, but also when
receiver has dynamic type (of 'id' variety) as well as when
receiver is of 'Class' type vareity. // rdar://7853549

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

11 years agoRemove option emitter from clang-tblgen
Reid Kleckner [Tue, 18 Jun 2013 15:25:00 +0000 (15:25 +0000)]
Remove option emitter from clang-tblgen

The CMake build was still using it because I forgot to s/CLANG/LLVM/ in
the tablegen() call.  The Makefile build is already using llvm-tblgen.

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

11 years agoRemove duplicated file and directory.
Rafael Espindola [Tue, 18 Jun 2013 14:09:48 +0000 (14:09 +0000)]
Remove duplicated file and directory.

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

11 years agoUpdate to pass in pointers intead of references.
Bill Wendling [Tue, 18 Jun 2013 07:22:05 +0000 (07:22 +0000)]
Update to pass in pointers intead of references.

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

11 years agosize_t on Darwin AAPCS targets is "unsigned long". <rdar://problem/14136459>
Bob Wilson [Tue, 18 Jun 2013 05:36:04 +0000 (05:36 +0000)]
size_t on Darwin AAPCS targets is "unsigned long". <rdar://problem/14136459>

Some embedded targets use ARM's AAPCS with iOS header files that define size_t
as unsigned long, which conflicts with the usual AAPCS definition of size_t
as unsigned int.

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

11 years agoSimplify a loop in ProcessCodeCompleteResults(). Pointed out by David Blaikie
Dmitri Gribenko [Tue, 18 Jun 2013 04:41:50 +0000 (04:41 +0000)]
Simplify a loop in ProcessCodeCompleteResults().  Pointed out by David Blaikie

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

11 years agoArrayRef'ize CodeCompletionContext::getNumSelIdents()
Dmitri Gribenko [Tue, 18 Jun 2013 04:02:26 +0000 (04:02 +0000)]
ArrayRef'ize CodeCompletionContext::getNumSelIdents()

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

11 years agocontextual conversion fix: C++98 compatibility warning.
Larisse Voufo [Tue, 18 Jun 2013 03:08:53 +0000 (03:08 +0000)]
contextual conversion fix: C++98 compatibility warning.

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

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