]> granicus.if.org Git - clang/log
clang
11 years agoAdd the global namespace (the "::" namespace specifier) to the list of
Kaelyn Uhrain [Mon, 24 Jun 2013 17:49:03 +0000 (17:49 +0000)]
Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

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

11 years agoCheck the canonical parameter type with getAs<>() in a static checker
Reid Kleckner [Mon, 24 Jun 2013 16:56:16 +0000 (16:56 +0000)]
Check the canonical parameter type with getAs<>() in a static checker

This will prevent breakage when I introduce the DecayedType sugar node.

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

11 years agoConvert a use of PathV1.h
Rafael Espindola [Mon, 24 Jun 2013 16:46:15 +0000 (16:46 +0000)]
Convert a use of PathV1.h

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

11 years agoAdd some invalid-decl checks to clang_Type_getOffsetOf.
Matt Beaumont-Gay [Mon, 24 Jun 2013 16:12:35 +0000 (16:12 +0000)]
Add some invalid-decl checks to clang_Type_getOffsetOf.

print-size-type.cpp was checking for specific record layout output for invalid
decls; I've removed the checks but left the records as tests for not crashing.

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

11 years agoConvert a use of PathV1.h.
Rafael Espindola [Mon, 24 Jun 2013 15:00:11 +0000 (15:00 +0000)]
Convert a use of PathV1.h.

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

11 years ago[Sema] Call CheckParmForFunctionDef on ObjC method parameters
Reid Kleckner [Mon, 24 Jun 2013 14:38:26 +0000 (14:38 +0000)]
[Sema] Call CheckParmForFunctionDef on ObjC method parameters

CheckParmForFunctionDef performs standard checks for type completeness
and other things like a destructor check for the MSVC++ ABI.

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

11 years agoclang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp: Suppress unexpected failures...
NAKAMURA Takumi [Mon, 24 Jun 2013 13:19:26 +0000 (13:19 +0000)]
clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp: Suppress unexpected failures on MS hosts.

FIXME: A couple of tests have been suppressed.
I know it'd be bad with _MSC_VER here, though.

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

11 years agoclang/test/Driver/coverage-ld.c: Tweak expressions to match dosish pathsep on win32...
NAKAMURA Takumi [Mon, 24 Jun 2013 13:19:20 +0000 (13:19 +0000)]
clang/test/Driver/coverage-ld.c: Tweak expressions to match dosish pathsep on win32 hosts.

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

11 years agoThe profile library must come before the C library so that it can use
Chandler Carruth [Mon, 24 Jun 2013 09:38:45 +0000 (09:38 +0000)]
The profile library must come before the C library so that it can use
atexit.

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

11 years agoAvoid adding entries to the DeclContext lookup table multiple times when lazily
Richard Smith [Mon, 24 Jun 2013 07:20:36 +0000 (07:20 +0000)]
Avoid adding entries to the DeclContext lookup table multiple times when lazily
constructing a lookup table.

Previously, buildLookup would add lookup table entries for each item lexically
within the DC, and adding the first entry with a given name would trigger the
external source to add all its entries with that name. Then buildLookup would
carry on and re-add those entries all over again.

Instead, follow a simple rule: a declaration from an external source is only
ever made visible by the external source. One exception to this: since we don't
usually build a lookup table for the TU in C, and we never serialize one, we
don't expect the external source to provide lookups in the TU in C, so we build
those ones ourselves.

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

11 years agoDebugInfo: ensure negative enumerators are emitted as such
David Blaikie [Mon, 24 Jun 2013 07:13:13 +0000 (07:13 +0000)]
DebugInfo: ensure negative enumerators are emitted as such

There's still a problem here - since we're not appropriately using the
signedness/range of the enum to chooset the encoding and emission of
enumerators, but GCC has some bugs around this too so I assume that's
not /such/ a high priority though I may get to it soon out of
completeness.

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

11 years agoDebugInfo: Merge a bad debug info enum test into a good one
David Blaikie [Mon, 24 Jun 2013 06:47:30 +0000 (06:47 +0000)]
DebugInfo: Merge a bad debug info enum test into a good one

The assembly generation testing has been moved to an LLVM test case.

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

11 years agoSlightly improve cross-module merging for function templates.
Richard Smith [Mon, 24 Jun 2013 04:45:28 +0000 (04:45 +0000)]
Slightly improve cross-module merging for function templates.

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

11 years agoComment parsing: allow "\param ..." to describe variadic arguments
Dmitri Gribenko [Mon, 24 Jun 2013 04:41:32 +0000 (04:41 +0000)]
Comment parsing: allow "\param ..." to describe variadic arguments

Original patch by Fariborz Jahanian; extended by me.

Fixes rdar://14124644

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

11 years agoWhen setting the external visible declarations for a decl context, check
Richard Smith [Mon, 24 Jun 2013 01:46:41 +0000 (01:46 +0000)]
When setting the external visible declarations for a decl context, check
whether they replace any existing lookups in the context, rather than
accumulating a bunch of lookup results referring to the same entity.

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

11 years agoAdd -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
Richard Smith [Mon, 24 Jun 2013 01:45:33 +0000 (01:45 +0000)]
Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
follow.

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

11 years agoMove comment on Sema::isFunctionPointerVarDecl() to the header file
Dmitri Gribenko [Mon, 24 Jun 2013 01:33:34 +0000 (01:33 +0000)]
Move comment on Sema::isFunctionPointerVarDecl() to the header file

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

11 years agoDocumentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
Dmitri Gribenko [Sun, 23 Jun 2013 23:33:14 +0000 (23:33 +0000)]
Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
so that -Wdocumentation-unknown-command does not warn on these commands.
Fixes PR16092.

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

11 years agoArrayRef'ize Sema::CodeCompleteConstructorInitializer
Dmitri Gribenko [Sun, 23 Jun 2013 22:58:02 +0000 (22:58 +0000)]
ArrayRef'ize Sema::CodeCompleteConstructorInitializer

Patch by Robert Wilhelm.

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

11 years agoFix the addition of Clang's profile runtime library to the link step
Chandler Carruth [Sun, 23 Jun 2013 11:28:48 +0000 (11:28 +0000)]
Fix the addition of Clang's profile runtime library to the link step
when specifying --coverage (or related) flags.

The system for doing this was based on the old LLVM-hosted profile_rt
library, and hadn't been updated for Linux to use the new compiler-rt
library. Also, it couldn't possibly work on multiarch or biarch systems
in many cases. The whole thing now works much the same as the sanitizer
libraries that are built and used out of the compiler-rt repo.

Note that other target OSes haven't been updated because I don't know if
they're doing anything special with the installation path of profile_rt.
I suspect however that *all* of these are wrong and would encourage
maintainers of each target to take a hard look at how compiler-rt
runtime libraries are linked on their platforms.

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

11 years agoThe makefile build system had two lists of the 32-bit runtime libraries
Chandler Carruth [Sun, 23 Jun 2013 10:10:25 +0000 (10:10 +0000)]
The makefile build system had two lists of the 32-bit runtime libraries
to build and one had grown out of sync. Put this list in a variable so
this doesn't happen again.

The whole thing here is somewhat suspicious as we don't support 32-bit
environments with a 64-bit bi-arch capable compiler, but none have
complained yet about this so I'm just leaving it alone.

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

11 years agoSlightly loosen the test as there are other linker invocation patterns.
Chandler Carruth [Sun, 23 Jun 2013 08:39:08 +0000 (08:39 +0000)]
Slightly loosen the test as there are other linker invocation patterns.

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

11 years agoAdd and tighten up tests for cross compiling tool selection. This now
Chandler Carruth [Sun, 23 Jun 2013 08:24:15 +0000 (08:24 +0000)]
Add and tighten up tests for cross compiling tool selection. This now
verifies that we run the assembler and linker in the correct mode, and
that we can successfully use a bi-arch variant of a GCC installation in
a generic cross compilation invocation of Clang.

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

11 years agoAdd null check (resolves PR16423)
Stephen Lin [Sun, 23 Jun 2013 07:37:13 +0000 (07:37 +0000)]
Add null check (resolves PR16423)

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

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