lldb.git
6 years agoPossibly fix MSVC compilation after r256054.
James Y Knight [Sat, 19 Dec 2015 00:53:22 +0000 (00:53 +0000)]
Possibly fix MSVC compilation after r256054.

I don't have any way to test MSVC compilation, but maybe this will fix
the error:

llvm/Support/TrailingObjects.h(286) : error C3210: 'TrailingObjectsBase' : access declaration can only be applied to a base class member
llvm/Support/TrailingObjects.h(337) : see reference to class template instantiation 'llvm::TrailingObjects<BaseTy,TrailingTys...>' being compiled
llvm/Support/TrailingObjects.h(286) : error C2602: 'llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken' is not a member of a base class of 'llvm::TrailingObjects<BaseTy,TrailingTys...>'
llvm/Support/TrailingObjects.h(91) : see declaration of 'llvm::trailing_objects_internal::TrailingObjectsBase::OverloadToken'

llvm-svn: 256068

6 years ago[TestCPPAuto] On linux, we need -fno-limit-debug-info.
Siva Chandra [Sat, 19 Dec 2015 00:52:29 +0000 (00:52 +0000)]
[TestCPPAuto] On linux, we need -fno-limit-debug-info.

Summary: Also xfailed for GCC as there is an problem with debug info generation.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 256067

6 years agoRevert r256063, it's killing clang-tools-extra
Paul Robinson [Sat, 19 Dec 2015 00:23:11 +0000 (00:23 +0000)]
Revert r256063, it's killing clang-tools-extra

llvm-svn: 256066

6 years agoDeprecate a few C APIs.
Rafael Espindola [Fri, 18 Dec 2015 23:46:42 +0000 (23:46 +0000)]
Deprecate a few C APIs.

This deprecates:
* LLVMParseBitcode
* LLVMParseBitcodeInContext
* LLVMGetBitcodeModuleInContext
* LLVMGetBitcodeModule

They are replaced with the functions with a 2 suffix which do not record
a diagnostic.

llvm-svn: 256065

6 years agoRegenerated test according to the example assembly at the top. NFC.
Pete Cooper [Fri, 18 Dec 2015 23:43:17 +0000 (23:43 +0000)]
Regenerated test according to the example assembly at the top.  NFC.

The assembly at the top of this file contained more relocations than
the YAML.  I regenerated it so that we'd have complete relocation testing.

Also added detailed explanations of the relocations in the file so that
future people don't have to try decode them when something goes wrong.

llvm-svn: 256064

6 years agoCC1 part of debugger tuning; pass through setting from driver to LLVM.
Paul Robinson [Fri, 18 Dec 2015 23:41:11 +0000 (23:41 +0000)]
CC1 part of debugger tuning; pass through setting from driver to LLVM.

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

llvm-svn: 256063

6 years agoXcode: remove --test-subdir test reduction from previous check-in
Todd Fiala [Fri, 18 Dec 2015 23:22:15 +0000 (23:22 +0000)]
Xcode: remove --test-subdir test reduction from previous check-in

That was not meant to go in, as it was for testing my last change.

llvm-svn: 256062

6 years agoPrevent monitor thread creation when KMP_BLOCKTIME="infinite"
Jonathan Peyton [Fri, 18 Dec 2015 23:20:36 +0000 (23:20 +0000)]
Prevent monitor thread creation when KMP_BLOCKTIME="infinite"

When users sets envirable KMP_BLOCKTIME to "infinite" (the time one busy-waits
at barrieres, etc.), the monitor thread is not useful and can be ignored. This
change prevents the creation of the monitor thread when the users sets
KMP_BLOCKTIME to "infinite".

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

llvm-svn: 256061

6 years agoRemove some extra spaces
Jonathan Peyton [Fri, 18 Dec 2015 23:15:35 +0000 (23:15 +0000)]
Remove some extra spaces

llvm-svn: 256060

6 years agoXcode build: pass in vt100 to the Python test runner.
Todd Fiala [Fri, 18 Dec 2015 23:12:19 +0000 (23:12 +0000)]
Xcode build: pass in vt100 to the Python test runner.

Some of the Green Dragon tests were failing because they didn't
have a TERM set.

llvm-svn: 256059

6 years ago[PGO] Cleanup: Move large member functions out of line (NFC)
Xinliang David Li [Fri, 18 Dec 2015 23:06:37 +0000 (23:06 +0000)]
[PGO] Cleanup: Move large member functions out of line (NFC)

llvm-svn: 256058

6 years ago[CMake] PGO training data
Chris Bieneman [Fri, 18 Dec 2015 23:00:57 +0000 (23:00 +0000)]
[CMake] PGO training data

Adding in a few more lit substitutions for cc1 and the test exec path.

llvm-svn: 256057

6 years agoRemove possibility of failures to due race in ThreadPool unittest
Teresa Johnson [Fri, 18 Dec 2015 22:59:35 +0000 (22:59 +0000)]
Remove possibility of failures to due race in ThreadPool unittest

Remove all checks that required main thread to run faster than tasks in
ThreadPool, and yields which are now unnecessary. This should fix some
bot failures.

llvm-svn: 256056

6 years agoFix invalid enum comparison.
Zachary Turner [Fri, 18 Dec 2015 22:58:42 +0000 (22:58 +0000)]
Fix invalid enum comparison.

llvm-svn: 256055

6 years agoRewrite the TrailingObjects template to provide two new features:
James Y Knight [Fri, 18 Dec 2015 22:54:37 +0000 (22:54 +0000)]
Rewrite the TrailingObjects template to provide two new features:

 - Automatic alignment of the base type for the alignment requirements
   of the trailing types.

 - Support for an arbitrary numbers of trailing types, instead of only
   1 or 2, by using a variadic template implementation.

Upcoming commits to clang will take advantage of both of these features.

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

llvm-svn: 256054

6 years ago__ne__ is the actual Python operator; __neq__ is a typo
Enrico Granata [Fri, 18 Dec 2015 22:46:58 +0000 (22:46 +0000)]
__ne__ is the actual Python operator; __neq__ is a typo

llvm-svn: 256053

6 years agoDelete dead code: only functions are materializable.
Rafael Espindola [Fri, 18 Dec 2015 22:44:07 +0000 (22:44 +0000)]
Delete dead code: only functions are materializable.

llvm-svn: 256052

6 years agoAdd support for seeing through clang::AutoType in ClangASTContext
Enrico Granata [Fri, 18 Dec 2015 22:41:25 +0000 (22:41 +0000)]
Add support for seeing through clang::AutoType in ClangASTContext

This allows LLDB to deal correctly with expression result variables declared via the C++11 'auto' keyword

rdar://problem/23960490

llvm-svn: 256051

6 years agoUse a lambda to reduce code duplication.
Rafael Espindola [Fri, 18 Dec 2015 22:40:27 +0000 (22:40 +0000)]
Use a lambda to reduce code duplication.

llvm-svn: 256050

6 years agoSplit RequireCompleteType into a function that actually requires that the type
Richard Smith [Fri, 18 Dec 2015 22:40:25 +0000 (22:40 +0000)]
Split RequireCompleteType into a function that actually requires that the type
is complete (with an error produced if not) and a function that merely queries
whether the type is complete. Either way we'll trigger instantiation if
necessary, but only the former will diagnose and recover from missing module
imports.

The intent of this change is to prevent a class of bugs where code would call
RequireCompleteType(..., 0) and then ignore the result. With modules, we must
check the return value and use it to determine whether the definition of the
type is visible.

This also fixes a debug info quality issue: calls to isCompleteType do not
trigger the emission of debug information for a type in limited-debug-info
mode. This allows us to avoid emitting debug information for type definitions
in more cases where we believe it is safe to do so.

llvm-svn: 256049

6 years agogit-clang-format a region I am about to change.
Rafael Espindola [Fri, 18 Dec 2015 22:23:16 +0000 (22:23 +0000)]
git-clang-format a region I am about to change.

llvm-svn: 256048

6 years ago[PGO] Simplify computehash interface (NFC)
Xinliang David Li [Fri, 18 Dec 2015 22:22:12 +0000 (22:22 +0000)]
[PGO] Simplify computehash interface (NFC)

llvm-svn: 256047

6 years agoSupport AlwaysBreakAfterReturnType
Zachary Turner [Fri, 18 Dec 2015 22:20:15 +0000 (22:20 +0000)]
Support AlwaysBreakAfterReturnType

This changes the behavior of AlwaysBreakAfterDeclarationReturnType
so that it supports breaking after declarations, definitions, or
both.

Differential Revision: http://reviews.llvm.org/D10370
Reviewed By: Daniel Jasper

llvm-svn: 256046

6 years ago[modules] Don't try to use the definition of a class if
Richard Smith [Fri, 18 Dec 2015 22:19:11 +0000 (22:19 +0000)]
[modules] Don't try to use the definition of a class if
RequireCompleteType(..., 0) says we're not permitted to do so. The definition
might not be visible, even though we know what it is.

llvm-svn: 256045

6 years agoremove xcshareddata exclusion from .gitignore; add desktop and lldb-python-testsuite...
Todd Fiala [Fri, 18 Dec 2015 22:08:24 +0000 (22:08 +0000)]
remove xcshareddata exclusion from .gitignore; add desktop and lldb-python-testsuite shared schemes used by Xcode buildbot

llvm-svn: 256043

6 years agoTurns out, many people define structs named Point that do not share the same names...
Enrico Granata [Fri, 18 Dec 2015 22:04:47 +0000 (22:04 +0000)]
Turns out, many people define structs named Point that do not share the same names that this formatter uses for fields; use the {} syntax to make it so that a failure to parse the summary doesn't cause the entire printout to fail

llvm-svn: 256042

6 years ago[Symbolize] Improve the ownership of parsed objects.
Alexey Samsonov [Fri, 18 Dec 2015 22:02:14 +0000 (22:02 +0000)]
[Symbolize] Improve the ownership of parsed objects.

This code changes the way Symbolize handles parsed binaries: now
parsed OwningBinary<Binary> is not broken into (binary, memory buffer)
pair, and is just stored as-is in a cache. ObjectFile components
of Mach-O universal binaries are also stored explicitly in a
separate cache.

Additionally, this change:
* simplifies the code that parses/caches binaries: it's now done
  in a single place, not three different functions.
* makes flush() method behave as expected, and actually clear
  the cached parsed binaries and objects.
* fixes a dangling pointer issue described in
  http://reviews.llvm.org/D15638

llvm-svn: 256041

6 years ago[sancov] IWYU fix: add proper header inclusion.
Alexey Samsonov [Fri, 18 Dec 2015 22:02:08 +0000 (22:02 +0000)]
[sancov] IWYU fix: add proper header inclusion.

llvm-svn: 256040

6 years agoUse getEdgeProbability() instead of getEdgeWeight() in BFI and remove getEdgeWeight...
Cong Hou [Fri, 18 Dec 2015 21:53:24 +0000 (21:53 +0000)]
Use getEdgeProbability() instead of getEdgeWeight() in BFI and remove getEdgeWeight() interfaces from MBPI.

This patch removes all getEdgeWeight() interfaces from CodeGen directory. As
getEdgeProbability() is a little more expensive than getEdgeWeight(), I will
compose a patch soon in which BPI only stores probabilities instead of edge
weights so that getEdgeProbability() will have O(1) time.

Differential revision: http://reviews.llvm.org/D15489

llvm-svn: 256039

6 years agoWire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call
Richard Smith [Fri, 18 Dec 2015 21:45:41 +0000 (21:45 +0000)]
Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call
for the derived class into it. This is mostly just a cleanup, but could in
principle be a bugfix if there is some codepath that reaches here and didn't
previously require a complete type (I couldn't find any such codepath, though).

llvm-svn: 256037

6 years ago[DivergenceAnalysis] fix a bug in computing influence regions
Jingyue Wu [Fri, 18 Dec 2015 21:44:26 +0000 (21:44 +0000)]
[DivergenceAnalysis] fix a bug in computing influence regions

Fixes PR25864

llvm-svn: 256036

6 years ago[NaryReassociate] allow candidate to have a different type
Jingyue Wu [Fri, 18 Dec 2015 21:36:30 +0000 (21:36 +0000)]
[NaryReassociate] allow candidate to have a different type

Summary:
If Candiadte may have a different type from GEP, we should bitcast or
pointer cast it to GEP's type so that the later RAUW doesn't complain.

Added a test in nary-gep.ll

Reviewers: tra, meheff

Subscribers: mcrosier, llvm-commits, jholewinski

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

llvm-svn: 256035

6 years agoAdd a test case that validates that my change in r255603 does the right thing
Enrico Granata [Fri, 18 Dec 2015 21:35:21 +0000 (21:35 +0000)]
Add a test case that validates that my change in r255603 does the right thing

llvm-svn: 256034

6 years agoAdd API to support retrieving the formatters category for a specific language
Enrico Granata [Fri, 18 Dec 2015 21:25:24 +0000 (21:25 +0000)]
Add API to support retrieving the formatters category for a specific language

llvm-svn: 256033

6 years agoRevert "Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst"
Rafael Espindola [Fri, 18 Dec 2015 21:23:32 +0000 (21:23 +0000)]
Revert "Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst"

This reverts commit r256028.

It broke:

    LLVM :: CodeGen/Mips/eh.ll
    LLVM :: CodeGen/Mips/insn-zero-size-bb.ll

llvm-svn: 256032

6 years agoRemove redundant argument. NFC.
Rafael Espindola [Fri, 18 Dec 2015 21:18:57 +0000 (21:18 +0000)]
Remove redundant argument. NFC.

llvm-svn: 256031

6 years agoEnhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst
Jun Bum Lim [Fri, 18 Dec 2015 20:53:47 +0000 (20:53 +0000)]
Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst

When identifying blocks post-dominated by an unreachable-terminated block
in BranchProbabilityInfo, consider only the edge to the normal destination
block if the terminator is InvokeInst and let calcInvokeHeuristics() decide
edge weights for the InvokeInst.

llvm-svn: 256028

6 years agoXcode build: add a lldb-python-test-suite target.
Todd Fiala [Fri, 18 Dec 2015 20:44:45 +0000 (20:44 +0000)]
Xcode build: add a lldb-python-test-suite target.

The llvm.org Green Dragon OS X lldb builder will be using this
target to run the LLDB Python test suite.

llvm-svn: 256027

6 years agoPIC should not be enabled by default on Darwin with -static.
Bob Wilson [Fri, 18 Dec 2015 20:37:54 +0000 (20:37 +0000)]
PIC should not be enabled by default on Darwin with -static.

r245667 changed -static so that it doesn't override an explicit -fPIC
option, but -static should still change the default for Darwin for -fno-PIC.
This matches longstanding GCC and Clang behavior on Darwin and changing it
would be disruptive, with no significant benefit.
http://reviews.llvm.org/D15455
rdar://problem/23811045

llvm-svn: 256026

6 years ago[Hexagon] Add PIC support
Krzysztof Parzyszek [Fri, 18 Dec 2015 20:19:30 +0000 (20:19 +0000)]
[Hexagon] Add PIC support

llvm-svn: 256025

6 years agoDrop materializeAllPermanently.
Rafael Espindola [Fri, 18 Dec 2015 20:13:39 +0000 (20:13 +0000)]
Drop materializeAllPermanently.

This inlines materializeAll into the only caller
(materializeAllPermanently) and renames materializeAllPermanently to
just materializeAll.

llvm-svn: 256024

6 years agoFix an unused variable warning from r256012.
Chad Rosier [Fri, 18 Dec 2015 20:08:40 +0000 (20:08 +0000)]
Fix an unused variable warning from r256012.

llvm-svn: 256023

6 years agoAMDGPU/SI: Test commit
Changpeng Fang [Fri, 18 Dec 2015 20:04:28 +0000 (20:04 +0000)]
AMDGPU/SI: Test commit
    Summary: This is just my first commit. Test!

    Reviewers: none

    Subscribers: none

    Differential Revision: none

llvm-svn: 256022

6 years agoRevert "AMDGPU/SI: Test commit"
Changpeng Fang [Fri, 18 Dec 2015 20:04:26 +0000 (20:04 +0000)]
Revert "AMDGPU/SI: Test commit"

This reverts commit a493cb636e0152ad28210934a47c6c44b1437193.

llvm-svn: 256021

6 years agoAMDGPU/SI: Test commit
Changpeng Fang [Fri, 18 Dec 2015 19:57:41 +0000 (19:57 +0000)]
AMDGPU/SI: Test commit
Summary: This is just my first commit. Test!

Reviewers: none

Subscribers: none

Differential Revision: none

llvm-svn: 256020

6 years agoDrop support for dematerializing.
Rafael Espindola [Fri, 18 Dec 2015 19:57:26 +0000 (19:57 +0000)]
Drop support for dematerializing.

It was only used on lib/Linker and the use was "dead" since it was used on a
function the IRMover had just moved.

llvm-svn: 256019

6 years ago[UBSan] Implement runtime suppressions (PR25066).
Alexey Samsonov [Fri, 18 Dec 2015 19:56:42 +0000 (19:56 +0000)]
[UBSan] Implement runtime suppressions (PR25066).

Summary:
Add the ability to suppress UBSan reports for files/functions/modules
at runtime. The user can now pass UBSAN_OPTIONS=suppressions=supp.txt
with the contents of the form:

signed-integer-overflow:file-with-known-overflow.cpp
alignment:function_doing_unaligned_access
vptr:shared_object_with_vptr_failures.so

Suppression categories match the arguments passed to -fsanitize=
flag (although, see below). There is no overhead if suppressions are
not provided. Otherwise there is extra overhead for symbolization.

Limitations:
1) sometimes suppressions need debug info / symbol table to function
   properly (although sometimes frontend generates enough info to
   do the match).
2) it's only possible to suppress recoverable UB kinds - if you've
   built the code with -fno-sanitize-recover=undefined, suppressions
   will not work.
3) categories are fine-grained check kinds, not groups like "undefined"
   or "integer", so you can't write "undefined:file_with_ub.cc".

Reviewers: rsmith, kcc

Subscribers: cfe-commits

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

llvm-svn: 256018

6 years agoRevert "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Pete Cooper [Fri, 18 Dec 2015 19:45:38 +0000 (19:45 +0000)]
Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."

This reverts commit r256008.

Its breaking multiple buildbots, although works for me locally.

llvm-svn: 256013

6 years agoAdd a defensive check for a nullptr.
Adrian Prantl [Fri, 18 Dec 2015 19:44:31 +0000 (19:44 +0000)]
Add a defensive check for a nullptr.

llvm-svn: 256012

6 years agoRename variables to reflect linker split (NFC)
Teresa Johnson [Fri, 18 Dec 2015 19:28:59 +0000 (19:28 +0000)]
Rename variables to reflect linker split (NFC)

Renamed variables to be more reflective of whether they are
an instance of Linker, IRLinker or ModuleLinker. Also fix a stale
comment.

llvm-svn: 256011

6 years agoConvert Arg, ArgList, and Option to dump() to dbgs() rather than errs().
Eric Christopher [Fri, 18 Dec 2015 18:55:26 +0000 (18:55 +0000)]
Convert Arg, ArgList, and Option to dump() to dbgs() rather than errs().

Also add print() functions.

Patch by Justin Lebar!

llvm-svn: 256010

6 years agoAdd a dump method for ArgList.
Eric Christopher [Fri, 18 Dec 2015 18:55:22 +0000 (18:55 +0000)]
Add a dump method for ArgList.

Patch by Justin Lebar!

llvm-svn: 256009

6 years agoImprove DWARFDebugFrame::parse to also handle __eh_frame.
Pete Cooper [Fri, 18 Dec 2015 18:51:08 +0000 (18:51 +0000)]
Improve DWARFDebugFrame::parse to also handle __eh_frame.

LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's.

This code improves DWARFDebugFrame::parse to do the same for parsing.

This also allows llvm-objdump to support the --dwarf=frames option which objdump supports.  This
option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse.

http://reviews.llvm.org/D15535

Reviewed by Rafael Espindola.

llvm-svn: 256008

6 years agoRecognize strings for Hexagon-specific variant kinds
Krzysztof Parzyszek [Fri, 18 Dec 2015 18:47:27 +0000 (18:47 +0000)]
Recognize strings for Hexagon-specific variant kinds

llvm-svn: 256007

6 years agomark TestGlobalVariables.py as XFAIL on OS X dwarf.
Todd Fiala [Fri, 18 Dec 2015 18:40:33 +0000 (18:40 +0000)]
mark TestGlobalVariables.py as XFAIL on OS X dwarf.

tracking bug:
https://llvm.org/bugs/show_bug.cgi?id=25872

llvm-svn: 256006

6 years ago[WinEH] Update LCSSA to handle catchswitch with handlers inside and outside a loop
Andrew Kaylor [Fri, 18 Dec 2015 18:12:35 +0000 (18:12 +0000)]
[WinEH] Update LCSSA to handle catchswitch with handlers inside and outside a loop

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

llvm-svn: 256005

6 years ago[AArch64] Promote loads from stores
Jun Bum Lim [Fri, 18 Dec 2015 18:08:30 +0000 (18:08 +0000)]
[AArch64] Promote loads from stores

This change promotes load instructions which directly read from stores by
replacing them with mov instructions. If the store is wider than the load,
the load will be replaced with a bitfield extract.
For example :
  STRWui %W1, %X0, 1
  %W0 = LDRHHui %X0, 3
becomes
  STRWui %W1, %X0, 1
  %W0 = UBFMWri %W1, 16, 31

llvm-svn: 256004

6 years ago[ThinLTO/LTO] Don't link in unneeded metadata
Teresa Johnson [Fri, 18 Dec 2015 17:51:37 +0000 (17:51 +0000)]
[ThinLTO/LTO] Don't link in unneeded metadata

Summary:
Third patch split out from http://reviews.llvm.org/D14752.

Only map in needed DISubroutine metadata (imported or otherwise linked
in functions and other DISubroutine referenced by inlined instructions).
This is supported for ThinLTO, LTO and llvm-link --only-needed, with
associated tests for each one.

Depends on D14838.

Reviewers: dexonsmith, joker.eph

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 256003

6 years ago[STATS] Have CMake do real check for stats functionality
Jonathan Peyton [Fri, 18 Dec 2015 16:19:35 +0000 (16:19 +0000)]
[STATS] Have CMake do real check for stats functionality

This change allows clang to build the stats library for every architecture
which supports __builtin_readcyclecounter().  CMake also checks for all
necessary features for stats and will error out if the platform does not
support it.

Patch by Hal Finkel and Johnny Peyton

llvm-svn: 256002

6 years agoHandle archives with paths in the names.
Rafael Espindola [Fri, 18 Dec 2015 16:07:17 +0000 (16:07 +0000)]
Handle archives with paths in the names.

We always create archives with just he filename as the member name, but
other archives can put a more complicated path in there.

This patches handles it by computing just the filename as we do when
adding a new member.

If storing the path is important for some reason, we should probably
have an orthogonal option for doing that and do it for both old and new
members.

Fixes pr25877.

llvm-svn: 256001

6 years agoFix the emulation of arm strd instruction
Tamas Berghammer [Fri, 18 Dec 2015 15:35:08 +0000 (15:35 +0000)]
Fix the emulation of arm strd instruction

The incorrect instruction emulation caused issues in the stack unwinding
code when strd was used to push 2 register to the stack with writeback.

llvm-svn: 256000

6 years agoclang-format to reduce diff in another patch.
Rafael Espindola [Fri, 18 Dec 2015 14:06:34 +0000 (14:06 +0000)]
clang-format to reduce diff in another patch.

llvm-svn: 255999

6 years agoFix error handling in LLVMGetBitcodeModuleInContext.
Rafael Espindola [Fri, 18 Dec 2015 13:58:05 +0000 (13:58 +0000)]
Fix error handling in LLVMGetBitcodeModuleInContext.

It was not setting OutMessage.

llvm-svn: 255998

6 years agoRevert r255996 ("[tsan] Add a DCHECK to verify __tsan_read* and __tsan_write function...
Kuba Brecka [Fri, 18 Dec 2015 13:52:08 +0000 (13:52 +0000)]
Revert r255996 ("[tsan] Add a DCHECK to verify __tsan_read* and __tsan_write function aren't called from ScopedInterceptor").

There are some test failures on the Linux buildbots.

llvm-svn: 255997

6 years ago[tsan] Add a DCHECK to verify __tsan_read* and __tsan_write function aren't called...
Kuba Brecka [Fri, 18 Dec 2015 13:08:15 +0000 (13:08 +0000)]
[tsan] Add a DCHECK to verify __tsan_read* and __tsan_write function aren't called from ScopedInterceptor

Interceptors using ScopedInteceptor should never call into user's code before the ScopedInterceptor is out of scope (and its destructor is called). Let's add a DCHECK to enforce that.

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

llvm-svn: 255996

6 years ago[tsan] Fix scoping of ScopedInteceptor in libdispatch support
Kuba Brecka [Fri, 18 Dec 2015 11:16:24 +0000 (11:16 +0000)]
[tsan] Fix scoping of ScopedInteceptor in libdispatch support

Some interceptors in tsan_libdispatch_mac.cc currently wrongly use TSAN_SCOPED_INTERCEPTOR/ScopedInterceptor. Its constructor can start ignoring memory accesses, and the destructor the stops this -- however, e.g. dispatch_sync can call user's code, so the ignoring will extend to user's code as well. This is not expected and we should only limit the scope of ScopedInterceptor to TSan code.  This patch introduces annotations that mark the beginning and ending of a callback into user's code.

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

llvm-svn: 255995

6 years agoGlobalsAA: Take advantage of ArgMemOnly, InaccessibleMemOnly and InaccessibleMemOrArg...
Vaivaswatha Nagaraj [Fri, 18 Dec 2015 11:02:52 +0000 (11:02 +0000)]
GlobalsAA: Take advantage of ArgMemOnly, InaccessibleMemOnly and InaccessibleMemOrArgMemOnly attributes

Summary:
1. Modify AnalyzeCallGraph() to retain function info for external functions
if the function has [InaccessibleMemOr]ArgMemOnly flags.
2. When analyzing the use of a global is function parameter at a call site,
mark the callee also as modifying the global appropriately.
3. Add additional test cases.

Depends on D15499

Reviewers: hfinkel, jmolloy

Subscribers: llvm-commits

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

llvm-svn: 255994

6 years agoReplace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().
Yaron Keren [Fri, 18 Dec 2015 10:30:12 +0000 (10:30 +0000)]
Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().

llvm-svn: 255993

6 years ago[OPENMP] Remove explicit call for implicit barrier
Alexey Bataev [Fri, 18 Dec 2015 10:24:53 +0000 (10:24 +0000)]
[OPENMP] Remove explicit call for implicit barrier
#pragma omp parallel needs an implicit barrier that is currently done by an explicit call to __kmpc_barrier. However, the runtime already ensures a barrier in __kmpc_fork_call which currently leads to two barriers per region per thread.
Differential Revision: http://reviews.llvm.org/D15561

llvm-svn: 255992

6 years ago[mips][microMIPS][DSP] Implement PACKRL.PH, PICK.PH, PICK.QB, SHILO, SHILOV and WRDSP...
Zlatko Buljan [Fri, 18 Dec 2015 08:59:37 +0000 (08:59 +0000)]
[mips][microMIPS][DSP] Implement PACKRL.PH, PICK.PH, PICK.QB, SHILO, SHILOV and WRDSP instructions
Differential Revision: http://reviews.llvm.org/D14429

llvm-svn: 255991

6 years ago[OPENMP] Fix for http://llvm.org/PR25878: Error compiling an OpenMP program
Alexey Bataev [Fri, 18 Dec 2015 07:58:25 +0000 (07:58 +0000)]
[OPENMP] Fix for llvm.org/PR25878: Error compiling an OpenMP program
OpenMP codegen tried to emit the code for its constructs even if it was detected as a dead-code. Added checks to ensure that the code is emitted if the code is not dead.

llvm-svn: 255990

6 years ago[OPENMP 4.5] Parsing/sema analysis for 'depend(source)' clause in 'ordered' directive.
Alexey Bataev [Fri, 18 Dec 2015 05:05:56 +0000 (05:05 +0000)]
[OPENMP 4.5] Parsing/sema analysis for 'depend(source)' clause in 'ordered' directive.
OpenMP 4.5 adds 'depend(source)' clause for 'ordered' directive to support cross-iteration dependence. Patch adds parsing and semantic analysis for this construct.

llvm-svn: 255986

6 years agoAdd a test for LLVMGetBitcodeModule.
Rafael Espindola [Fri, 18 Dec 2015 03:57:26 +0000 (03:57 +0000)]
Add a test for LLVMGetBitcodeModule.

llvm-svn: 255985

6 years ago[RS4GC] Use an value handle to help isolate errors quickly
Philip Reames [Fri, 18 Dec 2015 03:53:28 +0000 (03:53 +0000)]
[RS4GC] Use an value handle to help isolate errors quickly

Inspired by the bug reported in 25846.  Whatever we end up doing about that one, the value handle change is a generally good one since it will help catch this type of mistake more quickly.

Patch by: Manuel Jacob

llvm-svn: 255984

6 years agoclang-format to reduce diff in another patch.
Rafael Espindola [Fri, 18 Dec 2015 03:04:52 +0000 (03:04 +0000)]
clang-format to reduce diff in another patch.

llvm-svn: 255981

6 years agoRevert "[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs"
Vedant Kumar [Fri, 18 Dec 2015 02:30:45 +0000 (02:30 +0000)]
Revert "[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs"

This reverts commit r255977. This is part of
http://reviews.llvm.org/D15634.

llvm-svn: 255978

6 years ago[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs
Vedant Kumar [Fri, 18 Dec 2015 02:27:52 +0000 (02:27 +0000)]
[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs

llvm-svn: 255977

6 years agoFix formatting for last commit.
Jim Ingham [Fri, 18 Dec 2015 02:15:25 +0000 (02:15 +0000)]
Fix formatting for last commit.

llvm-svn: 255973

6 years agoMake the Language print the description of the Exception Breakpoint resolver. Also
Jim Ingham [Fri, 18 Dec 2015 02:14:04 +0000 (02:14 +0000)]
Make the Language print the description of the Exception Breakpoint resolver.  Also
have the breakpoint description print the precondition description if one exists.
No behavior change.

<rdar://problem/22885189>

llvm-svn: 255972

6 years agoReorganize the C API headers to improve build times.
Eric Christopher [Fri, 18 Dec 2015 01:46:52 +0000 (01:46 +0000)]
Reorganize the C API headers to improve build times.

Type specific declarations have been moved to Type.h and error handling
routines have been moved to ErrorHandling.h. Both are included in Core.h
so nothing should change for projects directly including the headers,
but transitive dependencies may be affected.

llvm-svn: 255965

6 years agoFix type in tuple test. Sorry for the noise
Eric Fiselier [Fri, 18 Dec 2015 01:04:36 +0000 (01:04 +0000)]
Fix type in tuple test. Sorry for the noise

llvm-svn: 255944

6 years agoObjC properties: consider ownership of properties from protocols when synthesizing.
Douglas Gregor [Fri, 18 Dec 2015 00:52:31 +0000 (00:52 +0000)]
ObjC properties: consider ownership of properties from protocols when synthesizing.

When determining whether ownership was explicitly written for a
property when it is being synthesized, also consider that the original
property might have come from a protocol. Fixes rdar://problem/23931441.

llvm-svn: 255943

6 years agoThe lldb side changes to go along with r255711 where a new
Jason Molenda [Fri, 18 Dec 2015 00:45:35 +0000 (00:45 +0000)]
The lldb side changes to go along with r255711 where a new
"thread-pcs" key is added to the T (questionmark) packet in
gdb-remote protocol so that lldb doesn't need to query the
pc values of every thread before it resumes a process.

The only odd part with this is that I'm sending the pc
values in big endian order, so we need to know the endianness
of the remote process before we can use them.  All other
register values in gdb-remote protocol are sent in native-endian
format so this requirement doesn't exist.  This addition is a
performance enhancement -- lldb will fall back to querying the
pc of each thread individually if it needs to -- so when
we don't have the byte order for the process yet, we don't
use these values.  Practically speaking, the only way I've
been able to elicit this condition is for the first
T packet when we attach to a process.

<rdar://problem/21963031>

llvm-svn: 255942

6 years ago[libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from K-Ballo.
Eric Fiselier [Fri, 18 Dec 2015 00:36:55 +0000 (00:36 +0000)]
[libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from K-Ballo.

Review: http://reviews.llvm.org/D14839
llvm-svn: 255941

6 years agoBranchProbabilityTest.cpp: Suppress warnings. [-Wsign-compare]
NAKAMURA Takumi [Fri, 18 Dec 2015 00:18:18 +0000 (00:18 +0000)]
BranchProbabilityTest.cpp: Suppress warnings. [-Wsign-compare]

llvm-svn: 255940

6 years agoRemove unused class variables.
Eric Christopher [Thu, 17 Dec 2015 23:43:40 +0000 (23:43 +0000)]
Remove unused class variables.

llvm-svn: 255939

6 years agoFix typo in MSC path
Xinliang David Li [Thu, 17 Dec 2015 23:37:30 +0000 (23:37 +0000)]
Fix typo in MSC path

llvm-svn: 255938

6 years agoAdd a test for r255875 & r255929, comparisons on DynTypeNode wrapped QualType.
Richard Trieu [Thu, 17 Dec 2015 23:20:57 +0000 (23:20 +0000)]
Add a test for r255875 & r255929, comparisons on DynTypeNode wrapped QualType.

llvm-svn: 255937

6 years ago[X86] Use push-pop for materializing small constants under 'minsize'
Hans Wennborg [Thu, 17 Dec 2015 23:18:39 +0000 (23:18 +0000)]
[X86] Use push-pop for materializing small constants under 'minsize'

Use the 3-byte (4 with REX prefix) push-pop sequence for materializing
small constants. This is smaller than using a mov (5, 6 or 7 bytes
depending on size and REX prefix), but it's likely to be slower, so
only used for 'minsize'.

This is a follow-up to r255656.

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

llvm-svn: 255936

6 years agoRevert "Disable test reruns on arm unless explicitly marked with --rerun-all-issues"
Todd Fiala [Thu, 17 Dec 2015 22:42:50 +0000 (22:42 +0000)]
Revert "Disable test reruns on arm unless explicitly marked with --rerun-all-issues"

and
Revert "prevent rerun logic from kicking in on test runs including aarch64."

This reverts commits:
r255719
r255747

llvm-svn: 255935

6 years ago[BranchProbability] Remove the restriction that known and unknown probabilities canno...
Cong Hou [Thu, 17 Dec 2015 22:27:07 +0000 (22:27 +0000)]
[BranchProbability] Remove the restriction that known and unknown probabilities cannot coexist when being normalized.

The current BranchProbability::normalizeProbabilities() forbids known and
unknown probabilities to coexist in the list. This was once used to help
capture probability exceptions but has caused some reported build
failures (https://llvm.org/bugs/show_bug.cgi?id=25838).

This patch removes this restriction by evenly distributing the complement
of the sum of all known probabilities to unknown ones. We could still
treat this as an abnormal behavior, but it is better to emit warnings in
our future profile validator.

Differential revision: http://reviews.llvm.org/D15548

llvm-svn: 255934

6 years ago[CUDA] runtime wrapper header tweaks
Artem Belevich [Thu, 17 Dec 2015 22:25:22 +0000 (22:25 +0000)]
[CUDA] runtime wrapper header tweaks

* Pull in host-only implementations of few CUDA-specific math functions.
* #nclude <cmath> early to prevent its inclusion from CUDA headers after
  they've messed with __THROW macro.

llvm-svn: 255933

6 years ago[InstCombine] Extend peephole DSE to handle unordered atomics
Philip Reames [Thu, 17 Dec 2015 22:19:27 +0000 (22:19 +0000)]
[InstCombine] Extend peephole DSE to handle unordered atomics

This extends the same line of reasoning used in EarlyCSE w/http://reviews.llvm.org/D15352 to the DSE implementation in InstCombine.

Key points:
 * We only remove unordered or simple stores.
 * The loads producing values consumed by dead stores don't influence whether the store is dead.

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

llvm-svn: 255932

6 years agoPolish atomic pointers
JF Bastien [Thu, 17 Dec 2015 22:09:19 +0000 (22:09 +0000)]
Polish atomic pointers

Summary:
I didn't realize that we already allowed atomic load/store of pointers,
it was added in 2012 by r162146. This patch updates the documentation
and tightens the verifier by using DataLayout to make sure that the
stored size is byte-sized and power-of-two. DataLayout is also used for
integers, and while I'm here I updated the corresponding code for
cmpxchg and rmw.

See the following discussion for context and upcoming changes to
add floating-point and vector atomics:
  https://groups.google.com/forum/#!topic/llvm-dev/Nh0P_E3CRoo/discussion

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 255931

6 years agoPass -m elf_x84_64 to gold invocations.
Rafael Espindola [Thu, 17 Dec 2015 21:56:27 +0000 (21:56 +0000)]
Pass -m elf_x84_64 to gold invocations.

Fixes pr25868.

llvm-svn: 255930

6 years agoFix r255875, use '<' instead of '==' for 'operator<'
Richard Trieu [Thu, 17 Dec 2015 21:56:22 +0000 (21:56 +0000)]
Fix r255875, use '<' instead of '==' for 'operator<'

Aaron Ballman pointed out a typo from the copy and paste in r255875.  This will
preserve the strict weak ordering when comparing DynTypedNode.

llvm-svn: 255929

6 years agoRevert "[AArch64] Add DAG combine for extract extend pattern"
Matthew Simpson [Thu, 17 Dec 2015 21:29:47 +0000 (21:29 +0000)]
Revert "[AArch64] Add DAG combine for extract extend pattern"

This reverts commit r255895. The patch breaks internal tests. Reverting until a
fix is ready.

llvm-svn: 255928

6 years agoDrop function that are deprecated since 2010.
Rafael Espindola [Thu, 17 Dec 2015 21:16:12 +0000 (21:16 +0000)]
Drop function that are deprecated since 2010.

These functions were deprecated in r97608.

llvm-svn: 255927

6 years agoTest commit
Dave Bartolomeo [Thu, 17 Dec 2015 20:54:16 +0000 (20:54 +0000)]
Test commit

llvm-svn: 255926

6 years ago[WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF.
Dan Gohman [Thu, 17 Dec 2015 20:50:45 +0000 (20:50 +0000)]
[WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF.

llvm-svn: 255925