Commit Graph

226382 Commits

Author SHA1 Message Date
Sean Silva c2feac75fd [libprofile] Handle '\\' in __llvm_profile_recursive_mkdir
This is implicitly needed at least by gcc-flag-compatibility.test

The thing that needs it is the `\` preceding the "default.profraw"
appended internally by clang when doing `-fprofile-use=`.

Clang uses `\` because is uses sys::path::append which will use `\` on a
Windows host. This is wrong, but I don't think there's an easy way to
solve it (maybe just always using `/` since places that accept `\` also
tend to accept `/`, but not the other way around).

llvm-svn: 264665
2016-03-28 21:32:46 +00:00
Richard Smith 8a3e39ab67 [modules] If both a module file and a module map for the same module are
explicitly provided, and the module map lists a header that does not exist,
unmark the module as 'unavailable' when loading its .pcm file. (Use of the
module might still fail if the relevant headers aren't embedded, but this
behavior is now consistent with how we behave if the module map is not
provided, and with the desired behavior for embedding headers in modules.)

llvm-svn: 264664
2016-03-28 21:31:09 +00:00
Nico Weber 70b895908c docs: Fix footnote after r260042.
r260042 removed a footnote referring to autoconf, but it left
around one item still referring to that footnote (libtool), and
it didn't renumber the later footnote reference.

llvm-svn: 264663
2016-03-28 21:24:46 +00:00
Sean Callanan 863fab69a2 Expose top-level Clang expressions via the command line and the API.
Top-level Clang expressions are expressions that act as new translation units,
and define their own symbols.  They do not have function wrappers like regular
expressions do, and declarations are persistent regardless of use of the dollar
sign in identifiers.  Names defined by these are given priority over all other
symbol lookups.

This patch adds a new expression option, '-p' or '--top-level,' which controls
whether the expression is treated this way.  It also adds a flag controlling 
this to SBExpressionOptions so that this API is usable externally.  It also adds
a test that validates that this works.  (The test requires a fix to the Clang
AST importer which I will be committing shortly.)

<rdar://problem/22864976>

llvm-svn: 264662
2016-03-28 21:20:05 +00:00
Sanjay Patel 7092de4cd2 fix CHECK_NEXT -> CHECK-NEXT
llvm-svn: 264661
2016-03-28 21:14:24 +00:00
Sean Callanan 2ff00003f1 Don't try to actually run code when the expression is top-level.
llvm-svn: 264660
2016-03-28 21:10:36 +00:00
Sean Callanan 38167d2536 Removed an override of LookupSymbol that mistakenly disabled it for Clang.
llvm-svn: 264659
2016-03-28 21:07:53 +00:00
Vedant Kumar 86705ba5b1 Reapply (2x) "[PGO] Fix name encoding for ObjC-like functions"
Function names in ObjC can have spaces in them. This interacts poorly
with name compression, which uses spaces to separate PGO names. Fix the
issue by using a different separator and update a test.

I chose "\01" as the separator because 1) it's non-printable, 2) we
strip it from PGO names, and 3) it's the next natural choice once "\00"
is discarded (that one's overloaded).

What's changed since the original commit?

- I fixed up the covmap-V2 binary format tests using a linux VM.
- I weakened the CHECK lines in instrprof-comdat.h to account for the
  fact that there have been bugfixes to clang coverage. These will be
  fixed up in a follow-up.
- I added an assert to make sure we don't get bitten by this again.
- I constructed the c-general.profraw file without name compression
  enabled to appease some bots.

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

llvm-svn: 264658
2016-03-28 21:06:42 +00:00
Adrian Prantl faebbb053d Add an IR Verifier check for orphaned DICompileUnits.
A DICompileUnit that is not listed in llvm.dbg.cu will cause assertion
failures and/or crashes in the backend. The Verifier should reject this.

rdar://problem/25369499

llvm-svn: 264657
2016-03-28 21:06:26 +00:00
Adam Nemet 64fa75391c [LVers] Change CHECK_LABEL to CHECK-LABEL (underscore->dash)
Thanks to Sanjoy for catching this.

llvm-svn: 264656
2016-03-28 21:04:13 +00:00
Jacques Pienaar d964cc22d1 [lanai] Add Lanai backend to clang driver.
Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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

llvm-svn: 264655
2016-03-28 21:02:54 +00:00
Nico Weber 83c3bd3e59 docs: Try to remove weird linebreak from generated html.
llvm-svn: 264654
2016-03-28 21:00:21 +00:00
Rui Ueyama 46a8e29587 Remove dead flags.
searchArchivesToOverrideTentativeDefinitions and
searchSharedLibrariesToOverrideTentativeDefinitions are always false.
For the dead flags, we have a fairly large amount of code which is
never be executed.

http://reviews.llvm.org/D17791

llvm-svn: 264653
2016-03-28 20:59:47 +00:00
Ryan Govostes d1268bd8db [asan] Fix testcase for r264645
llvm-svn: 264652
2016-03-28 20:42:56 +00:00
Reid Kleckner 2a5d34b5ef Update the description of Clang's MSVC compatibility flags
llvm-svn: 264651
2016-03-28 20:42:41 +00:00
Duncan P. N. Exon Smith 56d1fea6af Explicitly test BitstreamReader::setArtificialByteLimit, NFC
Explicitly check that artificial byte limit is rounded correctly by
exposing BitstreamReader::Size through a new accessor, getSizeIfKnown.

The original code for rounding (from r264547) wasn't obviously correct,
and even though r264623 cleaned it up (by calling llvm::alignTo) I think
it's worth testing.

llvm-svn: 264650
2016-03-28 20:39:41 +00:00
Evgeniy Stepanov a023f79db1 Handle section vs global name conflict.
This is a fix for PR26941.

When there is both a section and a global definition with the same
name, the global wins.

Section symbols are not added to the symbol table; section references
are left undefined and fixed up in the object writer unless they've
been satisfied by some other definition.

llvm-svn: 264649
2016-03-28 20:36:28 +00:00
Nico Weber cc8ee8e3a2 docs: Update Ninja link, also fix link syntax.
llvm-svn: 264648
2016-03-28 20:32:38 +00:00
Devin Coughlin 77942db0b8 [analyzer] Nullability: Don't warn along paths where null returned from non-null.
Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

llvm-svn: 264647
2016-03-28 20:30:25 +00:00
Duncan P. N. Exon Smith 0afa32cd59 Remove accidentally duplicated test
This was identical to setArtificialByteLimitNotWordBoundary.

llvm-svn: 264646
2016-03-28 20:30:15 +00:00
Ryan Govostes 653f9d0273 [asan] Support dead code stripping on Mach-O platforms
On OS X El Capitan and iOS 9, the linker supports a new section
attribute, live_support, which allows dead stripping to remove dead
globals along with the ASAN metadata about them.

With this change __asan_global structures are emitted in a new
__DATA,__asan_globals section on Darwin.

Additionally, there is a __DATA,__asan_liveness section with the
live_support attribute. Each entry in this section is simply a tuple
that binds together the liveness of a global variable and its ASAN
metadata structure. Thus the metadata structure will be alive if and
only if the global it references is also alive.

Review: http://reviews.llvm.org/D16737
llvm-svn: 264645
2016-03-28 20:28:57 +00:00
Ryan Govostes dc91fe5d8b [asan] Add runtime support for __asan_(un)register_image_globals
This change introduces routines that register and unregister all
instrumented globals in a loaded executable image.

These routines are only implemented on Darwin, where globals metadata
is expected to be placed in the __DATA,__asan_globals section.

Review: http://reviews.llvm.org/D16841
llvm-svn: 264644
2016-03-28 20:28:17 +00:00
Vedant Kumar 476a94d9ef Revert "Reapply "[PGO] Fix name encoding for ObjC-like functions""
This reverts commit r264641 to investigate why c-general.test is failing
on the bots.

llvm-svn: 264643
2016-03-28 20:20:40 +00:00
Reid Kleckner 25955f8590 Paper over the Windows-only enum initialization test failure until the bug is fixed
llvm-svn: 264642
2016-03-28 20:13:55 +00:00
Vedant Kumar f20b6cec1c Reapply "[PGO] Fix name encoding for ObjC-like functions"
Function names in ObjC can have spaces in them. This interacts poorly
with name compression, which uses spaces to separate PGO names. Fix the
issue by using a different separator and update a test.

I chose "\01" as the separator because 1) it's non-printable, 2) we
strip it from PGO names, and 3) it's the next natural choice once "\00"
is discarded (that one's overloaded).

This reverts the revert commit beaf3d18. What's changed?

- I fixed up the covmap-V2 binary format tests using a linux VM.
- I updated the expected counts in instrprof-comdat.h to account for
  the fact that there have been bugfixes to clang coverage.
- I added an assert to make sure we don't get bitten by this again.

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

llvm-svn: 264641
2016-03-28 20:12:07 +00:00
Kuba Brecka 0d026d9e9e [tsan] Fix a crash when exiting the main thread (e.g. dispatch_main)
This patch fixes the custom ThreadState destruction on OS X to avoid crashing when dispatch_main calls pthread_exit which quits the main thread.

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

llvm-svn: 264627
2016-03-28 19:36:25 +00:00
Sean Silva 7434e1d01f [libprofile] Make this test not depend on previous runs.
llvm-svn: 264626
2016-03-28 19:34:22 +00:00
Sean Silva 7d27e77820 [libprofile] Make this test a bit more specific
llvm-svn: 264625
2016-03-28 19:25:19 +00:00
Rafael Espindola 9cb885d5c3 Simplify how we represent relocation iterators.
Instead of using a bit to detect if they are "dynamic", just look at
sh_link.

This is a simplification on its own, and will help with using
llvm-objdump in dynamic objects.

llvm-svn: 264624
2016-03-28 19:23:51 +00:00
Douglas Katzman 9825491bbd Use 'alignTo' instead of re-inventing it. NFC
llvm-svn: 264623
2016-03-28 19:23:23 +00:00
Mike Spertus 1904598fff This file was accidentally committed with bad line endings. Fixed...
llvm-svn: 264621
2016-03-28 19:08:27 +00:00
Mike Spertus b45688eca4 Submitted new file with wrong line endings. Correcting...
llvm-svn: 264620
2016-03-28 19:06:17 +00:00
Easwaran Raman 8f6b9efc36 Profile summary cleanup.
Differential Revision: http://reviews.llvm.org/D18468

llvm-svn: 264619
2016-03-28 18:58:05 +00:00
Eugene Zelenko d9f635674a Fix builds on Windows broken in r264598.
llvm-svn: 264618
2016-03-28 18:54:58 +00:00
Jonathan Peyton 316af8de48 [STATS] Missing check for MIC in config-ix.cmake
llvm-svn: 264616
2016-03-28 18:53:10 +00:00
Adam Nemet a68d755774 [PGO] Update r264612 to use C-style comment
llvm-svn: 264615
2016-03-28 18:47:44 +00:00
Adam Nemet f761b3cec2 [PGO] Update r264611 to use C-style comment
llvm-svn: 264614
2016-03-28 18:45:30 +00:00
Adam Nemet 42a6fe199f [PGO] Comment how function pointers for indirect calls are mapped to function names
Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: llvm-commits

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

llvm-svn: 264612
2016-03-28 18:29:36 +00:00
Adam Nemet 2f36f05951 [PGO] Comment how function pointers for indirect calls are mapped to function names
Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: llvm-commits

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

llvm-svn: 264611
2016-03-28 18:27:44 +00:00
Mike Spertus e9f15b4b9f Convert to Unix line endings due to previous commit error.
llvm-svn: 264610
2016-03-28 18:24:22 +00:00
Reid Kleckner a2a07f95df dos2unix CMakeLists.txt
The sign now reads "0 days since the last line ending confusion"

llvm-svn: 264609
2016-03-28 18:19:32 +00:00
Matthias Braun b74eb41d58 MIRParser: Add %subreg.xxx syntax for subregister index operands
Differential Revision: http://reviews.llvm.org/D18279

llvm-svn: 264608
2016-03-28 18:18:46 +00:00
Matthias Braun 2bd8eeb6b7 CodeGen: Correct specification of PHI nodes
They do have a def machine operand.

Fixing the definition is necessary for an upcoming patch.

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

llvm-svn: 264607
2016-03-28 18:18:41 +00:00
Haicheng Wu 6a6bc750d5 [AArch64] Do not lower scalar sdiv/udiv to a shifts + mul sequence when optimizing for minsize
Mimic what x86 does when optimizing sdiv/udiv for minsize.

llvm-svn: 264606
2016-03-28 18:17:07 +00:00
Reid Kleckner ba85781f58 Revert "[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops"
This reverts commit r264596.

It does not compile.

llvm-svn: 264604
2016-03-28 18:07:40 +00:00
Mike Spertus 6601a4420b Use VS2015 Project Support for Natvis to eliminate the need to manually install clang native visualizer
This is the clang equivalent to llvm commit 264601. When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013).

llvm-svn: 264603
2016-03-28 18:03:37 +00:00
Mike Spertus 1c80677834 Forgot to commit this file in revision 264601
llvm-svn: 264602
2016-03-28 17:59:40 +00:00
Mike Spertus 0b96a2e842 Use VS2015 Project Support for Natvis to eliminate the need to manually install natvis files
When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013)

llvm-svn: 264601
2016-03-28 17:58:38 +00:00
Hal Finkel 7059d41622 [PowerPC] On the A2, popcnt[dw] are very slow
The A2 cores support the popcntw/popcntd instructions, but they're microcoded,
and slower than our default software emulation. Specifically, popcnt[dw] take
approximately 74 cycles, whereas our software emulation takes only 24-28
cycles.

I've added a new target feature to indicate a slow popcnt[dw], instead of just
removing the existing target feature from the a2/a2q processor models, because:
  1. This allows us to return more accurate information via the TTI interface
     (I recognize that this currently makes no practical difference)
  2. Is hopefully easier to understand (it allows the core's features to match
     its manual while still having the desired effect).

llvm-svn: 264600
2016-03-28 17:52:08 +00:00
David Blaikie b805f73ad1 Remove else after return
llvm-svn: 264599
2016-03-28 17:45:48 +00:00