platform/upstream/llvm.git
12 years agoFormat strings: don't ever convert %+d to %lu.
Jordan Rose [Thu, 17 Jan 2013 22:34:10 +0000 (22:34 +0000)]
Format strings: don't ever convert %+d to %lu.

Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

llvm-svn: 172762

12 years agoParsing support for C11's _Noreturn keyword. No semantics yet.
Richard Smith [Thu, 17 Jan 2013 22:16:11 +0000 (22:16 +0000)]
Parsing support for C11's _Noreturn keyword. No semantics yet.

llvm-svn: 172761

12 years ago-Wunsequenced: if the LHS of an &&, || or ?: is not constant, check for
Richard Smith [Thu, 17 Jan 2013 22:06:26 +0000 (22:06 +0000)]
-Wunsequenced: if the LHS of an &&, || or ?: is not constant, check for
unsequenced operations in the RHS. We don't compare the RHS with the rest of
the expression yet; such checks will need care to avoid diagnosing unsequenced
operations which are both in conditionally-evaluated subexpressions which
actually can't occur together, such as in '(b && ++x) + (!b && ++x)'.

llvm-svn: 172760

12 years ago[Linker] Drop some now-dead component dependencies.
Daniel Dunbar [Thu, 17 Jan 2013 22:05:18 +0000 (22:05 +0000)]
[Linker] Drop some now-dead component dependencies.

llvm-svn: 172759

12 years agoWe want the dwarf AT_producer for assembly source files to match clang's
Kevin Enderby [Thu, 17 Jan 2013 21:38:06 +0000 (21:38 +0000)]
We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is second of the two steps to allow us to do this.  The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string.  This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files.  Then using the new
setDwarfDebugProducer() method to set the AT_producer string.

rdar://12888242

llvm-svn: 172758

12 years ago<rdar://problem/12786725>
Enrico Granata [Thu, 17 Jan 2013 21:36:19 +0000 (21:36 +0000)]
<rdar://problem/12786725>

If there is any alive process being debugged, the user is asked for confirmation before quitting LLDB
This should prevent situations where the user mistakenly types "q" and LLDB slaughters their process without any mercy whatsoever
Since it can quickly get tedious, there is a new setting on the command interpreter to disable this and replicate the previous behavior

llvm-svn: 172757

12 years agoReverting r171325 & r172363. This was causing a mis-compile on the self-hosted LTO...
Bill Wendling [Thu, 17 Jan 2013 21:28:46 +0000 (21:28 +0000)]
Reverting r171325 & r172363. This was causing a mis-compile on the self-hosted LTO build bots.

Okay, here's how to reproduce the problem:

1) Build a Release (or Release+Asserts) version of clang in the normal way.

2) Using the clang & clang++ binaries from (1), build a Release (or
   Release+Asserts) version of the same sources, but this time enable LTO ---
   specify the `-flto' flag on the command line.

3) Run the ARC migrator tests:

    $ arcmt-test --args -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ ./src/tools/clang/test/ARCMT/cxx-rewrite.mm

You'll see that the output isn't correct (the whitespace is off).

The mis-compile is in the function `RewriteBuffer::RemoveText' in the
clang/lib/Rewrite/Core/Rewriter.cpp file. When that function and RewriteRope.cpp
are compiled with LTO and the `arcmt-test' executable is regenerated, you'll see
the error. When those files are not LTO'ed, then the output of the `arcmt-test'
is fine.

It is *really* hard to get a testcase out of this. I'll file a PR with what I
have currently.

--- Reverse-merging r172363 into '.':
U    include/llvm/Analysis/MemoryBuiltins.h
U    lib/Analysis/MemoryBuiltins.cpp

--- Reverse-merging r171325 into '.':
U    test/Transforms/InstCombine/objsize.ll
G    include/llvm/Analysis/MemoryBuiltins.h
G    lib/Analysis/MemoryBuiltins.cpp

llvm-svn: 172756

12 years agoConverting lambdas to plain old static function pointers
Enrico Granata [Thu, 17 Jan 2013 20:24:11 +0000 (20:24 +0000)]
Converting lambdas to plain old static function pointers

llvm-svn: 172755

12 years agoDo not pass -pie flag to linker if -shared specified. This matches
Peter Collingbourne [Thu, 17 Jan 2013 20:17:16 +0000 (20:17 +0000)]
Do not pass -pie flag to linker if -shared specified.  This matches
the gcc driver and makes it possible to add -pie to $CC or similar and
have it apply in the right places.

llvm-svn: 172753

12 years agoHarden this test a bit to work on the mac with ancient gdbs.
Eric Christopher [Thu, 17 Jan 2013 20:09:50 +0000 (20:09 +0000)]
Harden this test a bit to work on the mac with ancient gdbs.

llvm-svn: 172752

12 years agoReverting back to the fallback instead of using the 64-bit popcnt instruction as...
Aaron Ballman [Thu, 17 Jan 2013 20:04:28 +0000 (20:04 +0000)]
Reverting back to the fallback instead of using the 64-bit popcnt instruction as it doesn't exist on all x64 CPU architectures.

llvm-svn: 172751

12 years ago[Linker] Drop support for IR-level extended linking support (archives, etc.).
Daniel Dunbar [Thu, 17 Jan 2013 19:52:25 +0000 (19:52 +0000)]
[Linker] Drop support for IR-level extended linking support (archives, etc.).

 - This code is dead, and the "right" way to get this support is to use the
   platform-specific linker-integrated LTO mechanisms, or the forthcoming LLVM
   linker.

llvm-svn: 172749

12 years agoHave ReExec read environment from /proc/self/environ
Peter Collingbourne [Thu, 17 Jan 2013 19:50:42 +0000 (19:50 +0000)]
Have ReExec read environment from /proc/self/environ

It is possible for ReExec to be called before the C standard library
has initialised itself sufficiently for execv to work properly.
Fix this by parsing the environment ourselves and using execve.

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

llvm-svn: 172748

12 years agoRestore reverted test case, this time with REQUIRES: asserts
Bill Schmidt [Thu, 17 Jan 2013 19:46:51 +0000 (19:46 +0000)]
Restore reverted test case, this time with REQUIRES: asserts

llvm-svn: 172747

12 years agoRemove bad test case
Bill Schmidt [Thu, 17 Jan 2013 19:39:36 +0000 (19:39 +0000)]
Remove bad test case

llvm-svn: 172746

12 years agoThis patch fixes PR13626 by providing i128 support in the return
Bill Schmidt [Thu, 17 Jan 2013 19:34:57 +0000 (19:34 +0000)]
This patch fixes PR13626 by providing i128 support in the return
calling convention.  128-bit integers are now properly returned
in GPR3 and GPR4 on PowerPC.

llvm-svn: 172745

12 years ago[ms-inline asm] Updates and test case for r172743.
Chad Rosier [Thu, 17 Jan 2013 19:22:48 +0000 (19:22 +0000)]
[ms-inline asm] Updates and test case for r172743.
Part of rdar://12576868

llvm-svn: 172744

12 years ago[ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.
Chad Rosier [Thu, 17 Jan 2013 19:21:48 +0000 (19:21 +0000)]
[ms-inline asm] Add support for the 'SIZE' and 'LENGTH' operators.
Part of rdar://12576868

llvm-svn: 172743

12 years ago[ms-inline asm] Extend the Sema interface to get the size and length of a
Chad Rosier [Thu, 17 Jan 2013 19:21:24 +0000 (19:21 +0000)]
[ms-inline asm] Extend the Sema interface to get the size and length of a
VarDecl.
Part of rdar://12576868

llvm-svn: 172742

12 years ago[docs] Get rid of some UTF8 characters (non-breaking space maybe).
Daniel Dunbar [Thu, 17 Jan 2013 18:57:32 +0000 (18:57 +0000)]
[docs] Get rid of some UTF8 characters (non-breaking space maybe).

llvm-svn: 172741

12 years ago[utils] Update find-rev utility to take a branch argument (name of the git-svn
Daniel Dunbar [Thu, 17 Jan 2013 18:57:21 +0000 (18:57 +0000)]
[utils] Update find-rev utility to take a branch argument (name of the git-svn
branch).

llvm-svn: 172740

12 years agoFormat strings: correct signedness if already correcting width (%d,%u).
Jordan Rose [Thu, 17 Jan 2013 18:47:16 +0000 (18:47 +0000)]
Format strings: correct signedness if already correcting width (%d,%u).

It is valid to do this:
  printf("%u", (int)x);

But if we see this:
  printf("%lu", (int)x);

...our fixit should suggest %d, not %u.

llvm-svn: 172739

12 years agoConvert test/FixIt/format-darwin.m to use relative line numbers.
Jordan Rose [Thu, 17 Jan 2013 18:47:12 +0000 (18:47 +0000)]
Convert test/FixIt/format-darwin.m to use relative line numbers.

llvm-svn: 172738

12 years agoAdd indexed load/store instructions for offset validation check.
Jyotsna Verma [Thu, 17 Jan 2013 18:42:37 +0000 (18:42 +0000)]
Add indexed load/store instructions for offset validation check.
This patch fixes bug 14902 - http://llvm.org/bugs/show_bug.cgi?id=14902

llvm-svn: 172737

12 years agoAdded missing const from my last commit.
Michael Gottesman [Thu, 17 Jan 2013 18:36:17 +0000 (18:36 +0000)]
Added missing const from my last commit.

llvm-svn: 172736

12 years ago[ObjCARC] Implemented operator<< for InstructionClass and changed a ``Visited'' Debug...
Michael Gottesman [Thu, 17 Jan 2013 18:32:34 +0000 (18:32 +0000)]
[ObjCARC] Implemented operator<< for InstructionClass and changed a ``Visited'' Debug message to use it.

llvm-svn: 172735

12 years agoReverting back to the fallback instead of using popcnt; this instruction doesn't...
Aaron Ballman [Thu, 17 Jan 2013 18:27:30 +0000 (18:27 +0000)]
Reverting back to the fallback instead of using popcnt; this instruction doesn't exist on all CPU architectures.  Fixes PR14982

llvm-svn: 172734

12 years agoThis patch fixes the PPC calling convention to handle returns of
Bill Schmidt [Thu, 17 Jan 2013 17:45:19 +0000 (17:45 +0000)]
This patch fixes the PPC calling convention to handle returns of
_Complex float and _Complex long double, by simply increasing the
number of floating point registers available for return values.

The test case verifies that the correct registers are loaded.

llvm-svn: 172733

12 years agoAdd some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are not...
Joey Gouly [Thu, 17 Jan 2013 17:35:00 +0000 (17:35 +0000)]
Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are not supported.

llvm-svn: 172732

12 years agoFormatter: Get bit tests in ifs right.
Nico Weber [Thu, 17 Jan 2013 17:17:19 +0000 (17:17 +0000)]
Formatter: Get bit tests in ifs right.

It's generally not possible to know if 'a' '*' 'b' is a multiplication
expression or a variable declaration with a purely lexer-based approach. The
formatter currently uses a heuristic that classifies this token sequence as a
multiplication in rhs contexts (after '=' or 'return') and as a declaration
else.

Because of this, it gets bit tests in ifs, such as "if (a & b)" wrong. However,
declarations in ifs always have to be followed by '=', so this patch changes
the formatter to classify '&' as an operator if it's at the start of an if
statement.

Before:
  if (a& b)
  if (int* b = f())

Now:
  if (a & b)
  if (int* b = f())

llvm-svn: 172731

12 years ago[ubsan] Add SANITIZER_INTERFACE_ATTRIBUTE to __ubsan_vptr_type_cache
Will Dietz [Thu, 17 Jan 2013 17:14:12 +0000 (17:14 +0000)]
[ubsan] Add SANITIZER_INTERFACE_ATTRIBUTE to __ubsan_vptr_type_cache

Missed this one previously.

llvm-svn: 172730

12 years agoDocumentation: formatting
Dmitri Gribenko [Thu, 17 Jan 2013 17:04:54 +0000 (17:04 +0000)]
Documentation: formatting

llvm-svn: 172729

12 years agoUnder GNU/Linux & HURD, add a soname to the liblldb shared library.
Sylvestre Ledru [Thu, 17 Jan 2013 16:59:32 +0000 (16:59 +0000)]
Under GNU/Linux & HURD, add a soname to the liblldb shared library.

llvm-svn: 172728

12 years ago[ASan] minor changes to swapcontext handling: don't clear shadow memory if context...
Alexey Samsonov [Thu, 17 Jan 2013 15:45:28 +0000 (15:45 +0000)]
[ASan] minor changes to swapcontext handling: don't clear shadow memory if context stack is too large

llvm-svn: 172727

12 years agoASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1
Alexey Samsonov [Thu, 17 Jan 2013 15:26:47 +0000 (15:26 +0000)]
ASan: Allow __asan_get_allocated_size(malloc(0)) to be 0 or 1

llvm-svn: 172726

12 years ago[asan] attempting to fix the Mac build
Kostya Serebryany [Thu, 17 Jan 2013 15:14:20 +0000 (15:14 +0000)]
[asan] attempting to fix the Mac build

llvm-svn: 172725

12 years agofix 'const const' typo introduced in r172647
Daniel Malea [Thu, 17 Jan 2013 15:05:55 +0000 (15:05 +0000)]
fix 'const const' typo introduced in r172647

llvm-svn: 172724

12 years ago[asan] restructure read/pread/pread64 tests
Kostya Serebryany [Thu, 17 Jan 2013 14:58:29 +0000 (14:58 +0000)]
[asan] restructure read/pread/pread64 tests

llvm-svn: 172723

12 years ago[sanitizer] move write/pwrite/pwrite64 interceptors to common
Kostya Serebryany [Thu, 17 Jan 2013 14:48:03 +0000 (14:48 +0000)]
[sanitizer] move write/pwrite/pwrite64 interceptors to common

llvm-svn: 172722

12 years ago[msan] start using common interceptors in msan
Kostya Serebryany [Thu, 17 Jan 2013 13:57:07 +0000 (13:57 +0000)]
[msan] start using common interceptors in msan

llvm-svn: 172721

12 years ago[msan] More interceptors.
Evgeniy Stepanov [Thu, 17 Jan 2013 13:42:17 +0000 (13:42 +0000)]
[msan] More interceptors.

strtod and friends, dladdr, getrusage

llvm-svn: 172720

12 years ago[tsan] move prctl interceptor from asan to common_interceptors thus enabling it for...
Kostya Serebryany [Thu, 17 Jan 2013 13:38:16 +0000 (13:38 +0000)]
[tsan] move prctl interceptor from asan to common_interceptors thus enabling it for tsan too

llvm-svn: 172719

12 years agoAllow breaking after the trailing const after a function declaration.
Daniel Jasper [Thu, 17 Jan 2013 13:31:52 +0000 (13:31 +0000)]
Allow breaking after the trailing const after a function declaration.

Before:
void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) const GUARDED_BY(
    aaaaaaaaaaaaa);

After:
void aaaaaaaaaaaa(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) const
    GUARDED_BY(aaaaaaaaaaaaa);

llvm-svn: 172718

12 years ago[ASan] fix __asan_get_ownership(p) and __asan_get_allocated_size(p) for the p = malloc(0)
Alexey Samsonov [Thu, 17 Jan 2013 13:25:17 +0000 (13:25 +0000)]
[ASan] fix __asan_get_ownership(p) and __asan_get_allocated_size(p) for the p = malloc(0)

llvm-svn: 172717

12 years agoAdd initial rough support for synthesizing linker options when passed
Chandler Carruth [Thu, 17 Jan 2013 13:19:29 +0000 (13:19 +0000)]
Add initial rough support for synthesizing linker options when passed
-fopenmp in the link step on Linux. There is probably more tweaking that
will need to take place to get good support for linking the relevant
libraries on all Linux distributions and/or on other platforms, but this
get's the ball moving and allows Clang to build programs which contain
OpenMP pragmas that can be safely ignored by a compiler that doesn't
implement them, and yet makes direct calls into the OpenMP runtime.

llvm-svn: 172715

12 years ago[tsan] add write_range/read_range hooks to common interceptors called from tsan ...
Kostya Serebryany [Thu, 17 Jan 2013 13:18:40 +0000 (13:18 +0000)]
[tsan] add write_range/read_range hooks to common interceptors called from tsan (to find races on read/pread/etc)

llvm-svn: 172714

12 years ago[sanitizer] a bit more unification for interceptors (merge read/pread/pread64 in...
Kostya Serebryany [Thu, 17 Jan 2013 13:09:00 +0000 (13:09 +0000)]
[sanitizer] a bit more unification for interceptors (merge read/pread/pread64 in asan and tsan)

llvm-svn: 172713

12 years agotsan: fix a bug
Dmitry Vyukov [Thu, 17 Jan 2013 12:59:10 +0000 (12:59 +0000)]
tsan: fix a bug

llvm-svn: 172712

12 years agoImprove handling of comments in static initializers.
Daniel Jasper [Thu, 17 Jan 2013 12:53:34 +0000 (12:53 +0000)]
Improve handling of comments in static initializers.

Also adding more tests.

We can now keep the formatting of something like:

static SomeType type = { aaaaaaaaaaaaaaaaaaaa, /* comment */
                         aaaaaaaaaaaaaaaaaaaa /* comment */,
                         /* comment */ aaaaaaaaaaaaaaaaaaaa,
                         aaaaaaaaaaaaaaaaaaaa, // comment
                         aaaaaaaaaaaaaaaaaaaa };

Note that the comment in the first line is handled like a trailing line comment
as that is likely what the user intended.

llvm-svn: 172711

12 years agotsan: fix a bug
Dmitry Vyukov [Thu, 17 Jan 2013 12:13:03 +0000 (12:13 +0000)]
tsan: fix a bug

llvm-svn: 172710

12 years agoASan: add optional 'zero-based shadow' option to ASan passes. Always tell the values...
Alexey Samsonov [Thu, 17 Jan 2013 11:12:32 +0000 (11:12 +0000)]
ASan: add optional 'zero-based shadow' option to ASan passes. Always tell the values of shadow scale and offset to the runtime

llvm-svn: 172709

12 years agoOptimization for the following SIGN_EXTEND pairs:
Elena Demikhovsky [Thu, 17 Jan 2013 09:59:53 +0000 (09:59 +0000)]
Optimization for the following SIGN_EXTEND pairs:
v8i8  -> v8i64,
v8i8  -> v8i32,
v4i8  -> v4i64,
v4i16 -> v4i64
for AVX and AVX2.

Bug 14865.

llvm-svn: 172708

12 years agoImprove -Wreorder to handle cases of anonymous class member ordering
David Blaikie [Thu, 17 Jan 2013 08:49:22 +0000 (08:49 +0000)]
Improve -Wreorder to handle cases of anonymous class member ordering

llvm-svn: 172707

12 years agoclang/test/Index/code-completion-skip-bodies.cpp: Check stdout and stderr individuall...
NAKAMURA Takumi [Thu, 17 Jan 2013 07:27:55 +0000 (07:27 +0000)]
clang/test/Index/code-completion-skip-bodies.cpp: Check stdout and stderr individually, rather than mixed output of stdout and stderr with 2>&1.

XFAIL(s) are removed.

llvm-svn: 172705

12 years agoCombine AVX and SSE forms of MOVSS and MOVSD into the same multiclasses so they get...
Craig Topper [Thu, 17 Jan 2013 06:59:42 +0000 (06:59 +0000)]
Combine AVX and SSE forms of MOVSS and MOVSD into the same multiclasses so they get instantiated together.

llvm-svn: 172704

12 years agoRevert most of r172140.
Nico Weber [Thu, 17 Jan 2013 06:14:50 +0000 (06:14 +0000)]
Revert most of r172140.

r172140 changed the formatter to produce "-(id) foo" instead of "- (id)foo"
in google style, with a link to
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml#Method_Declarations_and_Definitions
as reference.  But now that I look at that link again, it seems I didn't
read it very carefully the first time round.

llvm-svn: 172703

12 years agoAdd one more bit of logging for armv7 watchpoint debugging.
Jason Molenda [Thu, 17 Jan 2013 05:34:17 +0000 (05:34 +0000)]
Add one more bit of logging for armv7 watchpoint debugging.

llvm-svn: 172702

12 years agoArrayRef-ize some ctor initializer related APIs
David Blaikie [Thu, 17 Jan 2013 05:26:25 +0000 (05:26 +0000)]
ArrayRef-ize some ctor initializer related APIs

llvm-svn: 172701

12 years agoRemove some unnecessary casts
David Blaikie [Thu, 17 Jan 2013 05:26:21 +0000 (05:26 +0000)]
Remove some unnecessary casts

llvm-svn: 172700

12 years agoFix the assembly and dissassembly of DW_FORM_sec_offset. Found this by
Eric Christopher [Thu, 17 Jan 2013 03:00:04 +0000 (03:00 +0000)]
Fix the assembly and dissassembly of DW_FORM_sec_offset. Found this by
changing both the string of the dwo_name to be correct and the type of
the statement list.

Testcases all around.

llvm-svn: 172699

12 years agoAdd the DW_AT_GNU_addr_base for the skeleton cu. Add support for
Eric Christopher [Thu, 17 Jan 2013 02:59:59 +0000 (02:59 +0000)]
Add the DW_AT_GNU_addr_base for the skeleton cu. Add support for
emitting the dwarf32 version of DW_FORM_sec_offset and correct
disassembler support.

llvm-svn: 172698

12 years agoAdd test for PR12938, fixed by Richard Smith in r172691
David Blaikie [Thu, 17 Jan 2013 02:43:00 +0000 (02:43 +0000)]
Add test for PR12938, fixed by Richard Smith in r172691

llvm-svn: 172697

12 years agoSuppress all -Wunused-value warnings from macro body expansions.
Matt Beaumont-Gay [Thu, 17 Jan 2013 02:06:08 +0000 (02:06 +0000)]
Suppress all -Wunused-value warnings from macro body expansions.

This is inspired by a number of false positives in real code, including
PR14968. I've added test cases reduced from these false positives to
test/Sema/unused-expr.c, as well as corresponding test cases that pass the
offending expressions as arguments to a no-op macro to ensure that we do warn
there.

This also removes my previous tweak from r166522/r166534, so that we warn on
unused cast expressions in macro arguments.

There were several test cases that were using -Wunused-value to test general
diagnostic emission features; I changed those to use other warnings or warn on
a macro argument expression. I stared at the test case for PR14399 for a while
with Richard Smith and we believe the new test case exercises the same
codepaths as before.

llvm-svn: 172696

12 years agoAdd a comment for Daniel
Douglas Gregor [Thu, 17 Jan 2013 01:58:31 +0000 (01:58 +0000)]
Add a comment for Daniel

llvm-svn: 172695

12 years agoTest that we correctly handle reversion of line splicing etc in raw string
Richard Smith [Thu, 17 Jan 2013 01:46:13 +0000 (01:46 +0000)]
Test that we correctly handle reversion of line splicing etc in raw string
literals. As suggested by Sean Silva.

llvm-svn: 172694

12 years agoAttempt to work around bug in older GCCs to fix buildbot.
Richard Smith [Thu, 17 Jan 2013 01:40:50 +0000 (01:40 +0000)]
Attempt to work around bug in older GCCs to fix buildbot.

llvm-svn: 172693

12 years ago[IRgen] Update modules autolink metadata to use module flags (as now specified
Daniel Dunbar [Thu, 17 Jan 2013 01:35:06 +0000 (01:35 +0000)]
[IRgen] Update modules autolink metadata to use module flags (as now specified
in the LangRef).

llvm-svn: 172692

12 years agoImplement C++11 semantics for [[noreturn]] attribute. This required splitting
Richard Smith [Thu, 17 Jan 2013 01:30:42 +0000 (01:30 +0000)]
Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).

llvm-svn: 172691

12 years agoAdd -Wunsequenced (with compatibility alias -Wsequence-point) to warn on
Richard Smith [Thu, 17 Jan 2013 01:17:56 +0000 (01:17 +0000)]
Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn on
expressions which have undefined behavior due to multiple unsequenced
modifications or an unsequenced modification and use of a variable.

llvm-svn: 172690

12 years agoclang/test/Modules/compiler_builtins.m: Mark this as XFAIL:win32 for now. Investigating.
NAKAMURA Takumi [Thu, 17 Jan 2013 01:07:09 +0000 (01:07 +0000)]
clang/test/Modules/compiler_builtins.m: Mark this as XFAIL:win32 for now. Investigating.

llvm-svn: 172689

12 years agoMove MachineTraceMetrics.h into include/llvm/CodeGen.
Jakob Stoklund Olesen [Thu, 17 Jan 2013 01:06:04 +0000 (01:06 +0000)]
Move MachineTraceMetrics.h into include/llvm/CodeGen.

Let targets use it.

llvm-svn: 172688

12 years agoProvide a place for targets to insert ILP optimization passes.
Jakob Stoklund Olesen [Thu, 17 Jan 2013 00:58:38 +0000 (00:58 +0000)]
Provide a place for targets to insert ILP optimization passes.

Move the early if-conversion pass into this group.

ILP optimizations usually need to find the right balance between
register pressure and ILP using the MachineTraceMetrics analysis to
identify critical paths and estimate other costs. Such passes should run
together so they can share dominator tree and loop info analyses.

Besides if-conversion, future passes to run here here could include
expression height reduction and ARM's MLxExpansion pass.

llvm-svn: 172687

12 years agoTreat hidden Objective-C protocol definitions as if they were
Douglas Gregor [Thu, 17 Jan 2013 00:38:46 +0000 (00:38 +0000)]
Treat hidden Objective-C protocol definitions as if they were
undefined, and don't find methods or protocols within those protocol
definitions. This completes <rdar://problem/10634711>.

llvm-svn: 172686

12 years agoThis is a resubmittal. For some reason it broke the bots yesterday
Jack Carter [Thu, 17 Jan 2013 00:28:20 +0000 (00:28 +0000)]
This is a resubmittal. For some reason it broke the bots yesterday
but I cannot reproduce the problem and have scrubed my sources and
even tested with llvm-lit -v --vg.

The Mips RDHWR (Read Hardware Register) instruction was not
tested for assembler or dissassembler consumption. This patch
adds that functionality.

Contributer: Vladimir Medic

llvm-svn: 172685

12 years agoImplement a fixit for -Wmain-return-type
Dmitri Gribenko [Thu, 17 Jan 2013 00:26:13 +0000 (00:26 +0000)]
Implement a fixit for -Wmain-return-type

llvm-svn: 172684

12 years agoobjC block layout: Patch reorders block layout to
Fariborz Jahanian [Thu, 17 Jan 2013 00:25:06 +0000 (00:25 +0000)]
objC block layout: Patch reorders block layout to
produce more inline layout metadata. // rdar://12752901

llvm-svn: 172683

12 years agoFix a typo introduced in r172665.
Matt Beaumont-Gay [Thu, 17 Jan 2013 00:21:55 +0000 (00:21 +0000)]
Fix a typo introduced in r172665.

llvm-svn: 172682

12 years ago[IR] Reserve/define the purpose for the "Linker Options" metadata flags.
Daniel Dunbar [Thu, 17 Jan 2013 00:16:27 +0000 (00:16 +0000)]
[IR] Reserve/define the purpose for the "Linker Options" metadata flags.

llvm-svn: 172681

12 years agoUpdate the description of the llvm.fmuladd.* intrinsics to avoid use of the
Lang Hames [Thu, 17 Jan 2013 00:00:49 +0000 (00:00 +0000)]
Update the description of the llvm.fmuladd.* intrinsics to avoid use of the
ambiguous term 'legal'.

Suggested by Andrew Booker. Thanks Andrew!

llvm-svn: 172680

12 years ago[objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a dictionary literal
Argyrios Kyrtzidis [Wed, 16 Jan 2013 23:54:48 +0000 (23:54 +0000)]
[objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a dictionary literal
if we can see the elements of the arrays.

for example:

 NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]];

-->

 NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" };

rdar://12428166

llvm-svn: 172679

12 years agoDelay linkage checks when validating the weakref attribute.
Rafael Espindola [Wed, 16 Jan 2013 23:49:06 +0000 (23:49 +0000)]
Delay linkage checks when validating the weakref attribute.

llvm-svn: 172678

12 years agoDocumentation: fix a typo 'IEE754'
Dmitri Gribenko [Wed, 16 Jan 2013 23:40:37 +0000 (23:40 +0000)]
Documentation: fix a typo 'IEE754'

Reported on IRC by _savage

llvm-svn: 172677

12 years agoFixes crash when illegal function definitions are deleted or defaulted. Fixes PR14577.
Aaron Ballman [Wed, 16 Jan 2013 23:39:10 +0000 (23:39 +0000)]
Fixes crash when illegal function definitions are deleted or defaulted.  Fixes PR14577.

llvm-svn: 172676

12 years ago[ELF] Use operator new(std::size_t, BumpPtrAllocator).
Michael J. Spencer [Wed, 16 Jan 2013 23:34:45 +0000 (23:34 +0000)]
[ELF] Use operator new(std::size_t, BumpPtrAllocator).

llvm-svn: 172675

12 years ago[ELF] clang-format ReaderELF.cpp
Michael J. Spencer [Wed, 16 Jan 2013 23:34:32 +0000 (23:34 +0000)]
[ELF] clang-format ReaderELF.cpp

llvm-svn: 172674

12 years agoSimplify code. No functionality change.
Rafael Espindola [Wed, 16 Jan 2013 23:21:32 +0000 (23:21 +0000)]
Simplify code. No functionality change.

llvm-svn: 172673

12 years agoRemove unnecessary initialization i Added in r172668.
David Blaikie [Wed, 16 Jan 2013 23:18:16 +0000 (23:18 +0000)]
Remove unnecessary initialization i Added in r172668.

echristo already fixed this in r172649, but I'll leave the reformatting in
since I'm in the blame history for it now anyway.

llvm-svn: 172672

12 years agoAdding a custom summary for libc++ std::vector<bool>
Enrico Granata [Wed, 16 Jan 2013 23:17:30 +0000 (23:17 +0000)]
Adding a custom summary for libc++ std::vector<bool>
vector<bool> is specialized and the existing general summary for vectors would lie to the user.
Tackling libstdc++ and synthetic children is the following, less critical, part of this task

llvm-svn: 172671

12 years agoWrapping __popcnt64 for MSVC so that it's only used on 64-bit builds.
Aaron Ballman [Wed, 16 Jan 2013 23:17:21 +0000 (23:17 +0000)]
Wrapping __popcnt64 for MSVC so that it's only used on 64-bit builds.

llvm-svn: 172670

12 years agoReadd an open paren that was lost while reformatting code.
David Blaikie [Wed, 16 Jan 2013 23:13:42 +0000 (23:13 +0000)]
Readd an open paren that was lost while reformatting code.

llvm-svn: 172669

12 years agoFix -Wreorder warning.
David Blaikie [Wed, 16 Jan 2013 23:13:36 +0000 (23:13 +0000)]
Fix -Wreorder warning.

Rewrapping courtesy of clang-format.

llvm-svn: 172668

12 years agoCheck for internal weak decls after merging.
Rafael Espindola [Wed, 16 Jan 2013 23:11:15 +0000 (23:11 +0000)]
Check for internal weak decls after merging.

This fixes pr14946. The problem was that the linkage computation was done too
early, so things like "extern int a;" would be given external linkage, even if
a previous declaration was static.

llvm-svn: 172667

12 years agoPR14964: intrinsic headers using non-reserved identifiers
David Blaikie [Wed, 16 Jan 2013 23:08:36 +0000 (23:08 +0000)]
PR14964: intrinsic headers using non-reserved identifiers

Several of the intrinsic headers were using plain non-reserved identifiers.
C++11 17.6.4.3.2 [global.names] p1 reservers names containing a double
begining with an underscore followed by an uppercase letter for any use.

I think I got them all, but open to being corrected. For the most part I
didn't bother updating function-like macro parameter names because I don't
believe they're subject to any such collission - though some function-like
macros already follow this convention (I didn't update them in part because
the churn was more significant as several function-like macros use the double
underscore prefixed version of the same name as a parameter in their
implementation)

llvm-svn: 172666

12 years agoRework the traversal of Objective-C categories and extensions to
Douglas Gregor [Wed, 16 Jan 2013 23:00:23 +0000 (23:00 +0000)]
Rework the traversal of Objective-C categories and extensions to
consider (sub)module visibility.

The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:

  visible_categories_iterator: Iterates over all visible categories
  and extensions, hiding any that have their "hidden" bit set. This is
  by far the most commonly used iterator.

  known_categories_iterator: Iterates over all categories and
  extensions, ignoring the "hidden" bit. This tends to be used for
  redeclaration-like traversals.

  visible_extensions_iterator: Iterates over all visible extensions,
  hiding any that have their "hidden" bit set.

  known_extensions_iterator: Iterates over all extensions, whether
  they are visible to normal name lookup or not.

The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.

Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.

Part two of <rdar://problem/10634711>.

llvm-svn: 172665

12 years agoUse getProcessTriple in clang-interpreter.
Peter Collingbourne [Wed, 16 Jan 2013 22:37:09 +0000 (22:37 +0000)]
Use getProcessTriple in clang-interpreter.

llvm-svn: 172664

12 years agoChanging the Python reference document to be more explicit in discouraging usage...
Enrico Granata [Wed, 16 Jan 2013 22:25:17 +0000 (22:25 +0000)]
Changing the Python reference document to be more explicit in discouraging usage of lldb.{debugger,...} convenience variables for formatters and other non-interactive Python extensions

llvm-svn: 172663

12 years agoRemoved unused variable.
Greg Clayton [Wed, 16 Jan 2013 22:22:42 +0000 (22:22 +0000)]
Removed unused variable.

llvm-svn: 172662

12 years agoFix a -Wdocumentation warning (empty paragraph passed to '\brief' command)
Dmitri Gribenko [Wed, 16 Jan 2013 22:10:09 +0000 (22:10 +0000)]
Fix a -Wdocumentation warning (empty paragraph passed to '\brief' command)

llvm-svn: 172661

12 years agoAdd raw string literal versus C preprocessor test, suggested by James Dennett.
Richard Smith [Wed, 16 Jan 2013 21:43:09 +0000 (21:43 +0000)]
Add raw string literal versus C preprocessor test, suggested by James Dennett.

llvm-svn: 172660

12 years ago[IR] Add 'Append' and 'AppendUnique' module flag behaviors.
Daniel Dunbar [Wed, 16 Jan 2013 21:38:56 +0000 (21:38 +0000)]
[IR] Add 'Append' and 'AppendUnique' module flag behaviors.

llvm-svn: 172659