Justin Bogner [Tue, 18 Nov 2014 23:03:14 +0000 (23:03 +0000)]
profile: Robustify instrprof tests
Change these tests not to rely on the exact metadata numbers the
profile data gets.
llvm-svn: 222279
Eric Fiselier [Tue, 18 Nov 2014 23:01:57 +0000 (23:01 +0000)]
Flush out test cases for tuples constructor SFINAE
llvm-svn: 222278
Enrico Granata [Tue, 18 Nov 2014 22:54:45 +0000 (22:54 +0000)]
Add the ability for the NSString and libc++ std::string formatters to retrieve uncapped data
llvm-svn: 222277
Enrico Granata [Tue, 18 Nov 2014 22:47:33 +0000 (22:47 +0000)]
Allow dsymutil to exists in a path with spaces in it
llvm-svn: 222276
Ismail Pazarbasi [Tue, 18 Nov 2014 22:45:59 +0000 (22:45 +0000)]
Revert "git-svn test commit"
This reverts commit
aa8d370ee798f75bc05a1ae9a240bc3e5b6870ac.
llvm-svn: 222275
Colin LeMahieu [Tue, 18 Nov 2014 22:45:47 +0000 (22:45 +0000)]
[Hexagon] Adding A2_and instruction.
llvm-svn: 222274
Ismail Pazarbasi [Tue, 18 Nov 2014 22:44:51 +0000 (22:44 +0000)]
git-svn test commit
llvm-svn: 222273
Chad Rosier [Tue, 18 Nov 2014 22:41:49 +0000 (22:41 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and arithmetic
shift-right for booleans (i1).
Arithmetic shift-right immediate with sign-/zero-extensions also works for
boolean values. Update the assert and the test cases to reflect that fact.
llvm-svn: 222272
Eric Christopher [Tue, 18 Nov 2014 22:40:27 +0000 (22:40 +0000)]
More override warning cleanup.
llvm-svn: 222271
Chad Rosier [Tue, 18 Nov 2014 22:38:42 +0000 (22:38 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and logical
shift-right for booleans (i1).
Logical shift-right immediate with sign-/zero-extensions also works for boolean
values. Update the assert and the test cases to reflect that fact.
llvm-svn: 222270
Eric Christopher [Tue, 18 Nov 2014 22:36:15 +0000 (22:36 +0000)]
Fix 80-column violations, trailing whitespace, comment text.
llvm-svn: 222269
Eric Christopher [Tue, 18 Nov 2014 22:36:11 +0000 (22:36 +0000)]
This test also requires an aarch64 target.
llvm-svn: 222268
Justin Bogner [Tue, 18 Nov 2014 22:17:30 +0000 (22:17 +0000)]
Fix an inaccurate comment
llvm-svn: 222267
Nick Kledzik [Tue, 18 Nov 2014 22:08:50 +0000 (22:08 +0000)]
[mach-o] for 32-bit arm, in -r mode support B (not BL) to undefined symbol
When fixing up BL instructions, the linker has to compare the thumbness of the
target to decide if the instruction needs to be converted to BLX. But with B
instruction there is no BX, so the linker asserts if the target is not the
same thumbness. This assert was firing in -r mode when the target was undefined
which it interpreted as being non-thumb.
Test case change is to add a B (in both thumb and arm code) to an undefined
symbol and round trip through -r mode.
llvm-svn: 222266
David Majnemer [Tue, 18 Nov 2014 22:06:45 +0000 (22:06 +0000)]
InstCombine: Fix another infinite loop caused by visitFPTrunc
We would attempt to replace an frem's operand with the same operand.
This would cause InstCombine to think real work was done, causing
InstCombine to enter an infinite loop.
This fixes the second part of PR21576.
llvm-svn: 222265
Fariborz Jahanian [Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)]
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://
18712242
llvm-svn: 222264
Colin LeMahieu [Tue, 18 Nov 2014 21:51:51 +0000 (21:51 +0000)]
[Hexagon] Adding A2_sub instruction
Renaming test files.
llvm-svn: 222263
Ismail Pazarbasi [Tue, 18 Nov 2014 21:46:06 +0000 (21:46 +0000)]
Find SWIG with CMake
SWIG is searched under certain paths within python script. CMake can
detect SWIG with find_package(SWIG). This is used iff user checks
LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION. If
buildSwigWrapperClasses.py does not receive swigExecutable argument,
then the script will use its current search implementation.
llvm-svn: 222262
David Majnemer [Tue, 18 Nov 2014 21:30:02 +0000 (21:30 +0000)]
Revert "Revert r222040 because of bot failure."
This reverts commit r222203, reverting r222040 didn't end up turning the
bot green.
llvm-svn: 222261
Eric Fiselier [Tue, 18 Nov 2014 21:28:49 +0000 (21:28 +0000)]
Add support for LLVM_USE_SANITIZER=Thread to test suite
llvm-svn: 222260
Eric Fiselier [Tue, 18 Nov 2014 21:26:45 +0000 (21:26 +0000)]
Add support for LLVM_USE_SANITIZER=Thread
llvm-svn: 222259
Eric Fiselier [Tue, 18 Nov 2014 21:23:38 +0000 (21:23 +0000)]
Add support for LLVM_USE_SANITIZER=Thread
Summary: This will help in testing libc++ and libc++abi with tsan.
Reviewers: samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D6283
llvm-svn: 222258
Juergen Ributzka [Tue, 18 Nov 2014 21:20:17 +0000 (21:20 +0000)]
[FastISel][AArch64] Follow-up fix for "Fix shift-immediate emission for "zero" shifts."
Shifts also perform sign-/zero-extends to larger types, which requires us to emit
an integer extend instead of a simple COPY.
Related to PR21594.
llvm-svn: 222257
Matt Arsenault [Tue, 18 Nov 2014 21:06:58 +0000 (21:06 +0000)]
R600/SI: Move SIFixSGPRCopies to inst selector passes
This should expose more of the actually used VALU
instructions to the machine optimization passes.
This also should help getting i1 handling into a better state.
For not entirly understood reasons, this fixes the split-scalar-i64-add.ll
test where a 64-bit add would only partially be moved to the VALU
resulting in use of undefined VCC.
llvm-svn: 222256
Juergen Ributzka [Tue, 18 Nov 2014 21:02:40 +0000 (21:02 +0000)]
[AArch64] Don't optimize all compare instructions.
"optimizeCompareInstr" converts compares (cmp/cmn) into plain sub/add
instructions when the flags are not used anymore. This conversion is valid for
most instructions, but not all. Some instructions that don't set the flags
(e.g. sub with immediate) can set the SP, whereas the flag setting version uses
the same encoding for the "zero" register.
Update the code to also check for the return register before performing the
optimization to make sure that a cmp doesn't suddenly turn into a sub that sets
the stack pointer.
I don't have a test case for this, because it isn't easy to trigger.
llvm-svn: 222255
Owen Anderson [Tue, 18 Nov 2014 20:50:19 +0000 (20:50 +0000)]
Fix an incorrect chain operand when expanding INSERT_VECTOR operations through the stack.
Patch by Daniil Troshkov!
llvm-svn: 222254
Tom Stellard [Tue, 18 Nov 2014 20:39:39 +0000 (20:39 +0000)]
R600/SI: Make sure resource descriptors are always stored in SGPRs
llvm-svn: 222253
Eric Fiselier [Tue, 18 Nov 2014 20:37:53 +0000 (20:37 +0000)]
[libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to suppress warnings.
Summary:
This patch mirrors the recent change to libc++ found here http://reviews.llvm.org/D6277.
This fixes PR20395 (http://llvm.org/bugs/show_bug.cgi?id=20395).
Reviewers: jroelofs, mclow.lists, danalbert
Reviewed By: danalbert
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6286
llvm-svn: 222252
Marshall Clow [Tue, 18 Nov 2014 20:37:47 +0000 (20:37 +0000)]
Marked LWG 2399 as complete. I committed a test for this earlier today.
llvm-svn: 222251
Chad Rosier [Tue, 18 Nov 2014 20:34:01 +0000 (20:34 +0000)]
[Reassociate] Use test cases that can actually be optimized to verify optional
flags are cleared. The reassociation pass was just reordering the leaf nodes
in the previous test cases.
llvm-svn: 222250
Colin LeMahieu [Tue, 18 Nov 2014 20:28:11 +0000 (20:28 +0000)]
[Hexagon] Converting from ADD_rr to A2_add which has encoding bits.
Adding test to show correct instruction selection and encoding.
llvm-svn: 222249
Chad Rosier [Tue, 18 Nov 2014 20:21:54 +0000 (20:21 +0000)]
[Reassociate] Rename local variable to not use same name as a member
variable. NFC.
llvm-svn: 222248
Juergen Ributzka [Tue, 18 Nov 2014 19:58:59 +0000 (19:58 +0000)]
[FastISel][AArch64] Fix shift-immediate emission for "zero" shifts.
This change emits a COPY for a shift-immediate with a "zero" shift value.
This fixes PR21594 where we emitted a shift instruction with an incorrect
immediate operand.
llvm-svn: 222247
Greg Clayton [Tue, 18 Nov 2014 19:45:23 +0000 (19:45 +0000)]
Fixed the stop hook test after recent editline changes.
llvm-svn: 222246
Ed Maste [Tue, 18 Nov 2014 19:30:13 +0000 (19:30 +0000)]
Add decorator for test that fails on FreeBSD after editline rework
llvm.org/21599
llvm-svn: 222245
Jozef Kolek [Tue, 18 Nov 2014 19:20:34 +0000 (19:20 +0000)]
Test commit to verify that commit access works.
llvm-svn: 222244
Jim Ingham [Tue, 18 Nov 2014 19:12:13 +0000 (19:12 +0000)]
Patch from dawn@burble.org to make the --silent-run do what it says, not the opposite of what it says.
llvm-svn: 222243
Marshall Clow [Tue, 18 Nov 2014 18:14:53 +0000 (18:14 +0000)]
Add a test for LWG issue #2399. We already implement this, but now we have a test as well.
llvm-svn: 222242
Philip Reames [Tue, 18 Nov 2014 17:46:32 +0000 (17:46 +0000)]
Tweak EarlyCSE to recognize series of dead stores
EarlyCSE is giving up on the current instruction immediately when it recognizes that the current instruction makes a previous store trivially dead. There's no reason to do this. Once the previous store has been deleted, it's perfectly legal to remember the value of the current store (for value forwarding) and the fact the store occurred (it could be dead too!).
Reviewed by: Hal
Differential Revision: http://reviews.llvm.org/D6301
llvm-svn: 222241
Marshall Clow [Tue, 18 Nov 2014 17:35:16 +0000 (17:35 +0000)]
Update status of LWG issues 2340, 2396 and 2401. In all three cases, these are things that we already do.
llvm-svn: 222240
Manman Ren [Tue, 18 Nov 2014 16:45:34 +0000 (16:45 +0000)]
Remove triple in testing case to recover an arm bot.
llvm-svn: 222239
Marshall Clow [Tue, 18 Nov 2014 16:15:00 +0000 (16:15 +0000)]
Since Eric poisoned the comma operator on all our test iterators, we no longer need 'comma_iterator'. Remove it from the test suite.
llvm-svn: 222238
NAKAMURA Takumi [Tue, 18 Nov 2014 15:05:01 +0000 (15:05 +0000)]
OMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]
llvm-svn: 222237
Evgeniy Stepanov [Tue, 18 Nov 2014 14:28:57 +0000 (14:28 +0000)]
[asan] Re-enable zero_page_pc test on Android.
It's not failing anymore. Not sure what has changed (the bot was down for a
long time), but lets keep it this way.
llvm-svn: 222236
Jeroen Ketema [Tue, 18 Nov 2014 14:19:27 +0000 (14:19 +0000)]
Don't include <stddef.h>
Including a standard or system header isn't allowed in OpenCL.
The type "size_t" needs to be explicitely defined now.
v2: Use __SIZE_TYPE__ instead of unsigned int.
v3: Define ptrdiff_t and NULL.
Patch-by: Jean-Sébastien Pédron
Reviewed-by: Jeroen Ketema
Reviewed-by: Jan Vesely
llvm-svn: 222235
Evgeniy Stepanov [Tue, 18 Nov 2014 14:04:12 +0000 (14:04 +0000)]
[asan] Fix CMake CMP0046 warning in standalone build.
Make FileCheck an "imported dependency" in standalone build.
llvm-svn: 222234
NAKAMURA Takumi [Tue, 18 Nov 2014 12:23:19 +0000 (12:23 +0000)]
CallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.
MSVC Runtime detects "Assertion failed: vector iterator not incrementable"
llvm-svn: 222233
Evgeniy Stepanov [Tue, 18 Nov 2014 10:33:15 +0000 (10:33 +0000)]
[msan] Remove MSanDR and supporting code.
MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.
This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.
llvm-svn: 222232
Alexey Bataev [Tue, 18 Nov 2014 10:14:22 +0000 (10:14 +0000)]
[OPENMP] Additional processing of 'omp atomic read' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it.
llvm-svn: 222231
David Majnemer [Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)]
InstCombine: Fold away tautological masked compares
It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.
While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.
llvm-svn: 222230
David Majnemer [Tue, 18 Nov 2014 09:31:36 +0000 (09:31 +0000)]
InstCombine: Clean up foldLogOpOfMaskedICmps
No functional change intended.
llvm-svn: 222229
Dmitry Vyukov [Tue, 18 Nov 2014 06:44:43 +0000 (06:44 +0000)]
tsan: add description of AcquireGlobal function
llvm-svn: 222228
Justin Hibbits [Tue, 18 Nov 2014 06:17:20 +0000 (06:17 +0000)]
Add PIC-level support to Clang.
Summary:
This distinguishes between -fpic and -fPIC now, with the additions in LLVM for
PIC level support.
Test Plan: No regressions
Reviewers: echristo, rafael
Reviewed By: rafael
Subscribers: rnk, emaste, llvm-commits
Differential Revision: http://reviews.llvm.org/D5400
llvm-svn: 222227
Jason Molenda [Tue, 18 Nov 2014 05:57:42 +0000 (05:57 +0000)]
Fix up the code in the FuncUnwinders class that
retrieves the personality routine addr and the
LSDA addr. Don't bother checking with the
"non-call site" unwind plan - this kind of
information is only going to come from the
call site unwind plan.
llvm-svn: 222226
Jason Molenda [Tue, 18 Nov 2014 05:43:11 +0000 (05:43 +0000)]
Add documentation for the SBTarget::ReadInstructions and
SBTarget::GetInstructions APIs so it's a little clearer to
understand which should be used.
<rdar://problem/
18787018>
llvm-svn: 222225
Argyrios Kyrtzidis [Tue, 18 Nov 2014 05:24:18 +0000 (05:24 +0000)]
[ASTReader] Add a convenience function to retrieve all the input files of a module file.
llvm-svn: 222224
Justin Bogner [Tue, 18 Nov 2014 05:22:39 +0000 (05:22 +0000)]
docs: Modernize some examples in WritingAnLLVMPass
llvm-svn: 222223
Justin Bogner [Tue, 18 Nov 2014 05:00:52 +0000 (05:00 +0000)]
docs: Fix a couple of typo-ish errors in WritingAnLLVMPass
- Make CallGraphSCCPass's paragraph about doFinalization refer to
runOnSCC instead of runOnFunction, since that's what it's about.
- Fix a reference in the FunctionPass paragraph.
llvm-svn: 222222
Jason Molenda [Tue, 18 Nov 2014 04:57:28 +0000 (04:57 +0000)]
Make the mutex ivar in Unwind recursive so we don't have a thread
deadlocking when we have the base Unwind class and the HistoryUnwind
subclass both trying to acquire the lock on the same thread to clear
their respective ivar state.
<rdar://problem/
18986350>
llvm-svn: 222221
Frederic Riss [Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)]
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.
For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.
(Another user will be the debug info generation for argument default values
that I need to resurect).
Differential Revision: http://reviews.llvm.org/D6173
llvm-svn: 222220
Frederic Riss [Tue, 18 Nov 2014 03:40:46 +0000 (03:40 +0000)]
[DebugInfo] Move collection of various function/var decl properties into helper functions.
NFC. Helpers to be re-used in upcoming commit.
llvm-svn: 222219
David Majnemer [Tue, 18 Nov 2014 03:06:52 +0000 (03:06 +0000)]
Update to match LLVM r222216
llvm-svn: 222218
Frederic Riss [Tue, 18 Nov 2014 02:46:11 +0000 (02:46 +0000)]
Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE.
Usually global variables are in a retain list and instanciated before
any call to constructImportedEntityDIE is made. This isn't true for
forward declarations though.
The testcase for this change is generated by a clang patched to emit
such forward declarations (patch at http://reviews.llvm.org/D6173
which will land soon). The updated testcase tests more than just
global variables, it now tests every type of 'using' clause we
support.
llvm-svn: 222217
David Majnemer [Tue, 18 Nov 2014 02:45:28 +0000 (02:45 +0000)]
llvm-readobj: Don't print the Characteristics field as the Subsystem
We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.
llvm-svn: 222216
Hans Wennborg [Tue, 18 Nov 2014 02:37:11 +0000 (02:37 +0000)]
SimplifyCFG: Range'ify some for-loops. No functional change.
llvm-svn: 222215
Jason Molenda [Tue, 18 Nov 2014 02:27:42 +0000 (02:27 +0000)]
Read the LSDA and Personality Routine function address out of the
eh_frame data. These two pieces of information are used in the
process of exception handler unwinding on SysV ABI systems.
This patch reads the data from the eh_frame section
(DWARFCallFrameInfo.cpp), allows for it to be saved & read out
of a given UnwindPlan (UnwindPlan.h, UnwindPlan.cpp) - as well
as printing the information in the UnwindPlan::Dump method - and
adds methods to the FuncUnwinders object so that higher levels
can query if a given function has an LSDA / personality routine
defined.
It's only lightly tested, but seems to be working correctly as long
as your have this information in eh_frame. Does not address getting
this information from compact unwind yet on Darwin systems.
<rdar://problem/
18742797>
llvm-svn: 222214
David Majnemer [Tue, 18 Nov 2014 02:20:58 +0000 (02:20 +0000)]
IndVarSimplify: Allow LFTR to fire more often
I added a pessimization in r217102 to prevent miscompiles when the
incremented induction variable was used in a comparison; it would be
poison.
Try to use the incremented induction variable more often when we can be
sure that the increment won't end in poison.
Differential Revision: http://reviews.llvm.org/D6222
llvm-svn: 222213
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 02:20:29 +0000 (02:20 +0000)]
IR: Sink MDNode::Hash down to GenericMDNode::Hash
Part of PR21532.
llvm-svn: 222212
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 01:56:14 +0000 (01:56 +0000)]
IR: Move MDNode operands from the back to the front
Having the operands at the back prevents subclasses from safely adding
fields. Move them to the front.
Instead of replicating the custom `malloc()`, `free()` and `DestroyFlag`
logic that was there before, overload `new` and `delete`.
I added calls to a new `GenericMDNode::dropAllReferences()` in
`LLVMContextImpl::~LLVMContextImpl()`. There's a maze of callbacks
happening during teardown, and this resolves them before we enter
the destructors.
Part of PR21532.
llvm-svn: 222211
Manman Ren [Tue, 18 Nov 2014 01:49:06 +0000 (01:49 +0000)]
Update testing case that was accidently duplicated.
llvm-svn: 222210
Michael J. Spencer [Tue, 18 Nov 2014 01:26:46 +0000 (01:26 +0000)]
Fix covered switch warning
llvm-svn: 222209
Michael J. Spencer [Tue, 18 Nov 2014 01:14:25 +0000 (01:14 +0000)]
Support ELF files of unknown type.
llvm-svn: 222208
Greg Clayton [Tue, 18 Nov 2014 00:43:17 +0000 (00:43 +0000)]
Have CommandObjectCommandsAddRegex inherit from IOHandlerDelegateMultiline so it will not immediately terminate after the first regular expression in "command regex <name>" commands.
Fixed the prompt to not include non-printable characters as it was hosing up the prompt when you ran "command regex foo" and entered multi-line editing mode.
Fixed error strings to include more complete descriptions when bad regular expressions are entered.
Removed the old IOHandlerLinesUpdated function as it is no longer needed (inheriting from IOHandlerDelegateMultiline takes care of what this function used to do).
llvm-svn: 222207
Greg Clayton [Tue, 18 Nov 2014 00:39:31 +0000 (00:39 +0000)]
Fixed a broken test suite test after recent editline merges.
The problem is that editline currently is trying to be smart when we paste things into a terminal window. It detects that input is pending and multi-line input is accepted as long as there is anything pending.
So if you open lldb and paste the text between the quotes:
"command regex carp
s/^$/help/
carp
"
We still still be stuck in the "command regex" multi-line input reader as it will have all three lines:
"s/^$/help/
carp
"
The true fix for this is something Kate Stone will soon work on:
- multi-line input readers must opt into this paste/pending input feature ("expr" will opt into it, all other commands won't)
- If we are in a multi-line input reader that requests this and stuff is pasted, then it will do what it does today
- if we start in a IOHandler that doesn't need/want pending input and text is pasted, and we transistion to a IOHandler that does want this functionality, then disable the pending input. Example text would be:
"frame variable
thread backtrace
expr
for (int i=0;i<10;++i)
(int)printf("i = %i\n", i);
frame select 0
"
When we push the expression multi-line reader we would disable the pending input because we had pending input _before_ we entered "expr".
If we did this first:
(lldb) expr
Then we pasted:
"void foo()
{
}
void bar()
{
}
"
Then we would allow the pending input to not look for an empty line to terminate the expression. We filed radar
19008425 to track fixing this issue.
llvm-svn: 222206
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 00:37:17 +0000 (00:37 +0000)]
IR: Split MDNode into GenericMDNode and MDNodeFwdDecl
Split `MDNode` into two classes:
- `GenericMDNode`, which is uniquable (and for now, always starts
uniqued). Once `Metadata` is split from the `Value` hierarchy, this
class will lose the ability to RAUW itself.
- `MDNodeFwdDecl`, which is used for the "temporary" interface, is
never uniqued, and isn't managed by `LLVMContext` at all.
I've left most of the guts in `MDNode` for now, but I'll incrementally
move things to the right places (or delete the functionality, as
appropriate).
Part of PR21532.
llvm-svn: 222205
Justin Bogner [Tue, 18 Nov 2014 00:34:46 +0000 (00:34 +0000)]
InstrProf: Don't emit coverage for uninstantiated templates
We include unused functions and methods in -fcoverage-mapping so that
we can differentiate between uninstrumented and unused. This can cause
problems for uninstantiated templates though, since they may involve
an incomplete type that can't be mangled. This shows up in things like
libc++'s <unordered_map> and makes coverage unusable.
Avoid the issue by skipping uninstantiated methods of a templated
class.
llvm-svn: 222204
Manman Ren [Tue, 18 Nov 2014 00:33:22 +0000 (00:33 +0000)]
Revert r222040 because of bot failure.
http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.
llvm-svn: 222203
Nick Kledzik [Tue, 18 Nov 2014 00:30:29 +0000 (00:30 +0000)]
[mach-o] zero-fill sections have no file offset
In mach-o, sections of type S_ZEROFILL are special cased and to always have
their section.offset field be zero.
llvm-svn: 222202
Nick Kledzik [Tue, 18 Nov 2014 00:30:25 +0000 (00:30 +0000)]
[mach-o] extract atom alignment information from mach-o files
llvm-svn: 222201
Nick Kledzik [Tue, 18 Nov 2014 00:30:22 +0000 (00:30 +0000)]
[mach-o] enhance arm64 reloc parser to support local pointer relocations
The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references. But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.
Add test case that the r_extern=0 relocation round trips.
llvm-svn: 222200
Nick Kledzik [Tue, 18 Nov 2014 00:30:20 +0000 (00:30 +0000)]
[mach-o] fix typos. No function change
llvm-svn: 222199
Nick Kledzik [Tue, 18 Nov 2014 00:30:17 +0000 (00:30 +0000)]
[mach-o] enhance arm64 reloc parser to support local pointer relocations
The arm64 assembler almost always uses r_extern=1 relocations in which the
r_symbolnum field is the index of the symbol the relocation references. But
sometimes it will set r_extern=0 in which case the linker needs to read the
content of the reloction to determine the target.
Add test case that the r_extern=0 relocation round trips.
llvm-svn: 222198
Nick Kledzik [Tue, 18 Nov 2014 00:30:14 +0000 (00:30 +0000)]
[mach-o] fix typos. No function change
llvm-svn: 222197
Manman Ren [Tue, 18 Nov 2014 00:29:32 +0000 (00:29 +0000)]
Debug Info: context field of a global variable is DIScopeRef.
Paired commit with r222195.
llvm-svn: 222196
Manman Ren [Tue, 18 Nov 2014 00:29:08 +0000 (00:29 +0000)]
Debug Info: In DIBuilder, the context field of a global variable is updated to
use DIScopeRef.
A paired commit at clang will follow to show cases where we will use an
identifer for the context of a global variable.
rdar://
18958417
llvm-svn: 222195
John McCall [Tue, 18 Nov 2014 00:19:01 +0000 (00:19 +0000)]
Fix an assertion when ending a function definition.
The bug is that ExprCleanupObjects isn't always empty
in a fresh evaluation context. New evaluation contexts just
track the current depth of the stack.
The assertion will misfire whenever we finish processing
a function body inside an expression that contained an earlier
block literal with non-trivial captures. That's actually
a lot less likely than you'd think, though, because it has
to be a real function declaration, not just another block.
Mixed block/lambda code would work, as would a template
instantiation or a local class definition.
The code works correctly if the assertion is disabled.
rdar://
16356628
llvm-svn: 222194
Alexander Kornienko [Mon, 17 Nov 2014 23:46:02 +0000 (23:46 +0000)]
Make DiagnosticsEngine::takeClient return std::unique_ptr<>
Summary:
Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated
callers to store conditional ownership using a pair of pointer and unique_ptr
instead of a pointer + bool. Updated code that temporarily registers clients to
use the non-owning registration (+ removed extra calls to takeClient).
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6294
llvm-svn: 222193
Reid Kleckner [Mon, 17 Nov 2014 23:36:45 +0000 (23:36 +0000)]
Handle use of default member initializers before end of outermost class
Specifically, when we have this situation:
struct A {
template <typename T> struct B {
int m1 = sizeof(A);
};
B<int> m2;
};
We can't parse m1's initializer eagerly because we need A to be
complete. Therefore we wait until the end of A's class scope to parse
it. However, we can trigger instantiation of B before the end of A,
which will attempt to instantiate the field decls eagerly, and it would
build a bad field decl instantiation that said it had an initializer but
actually lacked one.
Fixed by deferring instantiation of default member initializers until
they are needed during constructor analysis. This addresses a long
standing FIXME in the code.
Fixes PR19195.
Reviewed By: rsmith
Differential Revision: http://reviews.llvm.org/D5690
llvm-svn: 222192
Duncan P. N. Exon Smith [Mon, 17 Nov 2014 23:28:21 +0000 (23:28 +0000)]
IR: Simplify uniquing for MDNode
Change uniquing from a `FoldingSet` to a `DenseSet` with custom
`DenseMapInfo`. Unfortunately, this doesn't save any memory, since
`DenseSet<T>` is a simple wrapper for `DenseMap<T, char>`, but I'll come
back to fix that later.
I used the name `GenericDenseMapInfo` to the custom `DenseMapInfo` since
I'll be splitting `MDNode` into two classes soon: `MDNodeFwdDecl` for
temporaries, and `GenericMDNode` for everything else.
I also added a non-debug-info reduced version of a type-uniquing test
that started failing on an earlier draft of this patch.
Part of PR21532.
llvm-svn: 222191
Enrico Granata [Mon, 17 Nov 2014 23:14:11 +0000 (23:14 +0000)]
Fix a problem where the StringPrinter could be mistaking an empty string for a read error, and reporting spurious 'unable to read data' messages. rdar://
19007243
llvm-svn: 222190
Enrico Granata [Mon, 17 Nov 2014 23:06:20 +0000 (23:06 +0000)]
Add APIs on SBFunction and SBCompileUnit to inquire about the language type that the function/compile unit is defined in
llvm-svn: 222189
Reid Kleckner [Mon, 17 Nov 2014 22:55:59 +0000 (22:55 +0000)]
Revert "ADT: correctly report isMSVCEnvironment for windows itanium"
This reverts commit r222180.
llvm-svn: 222188
David Blaikie [Mon, 17 Nov 2014 22:55:41 +0000 (22:55 +0000)]
Revert "Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member."
This reverts commit r222183.
Broke on the MSVC buildbots due to MSVC not producing default move
operations - I'd fix it immediately but just broke my build system a
bit, so backing out until I have a chance to get everything going again.
llvm-svn: 222187
Eric Christopher [Mon, 17 Nov 2014 22:55:13 +0000 (22:55 +0000)]
Fix override/virtual warnings.
llvm-svn: 222186
Zachary Turner [Mon, 17 Nov 2014 22:42:57 +0000 (22:42 +0000)]
Change HostThread::GetNativeThread() to return a derived reference.
Previously using HostThread::GetNativeThread() required an ugly
cast to most-derived type. This solves the issue by simply returning
the derived type directly.
llvm-svn: 222185
Oleksiy Vyalov [Mon, 17 Nov 2014 22:42:28 +0000 (22:42 +0000)]
Fix broken NativeProcessLinux.cpp after signature change of ResolveExecutable.
llvm-svn: 222184
David Blaikie [Mon, 17 Nov 2014 22:16:55 +0000 (22:16 +0000)]
Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member.
The next step is to actually use unique_ptr in TreePatternNode's
Children vector. That will be more intrusive, and may not work,
depending on exactly how these things are handled (I have a bad
suspicion things are shared more than they should be, making this more
DAG than tree - but if it's really a tree, unique_ptr should suffice)
llvm-svn: 222183
Oleksiy Vyalov [Mon, 17 Nov 2014 22:16:42 +0000 (22:16 +0000)]
Fix broken Linux build after signature change of ResolveExecutable.
llvm-svn: 222182
Peter Collingbourne [Mon, 17 Nov 2014 22:16:15 +0000 (22:16 +0000)]
CMake: Use the new USES_TERMINAL option for test suite targets when available.
llvm-svn: 222181
Saleem Abdulrasool [Mon, 17 Nov 2014 22:13:26 +0000 (22:13 +0000)]
ADT: correctly report isMSVCEnvironment for windows itanium
The itanium environment on Windows uses MSVC and is a MSVC environment. Report
this correctly.
llvm-svn: 222180