Commit Graph

181973 Commits

Author SHA1 Message Date
Benjamin Kramer 7ab8476c15 ASTMatchers: Add a matcher to detect whether a decl or stmt is inside a template instantiation.
This is hoisted from clang-tidy where it's used everywhere. The implementation
is not particularly efficient right now, but there is no easy fix for that.

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

llvm-svn: 217029
2014-09-03 12:08:14 +00:00
Benjamin Kramer 8c90fd71f7 Add override to overriden virtual methods, remove virtual keywords.
No functionality change. Changes made by clang-tidy + some manual cleanup.

llvm-svn: 217028
2014-09-03 11:41:21 +00:00
Jim Cownie 77c2a634b0 Fix a crash that occurred under obscure circumstances during library shutdown
llvm-svn: 217027
2014-09-03 11:34:33 +00:00
Jim Cownie 07ea89f637 Fix a bug where the library slept for up to KMP_BLOCKTIME before exiting
llvm-svn: 217026
2014-09-03 11:10:54 +00:00
Benjamin Kramer a39beb9dd6 Parse: Replace polymorphic functor objects with lambdas and llvm::function_ref.
No change in functionality.

llvm-svn: 217025
2014-09-03 11:06:10 +00:00
Jim Cownie 12ad3b1911 Fix a problem on Windows machines with >32 processors
llvm-svn: 217024
2014-09-03 10:51:02 +00:00
Yaron Keren e499db0184 Fix ambiguous call to make_unique and clang-format.
llvm-svn: 217023
2014-09-03 08:22:30 +00:00
Daniel Jasper db986eb6bb clang-format: Add an option 'SpaceAfterCStyleCast'.
This permits to add a space after closing parenthesis of a C-style cast.
Defaults to false to preserve old behavior.

Fixes llvm.org/PR19982.

Before:
  (int)i;

After:
  (int) i;

Patch by Marek Kurdej.

llvm-svn: 217022
2014-09-03 07:37:29 +00:00
Alexander Potapenko c578567b07 Follow-up for r217020: actually commit the fix for PR20800,
revert the accidentally committed changes to LLVMSymbolize.cpp

llvm-svn: 217021
2014-09-03 07:37:20 +00:00
Alexander Potapenko 33e4d9e9e3 Fix PR20800: correctly calculate the offset of the subq instruction when generating compact unwind info.
This CL replaces the constant DarwinX86AsmBackend.PushInstrSize with a method
that lets the backend account for different sizes of "push %reg" instruction
sizes.

llvm-svn: 217020
2014-09-03 07:11:34 +00:00
Juergen Ributzka 31e5b7fb12 Reapply r216805 "[MachineCombiner][AArch64] Use the correct register class for MADD, SUB, and OR.""
This reapplies r216805 with a fix to a copy-past error, which resulted in an
incorrect register class.

Original commit message:
Select the correct register class for the various instructions that are
generated when combining instructions and constrain the registers to the
appropriate register class.

This fixes rdar://problem/18183707.

llvm-svn: 217019
2014-09-03 07:07:10 +00:00
Craig Topper cf05f91ab5 Recommit "Use unique_ptr to manager FilterChooser ownership."
Just using insert of a pair this time instead of emplace.

llvm-svn: 217018
2014-09-03 06:07:54 +00:00
Justin Bogner 2cfd1fed21 test: Make it possible to opt in to use_clang_verify per test
This modifies the use_clang_verify parameter I added in r217009 to
only apply to tests that specifically ask for it via // USE_VERIFY.
This allows us to incrementally convert tests, but start enjoying the
benefits right away.

Suggested by Eric Fiselier in code review.

llvm-svn: 217017
2014-09-03 06:01:52 +00:00
Ed Schouten ca98874943 Allow a scoped lockable object to acquire/release multiple locks.
Scoped lockable objects (mutex guards) are implemented as if it is a
lock itself that is acquired upon construction and unlocked upon
destruction. As it if course needs to be used to actually lock down
something else (a mutex), it keeps track of this knowledge through its
underlying mutex field in its FactEntry.

The problem with this approach is that this only allows us to lock down
a single mutex, so extend the code to use a vector of underlying
mutexes. This, however, makes the code a bit more complex than
necessary, so subclass FactEntry into LockableFactEntry and
ScopedLockableFactEntry and move all the logic that differs between
regular locks and scoped lockables into member functions.

llvm-svn: 217016
2014-09-03 06:00:11 +00:00
Craig Topper 6cb92c206b Revert "Use unique_ptr to manager FilterChooser ownership."
std::map::emplace isn't working on some of the bots.

llvm-svn: 217015
2014-09-03 05:59:23 +00:00
Craig Topper 2b0fbe539e Use unique_ptr to manager FilterChooser ownership.
llvm-svn: 217014
2014-09-03 05:49:09 +00:00
Craig Topper 5c2b4ac045 Implement move constructor and remove copy constructor for Filter objects in FixedLenDecoderEmitter. Also remove unused copy constructor of FilterChooser.
llvm-svn: 217013
2014-09-03 05:49:07 +00:00
Eric Fiselier 99ff9c7bb2 Fix buffer overflow issue in valarray test
llvm-svn: 217012
2014-09-03 05:47:35 +00:00
Lang Hames 925e51b11d [MCJIT] Make llvm-rtdyld process eh_frame sections in -verify mode (accidentally
left out of r217010).

Also remove a crufty debugging output statement that was accidentally left in.

llvm-svn: 217011
2014-09-03 05:42:52 +00:00
Lang Hames 587ee6ab4f [MCJIT] Add a 'section_addr' builtin function to RuntimeDyldChecker.
The syntax of the new builtin is 'section_addr(<filename>, <section-name>)'
(similar to the stub_addr builtin, but without a symbol name). It returns the
base address of the given section in the given object file. This builtin makes
it possible to refer to the contents of sections that cannot contain symbols,
e.g. sections added by the linker itself, like __eh_frame.

llvm-svn: 217010
2014-09-03 05:01:46 +00:00
Justin Bogner 33a2a2ed1a test: Allow using clang -verify for failures rather than exit 1
Currently, failure tests work by checking that compilation exits 1.
This can lead to tests that fail for the wrong reason, so it'd be
preferable to convert them to check for specific errors.

This adds use_clang_verify parameter that runs failure tests using
clang's -verify flag. I'll convert some tests in subsequent commits,
and once all of the tests are converted we should key this on whether
cxx_under_test is clang.

I've also converted one of the unique.ptr tests, since it's the one
that motivated the idea of using clang -verify when possible in the
review of r216317.

llvm-svn: 217009
2014-09-03 04:32:08 +00:00
Richard Smith 73b21d8fa1 [modules] Use DeclContext::equals rather than == on DeclContext* when
determining whether a declaration is out of line, instead of assuming
that the semantic and lexical DeclContext will be the same declaration
whenever they're the same entity.

This fixes behavior of declarations within merged classes and enums.

llvm-svn: 217008
2014-09-03 02:33:22 +00:00
Juergen Ributzka a1148b2173 [FastISel][AArch64] Add target-dependent instruction selection for Add/Sub.
There is already target-dependent instruction selection support for Adds/Subs to
support compares and the intrinsics with overflow check. This takes advantage of
the existing infrastructure to also support Add/Sub, which allows the folding of
immediates, sign-/zero-extends, and shifts.

This fixes rdar://problem/18207316.

llvm-svn: 217007
2014-09-03 01:38:36 +00:00
Nick Kledzik 644b9ae736 Fix test case to match correct llvm-objdump output
llvm-svn: 217006
2014-09-03 01:34:58 +00:00
Nick Kledzik 1d1ac4b303 Replace printf with outs() <<
llvm-svn: 217005
2014-09-03 01:12:52 +00:00
Sanjay Patel a982d992f0 Change name of copyFlags() to copyIRFlags(). Add convenience method for logical 'and' of all flags. NFC.
Adding 'IR' to the names in an attempt to be less ambiguous about the flags we're dealing with here.

The 'and' method is needed by the SLPVectorizer (PR20802) and possibly other passes.

llvm-svn: 217004
2014-09-03 01:06:50 +00:00
Reid Kleckner 5420953303 Really fix the LLDB build
llvm-svn: 217003
2014-09-03 00:40:36 +00:00
Reid Kleckner 634ff8ec04 Remove the JIT from LLDB's dependencies to fix the build
llvm-svn: 217002
2014-09-03 00:35:03 +00:00
Jonathan Roelofs 112237b476 Fix yet another aspect of the build breakage caused by r216949
llvm-svn: 217001
2014-09-03 00:29:02 +00:00
Hal Finkel 85f2692d2f [CFLAA] Remove one final initializer list
Maybe MSVC will be happy now...

llvm-svn: 217000
2014-09-03 00:06:47 +00:00
Jonathan Roelofs ffa0895c3b Fix comment that was obsoleted by r216949
llvm-svn: 216999
2014-09-02 23:52:46 +00:00
Hal Finkel 1ae325f53d [CFLAA] And even more MSVC fixes
Remove a couple more initializer lists and constexpr dependencies.

llvm-svn: 216998
2014-09-02 23:50:01 +00:00
Jonathan Roelofs bb8fd4ccdb Fix build breakage introduced in r216949
The bug shows up on systems that `#define _POSIX_CLOCK_MONOTONIC 0` to indicate
that users of CLOCK_MONOTONIC must check sysconf at runtime.

See: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html
llvm-svn: 216997
2014-09-02 23:49:15 +00:00
Chris Bieneman 186e7d1700 Cleaning up remaining static initializers in Signals.inc
llvm-svn: 216996
2014-09-02 23:48:13 +00:00
Kostya Serebryany 3f0e834842 [asan] Make vector asan annotations exception-friendly
Fix vector asan annotations with RAII.
Add a test.
Also, remove one dead function.
Review: http://reviews.llvm.org/D4170

llvm-svn: 216995
2014-09-02 23:43:38 +00:00
Hal Finkel ca616acd73 [CFLAA] More cleanup for MSVC
Remove more initializer lists, etc.

llvm-svn: 216994
2014-09-02 23:29:48 +00:00
Pete Cooper c0eb15304e Tablegen scheduling models don't reference empty itineraries as of r216919, so don't emit the unused itinerary variables
llvm-svn: 216993
2014-09-02 23:23:34 +00:00
Jason Molenda 5de2e7cafb RegisterContextLLDB::InitializeNonZerothFrame had a bit of code to
detct unwind loops but there was a code path through there (using
architecture default unwind plans) that didn't do the check, and
could end up with an infinite loop unwind.  Move that code into a
separate method and call it from both places where it is needed.

Also remove the use of ABI::FunctionCallsChangeCFA in that check.
I thought about it a lot and none of the architecutres that we're
supporting today can have a looping CFA.

Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and
ABI::StackUsesFrames(), and the unwinder was the only reason
those methods exists, I removed them from the ABI and all its
plugins.

<rdar://problem/17364005> 

llvm-svn: 216992
2014-09-02 23:04:01 +00:00
Hal Finkel 8d1590dc4b [CFLAA] No initializer lists for MSVC
MSVC 2012 does not understand initializer lists; remove them.

llvm-svn: 216991
2014-09-02 22:52:30 +00:00
Renato Golin 1a89e06740 Missing test from r216989
llvm-svn: 216990
2014-09-02 22:46:18 +00:00
Renato Golin e07a22ac14 Only emit movw on ARMv6T2+
Fix PR18364.

Patch by Dimitry Andric.

llvm-svn: 216989
2014-09-02 22:45:13 +00:00
David Blaikie 196e323c01 unique_ptrify passing the TargetMachine to ExecutionEngine::MCJITCtor
llvm-svn: 216988
2014-09-02 22:41:07 +00:00
Hal Finkel 42b7e01f7c [CFLAA] Remove tautological comparison
Fixes this (the warning is right, the unsigned value is not negative):
lib/Analysis/StratifiedSets.h:689:53: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
  bool inbounds(StratifiedIndex N) const { return N >= 0 && N < Links.size(); }

llvm-svn: 216987
2014-09-02 22:36:58 +00:00
Eric Christopher af2b7dc522 Reinstate "Update for llvm API change.""
This reinstates r215113.

llvm-svn: 216986
2014-09-02 22:35:49 +00:00
Juergen Ributzka 53dbef6ef1 [FastISel][AArch64] Use the target-dependent selection code for shifts first.
This uses the target-dependent selection code for shifts first, which allows us
to create better code for shifts with immediates and sign-/zero-extend folding.

Vector type are not handled yet and the code falls back to target-independent
instruction selection for these cases.

This fixes rdar://problem/17907920.

llvm-svn: 216985
2014-09-02 22:33:57 +00:00
Juergen Ributzka 8a4b8bebdc [FastISel][AArch64] Use a new helper function to determine if a value type is supported. NFCI.
FastISel for AArch64 supports more value types than are actually legal. Use a
dedicated helper function to reflect this.

It is very similar to the isLoadStoreTypeLegal function, with the exception
that vector types are not supported yet.

llvm-svn: 216984
2014-09-02 22:33:53 +00:00
Sean Silva 888320e9fa Nuke MCAnalysis.
The code is buggy and barely tested. It is also mostly boilerplate.
(This includes MCObjectDisassembler, which is the interface to that
functionality)

Following an IRC discussion with Jim Grosbach, it seems sensible to just
nuke the whole lot of functionality, and dig it up from VCS if
necessary (I hope not!).

All of this stuff appears to have been added in a huge patch dump (look
at the timeframe surrounding e.g. r182628) where almost every patch
seemed to be untested and not reviewed before being committed.
Post-review responses to the patches were never addressed. I don't think
any of it would have passed pre-commit review.

I doubt anyone is depending on this, since this code appears to be
extremely buggy. In limited testing that Michael Spencer and I did, we
couldn't find a single real-world object file that wouldn't crash the
CFG reconstruction stuff. The symbolizer stuff has O(n^2) behavior and
so is not much use to anyone anyway. It seemed simpler to remove them as
a whole. Most of this code is boilerplate, which is the only way it was
able to scrape by 60% coverage.

HEADSUP: Modules folks, some files I nuked were referenced from
include/llvm/module.modulemap; I just deleted the references. Hopefully
that is the right fix (one was a FIXME though!).

llvm-svn: 216983
2014-09-02 22:32:20 +00:00
Eric Christopher 79cc1e3ae7 Reinstate "Nuke the old JIT."
Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reinstates commits r215111, 215115, 215116, 215117, 215136.

llvm-svn: 216982
2014-09-02 22:28:02 +00:00
Hal Finkel 981602a84c [CFLAA] LLVM_CONSTEXPR -> const
The number is just a constant, and this should make MSVC happy (or at least
happier).

llvm-svn: 216981
2014-09-02 22:26:06 +00:00
Robin Morisset df20586a7a [X86] Allow atomic operations using immediates to avoid using a register
The only valid lowering of atomic stores in the X86 backend was mov from
register to memory. As a result, storing an immediate required a useless copy
of the immediate in a register. Now these can be compiled as a simple mov.

Similarily, adding/and-ing/or-ing/xor-ing an
immediate to an atomic location (but through an atomic_store/atomic_load,
not a fetch_whatever intrinsic) can now make use of an 'add $imm, x(%rip)'
instead of using a register. And the same applies to inc/dec.

This second point matches the first issue identified in
  http://llvm.org/bugs/show_bug.cgi?id=17281

llvm-svn: 216980
2014-09-02 22:16:29 +00:00