Commit Graph

229706 Commits

Author SHA1 Message Date
Reid Kleckner bc041b82d4 [codeview] Maintain the type enum-to-classname mapping in the .def file
This way it will be easy to stamp out something like a type visitor.

llvm-svn: 268347
2016-05-03 00:45:14 +00:00
Eric Fiselier 4df2666da1 Guard use of <unistd.h> in test.
llvm-svn: 268346
2016-05-03 00:36:57 +00:00
Sean Silva 2b34def662 Temporarily disable this test on llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast
`REQUIRES: shell` is not appropriate because that would mean that there
are no windows bots testing this, and that is precisely where it needs
the most testing.

Rafael or Rui are working on generating an archive directly, which
should avoid this issue.
We can try to move the bot to a shorter build directory path.

llvm-svn: 268345
2016-05-03 00:36:15 +00:00
Douglas Yung d58d9fa573 Adding a test for a compiler crash that was fixed in r248069.
Differential Revision: http://reviews.llvm.org/D19048

llvm-svn: 268344
2016-05-03 00:29:56 +00:00
Zachary Turner f5c59654f7 Parse the TPI (type information) stream of PDB files.
This parses the TPI stream (stream 2) from the PDB file. This stream
contains some header information followed by a series of codeview records.
There is some additional complexity here in that alongside this stream of
codeview records is a serialized hash table in order to efficiently query
the types. We parse the necessary bookkeeping information to allow us to
reconstruct the hash table, but we do not actually construct it yet as
there are still a few things that need to be understood first.

Differential Revision: http://reviews.llvm.org/D19840
Reviewed By: ruiu, rnk

llvm-svn: 268343
2016-05-03 00:28:21 +00:00
Zachary Turner 88bb163f81 Move llvm-readobj/StreamWriter to Support.
We wish to re-use this from llvm-pdbdump, and it provides a nice
way to print structured data in scoped format that could prove
useful for many other dumping tools as well.  Moving to support
and changing name to ScopedPrinter to better reflect its purpose.

llvm-svn: 268342
2016-05-03 00:28:04 +00:00
Mehdi Amini 5b85d8d67b ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268341
2016-05-03 00:27:28 +00:00
Matthias Braun d1aabb2813 livePhysRegs: Pass MBB by reference in addLive{Ins|Outs}(); NFC
The block must no be nullptr for the addLiveIns()/addLiveOuts()
function.

llvm-svn: 268340
2016-05-03 00:24:32 +00:00
Wolfgang Pieb a4e71bd11a Moved test case for r268323 to DebugInfo/X86 to unbreak aarch64.
llvm-svn: 268339
2016-05-03 00:22:09 +00:00
Jim Ingham c7468b7b96 Another little example use of scripted thread plans.
llvm-svn: 268338
2016-05-03 00:14:52 +00:00
Douglas Yung 091d8fd951 Adding period to the end of a comment to test out commit access.
llvm-svn: 268337
2016-05-03 00:12:59 +00:00
Matthias Braun 24f26e6d91 LivePhysRegs: Automatically determine presence of pristine regs.
Remove the AddPristinesAndCSRs parameters from
addLiveIns()/addLiveOuts().

We need to respect pristine registers after prologue epilogue insertion,
Seeing that we got this wrong in at least two commits already, we should
rather pay the small price to query MachineFrameInfo for it.

There are three cases that did not set AddPristineAndCSRs to true even
after register allocation:
- ExecutionDepsFix: live-out registers are used as a hint that the
  register is used soon. This is not true for pristine registers so
  use the new addLiveOutsNoPristines() to maintain this behaviour.
- SystemZShortenInst: Not setting AddPristineAndCSRs to true looks like
  a bug, should do the right thing automatically now.
- StackMapLivenessAnalysis: Not adding pristine registers looks like a
  bug to me. Added a FIXME comment but maintain the current behaviour
  as a change may need to get coordinated with GC runtimes.

llvm-svn: 268336
2016-05-03 00:08:46 +00:00
NAKAMURA Takumi 1a55a99362 MITests: Update libdeps.
llvm-svn: 268335
2016-05-03 00:04:07 +00:00
Adrian McCarthy 963a331a7e NFC: An iterator for stepping through CodeView type stream in llvm-readobj
This is a small refactoring step toward moving CodeView type stream logic from llvm-readobj to a library. It abstracts the logic of stepping through the stream into an iterator class and updates llvm-readobj to use that iterator. This has no functional change; llvm-readobj produces identical output.

The next step is to abstract the parsing of the different leaf types and then move that and the iterator into a library.

Since this is my first contrib outside LLDB, please let me know if I'm messing up on any of the LLVM style guidelines, idioms, or patterns.

Differential Revision: http://reviews.llvm.org/D19746

llvm-svn: 268334
2016-05-02 23:45:03 +00:00
Rui Ueyama dd368fcb05 Pass all buffers to BuildId hash function at once. NFC.
This change simplifies the BuildId classes by removing a few member
functions and variables from them. It should also make it easy to
parallelize hash computation in future because now each BuildId object
see all inputs rather than one at a time.

llvm-svn: 268333
2016-05-02 23:35:59 +00:00
Vitaly Buka 8742943cb0 Relax stack check as on some platforms demanglers fail
Summary:
  On Windows (already fixed) and FreeBSD we have stacks traces without
  operator().

Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19427

llvm-svn: 268332
2016-05-02 23:34:40 +00:00
Reid Kleckner 97837b7b09 [MC] Create unique .pdata sections for every .text section
Summary:
This adds a unique ID to the COFF section uniquing map, similar to the
one we have for ELF.  The unique id is not currently exposed via the
assembler because we don't have a use case for it yet. Users generally
create .pdata with the .seh_* family of directives, and the assembler
internally needs to produce .pdata and .xdata sections corresponding to
the code section.

The association between .text sections and the assembler-created .xdata
and .pdata sections is maintained as an ID field of MCSectionCOFF. The
CFI-related sections are created with the given unique ID, so if more
code is added to the same text section, we can find and reuse the CFI
sections that were already created.

Reviewers: majnemer, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19376

llvm-svn: 268331
2016-05-02 23:22:18 +00:00
Vitaly Buka 9102fc20f8 Add another failing use-after-scope test
Summary:
  Use after scope is not detected if array larger then 8 bytes.

Subscribers: kubabrecka

Differential Revision: http://reviews.llvm.org/D19572

llvm-svn: 268330
2016-05-02 23:12:04 +00:00
Matthias Braun 3199c4e1ef Add unittest for LiveIntervalAnalysis::handleMove()
This re-applies r260905. It requires LiveIntervals to not require
LiveVariables which was reverted and re-applied in r267954.

llvm-svn: 268329
2016-05-02 23:05:48 +00:00
Quentin Colombet 776e6de516 [MachineBlockPlacement] Let the target optimize the branches at the end.
After the layout of the basic blocks is set, the target may be able to get rid
of unconditional branches to fallthrough blocks that the generic code does not
catch. This happens any time TargetInstrInfo::AnalyzeBranch is not able to
analyze all the branches involved in the terminators sequence, while still
understanding a few of them.

In such situation, AnalyzeBranch can directly modify the branches if it has been
instructed to do so.

This patch takes advantage of that.

llvm-svn: 268328
2016-05-02 22:58:59 +00:00
Quentin Colombet 4e1d389ac5 [X86] Model FAULTING_LOAD_OP as a terminator and branch.
This operation may branch to the handler block and we do not want it
to happen anywhere within the basic block.
Moreover, by marking it "terminator and branch" the machine verifier
does not wrongly assume (because of AnalyzeBranch not knowing better)
the branch is analyzable. Indeed, the target was seeing only the
unconditional branch and not the faulting load op and thought it was
a simple unconditional block.
The machine verifier was complaining because of that and moreover,
other optimizations could have done wrong transformation!

In the process, simplify the representation of the handler block in
the faulting load op. Now, we directly reference the handler block
instead of using a label. This has the benefits of:
1. MC knows how to issue a label for a BB, so leave that to it.
2. Accessing the target BB from its label is painful, whereas it is
   direct from a MBB operand.

Note: The 2 bytes offset in implicit-null-check.ll comes from the
fact the unconditional jumps are not removed anymore, as the whole
terminator sequence is not analyzable anymore.

Will fix it in a subsequence commit.

llvm-svn: 268327
2016-05-02 22:58:54 +00:00
Rafael Espindola 9268a5d552 Simplify. NFC.
llvm-svn: 268326
2016-05-02 22:53:32 +00:00
Greg Clayton 7301d39401 debugserver should fflush its log stream in FileLogCallback, now it does.
<rdar://problem/24728287> 

llvm-svn: 268325
2016-05-02 22:53:08 +00:00
Rafael Espindola 133ebe5bc7 Simplify. NFC.
llvm-svn: 268324
2016-05-02 22:52:15 +00:00
Wolfgang Pieb 56aa4b0629 DebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.
Summary:
When SelectionDAG performs CSE it is possible that the context's source
location is different from that of the selected node. This can lead to
incorrect line number records. We update the debug location to the
one that occurs earlier in the instruction sequence.

This fixes PR21006.

Reviewers: echristo, sdmitrouk

Subscribers: jevinskie, asl, llvm-commits

Differential Revision: http://reviews.llvm.org/D12094

llvm-svn: 268323
2016-05-02 22:50:51 +00:00
Chris Bieneman b8f0a4ea33 [CMake] Enable LIBCXX HEADERS in Apple-Stage2.cmake
This enables installing the libcxx headers.

llvm-svn: 268322
2016-05-02 22:43:23 +00:00
Reid Kleckner 9d03109233 Fix argument expansion of reference fields of structs
r268261 made Clang "expand" more struct arguments on Windows. It removed
the check for 'RD->isCLike()', which was preventing us from attempting
to expand structs with reference type fields.

Our expansion code was attempting to load and pass each field of the
type in turn. We were accidentally doing one to many loads on reference
type fields.

On the function prologue side, we can use
EmitLValueForFieldInitialization, which obviously gets the address of
the field. On the call side, I tweaked EmitRValueForField directly,
since this is the only use of this method.

Fixes PR27607

llvm-svn: 268321
2016-05-02 22:42:34 +00:00
Chris Bieneman d5a3b23736 [CMake] Install libcxx-headers as part of the Apple-stage2 distribution
This installs the clang headers as part of the install-distribution target.

llvm-svn: 268320
2016-05-02 22:42:09 +00:00
Chris Bieneman 9920c39aef [CMake] Adding clang-headers to the Apple-stage2 distribution
This installs the clang headers as part of the install-distribution target.

llvm-svn: 268319
2016-05-02 22:38:06 +00:00
Akira Hatanaka 1cfa273091 Remove unneeded test in tryCaptureAsConstant.
It isn't necessary to call hasDefaultArg because we can't rematerialize
a captured variable that is a function parameter, regardless of whether
or not it has a default argument. NFC.

llvm-svn: 268318
2016-05-02 22:29:40 +00:00
Mehdi Amini 1e918c9cb3 Revert "ThinLTO: do not import function whose linkage prevents inlining."
This reverts commit r268315, the tests are not passing.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268317
2016-05-02 22:26:04 +00:00
Zachary Turner d6192f482f [llvm-pdbdump] Fix read past EOF when file is too small.
llvm-svn: 268316
2016-05-02 22:16:57 +00:00
Mehdi Amini bda9b2ae9e ThinLTO: do not import function whose linkage prevents inlining.
There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268315
2016-05-02 22:11:27 +00:00
Akira Hatanaka 3ba6535096 [CodeGenObjCXX] Don't rematerialize default arguments of function
parameters in the body of a block.

This fixes a bug where clang would materialize the default argument
inside the body of a block instead of passing the value via the block
descriptor.

For example, in the code below, foo1 would always print 42 regardless
of the value of argument "a" passed to foo1.

void foo1(const int a = 42 ) {
  auto block = ^{
    printf("%d\n", a);
  };
  block();
}

rdar://problem/24449235

llvm-svn: 268314
2016-05-02 21:52:57 +00:00
Kevin Enderby 64f7a995b0 Fix llvm-size to exit with non zero when it can’t open a file.
rdar://26027819

llvm-svn: 268313
2016-05-02 21:41:03 +00:00
Vedant Kumar 3c3d52cb76 Remove redundant return, NFC
llvm-svn: 268312
2016-05-02 21:33:36 +00:00
Vedant Kumar 58d1cd39be Fix a typo, NFC
llvm-svn: 268311
2016-05-02 21:32:07 +00:00
Rui Ueyama 6d0cd2b62b Teach Undefined symbols from which file they are created from.
This patch increases the size of Undefined by the size of a pointer,
but it wouldn't actually increase the size of memory that LLD uses
because we are not allocating the exact size but the size of the
largest SymbolBody.

llvm-svn: 268310
2016-05-02 21:30:42 +00:00
Enrico Granata 0a99485341 Fix an issue where the apropos command would not print fully qualified command names for nested command objects
rdar://problem/26020072

llvm-svn: 268309
2016-05-02 21:28:40 +00:00
Rafael Espindola 6bbd78df6f Revert "Temporary hack to see what is going on on a windows bot."
This reverts commit r268302.

llvm-svn: 268308
2016-05-02 21:21:26 +00:00
Sean Callanan c530ba98a9 Import block pointers from DWARF as Clang block pointers, not as structs.
Also added a data formatter that presents them as structs if you use frame
variable to look at their contents.  Now the blocks testcase works.

<rdar://problem/15984431>

llvm-svn: 268307
2016-05-02 21:15:31 +00:00
Simon Pilgrim 52f8693263 [X86][SSE] Added placeholder for 128/256-bit wide shuffle combines
Begun adding placeholder for future support for vperm2f128/vshuff64x2 style 128/256-bit wide shuffles

llvm-svn: 268306
2016-05-02 21:12:48 +00:00
Rafael Espindola 21507a4a5a Don't try to create thin bsd archives.
Not such variant has been specified yet.

llvm-svn: 268305
2016-05-02 21:06:57 +00:00
Frederic Riss bd126df21f [dsymutil] Create the temporary files in the system temp directory.
llvm-dsymutil used to create the temporary files in the output directory.
This works fine except when the output directory contains a '%' char, which
is then replaced by llvm::sys::fs::createUniqueFile() generating an invalid
path.
Just use the default temp dir for those files.

llvm-svn: 268304
2016-05-02 21:06:14 +00:00
Enrico Granata 1dccd9da01 Add more debug logging to g_get_shared_cache_class_info_body
llvm-svn: 268303
2016-05-02 20:58:15 +00:00
Rafael Espindola 732c4646ee Temporary hack to see what is going on on a windows bot.
llvm-svn: 268302
2016-05-02 20:47:06 +00:00
Xinliang David Li 5ad7c820fc Code refactoring -- preparation for new PM porting /NFC
llvm-svn: 268301
2016-05-02 20:33:59 +00:00
Reid Kleckner 5cb2b6b1be [codeview] Isolate type dumping from object file state
This isolates the state we use for type dumping from the knowledge of
object files. We can use CVTypeDumper to dump types from anywhere in
memory now.

NFC

Reviewers: zturner

Differential Revision: http://reviews.llvm.org/D19824

llvm-svn: 268300
2016-05-02 20:30:47 +00:00
Artem Belevich ca2b951cbc [CUDA] Make sure device-side __global__ functions are always visible.
__global__ functions are a special case in CUDA.

Even when the symbol would normally not be externally
visible according to C++ rules, they still must be visible
in CUDA GPU object so host-side stub can launch them.

Differential Revision: http://reviews.llvm.org/D19748

llvm-svn: 268299
2016-05-02 20:30:03 +00:00
Kevin Enderby 7bd8d99497 Thread Expected<...> up from libObject’s getType() for symbols to allow llvm-objdump to produce a good error message.
Produce another specific error message for a malformed Mach-O file when a symbol’s
section index is more than the number of sections.  The existing test case in test/Object/macho-invalid.test
for macho-invalid-section-index-getSectionRawName now reports the error with the message indicating
that a symbol at a specific index has a bad section index and that bad section index value.

Again converting interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. Where the existing code reported the error with a
string message or an error code it was converted to do the same.

Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
"// TODO: Actually report errors helpfully" and a call something like
consumeError(NameOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.

llvm-svn: 268298
2016-05-02 20:28:12 +00:00