Enrico Granata [Wed, 15 Oct 2014 20:18:58 +0000 (20:18 +0000)]
The NSDate formatter should use GMT instead of the local timezone. Fixes rdar://
13416848
llvm-svn: 219841
Alexey Samsonov [Wed, 15 Oct 2014 19:57:45 +0000 (19:57 +0000)]
Move SanitizerBlacklist to clangBasic. NFC.
This change moves SanitizerBlacklist.h from lib/CodeGen
to public Clang headers in include/clang/Basic. SanitizerBlacklist
is currently only used in CodeGen to decide which functions/modules
should be instrumented, but this will soon change as ASan will
optionally modify class layouts during AST construction
(http://reviews.llvm.org/D5687). We need blacklist machinery
to be available at this point.
llvm-svn: 219840
Joerg Sonnenberger [Wed, 15 Oct 2014 19:52:03 +0000 (19:52 +0000)]
As requested by Matt Thomas, use long long for intmax_t and int64_t on
PPC64/NetBSD.
llvm-svn: 219839
Joerg Sonnenberger [Wed, 15 Oct 2014 19:47:15 +0000 (19:47 +0000)]
Set ABI and DescriptionString first to reduce OS specific logic.
Use switch for FreeBSD check to allow easier extension.
llvm-svn: 219838
Sid Manning [Wed, 15 Oct 2014 19:32:52 +0000 (19:32 +0000)]
Wrong attribute. LLVM_ATTRIBUTE_USED not LLVM_ATTRIBUTE_UNUSED
llvm-svn: 219837
Tim Northover [Wed, 15 Oct 2014 19:32:21 +0000 (19:32 +0000)]
[mach-o] make __unwind_info defer to __eh_frame when necessary.
Not all situations are representable in the compressed __unwind_info format,
and when this happens the entry needs to point to the more general __eh_frame
description.
Just x86_64 implementation for now.
rdar://problem/
18208653
llvm-svn: 219836
Rafael Espindola [Wed, 15 Oct 2014 19:30:18 +0000 (19:30 +0000)]
Allow forward references to section symbols.
llvm-svn: 219835
Sanjoy Das [Wed, 15 Oct 2014 19:25:28 +0000 (19:25 +0000)]
Teach ScalarEvolution to sharpen range information.
If x is known to have the range [a, b) in a loop predicated by (icmp
ne x, a), its range can be sharpened to [a + 1, b). Get
ScalarEvolution and hence IndVars to exploit this fact.
This change triggers an optimization to widen-loop-comp.ll, so it had
to be edited to get it to pass.
phabricator: http://reviews.llvm.org/D5639
llvm-svn: 219834
Sid Manning [Wed, 15 Oct 2014 19:24:14 +0000 (19:24 +0000)]
Add LLVM_ATTRIBUTE_UNUSED to function currently just used in an assert
Fixes break when -Wunused-function is used.
llvm-svn: 219833
Akira Hatanaka [Wed, 15 Oct 2014 19:05:50 +0000 (19:05 +0000)]
InstCombine: Narrow switch instructions using known bits.
Truncate the operands of a switch instruction to a narrower type if the upper
bits are known to be all ones or zeros.
rdar://problem/
17720004
llvm-svn: 219832
Juergen Ributzka [Wed, 15 Oct 2014 18:58:07 +0000 (18:58 +0000)]
Reapply "[FastISel][AArch64] Add custom lowering for GEPs."
This is mostly a copy of the existing FastISel GEP code, but we have to
duplicate it for AArch64, because otherwise we would bail out even for simple
cases. This is because the standard fastEmit functions don't cover MUL at all
and ADD is lowered very inefficientily.
The original commit had a bug in the add emit logic, which has been fixed.
llvm-svn: 219831
Juergen Ributzka [Wed, 15 Oct 2014 18:58:02 +0000 (18:58 +0000)]
[FastISel][AArch64] Factor out add with immediate emission into a helper function. NFC.
Simplify add with immediate emission by factoring it out into a helper function.
llvm-svn: 219830
Rafael Espindola [Wed, 15 Oct 2014 18:55:30 +0000 (18:55 +0000)]
Correctly handle references to section symbols.
When processing assembly like
.long .text
we were creating a new undefined symbol .text. GAS on the other hand would
handle that as a reference to the .text section.
This patch implements that by creating the section symbols earlier so that
they are visible during asm parsing.
The patch also updates llvm-readobj to print the symbol number in the relocation
dump so that the test can differentiate between two sections with the same name.
llvm-svn: 219829
Enrico Granata [Wed, 15 Oct 2014 18:42:45 +0000 (18:42 +0000)]
Make this test case more resilient in the face of line-table and inlining changes
llvm-svn: 219828
Will Schmidt [Wed, 15 Oct 2014 18:34:04 +0000 (18:34 +0000)]
[compiler-rt] Enable ASAN for powerpc64le-linux
Whitespace update for lint check by myself (Will). Otherwise code and comments by Peter Bergner, as previously seen on llvm-commits.
The following patch gets ASAN somewhat working on powerpc64le-linux.
It currently assumes the LE kernel uses 46-bit addressing, which is
true, but it doesn't solve the case for BE where it may be 44 or
46 bits. That can be fixed with a follow on patch.
There are some test suite fails even with this patch that I haven't had
time to solve yet, but this is better than the state it is in now.
The limited debugging of those test suite fails seems to show that the
address map for 46-bit addressing has changed and so we'll need to
modify the shadow memory location slightly. Again, that can be fixed
with a follow on patch.
llvm-svn: 219827
Sid Manning [Wed, 15 Oct 2014 18:27:40 +0000 (18:27 +0000)]
Enable the instruction printer in HexagonMCTargetDesc
This adds the MCInstPrinter to the LLVMHexagonDesc library and removes
the dependency LLVMHexagonAsmPrinter had on LLVMHexagonDesc. This is
a prerequisite needed by the disassembler.
Phabricator Revision: http://reviews.llvm.org/D5734
llvm-svn: 219826
Alexey Samsonov [Wed, 15 Oct 2014 18:23:57 +0000 (18:23 +0000)]
[CMake] Cleanup CMake rules after r219302. NFC.
llvm-svn: 219825
Tim Northover [Wed, 15 Oct 2014 18:19:31 +0000 (18:19 +0000)]
[macho] Create references from __eh_frame FDEs to their function.
We'll also need references back to the CIE eventually, but for now making sure
we can work out what an FDE is referring to is enough.
The actual kind of reference needs to be different between architectures,
probably because of MachO's chronic shortage of relocation types but I don't
really want to know in case I find out something that distresses me even more.
rdar://problem/
18208653
llvm-svn: 219824
Matt Arsenault [Wed, 15 Oct 2014 18:06:43 +0000 (18:06 +0000)]
R600/SI: Also try to use 0 base for misaligned 8-byte DS loads.
llvm-svn: 219823
Alexey Samsonov [Wed, 15 Oct 2014 18:04:42 +0000 (18:04 +0000)]
[UBSan] [MIPS] Adding support of UBSan for mipsel arch
Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH
Reviewers: rsmith, kcc, dsanders, petarj, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani
Differential Revision: http://reviews.llvm.org/D5750
llvm-svn: 219822
Greg Clayton [Wed, 15 Oct 2014 18:03:59 +0000 (18:03 +0000)]
Allow ThreadLauncher::LaunchThread() to specify a minimum stack byte size when launching threads.
This defaults to zero, which means to use the system default.
NOTE: Windows will need to implement this.
<rdar://problem/
18644448>
llvm-svn: 219821
Kaelyn Takata [Wed, 15 Oct 2014 18:03:26 +0000 (18:03 +0000)]
Add llvm_unreachable after switch to avoid warnings about a missing
return.
Forgot to add this in r219818.
llvm-svn: 219820
Matt Arsenault [Wed, 15 Oct 2014 17:58:34 +0000 (17:58 +0000)]
R600: Fix miscompiles when BFE has multiple uses
SimplifyDemandedBits would break the other uses of the operand.
llvm-svn: 219819
Kaelyn Takata [Wed, 15 Oct 2014 17:46:18 +0000 (17:46 +0000)]
Drop unneccessary default case from switch introduced in r219809
This silences:
../tools/clang/tools/libclang/CIndex.cpp:6451:3: warning: default label
in switch which covers all enumeration values [-Wcovered-switch-default]
llvm-svn: 219818
Sanjay Patel [Wed, 15 Oct 2014 17:45:13 +0000 (17:45 +0000)]
correct const-ness with auto and dyn_cast
1. Use const with autos.
2. Don't bother with explicit const in cast ops because they do it automagically.
Thanks, David B. / Aaron B. / Reid K.
llvm-svn: 219817
Hal Finkel [Wed, 15 Oct 2014 17:35:01 +0000 (17:35 +0000)]
[SLPVectorize] Basic ephemeral-value awareness
The SLP vectorizer should not vectorize ephemeral values. These are used to
express information to the optimizer, and vectorizing them does not lead to
faster code (because the ephemeral values are dropped prior to code generation,
vectorized or not), and obscures the information the instructions are
attempting to communicate (the logic that interprets the arguments to
@llvm.assume generically does not understand vectorized conditions).
Also, uses by ephemeral values are free (because they, and the necessary
extractelement instructions, will be dropped prior to code generation).
llvm-svn: 219816
Hal Finkel [Wed, 15 Oct 2014 17:34:48 +0000 (17:34 +0000)]
Treat the WorkSet used to find ephemeral values as double-ended
We need to make sure that we visit all operands of an instruction before moving
deeper in the operand graph. We had been pushing operands onto the back of the work
set, and popping them off the back as well, meaning that we might visit an
instruction before visiting all of its uses that sit in between it and the call
to @llvm.assume.
To provide an explicit example, given the following:
%q0 = extractelement <4 x float> %rd, i32 0
%q1 = extractelement <4 x float> %rd, i32 1
%q2 = extractelement <4 x float> %rd, i32 2
%q3 = extractelement <4 x float> %rd, i32 3
%q4 = fadd float %q0, %q1
%q5 = fadd float %q2, %q3
%q6 = fadd float %q4, %q5
%qi = fcmp olt float %q6, %q5
call void @llvm.assume(i1 %qi)
%q5 is used by both %qi and %q6. When we visit %qi, it will be marked as
ephemeral, and we'll queue %q6 and %q5. %q6 will be marked as ephemeral and
we'll queue %q4 and %q5. Under the old system, we'd then visit %q4, which
would become ephemeral, %q1 and then %q0, which would become ephemeral as
well, and now we have a problem. We'd visit %rd, but it would not be marked as
ephemeral because we've not yet visited %q2 and %q3 (because we've not yet
visited %q5).
This will be covered by a test case in a follow-up commit that enables
ephemeral-value awareness in the SLP vectorizer.
llvm-svn: 219815
Zachary Turner [Wed, 15 Oct 2014 17:27:11 +0000 (17:27 +0000)]
Remove some unnecessary headers from Host.cpp
After the recent migration of code out of Host.cpp, many
unnecessary headers were still being included. This prunes the
include list down to only what is still necessary.
llvm-svn: 219814
Reid Kleckner [Wed, 15 Oct 2014 17:22:56 +0000 (17:22 +0000)]
Revert "Fix late template parsing leak with incremental processing"
This reverts commit r219810.
The test suite appears broken.
llvm-svn: 219813
Anton Yartsev [Wed, 15 Oct 2014 17:13:02 +0000 (17:13 +0000)]
[analyzer] Perl scripts are run differently from makefiles. Sometimes additional utilities are involved, e.g. 'env' utility that present in MSYS but is missing in MinGW. The patch unifies launch of "c++-analyzer" and "ccc-analyzer".
llvm-svn: 219812
Derek Schuff [Wed, 15 Oct 2014 17:10:04 +0000 (17:10 +0000)]
[MC] Make bundle alignment mode setting idempotent and support nested bundles
Summary:
Currently an error is thrown if bundle alignment mode is set more than once
per module (either via the API or the .bundle_align_mode directive). This
change allows setting it multiple times as long as the alignment doesn't
change.
Also nested bundle_lock groups are currently not allowed. This change allows
them, with the effect that the group stays open until all nests are exited,
and if any of the bundle_lock directives has the align_to_end flag, the
group becomes align_to_end.
These changes make the bundle aligment simpler to use in the compiler, and
also better match the corresponding support in GNU as.
Reviewers: jvoung, eliben
Differential Revision: http://reviews.llvm.org/D5801
llvm-svn: 219811
Reid Kleckner [Wed, 15 Oct 2014 17:08:33 +0000 (17:08 +0000)]
Fix late template parsing leak with incremental processing
Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing. Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed. Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.
Patch by Brad King!
llvm-svn: 219810
Argyrios Kyrtzidis [Wed, 15 Oct 2014 17:05:31 +0000 (17:05 +0000)]
[libclang] Add function to retrieve storage class in libclang.
Patch by guibufolo!
llvm-svn: 219809
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 17:01:28 +0000 (17:01 +0000)]
DI: Make comments "brief"-er, NFC
Follow-up to r219801. Post-commit review pointed out that all comments
require a `\brief` description [1], so I converted many and recrafted a
few to be briefer or to include a brief intro. (If I'm going to clean
them up, I should do it right!)
[1]: http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments
llvm-svn: 219808
Aaron Ballman [Wed, 15 Oct 2014 16:58:18 +0000 (16:58 +0000)]
Adding attributes to the IndirectFieldDecl that we generate for anonymous struct/union fields. This fixes PR20930.
llvm-svn: 219807
Reid Kleckner [Wed, 15 Oct 2014 16:38:00 +0000 (16:38 +0000)]
Don't use a global_ctors comdat for globals that aren't externally visible
In particular, if you have two identical templates in different TUs in
anonymous namespaces, we would use the same global_ctors comdat key for
both. As a result, only one would be run.
llvm-svn: 219806
David Majnemer [Wed, 15 Oct 2014 16:36:11 +0000 (16:36 +0000)]
CodeGen: Cleanup CGRecordLowering::lowerUnion a little
Remove some duplicated state, no functionality change intended.
llvm-svn: 219805
Sanjay Patel [Wed, 15 Oct 2014 16:21:37 +0000 (16:21 +0000)]
Use 'auto' for easier reading; no functional change intended.
llvm-svn: 219804
Sanjay Patel [Wed, 15 Oct 2014 16:20:45 +0000 (16:20 +0000)]
remove function names from comments; NFC
llvm-svn: 219803
Dario Domizioli [Wed, 15 Oct 2014 16:18:20 +0000 (16:18 +0000)]
Fix for PR21254 - Assertion in comment parser
The size of the ID field in CommandInfo was narrow, leading to potential
wrap-around of command IDs, causing misinterpretation later on.
The patch does the following:
- It extends the ID bitfield from 8 to 20 bits.
- It provides a DRY definition of the number of bits for the field to
avoid using literal numbers in different files.
- It introduces a new assertion that checks for the wrap-around.
- It adds the testcase from PR21254.
llvm-svn: 219802
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 16:15:15 +0000 (16:15 +0000)]
DI: Cleanup comments, NFC
A number of comment cleanups:
- Remove duplicated function and class names from comments.
- Remove duplicated comments from source file (some of which were
out-of-sync).
- Move any unduplicated comments from source file to header.
- Remove some noisy comments entirely (e.g., a comment for
`DIDescriptor::print()` saying "print descriptor" just gets in the
way of reading the code).
llvm-svn: 219801
Rafael Espindola [Wed, 15 Oct 2014 16:12:57 +0000 (16:12 +0000)]
Update for llvm api change.
llvm-svn: 219800
Rafael Espindola [Wed, 15 Oct 2014 16:12:52 +0000 (16:12 +0000)]
Simplify handling of --noexecstack by using getNonexecutableStackSection.
llvm-svn: 219799
Duncan P. N. Exon Smith [Wed, 15 Oct 2014 16:11:41 +0000 (16:11 +0000)]
DI: Use a `DenseMap` instead of named metadata, NFC
Remove a strange round-trip through named metadata to assign preserved
local variables to their subprograms.
llvm-svn: 219798
Rafael Espindola [Wed, 15 Oct 2014 15:44:25 +0000 (15:44 +0000)]
Update for llvm api change.
llvm-svn: 219797
Rafael Espindola [Wed, 15 Oct 2014 15:44:16 +0000 (15:44 +0000)]
Move getNonexecutableStackSection up to the base ELF class.
The .note.GNU-stack section is not SystemZ/X86 specific.
llvm-svn: 219796
Aaron Ballman [Wed, 15 Oct 2014 15:37:51 +0000 (15:37 +0000)]
Turned Sema::HandleDelayedAvailabilityCheck into a static function; NFC.
Did a bit of drive-by reformatting as well since it required rearranging some other static functions in the file.
llvm-svn: 219795
Anton Yartsev [Wed, 15 Oct 2014 15:11:45 +0000 (15:11 +0000)]
[analyzer] Handle 'mingw32-make' in the same way as 'make' and 'gmake'.
llvm-svn: 219794
Jan Vesely [Wed, 15 Oct 2014 15:08:06 +0000 (15:08 +0000)]
r600: Use llvm intrinsic to read work dimension information
v2: Fix function declaration
Add range metadata to r600 implementation
v3: change prefix to AMDGPU
Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219793
Samuel Benzaquen [Wed, 15 Oct 2014 14:58:46 +0000 (14:58 +0000)]
Speed up hasName() matcher.
Summary:
Speed up hasName() matcher by skipping the expensive generation of the
fully qualified name unless we need it.
In the common case of matching an unqualified name, we don't need to
generate the full name. We might not even need to copy any string at
all.
This change speeds up our clang-tidy benchmark by ~10%
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5776
llvm-svn: 219792
Viktor Kutuzov [Wed, 15 Oct 2014 12:47:48 +0000 (12:47 +0000)]
[Tsan] Fix the sunrpc.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D5730
llvm-svn: 219791
Viktor Kutuzov [Wed, 15 Oct 2014 12:43:04 +0000 (12:43 +0000)]
[Tsan] Make the mutex_robust tests Linux-specific
Differential Revision: http://reviews.llvm.org/D5729
llvm-svn: 219790
Alexander Kornienko [Wed, 15 Oct 2014 12:18:35 +0000 (12:18 +0000)]
Fix llvm-header-guard check.
Summary:
This patch makes the check work better for LLVM code:
* always fix existing #endif comments
* use one space before the comment (+allow customization for other styles)
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5795
llvm-svn: 219789
Alexander Kornienko [Wed, 15 Oct 2014 11:36:48 +0000 (11:36 +0000)]
Reformatted code samples in the unit test. No functional changes.
llvm-svn: 219788
Alexander Kornienko [Wed, 15 Oct 2014 11:03:39 +0000 (11:03 +0000)]
Fixed a comment. No functional changes.
llvm-svn: 219787
Alexander Kornienko [Wed, 15 Oct 2014 10:51:57 +0000 (10:51 +0000)]
[clang-tidy] Move some of the misc checks to readability/
Summary:
Some of the misc checks belong to readability/. I'm moving them there
without changing check names for now. As the next step, I want to register some
of these checks in the google and llvm modules with suitable settings (e.g.
BracesAroundStatementsCheck). I'm not sure if we want to create a "readability"
module, probably not.
Reviewers: djasper
Reviewed By: djasper
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D5792
llvm-svn: 219786
Marshall Clow [Wed, 15 Oct 2014 10:33:02 +0000 (10:33 +0000)]
Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks to Louis Dionne for the bug report and the patch.
llvm-svn: 219785
Dmitry Vyukov [Wed, 15 Oct 2014 08:56:43 +0000 (08:56 +0000)]
tsan: fix false positive related to signals
Write interceptor calls malloc, which causes a false
unsafe-call-in-signal-handler report. See the test.
llvm-svn: 219784
Dmitry Vyukov [Wed, 15 Oct 2014 08:56:15 +0000 (08:56 +0000)]
tsan: use a different dir for llvm build
build is used as gtest temp build dir, and is cleared during every build
llvm-svn: 219783
Matthew Gardiner [Wed, 15 Oct 2014 08:21:54 +0000 (08:21 +0000)]
Improve the handling of kalimba ELF file section type recognition.
Recognise the SHT_NOBITS property in kalimba ELF, and determine this to be
of type zerofilled. Subsequently recognise this type to represent bytes
on the target's DATA address space, and therefore be sized accordingly.
llvm-svn: 219782
David Majnemer [Wed, 15 Oct 2014 07:57:41 +0000 (07:57 +0000)]
CodeGen: Use the initing member's type for a union's storage type more often
Unions are initialized with the default initialization of their first
named member. If that member is not zero initialized, then we should
prefer that member's type. Otherwise, we might try to make an otherwise
unsuitable type (like an array) which we cannot easily initialize with a
pointer to member.
llvm-svn: 219781
David Majnemer [Wed, 15 Oct 2014 07:57:38 +0000 (07:57 +0000)]
CodeGen: Fix a typo in a comment
No functionality change intended.
llvm-svn: 219780
Dmitry Vyukov [Wed, 15 Oct 2014 05:38:49 +0000 (05:38 +0000)]
tsan: remove dead code
llvm-svn: 219779
Matt Arsenault [Wed, 15 Oct 2014 05:07:00 +0000 (05:07 +0000)]
R600: Use existing variable
llvm-svn: 219778
Matt Arsenault [Wed, 15 Oct 2014 05:06:57 +0000 (05:06 +0000)]
R600: Remove outdated comment
llvm-svn: 219777
Juergen Ributzka [Wed, 15 Oct 2014 04:55:48 +0000 (04:55 +0000)]
Revert "[FastISel][AArch64] Add custom lowering for GEPs."
This breaks our internal build bots. Reverting it to get the bots green again.
llvm-svn: 219776
David Majnemer [Wed, 15 Oct 2014 04:54:54 +0000 (04:54 +0000)]
MS ABI: Use the correct this arg when generating implicit array copy ctor
We assumed the last argument of the copy constructor was the this
pointer. However, this is not the case under the MS ABI.
llvm-svn: 219775
Richard Trieu [Wed, 15 Oct 2014 03:42:06 +0000 (03:42 +0000)]
Improvements to -Wnull-conversion
Split logic to separate checking function
Refine the macro checking
Catch nullptr->bool conversions
Add some explanatory comments
llvm-svn: 219774
Jingyue Wu [Wed, 15 Oct 2014 03:27:43 +0000 (03:27 +0000)]
[MachineSink] Use the real post dominator tree
Summary:
Fixes a FIXME in MachineSinking. Instead of using the simple heuristics in
isPostDominatedBy, use the real MachinePostDominatorTree and MachineLoopInfo.
The old heuristics caused instructions to sink unnecessarily, and might create
register pressure.
This is the second try of the fix. The first one (D4814) caused a performance
regression due to failing to sink instructions out of loops (PR21115). This
patch fixes PR21115 by sinking an instruction from a deeper loop to a shallower
one regardless of whether the target block post-dominates the source.
Thanks Alexey Volkov for reporting PR21115!
Test Plan:
Added a NVPTX codegen test to verify that our change prevents the backend from
over-sinking. It also shows the unnecessary register pressure caused by
over-sinking.
Added an X86 test to verify we can sink instructions out of loops regardless of
the dominance relationship. This test is reduced from Alexey's test in PR21115.
Updated an affected test in X86.
Also ran SPEC CINT2006 and llvm-test-suite for compilation time and runtime
performance. Results are attached separately in the review thread.
Reviewers: Jiangning, resistor, hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, bruno, volkalexey, llvm-commits, meheff, eliben, jholewinski
Differential Revision: http://reviews.llvm.org/D5633
llvm-svn: 219773
Jason Molenda [Wed, 15 Oct 2014 03:11:37 +0000 (03:11 +0000)]
Be more consistent about null checks for the Process and ABI
in GetFullUnwindPlanForFrame() - the code was mostly checking
that we had an active Process and ABI but not always.
clang static analyzer fixit.
llvm-svn: 219772
Jason Molenda [Wed, 15 Oct 2014 03:07:39 +0000 (03:07 +0000)]
Make sure local var cu is non-NULL before dereferencing.
(it was checked for NULL-ness in some places, not in others)
clang static analyzer fixit.
llvm-svn: 219771
Jason Molenda [Wed, 15 Oct 2014 03:06:23 +0000 (03:06 +0000)]
Remove unneeded local var initialization.
clang static analyzer fixit.
llvm-svn: 219770
Jason Molenda [Wed, 15 Oct 2014 03:05:38 +0000 (03:05 +0000)]
Make sure is_indirect local var is initialized; there
exists a code path where it could be used while uninitialized.
clang static analyzer fixit.
llvm-svn: 219769
Jason Molenda [Wed, 15 Oct 2014 03:04:33 +0000 (03:04 +0000)]
Ensure that m_syntax is initialized in all the FileSpec
constructors.
clang static analyzer fixit.
llvm-svn: 219768
Tim Northover [Wed, 15 Oct 2014 01:05:01 +0000 (01:05 +0000)]
ARM: drop check for triple that's no longer used.
Early attempts to support AAPCS bare metal MachO targets based the decision on
the CPU being compiled for. This was not a particularly great idea and we've
got a better option now, but this check remained.
No functional change for any target we care about.
llvm-svn: 219767
Justin Bogner [Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)]
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits
The various ways to create an ASTUnit all take a refcounted pointer to
a diagnostics engine as an argument, and if it isn't pointing at
anything they initialize it. This is a pretty confusing API, and it
really makes more sense for the caller to initialize the thing since
they control the lifetime anyway.
This fixes the one caller that didn't bother initializing the pointer
and asserts that the argument is initialized.
llvm-svn: 219752
Eric Christopher [Wed, 15 Oct 2014 00:15:26 +0000 (00:15 +0000)]
Remove unused variable.
llvm-svn: 219751
Eric Christopher [Wed, 15 Oct 2014 00:09:07 +0000 (00:09 +0000)]
Remove unused variable.
llvm-svn: 219750
Eric Christopher [Tue, 14 Oct 2014 23:58:51 +0000 (23:58 +0000)]
No need to cache this unused variable.
Patch by Ehsan Akhgari.
llvm-svn: 219749
Gerolf Hoflehner [Tue, 14 Oct 2014 23:55:00 +0000 (23:55 +0000)]
[AArch64] Wrong CC access in CSINC-conditional branch sequence
This is a follow up to commit r219742. It removes the CCInMI variable
and accesses the CC in CSCINC directly. In the case of a conditional
branch accessing the CC with CCInMI was wrong.
llvm-svn: 219748
Justin Bogner [Tue, 14 Oct 2014 23:36:06 +0000 (23:36 +0000)]
Frontend: Remove some unused arguments in ASTUnit (NFC)
llvm-svn: 219747
Nick Kledzik [Tue, 14 Oct 2014 23:29:38 +0000 (23:29 +0000)]
[llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
llvm-svn: 219746
Hans Wennborg [Tue, 14 Oct 2014 23:20:25 +0000 (23:20 +0000)]
vadefs.h: be even more conservative and only define the macros if already defined
llvm-svn: 219745
Ehsan Akhgari [Tue, 14 Oct 2014 23:15:44 +0000 (23:15 +0000)]
clang-cl: Diagnose the usage of ASAN with a debug runtime library
Summary:
AddressSanitizer currently doesn't support this configuration, and binaries
built with it will just get into an infinite loop during startup.
Test Plan: Includes an automated test.
Reviewers: samsonov
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5764
llvm-svn: 219744
Hans Wennborg [Tue, 14 Oct 2014 23:15:43 +0000 (23:15 +0000)]
Sort files list in lib/Headers/CMakeLists.txt
majnemer pointed out that vadefs.h was added in the wrong place. Might
as well sort the rest too.
llvm-svn: 219743
Gerolf Hoflehner [Tue, 14 Oct 2014 23:07:53 +0000 (23:07 +0000)]
[AAarch64] Optimize CSINC-branch sequence
Peephole optimization that generates a single conditional branch
for csinc-branch sequences like in the examples below. This is
possible when the csinc sets or clears a register based on a condition
code and the branch checks that register. Also the condition
code may not be modified between the csinc and the original branch.
Examples:
1. Convert csinc w9, wzr, wzr, <CC>;tbnz w9, #0, 0x44
to b.<invCC>
2. Convert csinc w9, wzr, wzr, <CC>; tbz w9, #0, 0x44
to b.<CC>
rdar://problem/
18506500
llvm-svn: 219742
Hal Finkel [Tue, 14 Oct 2014 22:59:49 +0000 (22:59 +0000)]
[LoopVectorize] Ignore @llvm.assume for cost estimates and legality
A few minor changes to prevent @llvm.assume from interfering with loop
vectorization. First, treat @llvm.assume like the lifetime intrinsics, which
are scalarized (but don't otherwise interfere with the legality checking).
Second, ignore the cost of ephemeral instructions in the loop (these will go
away anyway during CodeGen).
Alignment assumptions and other uses of @llvm.assume can often end up inside of
loops that should be vectorized (this is not uncommon for assumptions generated
by __attribute__((align_value(n))), for example).
llvm-svn: 219741
Hans Wennborg [Tue, 14 Oct 2014 22:35:42 +0000 (22:35 +0000)]
MS Compat: interpose vadefs.h to fix definitions of _crt_va_{start,end,arg} (PR21247)
Differential revision: http://reviews.llvm.org/D5784
llvm-svn: 219740
David Majnemer [Tue, 14 Oct 2014 22:35:11 +0000 (22:35 +0000)]
MC, COFF: Make bigobj test compatible with python3
No functionality change intended.
llvm-svn: 219739
Simon Pilgrim [Tue, 14 Oct 2014 22:31:34 +0000 (22:31 +0000)]
[X86][SSE] pslldq/psrldq shuffle mask decodes
Patch to provide shuffle decodes and asm comments for the sse pslldq/psrldq SSE2/AVX2 byte shift instructions.
Differential Revision: http://reviews.llvm.org/D5598
llvm-svn: 219738
David Majnemer [Tue, 14 Oct 2014 22:26:49 +0000 (22:26 +0000)]
MC: Rewrite bigobj test in python
This makes the test easier to work with. No functionality change
intended.
llvm-svn: 219737
David Blaikie [Tue, 14 Oct 2014 22:22:17 +0000 (22:22 +0000)]
DebugInfo: Lazily built static member variable declarations should use the canonical declaration for line/file information.
When lazily constructing static member variable declarations (when
the vtable optimization fires and the definition of the type is omitted
(or built later, lazily), but the out of line definition of the static
member is provided and must be described in debug info) ensure we use
the canonical declaration when computing the file, line, etc for that
declaration (rather than the definition, which is also a declaration,
but not the canonical one).
llvm-svn: 219736
Tim Northover [Tue, 14 Oct 2014 22:12:21 +0000 (22:12 +0000)]
ARM: remove ARM/Thumb distinction for preferred alignment.
Thumb1 has legitimate reasons for preferring 32-bit alignment of types
i1/i8/i16, since the 16-bit encoding of "add rD, sp, #imm" requires #imm to be
a multiple of 4. However, this is a trade-off betweem code size and RAM usage;
the DataLayout string is not the best place to represent it even if desired.
So this patch removes the extra Thumb requirements, hopefully making ARM and
Thumb completely compatible in this respect.
llvm-svn: 219735
Tim Northover [Tue, 14 Oct 2014 22:12:17 +0000 (22:12 +0000)]
ARM: remove ARM/Thumb distinction for preferred alignment.
Thumb1 has legitimate reasons for preferring 32-bit alignment of types
i1/i8/i16, since the 16-bit encoding of "add rD, sp, #imm" requires #imm to be
a multiple of 4. However, this is a trade-off betweem code size and RAM usage;
the DataLayout string is not the best place to represent it even if desired.
So this patch removes the extra Thumb requirements, hopefully making ARM and
Thumb completely compatible in this respect.
llvm-svn: 219734
Tim Northover [Tue, 14 Oct 2014 22:12:14 +0000 (22:12 +0000)]
ARM: allow misaligned local variables in Thumb1 mode.
There's no hard requirement on LLVM to align local variable to 32-bits, so the
Thumb1 frame handling needs to be able to deal with variables that are only
naturally aligned without falling over.
llvm-svn: 219733
Kaelyn Takata [Tue, 14 Oct 2014 21:57:21 +0000 (21:57 +0000)]
Be smarter when parsing variable declarations with unknown types.
Specifically, avoid typo-correcting the variable name into a type before
typo-correcting the actual type name in the declaration. Doing so
results in a very unpleasant cascade of errors, with the typo correction
of the actual type name being buried in the middle.
llvm-svn: 219732
Zachary Turner [Tue, 14 Oct 2014 21:55:08 +0000 (21:55 +0000)]
Create a process launcher abstraction.
This implements Host::LaunchProcess for windows, and in doing so
does some minor refactor to move towards a more modular process
launching design.
The original motivation for this is that launching processes on
windows needs some very windows specific code, which would live
most appropriately in source/Host/windows somewhere. However,
there is already some common code that all platforms use when
launching a process before delegating to the platform specific
stuff, which lives in source/Host/common/Host.cpp which would
be nice to reuse without duplicating.
This commonality has been abstracted into MonitoringProcessLauncher,
a class which abstracts out the notion of launching a process using
an arbitrary algorithm, and then monitoring it for state changes.
The windows specific launching code lives in ProcessLauncherWindows,
and the posix specific launching code lives in ProcessLauncherPosix.
When launching a process MonitoringProcessLauncher is created, and
then an appropriate delegate launcher is created and given to the
MonitoringProcessLauncher.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D5781
llvm-svn: 219731
Zachary Turner [Tue, 14 Oct 2014 21:54:14 +0000 (21:54 +0000)]
Fix a path concatenation issue related to windows paths.
llvm-svn: 219730
David Majnemer [Tue, 14 Oct 2014 21:47:53 +0000 (21:47 +0000)]
Add a test for writing COFF BigObj
llvm-svn: 219729
Jason Molenda [Tue, 14 Oct 2014 21:47:45 +0000 (21:47 +0000)]
When PlatformDarwinKernel::ExamineKextForMatchingUUID is given
a FileSpec, UUID, and ArchSpec, and it's opening all the kexts
with the same bundle id to see if they're a match, don't set
the Arch in the ModuleSpec. If Module::GetObjectFile() sees
that the architecture of the kext is a mismatch for the arch
we're looking for, it'll spew a warning message to the dev (r217251).
Rely on the UUID match to get the correct file if we have
a UUID -- we'll get no warning if it's a mismatch.
<rdar://problem/
18641477>
llvm-svn: 219728