platform/upstream/llvm.git
11 years agoRemove the non-const getInst accessor. It wasn't being used, and isn't very
Eli Bendersky [Wed, 5 Dec 2012 19:31:33 +0000 (19:31 +0000)]
Remove the non-const getInst accessor. It wasn't being used, and isn't very
good for enacpsulation anyway.

llvm-svn: 169407

11 years agoAdjust JIT target triple on OS X to match the current architecture.
Bob Wilson [Wed, 5 Dec 2012 19:09:13 +0000 (19:09 +0000)]
Adjust JIT target triple on OS X to match the current architecture.

For OS X builds, we generate one version of config.h but then build for
multiple architectures.  This means that the LLVM_HOSTTRIPLE setting may have
the wrong architecture.  Adjust it dynamically to match the current
architecture.  <rdar://problem/12715470>

llvm-svn: 169405

11 years agoFix misplaced closing brace.
Matthew Curtis [Wed, 5 Dec 2012 19:00:34 +0000 (19:00 +0000)]
Fix misplaced closing brace.

llvm-svn: 169404

11 years agoRename class __lambda_node to ___lambda_node to fix compile failure with gcc 4.6...
Daniel Malea [Wed, 5 Dec 2012 18:55:49 +0000 (18:55 +0000)]
Rename class __lambda_node to ___lambda_node to fix compile failure with gcc 4.6 and 4.7
- using "__lambda_node" causes internal compiler error in newer GCC versions

llvm-svn: 169402

11 years agoRemove two dead functions resulting from a bad rebase.
Andrew Trick [Wed, 5 Dec 2012 18:52:15 +0000 (18:52 +0000)]
Remove two dead functions resulting from a bad rebase.

llvm-svn: 169401

11 years agoFormat strings: offer a cast to 'unichar' for %C in Objective-C contexts.
Jordan Rose [Wed, 5 Dec 2012 18:44:49 +0000 (18:44 +0000)]
Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.

For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.

(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)

This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.

<rdar://problem/11982013>

llvm-svn: 169400

11 years agoFormat strings: add more expression types that don't need parens to cast.
Jordan Rose [Wed, 5 Dec 2012 18:44:44 +0000 (18:44 +0000)]
Format strings: add more expression types that don't need parens to cast.

No functionality change (the test change is a comment only, and the new
functionality can't be tested using the current test).

llvm-svn: 169399

11 years agoFormat strings: a character literal should be printed with %c, not %d.
Jordan Rose [Wed, 5 Dec 2012 18:44:40 +0000 (18:44 +0000)]
Format strings: a character literal should be printed with %c, not %d.

The type of a character literal is 'int' in C, but if the user writes a
character /as/ a literal, we should assume they meant it to be a
character and not a numeric value, and thus offer %c as a correction
rather than %d.

There's a special case for multi-character literals (like 'MooV'), which
have implementation-defined value and usually cannot be printed with %c.
These still use %d as the suggestion.

In C++, the type of a character literal is 'char', and so this problem
doesn't exist.

<rdar://problem/12282316>

llvm-svn: 169398

11 years agoFormat strings: the correct conversion for 'char' is %c, not %d or %hhd.
Jordan Rose [Wed, 5 Dec 2012 18:44:37 +0000 (18:44 +0000)]
Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

llvm-svn: 169397

11 years agoTry to unbreak the build on hosts that don't transitively pull in a definition for...
Benjamin Kramer [Wed, 5 Dec 2012 18:31:11 +0000 (18:31 +0000)]
Try to unbreak the build on hosts that don't transitively pull in a definition for int64_t.

Also use the portable (ugly) format string macros, for MSVC compatibility.

llvm-svn: 169396

11 years agoRemove unused MachineInstr constructors.
Jakob Stoklund Olesen [Wed, 5 Dec 2012 18:27:39 +0000 (18:27 +0000)]
Remove unused MachineInstr constructors.

A MachineInstr can only ever be constructed by CreateMachineInstr() and
CloneMachineInstr(), and those factories don't use the removed
constructors.

llvm-svn: 169395

11 years agoCrash every time with new target logging is now fixed.
Greg Clayton [Wed, 5 Dec 2012 18:23:55 +0000 (18:23 +0000)]
Crash every time with new target logging is now fixed.

llvm-svn: 169394

11 years agoAdded a option to the disassembler to print immediates as hex.
Kevin Enderby [Wed, 5 Dec 2012 18:13:19 +0000 (18:13 +0000)]
Added a option to the disassembler to print immediates as hex.

This is for the lldb team so most of but not all of the values are
to be printed as hex with this option.  Some small values like the
scale in an X86 address were requested to printed in decimal
without the leading 0x.

There may be some tweaks need to places that may still be in
decimal that they want in hex.  Specially for arm.  I made my best
guess.  Any tweaks from here should be simple.

I also did the best I know now with help from the C++ gurus
creating the cleanest formatImm() utility function and containing
the changes.  But if someone has a better idea to make something
cleaner I'm all ears and game for changing the implementation.

rdar://8109283

llvm-svn: 169393

11 years ago[asan] drop the extension from asan tests (as the extension may be different)
Kostya Serebryany [Wed, 5 Dec 2012 17:56:54 +0000 (17:56 +0000)]
[asan] drop the extension from asan tests (as the extension may be different)

llvm-svn: 169392

11 years ago- Added calls to doInitialization/doFinalization to immutable passes
Pedro Artigas [Wed, 5 Dec 2012 17:12:22 +0000 (17:12 +0000)]
- Added calls to doInitialization/doFinalization to immutable passes
- fixed ordering of calls to doFinalization to be the reverse of the pass run order due to potential dependencies
- fixed machine module info to operate in the doInitialization/doFinalization model, also fixes some FIXMEs

reviewed by Evan Cheng <evan.cheng@apple.com>

llvm-svn: 169391

11 years agoRemove bad and useless enum to bool conversion.
Daniel Jasper [Wed, 5 Dec 2012 16:24:48 +0000 (16:24 +0000)]
Remove bad and useless enum to bool conversion.

llvm-svn: 169390

11 years agoClang-format: parse for and while loops
Alexander Kornienko [Wed, 5 Dec 2012 15:06:06 +0000 (15:06 +0000)]
Clang-format: parse for and while loops

Summary: Adds support for formatting for and while loops.

Reviewers: djasper, klimek

Reviewed By: klimek

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

llvm-svn: 169387

11 years agoIndentation fixes for clang-format.
Daniel Jasper [Wed, 5 Dec 2012 14:57:28 +0000 (14:57 +0000)]
Indentation fixes for clang-format.

- Fix behavior of memoization together with optimization
- Correctly attribute the PenaltyIndentLevel (breaking directly after "(" did
  not count towards the inner level)
- Recognize more tokens as assignments

Review: http://llvm-reviews.chandlerc.com/D172
llvm-svn: 169384

11 years ago[msan] Instrument bswap intrinsic.
Evgeniy Stepanov [Wed, 5 Dec 2012 14:39:55 +0000 (14:39 +0000)]
[msan] Instrument bswap intrinsic.

llvm-svn: 169383

11 years agoFollow-up to r169286, addresses comments in http://llvm-reviews.chandlerc.com/D164...
Alexander Kornienko [Wed, 5 Dec 2012 13:56:52 +0000 (13:56 +0000)]
Follow-up to r169286, addresses comments in llvm-reviews.chandlerc.com/D164#comment-4 : comments and a method rename

llvm-svn: 169382

11 years ago[asan] undo the debug printf
Kostya Serebryany [Wed, 5 Dec 2012 13:39:29 +0000 (13:39 +0000)]
[asan] undo the debug printf

llvm-svn: 169381

11 years agoReuse an existing diagnostic for tsan/msan needing -pie error.
Evgeniy Stepanov [Wed, 5 Dec 2012 13:37:12 +0000 (13:37 +0000)]
Reuse an existing diagnostic for tsan/msan needing -pie error.
Add a diagnosting for -fsanitize=memory conflicting with other sanitizers.
Extend tests.

llvm-svn: 169380

11 years agotsan: fix memory barriers in atomics
Dmitry Vyukov [Wed, 5 Dec 2012 13:14:55 +0000 (13:14 +0000)]
tsan: fix memory barriers in atomics

llvm-svn: 169379

11 years ago[msan] Initialize callbacks in runOnFunction as opposed to doInitialization.
Evgeniy Stepanov [Wed, 5 Dec 2012 13:14:33 +0000 (13:14 +0000)]
[msan] Initialize callbacks in runOnFunction as opposed to doInitialization.

This mirrors the change in ASan & TSan done in r168864.

llvm-svn: 169378

11 years ago[msan] Change linkage type of __msan_track_origins.
Evgeniy Stepanov [Wed, 5 Dec 2012 12:49:41 +0000 (12:49 +0000)]
[msan] Change linkage type of __msan_track_origins.

LinkOnceODRLinkage globals may be removed in GlobalOpt if not used in the
current module.

llvm-svn: 169377

11 years agotsan: provide own implementation of __cxa_guard_xxx functions
Dmitry Vyukov [Wed, 5 Dec 2012 12:10:22 +0000 (12:10 +0000)]
tsan: provide own implementation of __cxa_guard_xxx functions
that way we allow static linking of libstdc++

llvm-svn: 169376

11 years agotest/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions...
NAKAMURA Takumi [Wed, 5 Dec 2012 11:52:45 +0000 (11:52 +0000)]
test/Modules/build-fail-notes.m: Tweak to unbreak Win32 hosts to relax expressions, for now.

llvm-svn: 169375

11 years agoIn C++, if we hit an error in the class-head, don't try to parse the class body.
Richard Smith [Wed, 5 Dec 2012 11:34:06 +0000 (11:34 +0000)]
In C++, if we hit an error in the class-head, don't try to parse the class body.
Our error recovery path may have made the class anonymous, and that has a pretty
disastrous impact on any attempt to parse a class body containing constructors.

llvm-svn: 169374

11 years agoPR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
Richard Smith [Wed, 5 Dec 2012 11:04:55 +0000 (11:04 +0000)]
PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
the LHS of a token paste. Use "expanded from here" instead when we're not sure
it's actually a macro.

llvm-svn: 169373

11 years agoFix make build (hopefully).
Daniel Jasper [Wed, 5 Dec 2012 10:22:07 +0000 (10:22 +0000)]
Fix make build (hopefully).

llvm-svn: 169371

11 years agotsan: remove unnecesary include file
Dmitry Vyukov [Wed, 5 Dec 2012 10:16:17 +0000 (10:16 +0000)]
tsan: remove unnecesary include file

llvm-svn: 169370

11 years agotsan: fix lint warnings
Dmitry Vyukov [Wed, 5 Dec 2012 10:16:02 +0000 (10:16 +0000)]
tsan: fix lint warnings

llvm-svn: 169369

11 years ago[tsan] get rid of *allocator64* files, moving everything to *allocator* files. This...
Kostya Serebryany [Wed, 5 Dec 2012 10:09:15 +0000 (10:09 +0000)]
[tsan] get rid of *allocator64* files, moving everything to *allocator* files. This will help with the 32-bit allocator implementation and testing

llvm-svn: 169368

11 years agoMinor reorganization. No functionality change.
Richard Smith [Wed, 5 Dec 2012 09:47:49 +0000 (09:47 +0000)]
Minor reorganization. No functionality change.

llvm-svn: 169367

11 years agoSimplified BLEND pattern matching for shuffles.
Elena Demikhovsky [Wed, 5 Dec 2012 09:24:57 +0000 (09:24 +0000)]
Simplified BLEND pattern matching for shuffles.
Generate VPBLENDD for AVX2 and VPBLENDW for v16i16 type on AVX2.

llvm-svn: 169366

11 years agoAdd missing virtual destructors reported by -Wnon-virtual-dtor.
Daniel Jasper [Wed, 5 Dec 2012 09:23:48 +0000 (09:23 +0000)]
Add missing virtual destructors reported by -Wnon-virtual-dtor.

llvm-svn: 169365

11 years agoFirst version of a command line clang-format tool.
Daniel Jasper [Wed, 5 Dec 2012 09:01:09 +0000 (09:01 +0000)]
First version of a command line clang-format tool.

Reads a single source range (offset, length) as well as the style guide
as parameters and then reformats everything it receives from stdin.

llvm-svn: 169364

11 years agoSmall tweaks to automatic formatting.
Daniel Jasper [Wed, 5 Dec 2012 07:51:39 +0000 (07:51 +0000)]
Small tweaks to automatic formatting.

Recognize '!=' as a binary operator and assume that there are no
type definitions on the RHS of an assignment.

llvm-svn: 169363

11 years agoFix build against recent versions of Clang. Based on patch by Alastair Donaldson!
Peter Collingbourne [Wed, 5 Dec 2012 07:39:02 +0000 (07:39 +0000)]
Fix build against recent versions of Clang.  Based on patch by Alastair Donaldson!

llvm-svn: 169362

11 years ago[tsan] make the 64-bit allocator build (but not work) in 32-bit mode to simplify...
Kostya Serebryany [Wed, 5 Dec 2012 07:11:47 +0000 (07:11 +0000)]
[tsan] make the 64-bit allocator build (but not work) in 32-bit mode to simplify the code and test structure and allow further refactoring

llvm-svn: 169361

11 years agoRegisterPressure API. Add support for physical register units.
Andrew Trick [Wed, 5 Dec 2012 06:47:12 +0000 (06:47 +0000)]
RegisterPressure API. Add support for physical register units.

At build-time register pressure was always computed in terms of
register units. But the compile-time API was expressed in terms of
register classes because it was intended for virtual registers (and
physical register units weren't yet used anywhere in codegen).

Now that the codegen uses physreg units consistently, prepare for
tracking register pressure also in terms of live units, not live
registers.

llvm-svn: 169360

11 years agoAdded RegisterPressureTracker::dump() for debugging.
Andrew Trick [Wed, 5 Dec 2012 06:47:08 +0000 (06:47 +0000)]
Added RegisterPressureTracker::dump() for debugging.

llvm-svn: 169359

11 years agoComment formatting.
Andrew Trick [Wed, 5 Dec 2012 06:47:06 +0000 (06:47 +0000)]
Comment formatting.

llvm-svn: 169358

11 years agoSimplify slightly by seperating out the responsibility for emission of a caret
Richard Smith [Wed, 5 Dec 2012 06:20:58 +0000 (06:20 +0000)]
Simplify slightly by seperating out the responsibility for emission of a caret
diagnostic from the emission of macro backtraces. Incidentally, we now get the
displayed source location for a diagnostic and the location for the caret from
the same place, rather than computing them separately. No functionality change.

llvm-svn: 169357

11 years agoThis test used to fail forever if it failed once, because it does not clean up after...
Richard Smith [Wed, 5 Dec 2012 06:16:54 +0000 (06:16 +0000)]
This test used to fail forever if it failed once, because it does not clean up after itself if it failed.

llvm-svn: 169356

11 years agoDriver.cpp: Restore clang/Config/config.h to be included at last not to prevent llvm...
NAKAMURA Takumi [Wed, 5 Dec 2012 04:56:27 +0000 (04:56 +0000)]
Driver.cpp: Restore clang/Config/config.h to be included at last not to prevent llvm-config.h.

Or "llvm/Support/system_error.h" could not be compiled on mingw.

llvm-svn: 169354

11 years agodocs: Explain plain preformatted text
Sean Silva [Wed, 5 Dec 2012 04:07:33 +0000 (04:07 +0000)]
docs: Explain plain preformatted text

llvm-svn: 169352

11 years agoSimplify diagnostic emission. No functionality change intended.
Richard Smith [Wed, 5 Dec 2012 03:18:16 +0000 (03:18 +0000)]
Simplify diagnostic emission. No functionality change intended.

llvm-svn: 169351

11 years agoThread-safety analysis: check locks on method calls, operator=, and
DeLesley Hutchins [Wed, 5 Dec 2012 01:20:45 +0000 (01:20 +0000)]
Thread-safety analysis: check locks on method calls, operator=, and
copy constructors.

llvm-svn: 169350

11 years ago[analyzer] Implement an opt-in variant of direct ivar assignment.
Anna Zaks [Wed, 5 Dec 2012 01:14:37 +0000 (01:14 +0000)]
[analyzer] Implement an opt-in variant of direct ivar assignment.

This will only check the direct ivar assignments in the annotated
methods.

llvm-svn: 169349

11 years agoThread Safety Analysis: refactor to make more methods accept const pointers,
DeLesley Hutchins [Wed, 5 Dec 2012 00:52:33 +0000 (00:52 +0000)]
Thread Safety Analysis: refactor to make more methods accept const pointers,
adjust checkAccess.  No change in functionality.

llvm-svn: 169348

11 years agoTesting C++ declarations embedded in
Fariborz Jahanian [Wed, 5 Dec 2012 00:38:44 +0000 (00:38 +0000)]
Testing C++ declarations embedded in
<declaration> tag of Comment XML and
added support for friend declaration printing.
This is wip. // rdar://12378714

llvm-svn: 169346

11 years agofix a typo
Shuxin Yang [Wed, 5 Dec 2012 00:33:16 +0000 (00:33 +0000)]
fix a typo

llvm-svn: 169345

11 years agoCopy clang/Driver/<Option parsing stuff> to llvm.
Michael J. Spencer [Wed, 5 Dec 2012 00:29:32 +0000 (00:29 +0000)]
Copy clang/Driver/<Option parsing stuff> to llvm.

llvm-svn: 169344

11 years agodocs: Sphinxify `docs/tutorial/`
Sean Silva [Wed, 5 Dec 2012 00:26:32 +0000 (00:26 +0000)]
docs: Sphinxify `docs/tutorial/`

Sorry for the massive commit, but I just wanted to knock this one down
and it is really straightforward.

There are still a couple trivial (i.e. not related to the content)
things left to fix:

- Use of raw HTML links where :doc:`...` and :ref:`...` could be used
  instead. If you are a newbie and want to help fix this it would make
  for some good bite-sized patches; more experienced developers should
  be focusing on adding new content (to this tutorial or elsewhere, but
  please _do not_ waste your time on formatting when there is such dire
  need for documentation (see docs/SphinxQuickstartTemplate.rst to get
  started writing)).

- Highlighting of the kaleidoscope code blocks (currently left as bare
  `::`).  I will be working on writing a custom Pygments highlighter for
  this, mostly as training for maintaining the `llvm` code-block's lexer
  in-tree. I want to do this because I am extremely unhappy with how it
  just "gives up" on the slightest deviation from the expected syntax
  and leaves the whole code-block un-highlighted.

  More generally I am looking at writing some Sphinx extensions and
  keeping them in-tree as well, to support common use cases that
  currently have no good solution (like "monospace text inside a link").

llvm-svn: 169343

11 years agoAdd an LLDB_LOG_TARGET logging channel (log eanble lldb target).
Jason Molenda [Wed, 5 Dec 2012 00:25:49 +0000 (00:25 +0000)]
Add an LLDB_LOG_TARGET logging channel (log eanble lldb target).

Update the Target methods which can change the target log to this
channel.

llvm-svn: 169342

11 years agoFix Linux build warnings due to redefinition of macros:
Daniel Malea [Wed, 5 Dec 2012 00:20:57 +0000 (00:20 +0000)]
Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!

llvm-svn: 169341

11 years ago<rdar://problem/12649160>
Greg Clayton [Wed, 5 Dec 2012 00:16:59 +0000 (00:16 +0000)]
<rdar://problem/12649160>

Added the ability to debug through your process exec'ing itself to the same architecture.

llvm-svn: 169340

11 years agoAdd x86 isel lowering logic to form bit test with inverted condition. e.g.
Evan Cheng [Wed, 5 Dec 2012 00:10:38 +0000 (00:10 +0000)]
Add x86 isel lowering logic to form bit test with inverted condition. e.g.
x ^ -1.

Patch by David Majnemer.
rdar://12755626

llvm-svn: 169339

11 years agoThread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.
DeLesley Hutchins [Wed, 5 Dec 2012 00:06:15 +0000 (00:06 +0000)]
Thread safety analysis: Add a new "beta" warning flag: -Wthread-safety-beta.
As the analysis improves, it will continue to add new warnings that are
potentially disruptive to existing users.  From now on, such warnings will
first be introduced under the "beta" flag.  Such warnings are not turned on by
default; their purpose is to allow users to test their code against future
planned changes, before those changes are actually made.  After a suitable
migration period, beta warnings will be folded into the standard
-Wthread-safety.

llvm-svn: 169338

11 years agoAppease GCC's -Wparentheses.
Matt Beaumont-Gay [Tue, 4 Dec 2012 23:54:02 +0000 (23:54 +0000)]
Appease GCC's -Wparentheses.

(TIL that Clang's -Wparentheses ignores 'x || y && "foo"' on purpose. Neat.)

llvm-svn: 169337

11 years agoSplit up the ParseOptionalAttrs method into three different methods for each
Bill Wendling [Tue, 4 Dec 2012 23:40:58 +0000 (23:40 +0000)]
Split up the ParseOptionalAttrs method into three different methods for each
class of attributes. This makes it much easier to check for errors and to reuse
the code.

llvm-svn: 169336

11 years agoFix a use-after-unmap bug in /proc/self/maps caching. The cached buffer was occasiona...
Alexander Potapenko [Tue, 4 Dec 2012 23:30:00 +0000 (23:30 +0000)]
Fix a use-after-unmap bug in /proc/self/maps caching. The cached buffer was occasionally deleted in the MemoryMappingLayout destructor.

llvm-svn: 169335

11 years agoLoopVectorizer: Increase the number of pointers that can be tested at runtime. If...
Nadav Rotem [Tue, 4 Dec 2012 23:25:24 +0000 (23:25 +0000)]
LoopVectorizer: Increase the number of pointers that can be tested at runtime. If we cant prove statically that the pointers are disjoint then we add the runtime check.

llvm-svn: 169334

11 years agoEnable if-conversion during vectorization.
Nadav Rotem [Tue, 4 Dec 2012 22:59:52 +0000 (22:59 +0000)]
Enable if-conversion during vectorization.

llvm-svn: 169331

11 years agoAdd -whole-archive around the ASan runtime archive in the link command.
Chandler Carruth [Tue, 4 Dec 2012 22:54:37 +0000 (22:54 +0000)]
Add -whole-archive around the ASan runtime archive in the link command.

This ensures that even though it comes first, we pick up its .o files.
Note that if we can use this (or something similar / equivalent) on
other platforms, we could potentially remove
ReplaceOperatorsNewAndDelete from the ASan runtimes.

We should probably do something similar for TSan and MSan as well.

llvm-svn: 169328

11 years agoARM custom lower ctpop for vector types. Patch by Pete Couperus.
Evan Cheng [Tue, 4 Dec 2012 22:41:50 +0000 (22:41 +0000)]
ARM custom lower ctpop for vector types. Patch by Pete Couperus.

llvm-svn: 169325

11 years agoFix a bug in vectorization of if-converted reduction variables. If the
Nadav Rotem [Tue, 4 Dec 2012 22:40:22 +0000 (22:40 +0000)]
Fix a bug in vectorization of if-converted reduction variables. If the
reduction variable is not used outside the loop then we ran into an
endless loop. This change checks if we found the original PHI.

llvm-svn: 169324

11 years agoSpeed up the AllocationOrder class a bit.
Jakob Stoklund Olesen [Tue, 4 Dec 2012 22:25:16 +0000 (22:25 +0000)]
Speed up the AllocationOrder class a bit.

Allow the central functions to be inlined, and use the argumentless
isHint() function when possible.

llvm-svn: 169319

11 years agoAlphabetize source files, just like they have been before.
Ted Kremenek [Tue, 4 Dec 2012 22:17:32 +0000 (22:17 +0000)]
Alphabetize source files, just like they have been before.

llvm-svn: 169318

11 years ago For rdar://12329730, last piece.
Shuxin Yang [Tue, 4 Dec 2012 22:15:32 +0000 (22:15 +0000)]
  For rdar://12329730, last piece.

  This change attempts to simplify (X^Y) -> X or Y in the user's context if we know that
only bits from X or Y are demanded.

  A minimized case is provided bellow. This change will simplify "t>>16" into "var1 >>16".

  =============================================================
  unsigned foo (unsigned val1, unsigned val2) {
    unsigned t = val1 ^ 1234;
    return (t >> 16) | t; // NOTE: t is used more than once.
  }
  =============================================================

  Note that if the "t" were used only once, the expression would be finally optimized as well.
However, with with this change, the optimization will take place earlier.

  Reviewed by Nadav, Thanks a lot!

llvm-svn: 169317

11 years agoFix comment in ABIMacOSX_i386::RegisterIsCalleeSaved to say that
Jason Molenda [Tue, 4 Dec 2012 22:08:50 +0000 (22:08 +0000)]
Fix comment in ABIMacOSX_i386::RegisterIsCalleeSaved to say that
these are the *non-volatile* registers on Darwin/i386, not the
volatile registers.
Recognize the sp, pc, fp generic reg names as well.

llvm-svn: 169316

11 years agoComment change made in r169304 as requested by Eric Christopher.
David Blaikie [Tue, 4 Dec 2012 22:02:33 +0000 (22:02 +0000)]
Comment change made in r169304 as requested by Eric Christopher.

llvm-svn: 169315

11 years agoDefine store instructions with base+register offset addressing mode
Jyotsna Verma [Tue, 4 Dec 2012 21:58:25 +0000 (21:58 +0000)]
Define store instructions with base+register offset addressing mode
using multiclass.

llvm-svn: 169314

11 years agoUser isl sha commit id instead of the git tag
Tobias Grosser [Tue, 4 Dec 2012 21:54:37 +0000 (21:54 +0000)]
User isl sha commit id instead of the git tag

Apperently the git tag causes trouble in some scripts.

llvm-svn: 169313

11 years agoUse the 'count' attribute to calculate the upper bound of an array.
Bill Wendling [Tue, 4 Dec 2012 21:34:03 +0000 (21:34 +0000)]
Use the 'count' attribute to calculate the upper bound of an array.

The count attribute is more accurate with regards to the size of an array. It
also obviates the upper bound attribute in the subrange. We can also better
handle an unbound array by setting the count to -1 instead of the lower bound to
1 and upper bound to 0.

llvm-svn: 169312

11 years agoUse the 'count' attribute to calculate the upper bound of an array.
Bill Wendling [Tue, 4 Dec 2012 21:33:58 +0000 (21:33 +0000)]
Use the 'count' attribute to calculate the upper bound of an array.

The count attribute is more accurate with regards to the size of an array. It
also obviates the upper bound attribute in the subrange. We can also better
handle an unbound array by setting the count to -1 instead of the lower bound to
1 and upper bound to 0.

llvm-svn: 169311

11 years agoCurrently, with -fsanitize=address, the driver appends libclang_rt.asan.a to
Matt Beaumont-Gay [Tue, 4 Dec 2012 21:18:26 +0000 (21:18 +0000)]
Currently, with -fsanitize=address, the driver appends libclang_rt.asan.a to
the link command. This all works fine when the driver is also responsible for
adding -lstdc++ to the link command. But, if -lstdc++ (or libstdc++.a, etc) is
passed explicitly to the driver, the ASan runtime will appear in the link
command after the standard library, leading to multiple-definition errors for
the global 'operator new' and 'operator delete'. Fix this in a painfully
simple way, by inserting libclang_rt.asan.a at the start of the link command
instead of the end.

If we need to do something more clever, we can walk the link command looking
for something that resembles libstdc++ and insert libclang_rt.asan.a as late
as possible, but the simple solution works for now.

llvm-svn: 169310

11 years agodocs: Begin Sphinxification of docs/tutorial/
Sean Silva [Tue, 4 Dec 2012 21:16:41 +0000 (21:16 +0000)]
docs: Begin Sphinxification of docs/tutorial/

llvm-svn: 169309

11 years agodocs: fixup legacy HTML link
Sean Silva [Tue, 4 Dec 2012 21:16:34 +0000 (21:16 +0000)]
docs: fixup legacy HTML link

llvm-svn: 169308

11 years agoTesting C declarations embedded in
Fariborz Jahanian [Tue, 4 Dec 2012 21:15:23 +0000 (21:15 +0000)]
Testing C declarations embedded in
<declaration> tag of Comment XML and fixed a
missing block literal printout as result of the testing.
// rdar://12378714

llvm-svn: 169307

11 years agoAdd library dependencies to the lld cmake build.
Benjamin Kramer [Tue, 4 Dec 2012 21:09:04 +0000 (21:09 +0000)]
Add library dependencies to the lld cmake build.

llvm-svn: 169306

11 years agoReapply r160148 (reverted in r163570) fixing spurious breakpoints in modern GDB
David Blaikie [Tue, 4 Dec 2012 21:05:36 +0000 (21:05 +0000)]
Reapply r160148 (reverted in r163570) fixing spurious breakpoints in modern GDB

This reapplies the fix for PR13303 now with more justification. Based on my
execution of the GDB 7.5 test suite this results in:

expected passes: 16101 -> 20890 (+30%)
unexpected failures: 4826 -> 637 (-77%)

There are 23 checks that used to pass and now fail. They are all in
gdb.reverse. Investigating a few looks like they were accidentally passing
due to extra breakpoints being set by this bug. They're generally due to the
difference in end location between gcc and clang, the test suite is trying to
set breakpoints on the closing '}' that clang doesn't associate with any
instructions.

llvm-svn: 169304

11 years agoAdd missing destructors found with -Wnon-virtual-dtor.
Daniel Jasper [Tue, 4 Dec 2012 21:05:31 +0000 (21:05 +0000)]
Add missing destructors found with -Wnon-virtual-dtor.

llvm-svn: 169303

11 years agoIn the data formatters, if we know the result
Sean Callanan [Tue, 4 Dec 2012 20:56:04 +0000 (20:56 +0000)]
In the data formatters, if we know the result
type of an Objective-C selector, don't bother
making the expression parser resolve it all over
again.  Just send the message straight to the
object pointer as if it were an id, and cast the
result.

<rdar://problem/12799087>

llvm-svn: 169300

11 years agoCache the names for Objective-C classes if we know
Sean Callanan [Tue, 4 Dec 2012 20:52:38 +0000 (20:52 +0000)]
Cache the names for Objective-C classes if we know
them while making our initial run through the
Objective-C runtime's class tables.

<rdar://problem/12799087>

llvm-svn: 169299

11 years agoMark TestConnectRemote.py as expected to fail on Linux due to bugzilla #14427
Daniel Malea [Tue, 4 Dec 2012 19:53:59 +0000 (19:53 +0000)]
Mark TestConnectRemote.py as expected to fail on Linux due to bugzilla #14427

llvm-svn: 169295

11 years agoRemove a URL from code
Eli Bendersky [Tue, 4 Dec 2012 19:08:43 +0000 (19:08 +0000)]
Remove a URL from code

llvm-svn: 169293

11 years agoAdapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
Eli Bendersky [Tue, 4 Dec 2012 18:38:10 +0000 (18:38 +0000)]
Adapt to LLVM commit 169291 which streamlines the usage of NaCl/NativeClient
in the triple.

llvm-svn: 169292

11 years agoMake NaCl naming consistent. The triple OSType is called NaCl and is represented
Eli Bendersky [Tue, 4 Dec 2012 18:37:26 +0000 (18:37 +0000)]
Make NaCl naming consistent. The triple OSType is called NaCl and is represented
textually as NativeClient. Also added a link to the native client project for
readers unfamiliar with it.

A Clang patch will follow shortly.

llvm-svn: 169291

11 years agoadditional test for declaration tag of a class extension.
Fariborz Jahanian [Tue, 4 Dec 2012 18:25:34 +0000 (18:25 +0000)]
additional test for declaration tag of a class extension.
// rdar://12378714

llvm-svn: 169289

11 years agoAdd support for reduction variables when IF-conversion is enabled.
Nadav Rotem [Tue, 4 Dec 2012 18:17:33 +0000 (18:17 +0000)]
Add support for reduction variables when IF-conversion is enabled.

llvm-svn: 169288

11 years agoAdd patterns to define 'combine', 'tstbit', 'ct0/cl0' (count trailing/leading zeros)
Jyotsna Verma [Tue, 4 Dec 2012 18:05:01 +0000 (18:05 +0000)]
Add patterns to define 'combine', 'tstbit', 'ct0/cl0' (count trailing/leading zeros)
instructions.

llvm-svn: 169287

11 years agoError recovery part 2
Alexander Kornienko [Tue, 4 Dec 2012 17:27:50 +0000 (17:27 +0000)]
Error recovery part 2

Summary: Adds recovery for structural errors in clang-format.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, silvas
Differential Revision: http://llvm-reviews.chandlerc.com/D164

llvm-svn: 169286

11 years agoobjective-c blocks: Consider padding due to alignment
Fariborz Jahanian [Tue, 4 Dec 2012 17:20:57 +0000 (17:20 +0000)]
objective-c blocks: Consider padding due to alignment
after the fixed size block header when generating
captured block variable info. // rdar://12773256

llvm-svn: 169285

11 years agoAdd constant extender support to ALU32 instructions for V2.
Jyotsna Verma [Tue, 4 Dec 2012 17:12:00 +0000 (17:12 +0000)]
Add constant extender support to ALU32 instructions for V2.

llvm-svn: 169284

11 years agoA test in thid directory was not being run because lit.local.cfg didn't
Eli Bendersky [Tue, 4 Dec 2012 17:00:11 +0000 (17:00 +0000)]
A test in thid directory was not being run because lit.local.cfg didn't
include .ll files. Fix that.

llvm-svn: 169283

11 years agoFix comment typo.
Duncan Sands [Tue, 4 Dec 2012 16:36:05 +0000 (16:36 +0000)]
Fix comment typo.

llvm-svn: 169282

11 years agoThis patch introduces initial-exec model support for thread-local storage
Bill Schmidt [Tue, 4 Dec 2012 16:18:08 +0000 (16:18 +0000)]
This patch introduces initial-exec model support for thread-local storage
on 64-bit PowerPC ELF.

The patch includes code to handle external assembly and MC output with the
integrated assembler.  It intentionally does not support the "old" JIT.

For the initial-exec TLS model, the ABI requires the following to calculate
the address of external thread-local variable x:

 Code sequence            Relocation                  Symbol
  ld 9,x@got@tprel(2)      R_PPC64_GOT_TPREL16_DS      x
  add 9,9,x@tls            R_PPC64_TLS                 x

The register 9 is arbitrary here.  The linker will replace x@got@tprel
with the offset relative to the thread pointer to the generated GOT
entry for symbol x.  It will replace x@tls with the thread-pointer
register (13).

The two test cases verify correct assembly output and relocation output
as just described.

PowerPC-specific selection node variants are added for the two
instructions above:  LD_GOT_TPREL and ADD_TLS.  These are inserted
when an initial-exec global variable is encountered by
PPCTargetLowering::LowerGlobalTLSAddress(), and later lowered to
machine instructions LDgotTPREL and ADD8TLS.  LDgotTPREL is a pseudo
that uses the same LDrs support added for medium code model's LDtocL,
with a different relocation type.

The rest of the processing is straightforward.

llvm-svn: 169281

11 years agoUpdate release notes for NVPTX
Justin Holewinski [Tue, 4 Dec 2012 16:11:51 +0000 (16:11 +0000)]
Update release notes for NVPTX

llvm-svn: 169280