Commit Graph

148792 Commits

Author SHA1 Message Date
Ashok Thirumurthi d36712df8d Refactoring for struct UserArea:
- Decouples RegisterContext_x86_64 from UserArea.
- Restores the original definition of UserArea so that it can be used to generate offsets for use with ptrace.
- Moves UserArea to the 64-bit Linux specialization.

- Also fixes an off-by-one error for the size of m_gpr.
- Also adds a TODO comment noting the need for a mechanism to identify the correct plugin based on the target OS (and architecture).

Reviewed by: Matt Kopec and Samuel Jacob

llvm-svn: 181055
2013-05-03 20:00:17 +00:00
Ulrich Weigand b9d5d073d6 [PowerPC] Avoid using '$' in generated assembler code
PowerPC assemblers are supposed to support a stand-alone '$' symbol
as an alternative of '.' to refer to the current PC.  This does not
work in the LLVM assembler parser yet.

To avoid bootstrap failures when using the LLVM assembler as system
assembler, this patch modifies the assembler source code generated
by LLVM to avoid using '$' (and simply use '.' instead).

llvm-svn: 181054
2013-05-03 19:53:04 +00:00
Ulrich Weigand 2c3a219b76 [PowerPC] Parse platform-specifc variant kinds in AsmParser
This patch adds support for PowerPC platform-specific variant
kinds in MCSymbolRefExpr::getVariantKindForName, and also
adds a test case to verify they are translated to the appropriate
fixup type.

llvm-svn: 181053
2013-05-03 19:52:35 +00:00
Ulrich Weigand 300b6875fb [PowerPC] Add some Book II instructions to AsmParser
This patch adds a couple of Book II instructions (isync, icbi) to the
PowerPC assembler parser.  These are needed when bootstrapping clang
with the integrated assembler forced on, because they are used in
inline asm statements in the code base.

The test case adds the full list of Book II storage control instructions,
including associated extended mnemonics.  Again, those that are not yet
supported as marked as FIXME.

llvm-svn: 181052
2013-05-03 19:51:09 +00:00
Ulrich Weigand d839490f16 [PowerPC] Support extended mnemonics in AsmParser
This patch adds infrastructure to support extended mnemonics in the
PowerPC assembler parser.  It adds support specifically for those
extended mnemonics that LLVM will itself generate.

The test case lists *all* extended mnemonics according to the
PowerPC ISA v2.06 Book I, but marks those not yet supported
as FIXME.

llvm-svn: 181051
2013-05-03 19:50:27 +00:00
Ulrich Weigand 640192daa8 [PowerPC] Add assembler parser
This adds assembler parser support to the PowerPC back end.

The parser will run for any powerpc-*-* and powerpc64-*-* triples,
but was tested only on 64-bit Linux.  The supported syntax is
intended to be compatible with the GNU assembler.

The parser does not yet support all PowerPC instructions, but
it does support anything that is generated by LLVM itself.
There is no support for testing restricted instruction sets yet,
i.e. the parser will always accept any instructions it knows,
no matter what feature flags are given.

Instruction operands will be checked for validity and errors
generated.  (Error handling in general could still be improved.)

The patch adds a number of test cases to verify instruction
and operand encodings.  The tests currently cover all instructions
from the following PowerPC ISA v2.06 Book I facilities:
Branch, Fixed-point, Floating-Point, and Vector. 
Note that a number of these instructions are not yet supported
by the back end; they are marked with FIXME.

A number of follow-on check-ins will add extra features.  When
they are all included, LLVM passes all tests (including bootstrap)
when using clang -cc1as as the system assembler.

llvm-svn: 181050
2013-05-03 19:49:39 +00:00
Andrew Kaylor 3a8625dda9 Fix logic error in ProcessInfo::SetArg0
llvm-svn: 181049
2013-05-03 19:38:09 +00:00
Ben Langmuir ce914fc84b Serialization for captured statements
Add serialization for captured statements and captured decls.  Also add
a const_capture_iterator to CapturedStmt.

Test contributed by Wei Pan

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

llvm-svn: 181048
2013-05-03 19:20:19 +00:00
Shuxin Yang 637b9bebd4 Decompose GVN::processNonLocalLoad() (about 400 LOC) into smaller helper functions. No function change.
This function consists of following steps:
   1. Collect dependent memory accesses.
   2. Analyze availability.
   3. Perform fully redundancy elimination, or 
   4. Perform PRE, depending on the availability

 Step 2, 3 and 4 are now moved to three helper routines.

llvm-svn: 181047
2013-05-03 19:17:26 +00:00
Richard Smith fa11fd669f PR15906: The body of a lambda is not an evaluated subexpression; don't visit it when visiting such subexpressions.
llvm-svn: 181046
2013-05-03 19:16:22 +00:00
Enrico Granata 4ffff2791f Harden against potential empty nodes in the map
llvm-svn: 181045
2013-05-03 19:07:20 +00:00
Enrico Granata d03a273b96 <rdar://problem/13749871>
Improvements to the std::map data formatter to recognize when invalid memory is being explored and bail out instead of looping for a potentially very long time

llvm-svn: 181044
2013-05-03 19:04:35 +00:00
Ben Langmuir 37943a7af8 Move CapturedStmt parameters to CapturedDecl
Move the creation of CapturedStmt parameters out of CodeGen and into
Sema, making it easier to customize the outlined function. The
ImplicitParamDecls are stored in the CapturedDecl using an
ASTContext-allocated array.

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

llvm-svn: 181043
2013-05-03 19:00:33 +00:00
Douglas Gregor 231ca1c929 Restore Richard's belief in me.
llvm-svn: 181042
2013-05-03 18:51:59 +00:00
Akira Hatanaka e86bd4f652 [mips] Split the DSP control register and define one register for each field of
its fields.

This removes false dependencies between DSP instructions which access different
fields of the the control register. Implicit register operands are added to
instructions RDDSP and WRDSP after instruction selection, depending on the
value of the mask operand.

llvm-svn: 181041
2013-05-03 18:37:49 +00:00
Ted Kremenek acf99a1a51 [analyzer] Start hacking up alternate control-flow edge generation. WIP. Not guaranteed to do anything useful yet.
llvm-svn: 181040
2013-05-03 18:25:33 +00:00
Argyrios Kyrtzidis fac3162022 Keep track of an @implementation's super class name location, if one was provided.
llvm-svn: 181039
2013-05-03 18:05:44 +00:00
Nadav Rotem 4ce060b3da LoopVectorizer: Add support for if-conversion of PHINodes with 3+ incoming values.
By supporting the vectorization of PHINodes with more than two incoming values we can increase the complexity of nested if statements.

We can now vectorize this loop:

int foo(int *A, int *B, int n) {
  for (int i=0; i < n; i++) {
    int x = 9;
    if (A[i] > B[i]) {
      if (A[i] > 19) {
        x = 3;
      } else if (B[i] < 4 ) {
        x = 4;
      } else {
        x = 5;
      }
    }
    A[i] = x;
  }
}

llvm-svn: 181037
2013-05-03 17:42:55 +00:00
Tom Stellard 4489b85f2b R600: Expand vector or, shl, srl, and xor nodes
llvm-svn: 181035
2013-05-03 17:21:31 +00:00
Tom Stellard 6a6ecedcb7 R600: BFI_INT is a vector-only instruction
llvm-svn: 181034
2013-05-03 17:21:24 +00:00
Tom Stellard eac65dde30 R600: Add pattern for SHA-256 Ma function
This can be optimized using the BFI_INT instruction.

llvm-svn: 181033
2013-05-03 17:21:20 +00:00
Tom Stellard c2516c6e40 R600: Clean up comments in Processors.td
llvm-svn: 181032
2013-05-03 17:21:14 +00:00
John McCall 55c0ceecac Micro-optimization: check the overloaded operator kind before
checking for a lambda.

Thanks to Jordan for the pointer.

llvm-svn: 181031
2013-05-03 17:11:14 +00:00
Edwin Vane 9924de1b28 Generate input files from within unit test
It is preferable for a unit test to be responsible for creating its own input
data instead of relying on checked-in data files. Now the IncludeExcludeTest
for cpp11-migrate does this.

- Removed old data files.
- Updated build system and lit files to remove references to old data files.

llvm-svn: 181029
2013-05-03 16:30:55 +00:00
Greg Clayton 6991afe31b Added a few things that need to be installed on linux to build LLDB.
llvm-svn: 181028
2013-05-03 16:29:42 +00:00
Ashok Thirumurthi d77e8aefe3 Fixed 'command script import' by eliminating the shadowing of basename.
Reviewed by: Daniel Malea

llvm-svn: 181027
2013-05-03 15:56:59 +00:00
Benjamin Kramer 00622f7d26 Autoconf: Compile cxxabi.h in C++ mode.
Should fix PR15877.

llvm-svn: 181026
2013-05-03 15:55:06 +00:00
Tobias Grosser a7ddc98206 RegionInfo: Do not crash if unreachable block is found
llvm-svn: 181025
2013-05-03 15:48:34 +00:00
Sylvestre Ledru 5b5a6e0162 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181024
2013-05-03 15:28:03 +00:00
Hans Wennborg 533c4646c2 Remove svn:eol-style property set in r180918 and r181004
git-svn accidentally added these for me.

llvm-svn: 181023
2013-05-03 15:10:30 +00:00
Dmitri Gribenko 8f8930fc01 ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()
Patch by Robert Wilhelm.

llvm-svn: 181022
2013-05-03 15:05:50 +00:00
Rafael Espindola aabf533656 Initialize WarnOnSpellCheck.
Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to
do so.

Issue noticed by Enea Zaffanella.

llvm-svn: 181021
2013-05-03 15:01:36 +00:00
Daniel Jasper 72463d32e0 Add space between ; and (.
Before: for (int i = 0;(i < 10); ++i) {}
After:  for (int i = 0; (i < 10); ++i) {}
llvm-svn: 181020
2013-05-03 14:50:50 +00:00
Benjamin Kramer ff2be22b91 CMake: cxxabi.h is only available to C++ compilers, use the right check macro.
llvm-svn: 181019
2013-05-03 14:48:29 +00:00
Ashok Thirumurthi 72b4c8dce3 Fixed the build to reflect the removal of OperatingSystem/Darwin-Kernel in r180993.
llvm-svn: 181018
2013-05-03 14:45:11 +00:00
Daniel Jasper c37de30219 Fix expression recognition in for-loops.
Before: for (; a&& b;) {}
After:  for (; a && b;) {}
llvm-svn: 181017
2013-05-03 14:41:24 +00:00
Richard Sandiford ae426b4a61 Remove comment that no target supports 128-bit IEEE floats
The soon-to-be-committed SystemZ port uses 128-bit IEEE floats.
MIPS64 GNU/Linux does too (albeit with unusual NaNs).

llvm-svn: 181016
2013-05-03 14:32:27 +00:00
Richard Sandiford ca0440826a [SystemZ] Add MCJIT support
Another step towards reinstating the SystemZ backend.  I'll commit
the configure changes separately (TARGET_HAS_JIT etc.), then commit
a patch to enable the MCJIT tests on SystemZ.

llvm-svn: 181015
2013-05-03 14:15:35 +00:00
Dmitri Gribenko 5267fdfb7f Add const qualifier to Sema::getTypeName's parameter `II`
Patch by Ismail Pazarbasi.

llvm-svn: 181011
2013-05-03 13:12:11 +00:00
Ulrich Weigand 90c9abdd27 [SystemZ] Support System Z as host architecture
The llvm::sys::AddSignalHandler function (as well as related routines) in
lib/Support/Unix/Signals.inc currently registers a signal handler routine
via "sigaction".  When this handler is called due to a SIGSEGV, SIGILL or
similar signal, it will show a stack backtrace, deactivate the handler,
and then simply return to the operating system.  The intent is that the
OS will now retry execution at the same location as before, which ought
to again trigger the same error condition and cause the same signal to be
delivered again.  Since the hander is now deactivated, the OS will take
its default action (usually, terminate the program and possibly create
a core dump).

However, this method doesn't work reliably on System Z:  With certain
signals (namely SIGILL, SIGFPE, and SIGTRAP), the program counter stored
by the kernel on the signal stack frame (which is the location where
execution will resume) is not the instruction that triggered the fault,
but then instruction *after it*.  When the LLVM signal handler simply
returns to the kernel, execution will then resume at *that* address,
which will not trigger the problem again, but simply go on and execute
potentially unrelated code leading to random errors afterwards.

To fix this, the patch simply goes and re-raises the signal in question
directly from the handler instead of returning from it.  This is done
only on System Z and only for those signals that have this particular
problem.

llvm-svn: 181010
2013-05-03 12:22:11 +00:00
Amara Emerson 2f54d9fe10 Add support for reading ARM ELF build attributes.
Build attribute sections can now be read if they exist via ELFObjectFile, and
the llvm-readobj tool has been extended with an option to dump this information
if requested. Regression tests are also included which exercise these features.

Also update the docs with a fixed ARM ABI link and a new link to the Addenda
which provides the build attributes specification.

llvm-svn: 181009
2013-05-03 11:36:35 +00:00
Richard Sandiford affdc8b54a [SystemZ] Add ELF relocation support
Another step towards reinstating the SystemZ backend.  Tests will be
included in the main backend patch.

llvm-svn: 181008
2013-05-03 11:11:15 +00:00
Richard Sandiford a238c5e08f [SystemZ] Add llvm::Triple::systemz
First step towards reinstating the SystemZ backend.  Tests will be
included in the main backend patch.

llvm-svn: 181007
2013-05-03 11:05:17 +00:00
Benjamin Kramer 914d7e06b6 Add support for -march=btver2.
llvm-svn: 181006
2013-05-03 10:47:15 +00:00
Benjamin Kramer b44c4275d5 X86: Add target description for btver2; make autodetection logic aware of AVX.
llvm-svn: 181005
2013-05-03 10:20:08 +00:00
Hans Wennborg cadd77c05b Support __wchar_t in -fms-extensions and -fms-compatibility modes.
MSVC provides __wchar_t, either as an alias for the built-in wchar_t
type, or as a separate type depending on language (C vs C++) and flags
(-fno-wchar).

In -fms-extensions, Clang will simply accept __wchar_t as an alias for
whatever type is used for wide character literals. In -fms-compatibility, we
try to mimic MSVC's behavior by always making __wchar_t a builtin type.

This fixes PR15815.

llvm-svn: 181004
2013-05-03 09:10:16 +00:00
Pekka Jaaskelainen b531a11701 Added pocl and TCE blurbs to the ReleaseNotes.
llvm-svn: 181001
2013-05-03 07:37:04 +00:00
John McCall dec348f7db Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions.  Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted.  Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method.  Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

llvm-svn: 181000
2013-05-03 07:33:41 +00:00
Jordan Rose 320fbf057c [analyzer] Check the stack frame when looking for a var's initialization.
FindLastStoreBRVisitor is responsible for finding where a particular region
gets its value; if the region is a VarRegion, it's possible that value was
assigned at initialization, i.e. at its DeclStmt. However, if a function is
called recursively, the same DeclStmt may be evaluated multiple times in
multiple stack frames. FindLastStoreBRVisitor was not taking this into
account and just picking the first one it saw.

<rdar://problem/13787723>

llvm-svn: 180997
2013-05-03 05:47:31 +00:00
Jordan Rose cea47b78fc [analyzer] Fix trackNullOrUndef when tracking args that have nil receivers.
There were actually two bugs here:
- if we decided to look for an interesting lvalue or call expression, we
  wouldn't go find its node if we also knew we were at a (different) call.
- if we looked through one message send with a  nil receiver, we thought we
  were still looking at an argument to the original call.

Put together, this kept us from being able to track the right values, which
means sub-par diagnostics and worse false-positive suppression.

Noticed by inspection.

llvm-svn: 180996
2013-05-03 05:47:24 +00:00