Commit Graph

170242 Commits

Author SHA1 Message Date
Rafael Espindola f1b10242c0 Convert a CodeGen test into a MC test.
llvm-svn: 204421
2014-03-21 00:55:42 +00:00
Rui Ueyama b4c358fab8 [PECOFF] Fix possible response file buffer overrun.
Response file is not NUL terminated, so when creating a StringRef for
the buffer contents, we need to pass the buffer size as well as the
pointer pointing to the buffer.

llvm-svn: 204420
2014-03-21 00:48:26 +00:00
Greg Fitzgerald 8288afb5fe fixed check_lint.sh in standalone build
Change-Id: I30d340bbe6b2028cc0f831399b62521912dcac60
llvm-svn: 204419
2014-03-21 00:45:21 +00:00
Rui Ueyama 827c8a2b07 Object/COFF: Support large relocation table.
NumberOfRelocations field in COFF section table is only 16-bit wide. If an
object has more than 65535 relocations, the number of relocations is stored
to VirtualAddress field in the first relocation field, and a special flag
(IMAGE_SCN_LNK_NRELOC_OVFL) is set to Characteristics field.

In test we cheated a bit. I made up a test file so that it has
IMAGE_SCN_LNK_NRELOC_OVFL flag but the number of relocations is much smaller
than 65535. This is to avoid checking in a large test file just to test a
file with many relocations.

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

llvm-svn: 204418
2014-03-21 00:44:19 +00:00
Richard Smith 56be754262 PR19215: When writing/reading a PCH that imported a module, store the location
at which that PCH imported each visible submodule of the module. Such locations
are needed when synthesizing macro directives resulting from the import.

llvm-svn: 204417
2014-03-21 00:33:59 +00:00
Rafael Espindola 2544330a29 Port test to cfi.
llvm-svn: 204416
2014-03-21 00:30:24 +00:00
Duncan P. N. Exon Smith 4543aac96e PGO: Indicate errors in profile runtime API
Return 0 for success, non-0 for failure.

llvm-svn: 204415
2014-03-21 00:27:50 +00:00
Duncan P. N. Exon Smith e5edc8869b PGO: Substitute pid for %p in filename
Add logic to do a printf-style substitution of %p for the process pid in
the filename.

It's getting increasingly awkward to work on lib/profile without test
infrastructure.  This needs to be fixed!

<rdar://problem/16383358>

llvm-svn: 204414
2014-03-21 00:27:48 +00:00
Alexander Kornienko 36155dd274 Fixed newlines.
llvm-svn: 204413
2014-03-21 00:07:27 +00:00
Rafael Espindola fc72577d92 Convert another CodeGen test into a MC test.
llvm-svn: 204412
2014-03-20 23:35:00 +00:00
Weiming Zhao 0152485679 Fix PR19136: [ARM] Fix Folding SP Update into vpush/vpop
Sicne MBB->computeRegisterLivenes() returns Dead for sub regs like s0,
d0 is used in vpop instead of updating sp, which causes s0 dead before
its use.

This patch checks the liveness of each subreg to make sure the reg is
actually dead.

llvm-svn: 204411
2014-03-20 23:28:16 +00:00
Greg Fitzgerald 1843227551 llvm-objdump output hex to match binutils' objdump
Patch by Ted Woodward

llvm-svn: 204409
2014-03-20 22:55:15 +00:00
Duncan P. N. Exon Smith 7c41451bc9 PGO: Don't define instrumentation data available_externally
Variables with available_externally linkage can be dropped at will.
This causes link errors, since there are still references to the
instrumentation!  linkonce_odr is almost equivalent, so use that
instead.

As a drive-by fix (I don't have an Elf system, so I'm not sure how to
write a testcase), use linkonce linkage for the instrumentation of
extern_weak functions.

<rdar://problem/15943240>

llvm-svn: 204408
2014-03-20 22:50:08 +00:00
Duncan P. N. Exon Smith 73f7862740 PGO: Rename FuncLinkage to VarLinkage; no functionality change
The variable is used to set the linkage for variables, and will become
different from function linkage in a follow-up commit.

<rdar://problem/15943240>

llvm-svn: 204407
2014-03-20 22:49:50 +00:00
Rafael Espindola df1be1f4c5 Convert CodeGen test into a more specific MC test.
llvm-svn: 204406
2014-03-20 22:05:59 +00:00
Rafael Espindola 52845cfd16 Remove llvm-mc's disable-cfi option.
It was dead.

llvm-svn: 204404
2014-03-20 21:48:20 +00:00
Richard Smith 564417a071 When the exception specification for a function in an imported PCH or module is
resolved, emit an update record.

llvm-svn: 204403
2014-03-20 21:47:22 +00:00
Greg Clayton 56b26a5707 Fixed case typo.
llvm-svn: 204402
2014-03-20 21:45:00 +00:00
Rafael Espindola c889a278fa Remove unused options from test.
llvm-svn: 204401
2014-03-20 21:38:04 +00:00
Greg Clayton 906e9acf91 Switch over to use the ArchSpec::GetMachine() instead of ArchSpec::GetCore() to keep the code more portable as we add new core types to ArchSpec.
llvm-svn: 204400
2014-03-20 21:31:55 +00:00
Rafael Espindola 98629c4e4d Don't use EmitAbsValue with symbol references.
The function exists to force an expression to be absolute, but there it is not
possible to force a symbol reference since

a = b
.long a

means something else.

This is an alternative fix for pr9951 that uses an assert. It then deletes
the old pr9951 test that was testing nothing already.

llvm-svn: 204399
2014-03-20 21:26:38 +00:00
Lang Hames 868d4b3122 Add an option to MCJIT to have it forward all sections to the
RTDyldMemoryManager, regardless of whether it thinks they're "required for
execution".

Currently, RuntimeDyld only passes sections that are "required for execution"
to the RTDyldMemoryManager, and takes "required for execution" to mean exactly
"contains symbols or relocations". There are two problems with this:
(1) It can drop sections with anonymous data that is referenced by code.
(2) It leaves the JIT client no way to inspect interesting sections that aren't
    actually required to run the program (e.g dwarf sections).

A test case is still in the works.

Future work: We may want to replace this with a generic section filtering
mechanism, but that will require more consideration. For now, this flag at least
allows clients to volunteer to do the filtering themselves.

Fixes <rdar://problem/15177691>.

llvm-svn: 204398
2014-03-20 21:06:46 +00:00
Richard Smith 6ef4293678 Refactor and simplify DeclUpdates serialization.
llvm-svn: 204397
2014-03-20 21:02:00 +00:00
Duncan P. N. Exon Smith 71704754d6 PGO: Declare zero-argument C functions as foo(void)
It turns out this is C code.  Specify foo(void).

<rdar://problem/15943240>

llvm-svn: 204396
2014-03-20 20:55:00 +00:00
DeLesley Hutchins d7fa5bd431 Consumed Analysis: IgnoreParens bugfix.
llvm-svn: 204395
2014-03-20 20:39:20 +00:00
Timur Iskhodzhanov ba5570221d Fix PR19172 - wrong this adjustment calculated for virtual destructor in a class with complex inheritance
Reviewed at http://llvm-reviews.chandlerc.com/D3128

llvm-svn: 204394
2014-03-20 20:38:34 +00:00
Juergen Ributzka 46357931ab Revert "[Constant Hoisting] Extend coverage of the constant hoisting pass."
I will break this up into smaller pieces for review and recommit.

llvm-svn: 204393
2014-03-20 20:17:13 +00:00
Richard Smith 59442b4f3a Refactor to move decl update emission into the decl emission loop.
llvm-svn: 204392
2014-03-20 20:07:19 +00:00
Duncan P. N. Exon Smith 9edbae0f16 PGO: Change runtime prefix from pgo to profile
These functions are in the profile runtime.  PGO comes later.

Unfortunately, there's only room for 16 characters in a Darwin section,
so use __llvm_prf_ instead of __llvm_profile_ for section names.

<rdar://problem/15943240>

llvm-svn: 204391
2014-03-20 20:00:44 +00:00
Duncan P. N. Exon Smith a7807637bf PGO: Change runtime prefix from pgo to profile
These functions are in the profile runtime.  PGO comes later.

Unfortunately, there's only room for 16 characters in a Darwin section,
so use __llvm_prf_ instead of __llvm_profile_ for section names.

<rdar://problem/15943240>

llvm-svn: 204390
2014-03-20 20:00:41 +00:00
Juergen Ributzka 6dab520c70 [Constant Hoisting] Extend coverage of the constant hoisting pass.
This commit extends the coverage of the constant hoisting pass, adds additonal
debug output and updates the function names according to the style guide.

Related to <rdar://problem/16381500>

llvm-svn: 204389
2014-03-20 19:55:52 +00:00
Mark Seaborn b6118c5b17 Remove LowerInvoke's obsolete "-enable-correct-eh-support" option
This option caused LowerInvoke to generate code using SJLJ-based
exception handling, but there is no code left that interprets the
jmp_buf stack that the resulting code maintained (llvm.sjljeh.jblist).
This option has been obsolete for a while, and replaced by
SjLjEHPrepare.

This leaves the default behaviour of LowerInvoke, which is to convert
invokes to calls.

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

llvm-svn: 204388
2014-03-20 19:54:47 +00:00
Duncan P. N. Exon Smith bb8345b791 Add vim swap files to .gitignore
llvm-svn: 204387
2014-03-20 19:44:33 +00:00
Duncan P. N. Exon Smith f1212176ac PGO: Add function to reset counters at runtime
Adding __llvm_pgo_reset_counters(), which sets all the counters to 0.

<rdar://problem/15943240>

llvm-svn: 204386
2014-03-20 19:44:31 +00:00
Richard Smith b9eab6d1c8 Rearrange serialization block order to put decl update emission into the same
block as decl and type emission. This allows decl updates include statements
and expressions. No functionality change (but the generated PCM files are
incompatible with earlier versions of Clang).

llvm-svn: 204385
2014-03-20 19:44:17 +00:00
Duncan P. N. Exon Smith c962cda1db PGO: Add missing file...
llvm-svn: 204384
2014-03-20 19:39:01 +00:00
Duncan P. N. Exon Smith 54cc0e2d81 PGO: Update interface for writing instrumentation data to file
__llvm_pgo_write_default_file() was a bad name, since it checked the
environment (it wasn't just a default file).

  - Change __llvm_pgo_write_file() to __llvm_pgo_write_file_with_name()
    and make it static.

  - Rename __llvm_pgo_write_default_file() to __llvm_pgo_write_file().

  - Add __llvm_pgo_set_filename(), which sets the filename for
    subsequent calls to __llvm_pgo_write_file().

<rdar://problem/15943240>

llvm-svn: 204381
2014-03-20 19:23:55 +00:00
Duncan P. N. Exon Smith 775c178a90 PGO: Add explicit static initialization
Instead of relying on explicit static initialization from translation
units, create a new file, InstrProfilingRuntime.cc, with an
__llvm_pgo_runtime variable.  After this commit (and its pair in clang),
the driver will create a use of this variable.  Unless the user defines
their own version, the new object file will get pulled in, including
that C++ static initialization that calls
__llvm_pgo_register_write_atexit.

The result is that, at least on Darwin, static initialization typically
consists of a single function call, which registers a writeout functino
atexit.  Furthermore, users can skip even this behaviour by defining
their own __llvm_pgo_runtime.

<rdar://problem/15943240>

llvm-svn: 204380
2014-03-20 19:23:53 +00:00
Duncan P. N. Exon Smith 5188e91cd4 PGO: Remove explicit static initialization
Remove the remaining explicit static initialization from translation
units, at least on Darwin.  Instead, create a use of __llvm_pgo_runtime,
which will pull in required code from compiler-rt.

After this commit (and its pair in compiler-rt), a user can define their
own __llvm_pgo_runtime to satisfy this undefined symbol and call the
functions in compiler-rt directly.

<rdar://problem/15943240>

llvm-svn: 204379
2014-03-20 19:23:46 +00:00
Eric Christopher 47f2be8847 Typo.
llvm-svn: 204378
2014-03-20 19:16:20 +00:00
Eric Christopher 384f3feb2d Reapply DW_AT_low/high_pc patch:
Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.

    This commit moves us from a single range per subprogram to extending
    ranges if we are:

    a) In the same section, and
    b) In the same enclosing CU.

    This means we have more fine grained ranges for compile units, and fewer
    ranges overall when we have multiple functions in the same CU
    adjacent to each other in the object file.

    Also remove all of the earlier hacks around this functionality for
    function sections etc. Also update all of the testcases to take into
    account the merging functionality.

with a fix for location entries in the debug_loc section:

Make sure that debug loc entries are relative to the low_pc
of the compile unit. This means that when we only have a single
range that the offset should be just relative to the low_pc
of the unit, for multiple ranges for a CU this means that we'll be
relative to 0 which we emit along with DW_AT_ranges.

This mostly shows up with linked binaries, so add a testcase with
multiple CUs so that our location is going to be offset of a CU
with a non-zero low_pc.

llvm-svn: 204377
2014-03-20 19:16:16 +00:00
Ted Kremenek d4576318b4 [-Wunreachable-code] Tweak isTrivialDoWhile() to handle implicit casts.
llvm-svn: 204376
2014-03-20 18:47:53 +00:00
Ted Kremenek 3d84c96dd3 Remove dead assignment dominated by a call to llvm_unreachable().
llvm-svn: 204375
2014-03-20 18:47:50 +00:00
Ted Kremenek 03a3d74ff2 [analyzer] Fix a bad bug in reversePropagateInterstingSymbols() where only one subexpression of BinaryOperator would be explored.
llvm-svn: 204374
2014-03-20 18:47:47 +00:00
Duncan P. N. Exon Smith 9cee5e0e92 PGO: Moving files for clarity
<rdar://problem/15943240>

llvm-svn: 204373
2014-03-20 18:43:09 +00:00
Duncan P. N. Exon Smith a5f804a7ea Use nullptr; no functionality change
llvm-svn: 204372
2014-03-20 18:40:55 +00:00
Duncan P. N. Exon Smith 3095e4d3bf Coding style fixup; no functionality change
llvm-svn: 204371
2014-03-20 18:40:53 +00:00
Justin Bogner f208d32355 llvm-profdata: Remove an empty comment
llvm-svn: 204370
2014-03-20 18:37:27 +00:00
Greg Clayton f587f8ec9a Add support for dumping DW_LNE_set_discriminator line table extended entries.
llvm-svn: 204369
2014-03-20 18:31:11 +00:00
Ben Langmuir c3ea5654f9 Prevent lookup of subframework modules by name without parent framework
We were 'allowing' the following import
@import Sub;

where Sub is a subframework of Foo and we had a -F path inside
Foo.framework/Frameworks and no module map file for Sub. This would
later hit assertion failures in debug builds.

Now we should correctly diagnose this as a module not found error.

llvm-svn: 204368
2014-03-20 18:27:26 +00:00