platform/upstream/llvm.git
11 years agoAdd tests for 'thread step out' for multithreaded programs
Daniel Malea [Tue, 16 Jul 2013 19:41:37 +0000 (19:41 +0000)]
Add tests for 'thread step out' for multithreaded programs
- test with python API
- test with command interpreter
- test stepping a single (selected) thread
- test stepping all threads in the program

llvm-svn: 186446

11 years agoFinally, force the target for this test. Should unbreak non-x86 buildbots.
Benjamin Kramer [Tue, 16 Jul 2013 19:22:07 +0000 (19:22 +0000)]
Finally, force the target for this test. Should unbreak non-x86 buildbots.

llvm-svn: 186445

11 years agoXFAIL this test on mingw.
Rafael Espindola [Tue, 16 Jul 2013 19:20:29 +0000 (19:20 +0000)]
XFAIL this test on mingw.

llvm-svn: 186444

11 years agoObjectiveC migration: complete migrating class
Fariborz Jahanian [Tue, 16 Jul 2013 18:58:41 +0000 (18:58 +0000)]
ObjectiveC migration: complete migrating class
declaration to include list of protocols class
conforms to.

llvm-svn: 186443

11 years agoLabel names also differ between platforms. Use a relaxed regex.
Benjamin Kramer [Tue, 16 Jul 2013 18:54:21 +0000 (18:54 +0000)]
Label names also differ between platforms. Use a relaxed regex.

llvm-svn: 186442

11 years agobuild lld unittests as part of lld-test target
Nick Kledzik [Tue, 16 Jul 2013 18:46:48 +0000 (18:46 +0000)]
build lld unittests as part of lld-test target

llvm-svn: 186441

11 years agoFix Driver tests to check return value of parse(), simplify subclassing, and remove...
Nick Kledzik [Tue, 16 Jul 2013 18:45:57 +0000 (18:45 +0000)]
Fix Driver tests to check return value of parse(), simplify subclassing, and remove unneeded instance variables

llvm-svn: 186440

11 years agoFix test not to fail when the target doesn't use leading underscores on symbols.
Benjamin Kramer [Tue, 16 Jul 2013 18:42:01 +0000 (18:42 +0000)]
Fix test not to fail when the target doesn't use leading underscores on symbols.

llvm-svn: 186439

11 years agoFileCheckize test/Driver/immediate-options.c
Hans Wennborg [Tue, 16 Jul 2013 18:27:29 +0000 (18:27 +0000)]
FileCheckize test/Driver/immediate-options.c

llvm-svn: 186438

11 years agoFix formatting. No functional change.
Craig Topper [Tue, 16 Jul 2013 18:27:27 +0000 (18:27 +0000)]
Fix formatting. No functional change.

llvm-svn: 186437

11 years agoCleanup testing case by using a shorter name for types.
Manman Ren [Tue, 16 Jul 2013 18:26:48 +0000 (18:26 +0000)]
Cleanup testing case by using a shorter name for types.

llvm-svn: 186436

11 years agoRemove floats from live range splitting costs.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:18 +0000 (18:26 +0000)]
Remove floats from live range splitting costs.

These floats all represented block frequencies anyway, so just use the
BlockFrequency class directly.

Some floating point computations remain in tryLocalSplit(). They are
estimating spill weights which are still floats.

llvm-svn: 186435

11 years agoReapply r185393.
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)]
Reapply r185393.

Original commit message:

Remove floating point computations from SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

llvm-svn: 186434

11 years agoRevamp the formatting of C++11 braced init lists.
Daniel Jasper [Tue, 16 Jul 2013 18:22:10 +0000 (18:22 +0000)]
Revamp the formatting of C++11 braced init lists.

The fundamental concept is:
Format as if the braced init list was a function call (with parentheses
replaced by braces). If there is no name/type before the opening brace
(e.g. if the braced list is nested), assume a zero-length identifier
just before the opening brace.

This behavior is gated on a new style flag, which for now replaces the
SpacesInBracedLists style flag. Activate this style flag for Google
style to reflect recent style guide changes.

llvm-svn: 186433

11 years ago[X86] Use min/max to optimze unsigend vector comparison on X86
Juergen Ributzka [Tue, 16 Jul 2013 18:20:45 +0000 (18:20 +0000)]
[X86] Use min/max to optimze unsigend vector comparison on X86

Use PMIN/PMAX for UGE/ULE vector comparions to reduce the number of required
instructions. This trick also works for UGT/ULT, but there is no advantage in
doing so. It wouldn't reduce the number of instructions and it would actually
reduce performance.

Reviewer: Ben

radar:5972691

llvm-svn: 186432

11 years agoMake SpecialCaseList match full strings, as documented, using anchors.
Peter Collingbourne [Tue, 16 Jul 2013 17:56:07 +0000 (17:56 +0000)]
Make SpecialCaseList match full strings, as documented, using anchors.

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

llvm-svn: 186431

11 years agoBug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pa...
Marshall Clow [Tue, 16 Jul 2013 17:45:44 +0000 (17:45 +0000)]
Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr.

llvm-svn: 186430

11 years agoTest commit to verify write access.
Juergen Ributzka [Tue, 16 Jul 2013 17:44:23 +0000 (17:44 +0000)]
Test commit to verify write access.

llvm-svn: 186429

11 years ago[WinLink] Add /LargeAddressAware command line option.
Rui Ueyama [Tue, 16 Jul 2013 17:20:38 +0000 (17:20 +0000)]
[WinLink] Add /LargeAddressAware command line option.

llvm-svn: 186428

11 years agoFix broken unittest for GnuLDDriver.
Rui Ueyama [Tue, 16 Jul 2013 17:17:01 +0000 (17:17 +0000)]
Fix broken unittest for GnuLDDriver.

llvm-svn: 186427

11 years ago[Support] Add a Unicode conversion wrapper from UTF16 to UTF8
Reid Kleckner [Tue, 16 Jul 2013 17:14:33 +0000 (17:14 +0000)]
[Support] Add a Unicode conversion wrapper from UTF16 to UTF8

This is to support parsing UTF16 response files in LLVM/lib/Option for
lld and clang.

Reviewers: hans

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

llvm-svn: 186426

11 years agoWhen the inliner merges allocas, it must keep the larger alignment
Hal Finkel [Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)]
When the inliner merges allocas, it must keep the larger alignment

For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.

I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.

llvm-svn: 186425

11 years agotsan: extend suppressions format with ^ and $ symbols
Dmitry Vyukov [Tue, 16 Jul 2013 16:44:15 +0000 (16:44 +0000)]
tsan: extend suppressions format with ^ and $ symbols
not it's possible to write more precise suppressions,
e.g. "^foo$" won't match "blafoobar"

llvm-svn: 186424

11 years agoOn error, close the temporary file descriptor.
Rafael Espindola [Tue, 16 Jul 2013 16:00:32 +0000 (16:00 +0000)]
On error, close the temporary file descriptor.

With this change llvm-ar can remove the temporary file on windows too.

llvm-svn: 186423

11 years agoAdd more types to ASTNodeKind. Refactor common instantiation code.
Samuel Benzaquen [Tue, 16 Jul 2013 15:47:24 +0000 (15:47 +0000)]
Add more types to ASTNodeKind. Refactor common instantiation code.

Summary:
Add support for CXXCtorInitializer and TemplateArgument types to ASTNodeKind.
This change is to support more matchers from clang/ASTMatchers/ASTMatchers.h in the dynamic layer (clang/ASTMatchers/Dynamic).

Reviewers: klimek

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

llvm-svn: 186422

11 years agoThis patch removes unused parameter allProperties and converts remaining
Fariborz Jahanian [Tue, 16 Jul 2013 15:33:19 +0000 (15:33 +0000)]
This patch removes unused parameter allProperties and converts remaining
parameters in ArrayRef'ize Sema::ActOnAtEnd  to ArrayRef.
Patch by Robert Wilhelm.

llvm-svn: 186421

11 years agoSLPVectorizer: Reduce the compile time of the consecutive store lookup.
Nadav Rotem [Tue, 16 Jul 2013 15:25:17 +0000 (15:25 +0000)]
SLPVectorizer: Reduce the compile time of the consecutive store lookup.

Process groups of stores in chunks of 16.

llvm-svn: 186420

11 years agoEnsure a correct order between memory accesses.
Hongbin Zheng [Tue, 16 Jul 2013 15:20:29 +0000 (15:20 +0000)]
Ensure a correct order between memory accesses.

Ensure that the scalar write access corresponds to the result of a load
instruction appears after the generic read access corresponds to the load
instruction.

llvm-svn: 186419

11 years agoIndependentBlock: Add option to disable scalar to array rewriting.
Hongbin Zheng [Tue, 16 Jul 2013 15:19:33 +0000 (15:19 +0000)]
IndependentBlock: Add option to disable scalar to array rewriting.

llvm-svn: 186418

11 years agoMake sure the each instruction is mapped to one memory access.
Hongbin Zheng [Tue, 16 Jul 2013 15:18:51 +0000 (15:18 +0000)]
Make sure the each instruction is mapped to one memory access.

llvm-svn: 186417

11 years agoFix and re-enable R600 vload/vstore assembly
Aaron Watry [Tue, 16 Jul 2013 14:29:01 +0000 (14:29 +0000)]
Fix and re-enable R600 vload/vstore assembly

The assembly optimizations were making unsafe assumptions about which address
spaces had which identifiers.

Also, fix vload/vstore with 64-bit pointers. This was broken previously on
Radeon SI.

This version still only has assembly versions of int/uint 2/4/8/16 for global
loads and stores on R600, but it does it in a way that would be very easily
extended to private/local/constant and could also be handled easily on other
architectures.

v2: 1) Leave v[load|store]_impl.ll in generic/lib
    2) Remove vload_if.ll and vstore_if.ll interfaces
    3) Fix address+offset calculations
    3) Remove offset from assembly arg list
llvm-svn: 186416

11 years agolibclc: vload/vstore disable assembly and fix offset calculation
Aaron Watry [Tue, 16 Jul 2013 14:28:58 +0000 (14:28 +0000)]
libclc: vload/vstore disable assembly and fix offset calculation

This commit gets us back to pure CLC and fixes offset calculations.

The next commit will re-enable the assembly implementation for R600,
fix bugs related to 64-bit address spaces, and also fix the
incorrect assumption that address space identifiers are the same in
all architectures.

llvm-svn: 186415

11 years agoCreate files with mode 666. This matches the behavior of other unix tools.
Rafael Espindola [Tue, 16 Jul 2013 14:10:07 +0000 (14:10 +0000)]
Create files with mode 666. This matches the behavior of other unix tools.

llvm-svn: 186414

11 years ago[Support] Fix some warnings when self-hosting clang on Windows
Reid Kleckner [Tue, 16 Jul 2013 14:04:08 +0000 (14:04 +0000)]
[Support] Fix some warnings when self-hosting clang on Windows

llvm-svn: 186413

11 years agoRemove unnecessary assignment.
Manuel Klimek [Tue, 16 Jul 2013 13:58:44 +0000 (13:58 +0000)]
Remove unnecessary assignment.

llvm-svn: 186412

11 years agoFixes another hard to test problem with iterator invalidation.
Manuel Klimek [Tue, 16 Jul 2013 13:20:30 +0000 (13:20 +0000)]
Fixes another hard to test problem with iterator invalidation.

As every match call can recursively call back into the memoized match
via a nested traversal matcher (for example:
stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))),
and every memoization step might clear the cache, we must not store
iterators into the result cache when calling match on a submatcher.

llvm-svn: 186411

11 years ago[ASan] Bump min supported Mac OS X version to 10.6 - makefile build
Alexey Samsonov [Tue, 16 Jul 2013 13:16:15 +0000 (13:16 +0000)]
[ASan] Bump min supported Mac OS X version to 10.6 - makefile build

llvm-svn: 186410

11 years ago[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation
Ulrich Weigand [Tue, 16 Jul 2013 13:03:25 +0000 (13:03 +0000)]
[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation

When truncating to a format with fewer mantissa bits, APFloat::convert
will perform a right shift of the mantissa by the difference of the
precision of the two formats.  Usually, this will result in just the
mantissa bits needed for the target format.

One special situation is if the input number is denormal.  In this case,
the right shift may discard significant bits.  This is usually not a
problem, since truncating a denormal usually results in zero (underflow)
after normalization anyway, since the result format's exponent range is
usually smaller than the target format's.

However, there is one case where the latter property does not hold:
when truncating from ppc_fp128 to double.  In particular, truncating
a ppc_fp128 whose first double of the pair is denormal should result
in just that first double, not zero.  The current code however
performs an excessive right shift, resulting in lost result bits.
This is then caught in the APFloat::normalize call performed by
APFloat::convert and causes an assertion failure.

This patch checks for the scenario of truncating a denormal, and
attempts to (possibly partially) replace the initial mantissa
right shift by decrementing the exponent, if doing so will still
result in a valid *target format* exponent.

Index: test/CodeGen/PowerPC/pr16573.ll
===================================================================
--- test/CodeGen/PowerPC/pr16573.ll (revision 0)
+++ test/CodeGen/PowerPC/pr16573.ll (revision 0)
@@ -0,0 +1,11 @@
+; RUN: llc < %s | FileCheck %s
+
+target triple = "powerpc64-unknown-linux-gnu"
+
+define double @test() {
+  %1 = fptrunc ppc_fp128 0xM818F2887B9295809800000000032D000 to double
+  ret double %1
+}
+
+; CHECK: .quad -9111018957755033591
+
Index: lib/Support/APFloat.cpp
===================================================================
--- lib/Support/APFloat.cpp (revision 185817)
+++ lib/Support/APFloat.cpp (working copy)
@@ -1956,6 +1956,23 @@
     X86SpecialNan = true;
   }

+  // If this is a truncation of a denormal number, and the target semantics
+  // has larger exponent range than the source semantics (this can happen
+  // when truncating from PowerPC double-double to double format), the
+  // right shift could lose result mantissa bits.  Adjust exponent instead
+  // of performing excessive shift.
+  if (shift < 0 && isFiniteNonZero()) {
+    int exponentChange = significandMSB() + 1 - fromSemantics.precision;
+    if (exponent + exponentChange < toSemantics.minExponent)
+      exponentChange = toSemantics.minExponent - exponent;
+    if (exponentChange < shift)
+      exponentChange = shift;
+    if (exponentChange < 0) {
+      shift -= exponentChange;
+      exponent += exponentChange;
+    }
+  }
+
   // If this is a truncation, perform the shift before we narrow the storage.
   if (shift < 0 && (isFiniteNonZero() || category==fcNaN))
     lostFraction = shiftRight(significandParts(), oldPartCount, -shift);

llvm-svn: 186409

11 years ago[Sanitizer] move strcpy and strncpy to common interceptors
Alexey Samsonov [Tue, 16 Jul 2013 12:51:53 +0000 (12:51 +0000)]
[Sanitizer] move strcpy and strncpy to common interceptors

llvm-svn: 186408

11 years ago[XCore] Fix printing of inline asm operands.
Richard Osborne [Tue, 16 Jul 2013 12:48:34 +0000 (12:48 +0000)]
[XCore] Fix printing of inline asm operands.

Previously an asm operand with no operand modifier would give the error
"invalid operand in inline asm".

llvm-svn: 186407

11 years agoARM: allow printing of ARM atomic DAG nodes.
Tim Northover [Tue, 16 Jul 2013 12:15:36 +0000 (12:15 +0000)]
ARM: allow printing of ARM atomic DAG nodes.

We'd forgotten to provide string representations for the special ARMISD atomic
nodes; this adds them in. No effect on CodeGen, just makes the output of
"-view-whatever-dags" slightly more readable.

llvm-svn: 186406

11 years ago[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes
Richard Sandiford [Tue, 16 Jul 2013 11:55:57 +0000 (11:55 +0000)]
[SystemZ] Use ROSBG and non-zero form of RISBG for OR nodes

llvm-svn: 186405

11 years ago[ASan] Bump min supported Mac OS X version to 10.6
Alexey Samsonov [Tue, 16 Jul 2013 11:54:40 +0000 (11:54 +0000)]
[ASan] Bump min supported Mac OS X version to 10.6

llvm-svn: 186404

11 years agoFixing a buildbot failure:unused function.
Vladimir Medic [Tue, 16 Jul 2013 11:43:20 +0000 (11:43 +0000)]
Fixing a buildbot failure:unused function.

llvm-svn: 186403

11 years agoclang-format: Improve detection of function types.
Daniel Jasper [Tue, 16 Jul 2013 11:37:21 +0000 (11:37 +0000)]
clang-format: Improve detection of function types.

This fixes an incorrect detection that led to a formatting error.
Before:
  some_var = function (*some_pointer_var)[0];
After:
  some_var = function(*some_pointer_var)[0];

llvm-svn: 186402

11 years ago[SystemZ] Add MC support for R[NOX]SBG
Richard Sandiford [Tue, 16 Jul 2013 11:28:08 +0000 (11:28 +0000)]
[SystemZ] Add MC support for R[NOX]SBG

CodeGen support will come later.

llvm-svn: 186401

11 years agotsan: support sigsuspend() call
Dmitry Vyukov [Tue, 16 Jul 2013 11:28:04 +0000 (11:28 +0000)]
tsan: support sigsuspend() call
Intercepting it makes it process pending signal before return.

llvm-svn: 186400

11 years ago[SystemZ] Use RISBG for (shift (and ...))
Richard Sandiford [Tue, 16 Jul 2013 11:02:24 +0000 (11:02 +0000)]
[SystemZ] Use RISBG for (shift (and ...))

Another patch in the series to make more use of R.SBG.  This one extends
r186072 and r186073 to handle cases where the AND is inside the shift.

llvm-svn: 186399

11 years agoFix test on release builds.
Tim Northover [Tue, 16 Jul 2013 10:22:19 +0000 (10:22 +0000)]
Fix test on release builds.

Unfortunately I don't think there's a good way to validate branch targets on
release builds. Fortunately it's a minor part of this test (and based on
generic code) so I don't mind dropping it.

llvm-svn: 186398

11 years ago This patch represents Mips utilization of r186388 code that alows asm matcher to...
Vladimir Medic [Tue, 16 Jul 2013 10:07:14 +0000 (10:07 +0000)]
 This patch represents Mips utilization of r186388 code that alows asm matcher to emit mnemonics contain '.' characters. This makes asm parser code simpler and more efficient.

llvm-svn: 186397

11 years agoPPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.
NAKAMURA Takumi [Tue, 16 Jul 2013 09:59:51 +0000 (09:59 +0000)]
PPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on powerpc-linux Fedora 12.

    g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)

llvm-svn: 186396

11 years agoARM: implement low-level intrinsics for the atomic exclusive operations.
Tim Northover [Tue, 16 Jul 2013 09:47:53 +0000 (09:47 +0000)]
ARM: implement low-level intrinsics for the atomic exclusive operations.

This adds three overloaded intrinsics to Clang:
    T __builtin_arm_ldrex(const volatile T *addr)
    int __builtin_arm_strex(T val, volatile T *addr)
    void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

llvm-svn: 186394

11 years ago[ASan] Use less shadow on Win 32-bit
Timur Iskhodzhanov [Tue, 16 Jul 2013 09:47:39 +0000 (09:47 +0000)]
[ASan] Use less shadow on Win 32-bit

llvm-svn: 186393

11 years agoARM: implement ldrex, strex and clrex intrinsics
Tim Northover [Tue, 16 Jul 2013 09:46:55 +0000 (09:46 +0000)]
ARM: implement ldrex, strex and clrex intrinsics

Intrinsics already existed for the 64-bit variants, so these support operations
of size at most 32-bits.

llvm-svn: 186392

11 years agoARM EABI divmod support
Renato Golin [Tue, 16 Jul 2013 09:32:17 +0000 (09:32 +0000)]
ARM EABI divmod support

This patch enables calls to __aeabi_idivmod when in EABI mode,
by using the remainder value returned on registers (R1),
enabled by the ARM triple "none-eabi". Note that Darwin and
GNUEABI triples will continue lowering on GNU style, that is,
using the stack for the remainder.

Still need to add SREM/UREM support fix for 64-bit lowering.

llvm-svn: 186390

11 years ago[ASan] Cache the OSX version to avoid calling sysctl() on every GetMacosVersion(...
Alexander Potapenko [Tue, 16 Jul 2013 09:29:48 +0000 (09:29 +0000)]
[ASan] Cache the OSX version to avoid calling sysctl() on every GetMacosVersion() call.

llvm-svn: 186389

11 years agoThis patch allows targets to define weather the instruction mnemonics in asm matcher...
Vladimir Medic [Tue, 16 Jul 2013 09:22:38 +0000 (09:22 +0000)]
This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.

llvm-svn: 186388

11 years agollvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be opened...
NAKAMURA Takumi [Tue, 16 Jul 2013 09:06:47 +0000 (09:06 +0000)]
llvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be opened on cygwin.

llvm-svn: 186387

11 years ago[ASan] Add support for OS X Mavericks to GetMacosVersion.
Alexander Potapenko [Tue, 16 Jul 2013 08:35:42 +0000 (08:35 +0000)]
[ASan] Add support for OS X Mavericks to GetMacosVersion.

llvm-svn: 186386

11 years agoLimit number of bits in size representation so that bit size fit 64 bits.
Serge Pavlov [Tue, 16 Jul 2013 07:14:18 +0000 (07:14 +0000)]
Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.

llvm-svn: 186385

11 years ago[PECOFF][Writer] Replace magic numbers with sizeof().
Rui Ueyama [Tue, 16 Jul 2013 06:21:39 +0000 (06:21 +0000)]
[PECOFF][Writer] Replace magic numbers with sizeof().

This is a follow up patch for r186336.

Reviewers: LegalizeAdulthood

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

llvm-svn: 186384

11 years agoAdd 'const' qualifiers to static const char* variables.
Craig Topper [Tue, 16 Jul 2013 05:03:10 +0000 (05:03 +0000)]
Add 'const' qualifiers to static const char* variables.

llvm-svn: 186383

11 years ago[PECOFF][Writer] Use defined constants instead of magic numbers.
Rui Ueyama [Tue, 16 Jul 2013 04:47:02 +0000 (04:47 +0000)]
[PECOFF][Writer] Use defined constants instead of magic numbers.

llvm-svn: 186382

11 years agoUse open+fstat instead of stat+open.
Rafael Espindola [Tue, 16 Jul 2013 03:34:31 +0000 (03:34 +0000)]
Use open+fstat instead of stat+open.

llvm-svn: 186381

11 years agoRemember that we have a null terminated string.
Rafael Espindola [Tue, 16 Jul 2013 03:30:10 +0000 (03:30 +0000)]
Remember that we have a null terminated string.

This is a micro optimization. Instead of going char*->StringRef->Twine->char*,
go char*->Twine->char* and avoid having to copy the filename on the stack.

llvm-svn: 186380

11 years ago[Object/COFF] Add import_directory_table_entry.
Rui Ueyama [Tue, 16 Jul 2013 03:23:55 +0000 (03:23 +0000)]
[Object/COFF] Add import_directory_table_entry.

Summary: Add import_directory_table_entry to use for .idata section.

Reviewers: Bigcheese

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

llvm-svn: 186379

11 years agoAdd a version of sys::fs::status that uses fstat.
Rafael Espindola [Tue, 16 Jul 2013 03:20:13 +0000 (03:20 +0000)]
Add a version of sys::fs::status that uses fstat.

llvm-svn: 186378

11 years agoCOFF: Add constants for optional data directory.
Rui Ueyama [Tue, 16 Jul 2013 03:11:55 +0000 (03:11 +0000)]
COFF: Add constants for optional data directory.

llvm-svn: 186377

11 years agoInstead friending status, provide windows and posix constructors to file_status.
Rafael Espindola [Tue, 16 Jul 2013 02:55:33 +0000 (02:55 +0000)]
Instead friending status, provide windows and posix constructors to file_status.

This opens the way of having static helpers in the .inc files that can
construct a file_status.

llvm-svn: 186376

11 years agounittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.
NAKAMURA Takumi [Tue, 16 Jul 2013 02:44:23 +0000 (02:44 +0000)]
unittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.

llvm-svn: 186375

11 years agoFix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and compatible to...
NAKAMURA Takumi [Tue, 16 Jul 2013 02:43:51 +0000 (02:43 +0000)]
Fix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and compatible to Win32's FILETIME.

llvm-ar is the only user of toWin32Time() (via setLastModificationAndAccessTime), and r186298 can be reverted.
It had been buggy since the initial commit.

FIXME: Could we rename {from|to}Win32Time as {from|to}Win32FILETIME in TimeValue?
llvm-svn: 186374

11 years agoMerge attributes on typedef decls.
Eli Friedman [Tue, 16 Jul 2013 02:07:49 +0000 (02:07 +0000)]
Merge attributes on typedef decls.

Not completely sure this is right, but it's clearly better than what
we did before this commit (effectively dropping the attribute).

<rdar://problem/14413117>

llvm-svn: 186373

11 years agoRename Support.TimeValue to TimeValue.time_t in unittests/Support.
NAKAMURA Takumi [Tue, 16 Jul 2013 02:03:32 +0000 (02:03 +0000)]
Rename Support.TimeValue to TimeValue.time_t in unittests/Support.

llvm-svn: 186372

11 years agoAdd 'const' qualifiers to static const char* variables.
Craig Topper [Tue, 16 Jul 2013 01:17:10 +0000 (01:17 +0000)]
Add 'const' qualifiers to static const char* variables.

llvm-svn: 186371

11 years agoFix alignment of class derived from empty class.
Eli Friedman [Tue, 16 Jul 2013 00:21:28 +0000 (00:21 +0000)]
Fix alignment of class derived from empty class.

The record layout code didn't properly take into account that
an empty class at offset 0 can have an alignment greater than 1.

Patch by Andrea Di Biagio.

llvm-svn: 186370

11 years agoObjC migrator: build conforming interface
Fariborz Jahanian [Tue, 16 Jul 2013 00:20:21 +0000 (00:20 +0000)]
ObjC migrator: build conforming interface
declaration (not yet used). wip.

llvm-svn: 186369

11 years ago[PECOFF] Add default argument to addDir32NBReloc() as the default value 0 is reasonable.
Rui Ueyama [Tue, 16 Jul 2013 00:03:51 +0000 (00:03 +0000)]
[PECOFF] Add default argument to addDir32NBReloc() as the default value 0 is reasonable.

llvm-svn: 186368

11 years agoFix member refs with using decl + anonymous union.
Eli Friedman [Tue, 16 Jul 2013 00:01:31 +0000 (00:01 +0000)]
Fix member refs with using decl + anonymous union.

Make sure we call BuildFieldReferenceExpr with the appropriate decl
when a member of an anonymous union is made public with a using decl.
Also, fix a crash on invalid field access into an anonymous union.

Fixes PR16630.

llvm-svn: 186367

11 years agoRevert "Don't pass llvm::errs() all over the place. Diagnostics always go to stderr."
Rafael Espindola [Mon, 15 Jul 2013 23:55:07 +0000 (23:55 +0000)]
Revert "Don't pass llvm::errs() all over the place. Diagnostics always go to stderr."

This reverts commit 185657. It will be used by unit tests.

llvm-svn: 186366

11 years agoAdd mingw32 to the XFAIL. I forgot about it when adding win32.
Rafael Espindola [Mon, 15 Jul 2013 23:51:47 +0000 (23:51 +0000)]
Add mingw32 to the XFAIL. I forgot about it when adding win32.

llvm-svn: 186365

11 years agoPEI: Support for non-zero SPAdj at beginning of a basic block.
Manman Ren [Mon, 15 Jul 2013 23:47:29 +0000 (23:47 +0000)]
PEI: Support for non-zero SPAdj at beginning of a basic block.

We can have a FrameSetup in one basic block and the matching FrameDestroy
in a different basic block when we have struct byval. In that case, SPAdj
is not zero at beginning of the basic block.

Modify PEI to correctly set SPAdj at beginning of each basic block using
DFS traversal. We used to assume SPAdj is 0 at beginning of each basic block.

PEI had an assert SPAdjCount || SPAdj == 0.
If we have a Destroy <n> followed by a Setup <m>, PEI will assert failure.
We can add an extra condition to make sure the pairs are matched:
  The pairs start with a FrameSetup.
But since we are doing a much better job in the verifier, this patch removes
the check in PEI.

PR16393

llvm-svn: 186364

11 years agoFixed a problem in IRForTarget where we would not
Sean Callanan [Mon, 15 Jul 2013 23:31:47 +0000 (23:31 +0000)]
Fixed a problem in IRForTarget where we would not
delete a constant after we replaced it with a
dynamically-computed value.  Also ensured that we
replace all users of the constant if there are
multiple ones.  Added a testcase.

<rdar://problem/14379043>

llvm-svn: 186363

11 years agoDisabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)
Enrico Granata [Mon, 15 Jul 2013 23:17:32 +0000 (23:17 +0000)]
Disabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)

llvm-svn: 186362

11 years agoRemove unused RunLocker and related code
Ed Maste [Mon, 15 Jul 2013 22:59:08 +0000 (22:59 +0000)]
Remove unused RunLocker and related code

RunLocker was not used anywhere, and was the only instance of the
WriteLocker class.  Remove both.

llvm-svn: 186361

11 years ago<rdar://problem/13793059>
Greg Clayton [Mon, 15 Jul 2013 22:54:20 +0000 (22:54 +0000)]
<rdar://problem/13793059>

Added a setting to control timeout for kdp response packets. While I was at it, I also added a way to control the response timeout for gdb-remote packets.

KDP defaults to 5 seconds, and GDB defaults to 1 second. These were the default values that were in the code prior to adding these settings.

(lldb) settings set plugin.process.gdb-remote.packet-timeout 10
(lldb) settings set plugin.process.kdp-remote.packet-timeout 10

llvm-svn: 186360

11 years agoPR16628: Fix a bug in the code that merges compares.
Nadav Rotem [Mon, 15 Jul 2013 22:52:48 +0000 (22:52 +0000)]
PR16628: Fix a bug in the code that merges compares.
Compares return i1 but they compare different types.

llvm-svn: 186359

11 years agoFix typeo in diagnose-unwind.py.
Jason Molenda [Mon, 15 Jul 2013 22:40:17 +0000 (22:40 +0000)]
Fix typeo in diagnose-unwind.py.

llvm-svn: 186358

11 years agoPPC: Refactoring to support subtarget feature changing
Hal Finkel [Mon, 15 Jul 2013 22:29:40 +0000 (22:29 +0000)]
PPC: Refactoring to support subtarget feature changing

This change mirrors the changes that were made to the X86 and ARM targets to
support subtarget feature changing. As indicated in r182899, the mechanism is
still undergoing revision, and so as with the X86 and ARM targets, there is no
test case yet (there is no effective functionality change).

llvm-svn: 186357

11 years agoFurther simplify test case from r186119/r186035.
David Blaikie [Mon, 15 Jul 2013 22:28:45 +0000 (22:28 +0000)]
Further simplify test case from r186119/r186035.

llvm-svn: 186356

11 years ago[PECOFF][Writer] Follow up patch for r186336.
Rui Ueyama [Mon, 15 Jul 2013 22:20:10 +0000 (22:20 +0000)]
[PECOFF][Writer] Follow up patch for r186336.

- Make a const reference instead of copying an object
- Fix a comment

llvm-svn: 186355

11 years agoXFAIL on windows too and document the XFAILs.
Rafael Espindola [Mon, 15 Jul 2013 22:16:53 +0000 (22:16 +0000)]
XFAIL on windows too and document the XFAILs.

llvm-svn: 186354

11 years ago[PECOFF][Writer] s/dyn_cast/cast/ where we don't expect null return value.
Rui Ueyama [Mon, 15 Jul 2013 22:15:32 +0000 (22:15 +0000)]
[PECOFF][Writer] s/dyn_cast/cast/ where we don't expect null return value.

llvm-svn: 186353

11 years ago[PECOFF][Writer] Refactoring: Move private methods below public ones.
Rui Ueyama [Mon, 15 Jul 2013 21:35:15 +0000 (21:35 +0000)]
[PECOFF][Writer] Refactoring: Move private methods below public ones.

llvm-svn: 186352

11 years agoTest case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)
David Blaikie [Mon, 15 Jul 2013 21:33:26 +0000 (21:33 +0000)]
Test case for r18266 (serialization support for TagDecl:IsCompleteDefinitionRequired)

llvm-svn: 186351

11 years agoMachine Verifier: verify FrameSetup and FrameDestroy
Manman Ren [Mon, 15 Jul 2013 21:26:31 +0000 (21:26 +0000)]
Machine Verifier: verify FrameSetup and FrameDestroy

1> on every path through the CFG, a FrameSetup <n> is always followed by a
   FrameDestroy <n> and a FrameDestroy is always followed by a FrameSetup.
2> stack adjustments are identical on all CFG edges to a merge point.
3> frame is destroyed at end of a return block.

PR16393

llvm-svn: 186350

11 years agoObjC migrator: finding conforming protocol
Fariborz Jahanian [Mon, 15 Jul 2013 21:22:08 +0000 (21:22 +0000)]
ObjC migrator: finding conforming protocol
candidates for each class. wip.

llvm-svn: 186349

11 years agoFix a typo in the diagnostic note added in r186342.
Kaelyn Uhrain [Mon, 15 Jul 2013 21:18:33 +0000 (21:18 +0000)]
Fix a typo in the diagnostic note added in r186342.

llvm-svn: 186348

11 years agoFix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handli...
Greg Clayton [Mon, 15 Jul 2013 21:10:17 +0000 (21:10 +0000)]
Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by:

1 - looking up the type basename in the type index
2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match

The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name.

llvm-svn: 186347

11 years ago[PECOFF] Fix comment.
Rui Ueyama [Mon, 15 Jul 2013 21:00:53 +0000 (21:00 +0000)]
[PECOFF] Fix comment.

llvm-svn: 186346

11 years agoRemove an extra is_directory call.
Rafael Espindola [Mon, 15 Jul 2013 20:52:01 +0000 (20:52 +0000)]
Remove an extra is_directory call.

I checked that opening a directory on windows does fail, so this saves a "stat".

llvm-svn: 186345