]> granicus.if.org Git - clang/log
clang
11 years agoFix CodeGenCXX/debug-info.cpp test on Windows
Reid Kleckner [Thu, 20 Jun 2013 16:28:24 +0000 (16:28 +0000)]
Fix CodeGenCXX/debug-info.cpp test on Windows

On Windows, it looks like FlagIndirectVariable is being set in Flags for
DIBuilder::createLocalVariable(), giving us an i32 of 8192 instead of 0,
as on Linux.

Fixes breakage from r184367.

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

11 years agoUse the new name of getUniqueID.
Rafael Espindola [Thu, 20 Jun 2013 15:12:38 +0000 (15:12 +0000)]
Use the new name of getUniqueID.

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

11 years agoEnhancements for the DynTypedMatcher system.
Samuel Benzaquen [Thu, 20 Jun 2013 14:28:32 +0000 (14:28 +0000)]
Enhancements for the DynTypedMatcher system.
- Added conversion routines and checks in Matcher<T> that take a DynTypedMatcher.
- Added type information on the error messages for the marshallers.
- Allows future work on Polymorphic/overloaded matchers. We should be
  able to disambiguate at runtime and choose the appropriate overload.

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

11 years agoAdds the equalsBoundNode matcher.
Manuel Klimek [Thu, 20 Jun 2013 14:06:32 +0000 (14:06 +0000)]
Adds the equalsBoundNode matcher.

Most of the tests contributed by Edwin Vane.

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

11 years agoUse the same set of whitespace characters for all operations in BreakableToken.
Alexander Kornienko [Thu, 20 Jun 2013 13:58:37 +0000 (13:58 +0000)]
Use the same set of whitespace characters for all operations in BreakableToken.

Summary:
Fixes a problem where \t,\v or \f could lead to a crash when placed as
a first character in a line comment. The cause is that rtrim and ltrim handle
these characters, but our code didn't, so some invariants could be broken.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoImplements declaratorDecl, parmVarDecl and hassTypeLoc matchers.
Manuel Klimek [Thu, 20 Jun 2013 13:08:29 +0000 (13:08 +0000)]
Implements declaratorDecl, parmVarDecl and hassTypeLoc matchers.

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

11 years agoImproved source code fidelity for gcc mode attribute.
Enea Zaffanella [Thu, 20 Jun 2013 12:46:19 +0000 (12:46 +0000)]
Improved source code fidelity for gcc mode attribute.

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

11 years agoAdd -fno-assume-sane-operator-new when building with MSan.
Evgeniy Stepanov [Thu, 20 Jun 2013 10:49:46 +0000 (10:49 +0000)]
Add -fno-assume-sane-operator-new when building with MSan.

A workaroudn for PR16386. MSan's operator new aften has side-effects that are
miscompiled without this flag.

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

11 years agoUpdate two options to my proposed syntax for user-facing driver options:
Chandler Carruth [Thu, 20 Jun 2013 09:42:40 +0000 (09:42 +0000)]
Update two options to my proposed syntax for user-facing driver options:

  -gcc-toolchain foo  ->  --gcc-toolchain=foo
  -target foo         ->  --target=foo

I've added legacy aliases for the original spellings. I've updated the
canonical tests to check both spellings, and switched all of the
-gcc-toolchain usages elsewhere in the test suite to use the new one.
I've updated some of the usages of -target to the new syntax, but will
finish that in a separate entirely mechanical change once I'm sure this
won't get rolled back for some reason (It touches a *huge* number of RUN
lines in the test suite unsurprisingly).

A nice result is that the three most common flags I end up using when
doing cross compiles are all now consistent: --target=, --sysroot=, and
--gcc-toolchain=.

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

11 years agoFix static analyzer crash when casting from an incomplete type
Pavel Labath [Thu, 20 Jun 2013 07:45:01 +0000 (07:45 +0000)]
Fix static analyzer crash when casting from an incomplete type

Summary:
When doing a reinterpret+dynamic cast from an incomplete type, the analyzer
would crash (bug #16308). This fix makes the dynamic cast evaluator ignore
incomplete types, as they can never be used in a dynamic_cast. Also adding a
regression test.

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

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

11 years agoAdd a regression test for PR16370 next to the dr7 test case since they
Chandler Carruth [Thu, 20 Jun 2013 07:06:39 +0000 (07:06 +0000)]
Add a regression test for PR16370 next to the dr7 test case since they
seem closely related. (I'm happy to move this if others have a better
idea of where to put it.)

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

11 years agoTemporarily revert r183462: "Implement DR7"
Chandler Carruth [Thu, 20 Jun 2013 07:06:34 +0000 (07:06 +0000)]
Temporarily revert r183462: "Implement DR7"

This fixes PR16370, I'll add the test case in a follow-up commit.

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

11 years agoFix one place I missed that was memcpy'ing TypeLocs in a way that messes
Eli Friedman [Thu, 20 Jun 2013 04:11:21 +0000 (04:11 +0000)]
Fix one place I missed that was memcpy'ing TypeLocs in a way that messes
up alignment.

Fixes utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp from the
libc++ testsuite.

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

11 years agoPR16377: Allow evaluation of statement expressions in constant evaluation,
Richard Smith [Thu, 20 Jun 2013 03:00:05 +0000 (03:00 +0000)]
PR16377: Allow evaluation of statement expressions in constant evaluation,
why not. Apparently GCC supports this.

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

11 years agoAdd a workaround for a libstdc++-4.2 <tr1/hashtable> bug. This header uses
Richard Smith [Thu, 20 Jun 2013 02:18:31 +0000 (02:18 +0000)]
Add a workaround for a libstdc++-4.2 <tr1/hashtable> bug. This header uses

  return false;

in a function returning a pointer. 'false' was a null pointer constant in C++98
but is not in C++11. Punch a very small hole in the initialization rules in
C++11 mode to allow this specific case in system headers.

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

11 years agoOne more cast test.
Eli Friedman [Thu, 20 Jun 2013 01:47:05 +0000 (01:47 +0000)]
One more cast test.

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

11 years agoAdd a few more tests for casts.
Eli Friedman [Thu, 20 Jun 2013 01:35:13 +0000 (01:35 +0000)]
Add a few more tests for casts.

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

11 years agoFix typo in r184308.
Richard Smith [Thu, 20 Jun 2013 01:33:59 +0000 (01:33 +0000)]
Fix typo in r184308.

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

11 years agoAdd a testcase which uses an UnresolvedUsingTypenameDecl as the base of an NNS.
Eli Friedman [Thu, 20 Jun 2013 00:04:23 +0000 (00:04 +0000)]
Add a testcase which uses an UnresolvedUsingTypenameDecl as the base of an NNS.

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

11 years ago[clang-lit] Added the run_long_tests param option/long_tests feature to toggle execut...
Michael Gottesman [Wed, 19 Jun 2013 23:23:49 +0000 (23:23 +0000)]
[clang-lit] Added the run_long_tests param option/long_tests feature to toggle execution of long running FileCheck tests.

This will allow for longer running FileCheck based tests to be committed to
clang for use on buildbots, preventing the normal make-check cycle from
increasing in time significantly.

This is a necessary change in order to commit the end-to-end arm neon intrinsic
tests since FileCheck takes ~20 seconds to run said test due to the large amount
of neon intrinsics.

To force a test to run only when --param run_long_tests=true is passed in use
the following requires statement:

// REQUIRES: long_tests

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

11 years agoRevert r184205 and associated patches while investigating issue with broken buildbot...
Stephen Lin [Wed, 19 Jun 2013 23:23:19 +0000 (23:23 +0000)]
Revert r184205 and associated patches while investigating issue with broken buildbot (possible interaction with LTO)

<rdar://problem/14209661>

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

11 years ago[libclang] Make sure crash-recovery for module-building does not interfere with libcl...
Argyrios Kyrtzidis [Wed, 19 Jun 2013 23:15:35 +0000 (23:15 +0000)]
[libclang] Make sure crash-recovery for module-building does not interfere with libclang crash-recovery.

This tests llvm commit r184380.
rdar://14204560

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

11 years agoFix r184381 so the test doesn't fail. Sorry for the inconvenience, I thought I had...
Eli Friedman [Wed, 19 Jun 2013 23:00:37 +0000 (23:00 +0000)]
Fix r184381 so the test doesn't fail.  Sorry for the inconvenience, I thought I had checked it.

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

11 years agoExtra test for diagnostic in Sema::BuildCXXNestedNameSpecifier.
Eli Friedman [Wed, 19 Jun 2013 22:58:30 +0000 (22:58 +0000)]
Extra test for diagnostic in Sema::BuildCXXNestedNameSpecifier.

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

11 years agoRemove dead code.
Eli Friedman [Wed, 19 Jun 2013 22:49:39 +0000 (22:49 +0000)]
Remove dead code.

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

11 years agoImprove diagnostic for redeclaring static member function. Fixes PR16382.
Eli Friedman [Wed, 19 Jun 2013 22:43:55 +0000 (22:43 +0000)]
Improve diagnostic for redeclaring static member function.  Fixes PR16382.

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

11 years agoFix for PR 16367, display the name of a function in a diagnostic instead of
Richard Trieu [Wed, 19 Jun 2013 22:25:01 +0000 (22:25 +0000)]
Fix for PR 16367, display the name of a function in a diagnostic instead of
showing "(null)".

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

11 years agoAdd missing test for -Wunneeded-member-functions.
Eli Friedman [Wed, 19 Jun 2013 22:01:25 +0000 (22:01 +0000)]
Add missing test for -Wunneeded-member-functions.

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

11 years agoDebug Info: PR14763/r183329 - specify that non-trivial pass-by-value parameters are...
David Blaikie [Wed, 19 Jun 2013 21:53:53 +0000 (21:53 +0000)]
Debug Info: PR14763/r183329 - specify that non-trivial pass-by-value parameters are stored indirectly

This is to fix the location information for such parameters to refer to
the object accessible through the pointer rather than to the pointer
parameter itself.

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

11 years agoFixed long-standing issue with incorrect length calculation of multi-line comments.
Alexander Kornienko [Wed, 19 Jun 2013 19:50:11 +0000 (19:50 +0000)]
Fixed long-standing issue with incorrect length calculation of multi-line comments.

Summary:
A trailing block comment having multiple lines would cause extremely
high penalties if the summary length of its lines is more than the column limit.
Fixed by always considering only the last line of a multi-line block comment.
Removed a long-standing FIXME from relevant tests and added a motivating test
modelled after problem cases from real code.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoDelete dead code. (Array element types are always complete in C.)
Eli Friedman [Wed, 19 Jun 2013 19:03:14 +0000 (19:03 +0000)]
Delete dead code.  (Array element types are always complete in C.)

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

11 years agoEnhancements for the DynTypedNode
Samuel Benzaquen [Wed, 19 Jun 2013 18:45:24 +0000 (18:45 +0000)]
Enhancements for the DynTypedNode

Added ASTNodeKind as a standalone way to represent node kinds and their hierarchy.
This change is to support ongoing work on D815.

Reviewers: klimek

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

11 years agoCorrections to r184205 ('this'-return optimization) due to the wrong version of the...
Stephen Lin [Wed, 19 Jun 2013 18:10:35 +0000 (18:10 +0000)]
Corrections to r184205 ('this'-return optimization) due to the wrong version of the patch being committed originally.
1) Removed useless return value of CGCXXABI::EmitConstructorCall and CGCXXABI::EmitVirtualDestructorCall and implementations
2) Corrected last portion of CodeGenCXX/constructor-destructor-return-this to correctly test for non-'this'-return of virtual destructor calls

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

11 years agodocumentation parsing: patch to make @class work for
Fariborz Jahanian [Wed, 19 Jun 2013 18:08:03 +0000 (18:08 +0000)]
documentation parsing: patch to make @class work for
class templates; and similarly, @function  works for
function templates. // rdar://14124702

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

11 years agoRevert "Adds support for openSUSE ARM v5/v7 triples."
Renato Golin [Wed, 19 Jun 2013 17:28:50 +0000 (17:28 +0000)]
Revert "Adds support for openSUSE ARM v5/v7 triples."

This reverts commit 312e51ca484976c2b1254952ff23d5162ca8edc2.

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

11 years agoAdds support for openSUSE ARM v5/v7 triples.
Renato Golin [Wed, 19 Jun 2013 17:28:42 +0000 (17:28 +0000)]
Adds support for openSUSE ARM v5/v7 triples.

Now, with a comma.

Patch by İsmail Dönmez

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

11 years ago[CodeGen] Move EHScopeStack into its own header
Reid Kleckner [Wed, 19 Jun 2013 17:07:50 +0000 (17:07 +0000)]
[CodeGen] Move EHScopeStack into its own header

CGCleanup.h isn't meant to be included by all of CodeGen according to
John.

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

11 years ago[Windows] Fix __declspec(property) when the getter returns a ref
Reid Kleckner [Wed, 19 Jun 2013 16:37:23 +0000 (16:37 +0000)]
[Windows] Fix __declspec(property) when the getter returns a ref

This fixes an issue when parsing atlbase.h.

Patch by Will Wilson!

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

11 years agoCompletely revamp node binding for AST matchers.
Manuel Klimek [Wed, 19 Jun 2013 15:42:45 +0000 (15:42 +0000)]
Completely revamp node binding for AST matchers.

This is in preparation for the backwards references to bound
nodes, which will expose a lot more about how matches occur.  Main
changes:
- instead of building the tree of bound nodes, we build a "set" of bound
  nodes and explode all possible match combinations while running
  through the matchers; this will allow us to also implement matchers
  that filter down the current set of matches, like "equalsBoundNode"
- take the set of bound nodes at the start of the match into
  consideration when doing memoization; as part of that, reevaluated
  that memoization gives us benefits that are large enough (it still
  does - the effect on common match patterns is up to an order of
  magnitude)
- reset the bound nodes when a node does not match, thus never leaking
  information from partial sub-matcher matches for failing matchers

Effects:
- we can now correctly "explode" combinatorial matches, for example:
  allOf(forEachDescendant(...bind("a")),
  forEachDescendant(...bind("b"))) will now trigger matches for all
  combinations of matching "a" and "b"s.
- we now never expose bound nodes from partial matches in matchers that
  did not match in the end - this fixes a long-standing issue

FIXMEs:
- rename BoundNodesTreeBuilder to BoundNodesBuilder or
  BoundNodesSetBuilder, as we don't build a tree any more; this is out
  of scope for this change, though
- we're seeing some performance regressions (around 10%), but I expect
  some performance tuning will get that back, and it's easily worth
  the increase in expressiveness for now

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

11 years agoDon't depend on PathV1.h including set.
Rafael Espindola [Wed, 19 Jun 2013 15:31:27 +0000 (15:31 +0000)]
Don't depend on PathV1.h including set.

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

11 years ago[ms-cxxabi] Emit and install appropriately mangled vbtables
Reid Kleckner [Wed, 19 Jun 2013 15:20:38 +0000 (15:20 +0000)]
[ms-cxxabi] Emit and install appropriately mangled vbtables

In Itanium, dynamic classes have one vtable with several different
address points for dynamic base classes that can't share vtables.

In the MS C++ ABI, each vbtable that can't be shared gets its own
symbol, similar to how ctor vtables work in Itanium.  However, instead
of mangling the subobject offset into the symbol, the unique portions of
the inheritance path are mangled into the symbol to make it unique.

This patch implements the MSVC 2012 scheme for forming unique vbtable
symbol names.  MSVC 2010 use the same mangling with a different subset
of the path.  Implementing that mangling and possibly others is TODO.

Each vbtable is an array of i32 offsets from the vbptr that points to it
to another virtual base subobject.  The first entry of a vbtable always
points to the base of the current subobject, implying that it is the
same no matter which parent class contains it.

Reviewers: rjmccall

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

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

11 years ago[Driver] Don't forward source file input args to gcc
Reid Kleckner [Wed, 19 Jun 2013 15:09:06 +0000 (15:09 +0000)]
[Driver] Don't forward source file input args to gcc

gcc's inputs are already added by the InputInfoList passed to
Action::ConstructJob.

Fixes a regression from r183989.  This was manifesting when targetting
mingw as an extra input argument to gcc when assembling.  It presumably
affects other situations where clang calls gcc.

Prior to r183989, forwardToGCC() was returning false because the INPUT
option defined in OptParser.td had the DriverOption flag set on it.
LLVM's Option library does not set this flag for INPUT.

Reviewers: espindola

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

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

11 years agoRevert r184302 on Renato's behalf - it broke the bots and he's asked me to revert...
James Molloy [Wed, 19 Jun 2013 15:03:14 +0000 (15:03 +0000)]
Revert r184302 on Renato's behalf - it broke the bots and he's asked me to revert as he's unavailable.

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

11 years agoSplit long strings on word boundaries.
Alexander Kornienko [Wed, 19 Jun 2013 14:22:47 +0000 (14:22 +0000)]
Split long strings on word boundaries.

Summary: Split strings at word boundaries, when there are no spaces and slashes.

Reviewers: klimek

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

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

11 years agoAdds support for openSUSE ARM v5/v7 triples.
Renato Golin [Wed, 19 Jun 2013 14:03:51 +0000 (14:03 +0000)]
Adds support for openSUSE ARM v5/v7 triples.

Patch by İsmail Dönmez

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

11 years agoFix pr16354.
Rafael Espindola [Wed, 19 Jun 2013 13:41:54 +0000 (13:41 +0000)]
Fix pr16354.

We now reject things like

struct ABC {
  static double a;
};
register double ABC::a = 1.0;

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

11 years agoSilence 'set but not used' warning when building in release mode using gcc.
Andy Gibbs [Wed, 19 Jun 2013 13:33:37 +0000 (13:33 +0000)]
Silence 'set but not used' warning when building in release mode using gcc.

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

11 years agoUse llvm::sys::fs::can_execute.
Rafael Espindola [Wed, 19 Jun 2013 13:24:29 +0000 (13:24 +0000)]
Use llvm::sys::fs::can_execute.

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

11 years agoFix a crash in the static analyzer (bug #16307)
Pavel Labath [Wed, 19 Jun 2013 08:19:56 +0000 (08:19 +0000)]
Fix a crash in the static analyzer (bug #16307)

Summary:
When processing a call to a function, which got passed less arguments than it
expects, the analyzer would crash.

I've also added a test for that and a analyzer warning which detects these
cases.

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

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

11 years agoFix a warning. [-Wunused-variable]
NAKAMURA Takumi [Wed, 19 Jun 2013 06:58:20 +0000 (06:58 +0000)]
Fix a warning. [-Wunused-variable]

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

11 years agoRevert r184249, "doc. parsing: Allow parameter name "..." for variadic functions...
NAKAMURA Takumi [Wed, 19 Jun 2013 06:58:14 +0000 (06:58 +0000)]
Revert r184249, "doc. parsing: Allow parameter name "..." for variadic functions/methods."

It crashes in the case;

/// Without any "param"s in the description.
int printf(const char *format, ...);

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

11 years agoDelete dead code.
Eli Friedman [Wed, 19 Jun 2013 02:07:51 +0000 (02:07 +0000)]
Delete dead code.

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

11 years agoDebug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
Manman Ren [Wed, 19 Jun 2013 01:46:49 +0000 (01:46 +0000)]
Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4

These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.

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

11 years agoAdd test coverage for serialization of dependent function template specializations.
Eli Friedman [Wed, 19 Jun 2013 01:38:21 +0000 (01:38 +0000)]
Add test coverage for serialization of dependent function template specializations.

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

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