]> granicus.if.org Git - clang/log
clang
11 years agoAST: Clean up FriendObjectKind related decls
David Majnemer [Sun, 23 Jun 2013 03:38:10 +0000 (03:38 +0000)]
AST: Clean up FriendObjectKind related decls

Allow the comments in the FriendObjectKind enumerator-list show up in
doxygen. Also, some small readability improvements in related functions.

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

11 years agoComment parsing: followup to r184610: allow multiple \returns
Dmitri Gribenko [Sat, 22 Jun 2013 23:03:37 +0000 (23:03 +0000)]
Comment parsing: followup to r184610: allow multiple \returns

Remove unneeded member in CommentSema, add a test for the XML schema (the
schema already allowed multiple paragraphs in <ResultDiscussion>, but there
were no tests for that), fix HTML generation (it is not allowed to have <p>
inside <dl>).

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

11 years agoFix assert if an attempt is made to explicitly instantiate an alias template.
Richard Smith [Sat, 22 Jun 2013 22:03:31 +0000 (22:03 +0000)]
Fix assert if an attempt is made to explicitly instantiate an alias template.
Patch by Ismail Pazarbasi!

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

11 years agoAdd dumping support for DeclContext's StoredDeclsMap.
Richard Smith [Sat, 22 Jun 2013 21:49:40 +0000 (21:49 +0000)]
Add dumping support for DeclContext's StoredDeclsMap.

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

11 years agoDebugInfo: Support (using GNU extensions) for template template parameters and parame...
David Blaikie [Sat, 22 Jun 2013 18:59:18 +0000 (18:59 +0000)]
DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs

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

11 years agoRemove duplicated case.
Benjamin Kramer [Sat, 22 Jun 2013 16:44:45 +0000 (16:44 +0000)]
Remove duplicated case.

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

11 years agoInstantiation bug fix extension (cf. r184503) -- minor code fixes, including a typo...
Larisse Voufo [Sat, 22 Jun 2013 13:56:11 +0000 (13:56 +0000)]
Instantiation bug fix extension (cf. r184503) -- minor code fixes, including a typo that caused a runtime assertion after firing diagnosis for class definitions, with the 'template' keyword as template header, in friend declarations.

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

11 years agoReword and reformat some of the "Multiarch" code in the toolchain setup.
Chandler Carruth [Sat, 22 Jun 2013 11:35:51 +0000 (11:35 +0000)]
Reword and reformat some of the "Multiarch" code in the toolchain setup.

There are fundamentally two different things that were getting conflated
here.

1) A bi-arch GCC toolchain install. This is not a full blown cross
   compiler, but it supports targetting both 32-bit and 64-bit variants
   of the same architecture using multilib OS installs and runtimes.

2) A "multiarch" Debian OS/runtime layout that lays out the libraries,
   headers, etc as-if there were going to be a full blown cross compiler
   even when in reality it is just a bi-arch GCC targeting two variants.
   Also, these tend to use oddly "canonicalized" triples without the
   vendor in them unlike the typical cross compiler runtime library
   search that vanilla GCC cross compilers perform.

Now, when we mean the bi-arch nature of GCC accomplished with just
a suffix or tweak to the GCC paths, we say 'Biarch' or something
related. When we mean the Debian layout of includes and libraries, we
say multiarch or reference the multiarch triple.

In the process of reading and often renaming stuff in all these places,
also reformat with clang-format. No functionality change should be going
on here, this is just tidying up.

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

11 years agoRevert r184401 which reverted r183462.
David Majnemer [Sat, 22 Jun 2013 06:43:58 +0000 (06:43 +0000)]
Revert r184401 which reverted r183462.

The problem with r183462 was that we assumed that a diagnostic id of
zero would be silent.

This small correction to CheckDerivedToBaseConversion changes it's
behavior to omit the diagnostic when given a diagnostic id of zero.

This fix passes the test case added in r184402.

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

11 years agoExtend -Wnon-pod-varargs to check calls made from member pointers.
Richard Trieu [Sat, 22 Jun 2013 02:30:38 +0000 (02:30 +0000)]
Extend -Wnon-pod-varargs to check calls made from member pointers.

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

11 years agoFixed typo.
Alexander Kornienko [Sat, 22 Jun 2013 01:35:36 +0000 (01:35 +0000)]
Fixed typo.

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

11 years ago[analyzer] Use output form collections’ count to decide if ObjC for loop should be...
Anna Zaks [Sat, 22 Jun 2013 00:23:26 +0000 (00:23 +0000)]
[analyzer] Use output form collections’ count to decide if ObjC for loop should be entered

This fixes false positives by allowing us to know that a loop is always entered if
the collection count method returns a positive value and vice versa.

Addresses radar://14169391.

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

11 years ago[CFG] Set the “loop target” (back edge) for VisitObjCForCollectionStmt loops
Anna Zaks [Sat, 22 Jun 2013 00:23:20 +0000 (00:23 +0000)]
[CFG] Set the “loop target” (back edge) for VisitObjCForCollectionStmt loops

Add the back edge info by creating a basic block, marked as loop target. This is
consistent with how other loops are processed, but was omitted from
VisitObjCForCollectionStmt.

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

11 years agoExtend -Wnon-pod-varargs to more cases, such as function pointers as return
Richard Trieu [Sat, 22 Jun 2013 00:20:41 +0000 (00:20 +0000)]
Extend -Wnon-pod-varargs to more cases, such as function pointers as return
types and function pointer arrays.

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

11 years agoDebugInfo: Random tidying up/simplification
David Blaikie [Sat, 22 Jun 2013 00:09:36 +0000 (00:09 +0000)]
DebugInfo: Random tidying up/simplification

No functionality change intended.

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

11 years agoProvide suggested no-arg calls for overloaded member functions missing calls
David Blaikie [Fri, 21 Jun 2013 23:54:45 +0000 (23:54 +0000)]
Provide suggested no-arg calls for overloaded member functions missing calls

Reviewed by Richard Smith.

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

11 years ago[docs] `-fno-sanitize=` is accepted too.
Sean Silva [Fri, 21 Jun 2013 23:50:58 +0000 (23:50 +0000)]
[docs] `-fno-sanitize=` is accepted too.

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

11 years ago[document parsing]: Allow multiple adjacent \return and the like
Fariborz Jahanian [Fri, 21 Jun 2013 23:49:29 +0000 (23:49 +0000)]
[document parsing]: Allow multiple adjacent \return and the like
commands. Render them properly in XML output.
// rdar://14207725

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

11 years agoTeach ARM va_arg to ignore empty structs.
Tim Northover [Fri, 21 Jun 2013 23:05:33 +0000 (23:05 +0000)]
Teach ARM va_arg to ignore empty structs.

Empty structs are ignored for parameter passing purposes, but va_arg was
incrementing the pointer anyway which could lead to va_list getting out of
sync.

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

11 years agoCheck for trivial constructibility before emptiness in ARM ABI.
Tim Northover [Fri, 21 Jun 2013 22:49:34 +0000 (22:49 +0000)]
Check for trivial constructibility before emptiness in ARM ABI.

According to the Itanium ABI (3.1.1), types with non-trivial copy constructors
passed by value should be passed indirectly, with the caller creating a
temporary.

We got this mostly correct, but forgot that empty structs can have non-trivial
constructors too and passed them incorrectly. This simply reverses the order of
the check.

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

11 years ago[NVPTX] Fix inline asm test case to use LLVM IR instead of PTX so it works even when...
Justin Holewinski [Fri, 21 Jun 2013 22:39:56 +0000 (22:39 +0000)]
[NVPTX] Fix inline asm test case to use LLVM IR instead of PTX so it works even when the NVPTX target is not built

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

11 years agoDebugInfo test: Rename function to avoid using the same name as a type
David Blaikie [Fri, 21 Jun 2013 21:58:54 +0000 (21:58 +0000)]
DebugInfo test: Rename function to avoid using the same name as a type

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

11 years agoAggregate & rename limit debug info tests.
David Blaikie [Fri, 21 Jun 2013 21:23:18 +0000 (21:23 +0000)]
Aggregate & rename limit debug info tests.

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

11 years agoFix a leak of TargetMachine in clang. We'll continue to leak it on purpose if
Nick Lewycky [Fri, 21 Jun 2013 21:15:32 +0000 (21:15 +0000)]
Fix a leak of TargetMachine in clang. We'll continue to leak it on purpose if
given -disable-free. (Reviewed by John McCall over IRC.)

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

11 years agoPR16214: Debug info for types first used via pointers or qualified types & later...
David Blaikie [Fri, 21 Jun 2013 21:03:11 +0000 (21:03 +0000)]
PR16214: Debug info for types first used via pointers or qualified types & later require definitions

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

11 years agoPropagate the invalid bit from bases to derived template classes.
Matt Beaumont-Gay [Fri, 21 Jun 2013 18:58:32 +0000 (18:58 +0000)]
Propagate the invalid bit from bases to derived template classes.

Fixes PR16292.

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

11 years ago[NVPTX] Add NVPTX register constraints
Justin Holewinski [Fri, 21 Jun 2013 18:51:24 +0000 (18:51 +0000)]
[NVPTX] Add NVPTX register constraints

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

11 years agoExtend template instantiation bug fix (r184503) with fixit test
Larisse Voufo [Fri, 21 Jun 2013 18:49:56 +0000 (18:49 +0000)]
Extend template instantiation bug fix (r184503) with fixit test

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

11 years agoAdd an option to not indent declarations when breaking after the type.
Manuel Klimek [Fri, 21 Jun 2013 17:25:42 +0000 (17:25 +0000)]
Add an option to not indent declarations when breaking after the type.

Make that option the default for LLVM style.

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

11 years agoRevert "[analyzer] Handle zeroing CXXConstructExprs."
Jordan Rose [Fri, 21 Jun 2013 16:30:32 +0000 (16:30 +0000)]
Revert "[analyzer] Handle zeroing CXXConstructExprs."

Per review from Anna, this really should have been two commits, and besides
it's causing problems on our internal buildbot. Reverting until these have
been worked out.

This reverts r184511 / 98123284826bb4ce422775563ff1a01580ec5766.

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

11 years ago[Modules] If a module map resides in a system header directory, treat it as a system...
Douglas Gregor [Fri, 21 Jun 2013 16:28:10 +0000 (16:28 +0000)]
[Modules] If a module map resides in a system header directory, treat it as a system module.

This prevents -pedantic from causing warnings in the system headers
used to create modules. Fixes <rdar://problem/14201171>.

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

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