Commit Graph

156776 Commits

Author SHA1 Message Date
Ed Maste 7dcb77de06 Move detach to FreeBSD- and Linux-specific classes.
On Linux there is no separate notion of a process (vs. a thread) for
ptrace(); each thread needs to be individually detached.  On FreeBSD
we have a separate process context, and we detach just it.

Review: http://llvm-reviews.chandlerc.com/D1418
llvm-svn: 189666
2013-08-30 13:11:30 +00:00
Alexey Samsonov e3963d0d79 Restore llvm-ranlib expansion in RUN-lines removed in r184019
llvm-svn: 189665
2013-08-30 12:53:22 +00:00
Hans Wennborg d024c1c803 clang-cl: Pass -incremental:no to linker when using ASan
llvm-svn: 189664
2013-08-30 10:50:52 +00:00
Daniel Jasper 8ddfa8489b clang-format: Enable formatting of protocol buffer definitions.
Almost by accident, clang-format seems to be able to format protocol
buffer definitions (https://code.google.com/p/protobuf/).

The only change is that a space is required between numeric constants
and opening square brackets (for default values). While this might in
theory be used for array subscripts (int val = 4[MyArray]), I have not
seen this pattern in practice much. If this is wrong, we can make this
smarter in the future.

llvm-svn: 189663
2013-08-30 10:36:58 +00:00
Daniel Jasper b715087278 clang-format: Improve recovery from enums with errors.
Before:
  namespace n {
  enum Type {
    One,
    Two, // missing };
    int i;
  } void g() {
  }

After:
  namespace n {
  enum Type {
    One,
    Two, // missing };
    int i;
  }
  void g() {}

llvm-svn: 189662
2013-08-30 10:10:19 +00:00
Hans Wennborg 1cc6cce9a6 Revert r188531: "Windows ToolChain: add VS bin dir to PogramPaths"
This never really worked. Even if we find and execute link.exe in the VS bin dir
this way, link.exe wouldn't find the DLLs it needs, libraries, etc.

It also causes trouble when the user has multiple versions of VS installed,
one of them is in the path, but this code finds the other one (PR17041).

Revert until we can fix this properly.

> Windows ToolChain: add VS bin dir to PogramPaths
>
> We have a lot of fancy logic to find Visual Studio, which is currently used
> to set the system header include paths.
>
> Use the same code to set the ProgramPaths, which is used for finding programs
> such as link.exe. Previously, Clang would just search PATH for link.exe,
> but now it should find it if it's able to find Visual Studio.

llvm-svn: 189661
2013-08-30 09:42:06 +00:00
Yunzhong Gao 0ebf1bb150 Revert r189649 because it was breaking sanitizer bots.
llvm-svn: 189660
2013-08-30 08:53:09 +00:00
Pavel Labath 58934986f2 Sema: avoid reuse of Exprs when synthesizing operator=
Summary:
Previously, Sema was reusing parts of the AST when synthesizing an assignment
operator, turning it into a AS-dag. This caused problems for the static
analyzer, which assumed an expression appears in the tree only once.

Here I make sure to always create a fresh Expr, when inserting something into
the AST, fixing PR16745 in the process.

Reviewers: doug.gregor

CC: cfe-commits, jordan_rose

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

llvm-svn: 189659
2013-08-30 08:52:28 +00:00
Daniel Jasper f79b0b1562 clang-format: Fix incorrect indentation.
Before:
aaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccc(
               dddddddddddddddddddddddddddddd));
aaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(
    dddddddddddddddddddddddddddddd));

After:
aaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccc(
    dddddddddddddddddddddddddddddd));
aaaaaaaaaaa(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(
    dddddddddddddddddddddddddddddd));

This was overlooked when interducing the new builder-type call
detection in r189337. Also, some minor reorganization of a test.

llvm-svn: 189658
2013-08-30 08:29:25 +00:00
Daniel Jasper 2cf664fb86 clang-format: Don't indent builders relative to "return".
While this looks kind of nice, it wastes horizontal space and does not
seem to be common in the LLVM codebase.

Before:
  return llvm::StringSwitch<Reference::Kind>(name)
      .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
      .StartsWith(".eh_frame", ORDER_EH_FRAME)
      .StartsWith(".init", ORDER_INIT)
      .StartsWith(".fini", ORDER_FINI)
      .StartsWith(".hash", ORDER_HASH)
      .Default(ORDER_TEXT);

After:
  return llvm::StringSwitch<Reference::Kind>(name)
             .StartsWith(".eh_frame_hdr", ORDER_EH_FRAMEHDR)
             .StartsWith(".eh_frame", ORDER_EH_FRAME)
             .StartsWith(".init", ORDER_INIT)
             .StartsWith(".fini", ORDER_FINI)
             .StartsWith(".hash", ORDER_HASH)
             .Default(ORDER_TEXT);

llvm-svn: 189657
2013-08-30 07:27:13 +00:00
Craig Topper f78c19c3bb Fixup BZHI selection to remove an unneeded zero extension.
llvm-svn: 189656
2013-08-30 07:16:16 +00:00
Daniel Jasper f8151e9bc1 clang-format: Fix corner case in builder-type calls.
Before:
  aaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaa()->aaaaaaaaaaaaaae(
                                                 0)->aaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaa()
      ->aaaaaaaaaaaaaae(0)
      ->aaaaaaaaaaaaaaa();

llvm-svn: 189655
2013-08-30 07:12:40 +00:00
Craig Topper 48a5d69ee1 Remove unused X86andn_flag node.
llvm-svn: 189654
2013-08-30 07:06:26 +00:00
Craig Topper 0bccad2d43 Teach X86 backend to create BMI2 BZHI instructions from (and X, (add (shl 1, Y), -1)). Fixes PR17038.
llvm-svn: 189653
2013-08-30 06:52:21 +00:00
Yunzhong Gao be8d7ba93a Fixing a bug where debug info for a local variable gets emitted at file scope.
The patch was discussed in Phabricator. See:
http://llvm-reviews.chandlerc.com/D1281

llvm-svn: 189649
2013-08-30 05:37:02 +00:00
Michael Gottesman b7ecc3e6af Revert "ARM: Improve pattern for isel mul of vector by scalar."
This reverts commit r189619.

The commit was breaking the arm_neon_intrinsic test.

llvm-svn: 189648
2013-08-30 05:36:14 +00:00
Richard Smith 99bc1b99d3 Mention in AST dump whether a class declaration is a definition.
llvm-svn: 189647
2013-08-30 05:32:29 +00:00
Richard Smith a4ba74c5f5 Don't eagerly load all conversion operators when loading a class declaration
from a PCH/module.

llvm-svn: 189646
2013-08-30 04:46:40 +00:00
Richard Smith 8568e576b0 Simplify slightly.
llvm-svn: 189645
2013-08-30 04:45:38 +00:00
Charles Davis b5a214e4f3 Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice!

llvm-svn: 189644
2013-08-30 04:39:01 +00:00
Andrew Trick 2bc74c2887 mi-sched: update PressureDiffs on-the-fly for liveness.
This removes all expensive pressure tracking logic from the scheduling
critical path of node comparison.

llvm-svn: 189643
2013-08-30 04:36:57 +00:00
Andrew Trick ff60477306 Replace LiveInterval::killedAt with isKilledAtInstr.
Return true for LRGs that end at EarlyClobber or Register slots.

llvm-svn: 189642
2013-08-30 04:31:01 +00:00
Andrew Trick b1a45b6c61 mi-sched: improve the generic register pressure comparison.
Only compare pressure within the same set. When multiple sets are
affected, we prioritize the most constrained set.

llvm-svn: 189641
2013-08-30 04:27:29 +00:00
Andrew Trick 1a8313458f mi-sched: Precompute a PressureDiff for each instruction, adjust for liveness later.
Created SUPressureDiffs array to hold the per node PDiff computed during DAG building.

Added a getUpwardPressureDelta API that will soon replace the old
one. Compute PressureDelta here from the precomputed PressureDiffs.

Updating for liveness will come next.

llvm-svn: 189640
2013-08-30 03:49:48 +00:00
Bill Schmidt 057b04f662 [PowerPC] Handle selection of compare instructions in fast-isel.
Mostly trivial patch adding support for compares.  The meat of the
work was added with the branch support.

llvm-svn: 189639
2013-08-30 03:16:48 +00:00
Bill Schmidt 72e3d55a76 Remove bogus debug statement. Sheesh.
llvm-svn: 189638
2013-08-30 03:07:11 +00:00
Bill Schmidt 579de9417c [PowerPC] Miscellaneous fast-isel test cases.
Here are a few more tests that now pass after the recent fast-isel
commits.

llvm-svn: 189637
2013-08-30 02:43:08 +00:00
Bill Schmidt ccecf26157 [PowerPC] Add loads, stores, and related things to fast-isel.
This is the next big chunk of fast-isel code.  The primary purpose is
to implement selection of loads and stores, but there is a lot of
drag-along to support this.  The common code to analyze addresses for
both loads and stores is substantial.  It's also necessary to add the
materialization code for global values.

Related to load-store processing is the code to fold loads into
integer extends, since otherwise we generate lots of redundant
instructions.  We also need to add some overrides to some FastEmit
routines to ensure we don't assign GPR 0 to a virtual register when
this would change the meaning of an instruction.

I added handling selection of a few binary arithmetic instructions, to
enable committing some test cases I wrote a while back.

Finally, ap couple of miscellaneous changes:
 * I cleaned up some poor style from a previous patch in
   PPCISelLowering.cpp, pointed out by David Blaikie.
 * I enlarged the Addr.Offset field to avoid sign problems with 32-bit
   offsets. 

llvm-svn: 189636
2013-08-30 02:29:45 +00:00
Andrew Trick ef80f50058 comment typo
llvm-svn: 189635
2013-08-30 02:02:12 +00:00
Marshall Clow 1e548c72e7 LWG Issue 2128: Implement global cbegin/rbegin/cend/rbegin
llvm-svn: 189634
2013-08-30 01:17:07 +00:00
Eric Christopher 531cd4b278 Pass the special backend option to this test for now to get it passing
again.

This test should a) test IR or be moved, and b) get an actual option
for the dwarf pub sections.

llvm-svn: 189633
2013-08-30 00:52:06 +00:00
Bill Wendling 4c0d9adecb Random cleanup: No need to use a std::vector here, since createInternalizePass uses an ArrayRef.
llvm-svn: 189632
2013-08-30 00:48:37 +00:00
Eric Christopher 4b358188c6 Don't bother emitting the pubtypes section on darwin since there aren't
any maintained consumers of it on that platform.

llvm-svn: 189631
2013-08-30 00:40:17 +00:00
Eric Christopher ac8199bf60 Reformat slightly.
llvm-svn: 189630
2013-08-30 00:39:57 +00:00
Richard Smith 9dd9f036c6 Map from local decl IDs to global decl IDs when lazily deserializing friend decl chains.
llvm-svn: 189629
2013-08-30 00:23:29 +00:00
Fariborz Jahanian a23f4fb5c9 ObjectiveC migrator: User of hexadecimal enumerator
should infer migration to NS_OPTIONS.

llvm-svn: 189628
2013-08-30 00:10:37 +00:00
Richard Smith 676c404dec Be lazier when loading KeyFunctions from PCH/modules. We don't need to load
these in eagerly if we're not actually processing a translation unit. The added
laziness here also avoids us loading in parts of a CXXRecordDecl earlier than an
upcoming class template specialization merging patch would like.

Ideally, we should mark the vtable as used when we see a definition for the key
function, rather than having a separate pass over dynamic classes at the end of
the TU. The existing approach is pretty bad for PCH/modules, since it forcibly
loads the declarations of all key functions in all imported modules, whether or
not those key functions are defined.

llvm-svn: 189627
2013-08-29 23:59:27 +00:00
Howard Hinnant b81766ca23 Glen: Remove unneeded _LIBCPP_ALWAYS_INLINE.
llvm-svn: 189626
2013-08-29 23:50:48 +00:00
Eli Friedman 0718591771 Adjust clang for change to APFloat::toString.
I changed the diagnostic printing code because it's probably better
to cut off a digit from DBL_MAX than to print something like
1.300000001 when the user wrote 1.3.

llvm-svn: 189625
2013-08-29 23:44:43 +00:00
Eli Friedman e72f132097 Change default # of digits for APFloat::toString
This is a re-commit of r189442; I'll follow up with clang changes.

The previous default was almost, but not quite enough digits to
represent a floating-point value in a manner which preserves the
representation when it's read back in.  The larger default is much
less confusing.

I spent some time looking into printing exactly the right number of
digits if a precision isn't specified, but it's kind of complicated,
and I'm not really sure I understand what APFloat::toString is supposed
to output for FormatPrecision != 0 (or maybe the current API specification
is just silly, not sure which).  I have a WIP patch if anyone is interested.

llvm-svn: 189624
2013-08-29 23:44:34 +00:00
Howard Hinnant 9762413621 Xing Xue: Some minor changes for IBM XLC++/AIX.
llvm-svn: 189623
2013-08-29 23:37:50 +00:00
Manman Ren e0064d8c24 Debug Info: generate a unique identifier for C++ struct, class, union, and enum.
We use CXX mangler to generate unique identifier for external C++ struct,
union, class and enum. Types with unique identifier are added to retained
types by DIBuilder.

Testing cases are updated to reflect the unique identifier generated for types.
The order of MDNodes is changed because of retained types and testing cases
are updated accordingly.

Testing case debug-info-uuid.cpp now emits error with Itanium mangler, since
uuid is not yet handled in Itanium mangler. And it will check for the error
message.

llvm-svn: 189622
2013-08-29 23:19:58 +00:00
Manman Ren 0b41040782 DIBuilder: retain a type when created with a unique identifier.
createClassType, createStructType, createUnionType, createEnumerationType,
and createForwardDecl will retain a type when created with a unique identifier,
to make sure they are treated as used even when all uses are replaced with
the identifiers.

Use TrackingVH<MDNode> instead of MDNode in AllRetainTypes, since the created
node can later be updated.

The change will be tested when clients of DIBuilder start to pass in non-empty
unique identifier.

llvm-svn: 189621
2013-08-29 23:17:54 +00:00
Peter Collingbourne 014328e76c [dfsan] Add a syms file.
llvm-svn: 189620
2013-08-29 22:49:00 +00:00
Jim Grosbach 04cc76dd53 ARM: Improve pattern for isel mul of vector by scalar.
In addition to recognizing when the multiply's second argument is
coming from an explicit VDUPLANE, also look for a plain scalar
f32 reference and reference it via the corresponding vector
lane.

rdar://14870054

llvm-svn: 189619
2013-08-29 22:41:46 +00:00
Jim Grosbach f29df34d12 Tidy up. Comment grammar.
llvm-svn: 189618
2013-08-29 22:41:43 +00:00
Jim Grosbach cfb7b917cb Tidy up. Trailing whitespace.
llvm-svn: 189617
2013-08-29 22:41:39 +00:00
DeLesley Hutchins b570c13574 Consumed analysis: track function parameters.
Patch by chris.wailes@gmail.com.

llvm-svn: 189616
2013-08-29 22:36:05 +00:00
Reid Kleckner c974f09731 Substitute LLVM's version into the msbuild property file at config time
Requires shuffling the CPack code up before add_subdirectory(tools), but
that's where the version settings are anyway.

llvm-svn: 189615
2013-08-29 22:09:43 +00:00
Rui Ueyama 5b41201066 [PECOFF] Add /force:unresolved command line option as a synonym of /force.
llvm-svn: 189614
2013-08-29 21:46:47 +00:00