]> granicus.if.org Git - clang/log
clang
11 years agoAdd basic fixit test to template instantiation bug fix (r184503)
Larisse Voufo [Fri, 21 Jun 2013 15:56:15 +0000 (15:56 +0000)]
Add basic fixit test to template instantiation bug fix (r184503)

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

11 years agoAdd support for polymorphic matchers. Use runtime type checking to determine the...
Samuel Benzaquen [Fri, 21 Jun 2013 15:51:31 +0000 (15:51 +0000)]
Add support for polymorphic matchers. Use runtime type checking to determine the right polymorphic overload to use.

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

11 years agoDisable an assertion death test when using MSVC's assert()
Reid Kleckner [Fri, 21 Jun 2013 12:58:12 +0000 (12:58 +0000)]
Disable an assertion death test when using MSVC's assert()

MSVC's debug runtime prints assertion failures in wide characters, which
gtest doesn't understand.

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

11 years ago[ms-cxxabi] Destroy temporary record arguments in the callee
Reid Kleckner [Fri, 21 Jun 2013 12:45:15 +0000 (12:45 +0000)]
[ms-cxxabi] Destroy temporary record arguments in the callee

Itanium destroys them in the caller at the end of the full expression,
but MSVC destroys them in the callee.  This is further complicated by
the need to emit EH-only destructor cleanups in the caller.

This should help clang compile MSVC's debug iterators more correctly.
There is still an outstanding issue in PR5064 of a memcpy emitted by the
LLVM backend, which is not correct for C++ records.

Fixes PR16226.

Reviewers: rjmccall

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

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

11 years agoImprove documentation for AST matchers.
Manuel Klimek [Fri, 21 Jun 2013 09:59:59 +0000 (09:59 +0000)]
Improve documentation for AST matchers.

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

11 years agoDebugInfo: handle the DI asm printing change to reword '[fwd]' as '[decl]' and add...
David Blaikie [Fri, 21 Jun 2013 03:41:46 +0000 (03:41 +0000)]
DebugInfo: handle the DI asm printing change to reword '[fwd]' as '[decl]' and add '[def]' for non-decl tag types

This is to make test cases looking for definitions more legible by
making the definition explicit rather than just the absence of '[fwd]'.
This allowed the debug-info-record tests to be rephrased - and in the
interests of reducing the number of individual test cases/invocations we
have, I merged them into one file, separated them with namespaces (&
then moved them to C++ because namespaces are great). If they need to
remain 'C' only tests, they can be moved back. (I didn't group them with
'debug-info-class.cpp' because these tests only apply to
-fno-limit-debug-info)

I removed the pieces of code that would cause these tests to pass under
-flimit-debug-info to ensure the tests remain relevant to their fixes
should we ever improve -flimit-debug-info to catch that kind of code.

This commit is version locked with the corresponding change to
DebugInfo.h in LLVM. Except some transient buildbot fallout.

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

11 years agoDelete dead code.
Eli Friedman [Fri, 21 Jun 2013 02:13:57 +0000 (02:13 +0000)]
Delete dead code.

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

11 years agoAdd test.
Eli Friedman [Fri, 21 Jun 2013 02:09:51 +0000 (02:09 +0000)]
Add test.

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

11 years ago[docs] Add link to presentation slides.
Sean Silva [Fri, 21 Jun 2013 02:09:29 +0000 (02:09 +0000)]
[docs] Add link to presentation slides.

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

11 years agoDelete dead code.
Eli Friedman [Fri, 21 Jun 2013 01:49:53 +0000 (01:49 +0000)]
Delete dead code.

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

11 years agoAdd an assert() suggested by Richard.
Nico Weber [Fri, 21 Jun 2013 01:29:36 +0000 (01:29 +0000)]
Add an assert() suggested by Richard.

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

11 years agoAdd missing test.
Eli Friedman [Fri, 21 Jun 2013 01:28:03 +0000 (01:28 +0000)]
Add missing test.

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

11 years agoFix all the silly things I committed in r184509
David Blaikie [Fri, 21 Jun 2013 00:59:44 +0000 (00:59 +0000)]
Fix all the silly things I committed in r184509

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

11 years ago[analyzer] Handle zeroing CXXConstructExprs.
Jordan Rose [Fri, 21 Jun 2013 00:59:00 +0000 (00:59 +0000)]
[analyzer] Handle zeroing CXXConstructExprs.

Certain expressions can cause a constructor invocation to zero-initialize
its object even if the constructor itself does no initialization. The
analyzer now handles that before evaluating the call to the constructor,
using the same "default binding" mechanism that calloc() uses, rather
than simply ignoring the zero-initialization flag.

As a bonus, trivial default constructors are now no longer inlined; they
are instead processed explicitly by ExprEngine. This has a (positive)
effect on the generated path edges: they no longer stop at a default
constructor call unless there's a user-provided implementation.

<rdar://problem/14212563>

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

11 years ago[analyzer] Fix stale comment in CallEvent.
Jordan Rose [Fri, 21 Jun 2013 00:58:51 +0000 (00:58 +0000)]
[analyzer] Fix stale comment in CallEvent.

No functionality change.

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

11 years agoAlternative fix for r184473.
David Blaikie [Fri, 21 Jun 2013 00:40:50 +0000 (00:40 +0000)]
Alternative fix for r184473.

This just seems a bit tidier/more principled. Based on a patch provided
by Adrian - with the only minor tweak that it needed to use
"getTypeOrNull" rather than "getCompletedTypeOrNull" since we don't
store declarations in the CompletedTypes cache.

No intended functionality change.

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

11 years agoAdd test header missing from r184504.
Douglas Gregor [Fri, 21 Jun 2013 00:22:44 +0000 (00:22 +0000)]
Add test header missing from r184504.

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

11 years agoWhen building a module, keep *all* declared methods in the global method pool.
Douglas Gregor [Fri, 21 Jun 2013 00:20:25 +0000 (00:20 +0000)]
When building a module, keep *all* declared methods in the global method pool.

As an optimization, we only kept declared methods with distinct
signatures in the global method pool, to keep the method lists
small. Under modules, however, one could have two different methods
with the same signature that occur in different (sub)modules. If only
the later submodule is important, message sends to 'id' with that
selector would fail because the first method (the only one that got
into the method pool) was hidden. When building a module, keep *all*
of the declared methods.

I did a quick check of both module build time and uses of modules, and
found no performance regression despite this causing us to keep more
methods in the global method pool. Fixes <rdar://problem/14148896>.

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

11 years agoBug Fix: Template explicit instantiations should not have definitions (FixIts yet...
Larisse Voufo [Fri, 21 Jun 2013 00:08:46 +0000 (00:08 +0000)]
Bug Fix: Template explicit instantiations should not have definitions (FixIts yet to be tested.)

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

11 years agoAdd a couple more tests.
Eli Friedman [Thu, 20 Jun 2013 23:58:09 +0000 (23:58 +0000)]
Add a couple more tests.

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

11 years agoUpdate a comment to clarify that searching the target triple bin
Chandler Carruth [Thu, 20 Jun 2013 23:37:54 +0000 (23:37 +0000)]
Update a comment to clarify that searching the target triple bin
directory for programs used by the driver is actually the standard
behavior we want to be compatible with GCC cross compilers -- it isn't
specific to SUSE or any other distro.

Also start fleshing out testing of the different cross compilation
patterns, both with a new very bare-bones tree of cross compilers and by
extending the multilib trees. Currently, we don't correctly model doing
a cross compile using the non-triple target of a bi-arch GCC install,
but I'll add support for that (and tests) next.

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

11 years agoFix a crash with __flaot128 noticed by Eli.
Nico Weber [Thu, 20 Jun 2013 23:30:30 +0000 (23:30 +0000)]
Fix a crash with __flaot128 noticed by Eli.

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

11 years ago[checked-arithmetic builtins] Added builtins to enable users to perform checked-arith...
Michael Gottesman [Thu, 20 Jun 2013 23:28:10 +0000 (23:28 +0000)]
[checked-arithmetic builtins] Added builtins to enable users to perform checked-arithmetic in c.

This will enable users in security critical applications to perform
checked-arithmetic in a fast safe manner that is amenable to c.

Tests/an update to Language Extensions is included as well.

rdar://13421498.

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

11 years agoAdd back a condition accidentially removed in r184470.
Richard Trieu [Thu, 20 Jun 2013 23:21:54 +0000 (23:21 +0000)]
Add back a condition accidentially removed in r184470.

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

11 years agoFix typo in comment. Patch by Matthew Dempsky!
Richard Smith [Thu, 20 Jun 2013 23:03:35 +0000 (23:03 +0000)]
Fix typo in comment. Patch by Matthew Dempsky!

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

11 years agoFix copy-pasted comment.
Richard Smith [Thu, 20 Jun 2013 23:01:44 +0000 (23:01 +0000)]
Fix copy-pasted comment.

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

11 years agoDon't allow __attribute__((common)) in C++. PR16330.
Eli Friedman [Thu, 20 Jun 2013 22:55:04 +0000 (22:55 +0000)]
Don't allow __attribute__((common)) in C++.  PR16330.

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

11 years agoAvoid repeatedly evaluating subexpressions when checking for unsequenced
Richard Smith [Thu, 20 Jun 2013 22:21:56 +0000 (22:21 +0000)]
Avoid repeatedly evaluating subexpressions when checking for unsequenced
operations in the case where evaluating a subexpression fails. No functionality
change, but test/Sema/many-logical-ops.c gets ~100x faster with this change.

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

11 years agoLazily provide a __float128 dummy type in -std=gnu++11 mode.
Nico Weber [Thu, 20 Jun 2013 21:44:55 +0000 (21:44 +0000)]
Lazily provide a __float128 dummy type in -std=gnu++11 mode.

This is needed to parse libstdc++ 4.7's type_traits, see PR13530.

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

11 years agoCall __cxa_begin_catch before std::terminate() in a noexcept trap.
John McCall [Thu, 20 Jun 2013 21:37:43 +0000 (21:37 +0000)]
Call __cxa_begin_catch before std::terminate() in a noexcept trap.

r174939-40 caused us to do this in the canonical terminate lpad,
but when the EH stack has other cleanups on it we use the
terminate handler block, which wasn't doing this.

Fixes the rest of rdar://11904428 given appropriate stdlib support.

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

11 years agoDebug Info: Attempt to resolve forward declarations if we are not emitting
Adrian Prantl [Thu, 20 Jun 2013 21:17:24 +0000 (21:17 +0000)]
Debug Info: Attempt to resolve forward declarations if we are not emitting
limited debug info.

This is another small addendum to r184252.

rdar://problem/14101097

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

11 years agoTest files for private header patch.
Lawrence Crowl [Thu, 20 Jun 2013 21:15:51 +0000 (21:15 +0000)]
Test files for private header patch.

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

11 years agoThis patch adds new private headers to the module map. Private
Lawrence Crowl [Thu, 20 Jun 2013 21:14:14 +0000 (21:14 +0000)]
This patch adds new private headers to the module map. Private
headers may be included from within the module, but not from outside
the module.

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

11 years agoExtend -Wnon-pod-varargs to check calls made from function pointers.
Richard Trieu [Thu, 20 Jun 2013 21:03:13 +0000 (21:03 +0000)]
Extend -Wnon-pod-varargs to check calls made from function pointers.

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

11 years agoClean up warning and add a test.
Eli Friedman [Thu, 20 Jun 2013 20:58:02 +0000 (20:58 +0000)]
Clean up warning and add a test.

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

11 years agoAdd test.
Eli Friedman [Thu, 20 Jun 2013 20:56:57 +0000 (20:56 +0000)]
Add test.

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

11 years agoFix English grammar error.
Lawrence Crowl [Thu, 20 Jun 2013 20:51:51 +0000 (20:51 +0000)]
Fix English grammar error.

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

11 years agoCodeGen: Don't set 'PMBuilder.DisableSimplifyLibCalls'
Meador Inge [Thu, 20 Jun 2013 19:47:18 +0000 (19:47 +0000)]
CodeGen: Don't set 'PMBuilder.DisableSimplifyLibCalls'

The simplify-libcalls pass has been removed from LLVM.  Thus
'PMBuilder.DisableSimplifyLibCalls' does not exist anymore.
The disabling/enabling of library call simplifications is
done through the TargetLibraryInfo which is already wired
up in Clang.

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

11 years agoAdd an additional test for dynamic_cast.
Eli Friedman [Thu, 20 Jun 2013 18:53:38 +0000 (18:53 +0000)]
Add an additional test for dynamic_cast.

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

11 years agoRemove dead code.
Eli Friedman [Thu, 20 Jun 2013 18:53:21 +0000 (18:53 +0000)]
Remove dead code.

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

11 years agoFix CodeGenCXX/debug-info.cpp to target a known ABI (x86-64-linux) so as not to be...
David Blaikie [Thu, 20 Jun 2013 17:23:30 +0000 (17:23 +0000)]
Fix CodeGenCXX/debug-info.cpp to target a known ABI (x86-64-linux) so as not to be confused by strange (& currently broken) Windows ABI

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

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