Pete Cooper [Tue, 22 Mar 2016 22:51:03 +0000 (22:51 +0000)]
Don't memcpy from a null source. Found by UBSan
llvm-svn: 264114
Sean Callanan [Tue, 22 Mar 2016 22:42:42 +0000 (22:42 +0000)]
Reverted a change in r264074 that made lldb-mi use lldb_private APIs.
FileSystem::Fopen is a lldb_private API, but lldb-mi uses only the
public API. Depending on lldb_private APIs makes Xcode builds fail.
I reverted the portion of r264074 that added such a dependency.
llvm-svn: 264113
Derek Bruening [Tue, 22 Mar 2016 22:32:03 +0000 (22:32 +0000)]
Test commit to verify repository access and fix a typo.
llvm-svn: 264112
Davide Italiano [Tue, 22 Mar 2016 22:31:34 +0000 (22:31 +0000)]
[LTO] Keep linkonce_odr symbols when appropriate.
Ensure we keep the symbol we need to before it reaches
the Writer (and hit an assertion), changing its linkage
from linkonce_odr to weak. For a more detailed description
of the problem, see PR19901 where a similar problem was
fixed for the gold plugin. Thanks to Rafael for providing
a testcase.
llvm-svn: 264111
Joerg Sonnenberger [Tue, 22 Mar 2016 22:24:52 +0000 (22:24 +0000)]
Typo
llvm-svn: 264110
Justin Bogner [Tue, 22 Mar 2016 22:24:29 +0000 (22:24 +0000)]
MC: Don't access the filesystem in MCContext's constructor
MCContext shouldn't be accessing the filesystem - that's a gross
layering violation and makes it awkward to use as a library or in a
daemon where it may not even be allowed filesystem access.
The CWD lookup here is normally redundant anyway, since the calling
context either also looks up the CWD or sets this to something more
specific. Here, we fix up the one caller that doesn't already set up a
debug compilation dir and make it clear that the responsibility for
such set up is in the users of MCContext.
llvm-svn: 264109
Enrico Granata [Tue, 22 Mar 2016 22:12:59 +0000 (22:12 +0000)]
Make it so that a command alias can actually remove the help/long help from its parent command by setting itself to an empty help string
llvm-svn: 264108
Justin Lebar [Tue, 22 Mar 2016 22:08:01 +0000 (22:08 +0000)]
[NVVM] Remove noduplicate attribute from synchronizing intrinsics.
Summary:
I've completed my audit of all the code that looks at noduplicate and
added handling of convergent where appropriate, so we no longer need
noduplicate on these intrinsics.
Reviewers: jholewinski
Subscribers: llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D18168
llvm-svn: 264107
Justin Lebar [Tue, 22 Mar 2016 22:06:19 +0000 (22:06 +0000)]
[CUDA] Don't allow templated variadic functions.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18373
llvm-svn: 264106
Tobias Grosser [Tue, 22 Mar 2016 22:05:32 +0000 (22:05 +0000)]
Invalidate scop on encountering a complex control flow
We bail out if current scop has a complex control flow as this could lead to
building of large domain conditions. This is to reduce compile time. This
addresses r26382.
Contributed-by: Chris Jenneisch <chrisj@codeaurora.org>
Differential Revision: http://reviews.llvm.org/D18362
llvm-svn: 264105
Siva Chandra [Tue, 22 Mar 2016 21:37:56 +0000 (21:37 +0000)]
[lldb-mi] Uncomment a line in CMakeLists.txt to make linux build happy.
Reviewers: zturner
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D18377
llvm-svn: 264104
Rafael Espindola [Tue, 22 Mar 2016 21:35:47 +0000 (21:35 +0000)]
Drop comdats from the dst module if they are not selected.
A really unfortunate design of llvm-link and related libraries is that
they operate one module at a time.
This means they can copy a GV to the destination module that should not
be there in the final result because a later bitcode file takes
precedence.
We already handled cases like a strong GV replacing a weak for example.
One case that is not currently handled is a comdat replacing another.
This doesn't happen in ELF, but with COFF largest selection kind it is
possible.
In "llvm-link a.ll b.ll" if the selected comdat was from a.ll,
everything will work and we will not copy the comdat from b.ll.
But if we run "llvm-link b.ll a.ll", we fail to delete the already
copied comdat from b.ll. This patch fixes that.
llvm-svn: 264103
George Burgess IV [Tue, 22 Mar 2016 21:25:08 +0000 (21:25 +0000)]
Keep CodeGenPrepare from preserving the domtree.
CGP modifies the domtree in some cases, so saying that it preserves the
domtree is a lie. We'll be able to selectively preserve it with the new
pass manager.
Differential Revision: http://reviews.llvm.org/D16893
llvm-svn: 264099
JF Bastien [Tue, 22 Mar 2016 21:12:48 +0000 (21:12 +0000)]
Update cxx-features test to C++1z
Forked from the following patch:
http://reviews.llvm.org/D17950
llvm-svn: 264098
Pete Cooper [Tue, 22 Mar 2016 21:08:39 +0000 (21:08 +0000)]
Fix operator= on OwningAtomPtr to call destructor when needed.
If the LHS of 'a = b' already had an atom in it then we wouldn't
call the destructor. This happens when we use something like
std::remove_if which is done in the CompactUnwindPass. Should fix
the leaks on the mach-o/unwind-info-simple-x86_64.yaml test case.
Lang and I are going to take a look at removing OwningAtomPtr in
favour of a std::unique_ptr but just trying to get the bots green
so we have a good baseline first.
llvm-svn: 264097
Enrico Granata [Tue, 22 Mar 2016 21:07:54 +0000 (21:07 +0000)]
Fix a bug caused by my alias refactoring where, if an alias was defined in terms of another alias, trying to run the nested command would actually cause a crash in the command interpreter
llvm-svn: 264096
Sean Callanan [Tue, 22 Mar 2016 21:05:51 +0000 (21:05 +0000)]
Backend support for top-level Clang epxressions
This patch adds a new ExecutionPolicy, eExecutionPolicyTopLevel, which
tells the expression parser that the expression should be JITted as top
level code but nothing (except static initializers) should be run. I
have modified the Clang expression parser to recognize this execution
policy. On top of the existing patches that support storing IR and
maintaining a map of arbitrary Decls, this is mainly just patching up a
few places in the expression parser.
I intend to submit a patch for review that exposes this functionality
through the "expression" command and through the SB API. That patch
also includes a testcase for all of this.
<rdar://problem/
22864976>
llvm-svn: 264095
Sean Silva [Tue, 22 Mar 2016 21:04:03 +0000 (21:04 +0000)]
Mark SymbolBody::getSymbol as `const`.
llvm-svn: 264094
Rui Ueyama [Tue, 22 Mar 2016 20:58:15 +0000 (20:58 +0000)]
We do not use libLTO, so fix the error.
llvm-svn: 264093
John Thompson [Tue, 22 Mar 2016 20:57:51 +0000 (20:57 +0000)]
D18325: Added mm_malloc module export.
llvm-svn: 264092
Rui Ueyama [Tue, 22 Mar 2016 20:52:10 +0000 (20:52 +0000)]
ELF: Create LTO.{cpp,h} and move LTO-related code to that file.
The code for LTO has been growing, so now is probably a good time to
move it to its own file. SymbolTable.cpp is for symbol table, and
because compiling bitcode files are semantically not a part of
symbol table, this is I think a good thing to do.
http://reviews.llvm.org/D18370
llvm-svn: 264091
Sean Silva [Tue, 22 Mar 2016 20:25:32 +0000 (20:25 +0000)]
[lto] Provide a file name for the combined LTO object.
Otherwise, we get diagnostics like:
undefined symbol: foo in
Which isn't particularly useful.
llvm-svn: 264089
Matthias Braun [Tue, 22 Mar 2016 20:24:34 +0000 (20:24 +0000)]
Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This commit broke LTO builds. Reverting it to unbreak the bots while the
issue is investigated. See also:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20160321/341002.html
This reverts r263158
llvm-svn: 264088
Enrico Granata [Tue, 22 Mar 2016 20:16:51 +0000 (20:16 +0000)]
Changes to the Xcode project file to make LLDB build again after llvm/Support/ConvertUTF.h was brought into the driver
llvm-svn: 264087
Simon Pilgrim [Tue, 22 Mar 2016 20:10:49 +0000 (20:10 +0000)]
[X86][AVX] Added AVX1 tests for 256-bit vector idiv-by-constant
Prep work based on feedback for D18307
llvm-svn: 264086
Simon Pilgrim [Tue, 22 Mar 2016 19:59:53 +0000 (19:59 +0000)]
[SelectionDAG] Ensure constant folded legalized vector element types are compatible with the BUILD_VECTOR type
Found during fuzz testing - 32-bit x86 targets were legalizing a <2 x i1> compare result to <2 x i32> when <2 x i64> was expected.
llvm-svn: 264085
Tim Northover [Tue, 22 Mar 2016 19:14:38 +0000 (19:14 +0000)]
CodeGen: check return types match when emitting tail call to builtin.
We were just completely ignoring the types when determining whether we could
safely emit a libcall as a tail call. This is clearly wrong.
Theoretically, we could dig deeper looking for incidental matches (much like
the generic code in Analysis.cpp does), but it's probably not worth it for the
few libcalls that exist.
llvm-svn: 264084
Sanjoy Das [Tue, 22 Mar 2016 18:45:41 +0000 (18:45 +0000)]
Remove unnecessary branch from test
(Addresses post commit review by Reid Kleckner)
llvm-svn: 264083
Adam Nemet [Tue, 22 Mar 2016 18:38:15 +0000 (18:38 +0000)]
[LoopVersioning] Relax an assert for LCSSA PHIs
When you have multiple LCSSA (single-operand) PHIs that are converted
into two-operand PHIs due to versioning, only assert that the PHI
currently being converted has a single operand. I.e. we don't want to
check PHIs that were converted earlier in the loop.
Fixes PR27023.
Thanks to Karl-Johan Karlsson for the minimized testcase!
llvm-svn: 264081
Etienne Bergeron [Tue, 22 Mar 2016 18:21:17 +0000 (18:21 +0000)]
[clang-tidy] Fix broken test with redundant string init (msvc).
Summary:
There is a silly bug that got introduced after fixing incorrect paths with this patch:
http://reviews.llvm.org/D18293
The tests was present twice in the file.
Reviewers: alexfh, rnk
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18365
llvm-svn: 264080
Yabin Cui [Tue, 22 Mar 2016 18:12:18 +0000 (18:12 +0000)]
[tsan] Fix check-tsan build by using CHECK_NE.
Reviewers: llvm-commits, srhines, dvyukov
Subscribers: srhines
Differential Revision: http://reviews.llvm.org/D18361
llvm-svn: 264079
Sanjoy Das [Tue, 22 Mar 2016 18:10:39 +0000 (18:10 +0000)]
Allow lowering call sites with both funclets and deopt state
Lowering funclets is a no-op, so we can just go ahead and lower the
deopt state.
llvm-svn: 264078
Pete Cooper [Tue, 22 Mar 2016 18:09:55 +0000 (18:09 +0000)]
More MSVC bot appeasement. Explicitly define rvalue methods on SortKey.
OwningAtomPtr does not have OwningAtomPtr(OwningAtomPtr&) or the equivalent
operator= as we only want to use rvalue references in it.
SortKey didn't like this on MSVC as it was synthesizing SortKey(SortKey&) and
trying to use the OwningAtomPtr(OwningAtomPtr&) method which was private an
unimplemented.
Now we explicitly have the methods on SortKey so hopefully the bot will be
happier.
llvm-svn: 264077
Dan Gohman [Tue, 22 Mar 2016 18:01:49 +0000 (18:01 +0000)]
[WebAssembly] Implement the rotate instructions.
llvm-svn: 264076
Etienne Bergeron [Tue, 22 Mar 2016 18:00:13 +0000 (18:00 +0000)]
[clang-tidy] Fix redundant-string-cstr check with msvc 14 headers.
Summary:
The string constructors are not defined using optional parameters and are not recognize by the checker.
The constructor defined in the MSVC header is defined with 1 parameter. Therefore, patterns are not recognized by the checker.
The current patch add support to accept constructor with only one parameter.
Repro on a Visual Studio 14 installation with the following code:
```
void f1(const std::string &s) {
f1(s.c_str());
}
```
In the xstring.h header, the constructors are defined this way:
```
basic_string(const _Myt& _Right) [...]
basic_string(const _Myt& _Right, const _Alloc& _Al) [...]
```
The CXXConstructExpr to recognize only contains 1 parameter.
```
CXXConstructExpr 0x3f1a070 <C:\src\llvm\examples\test.cc:6:6, col:14> 'const std::string':'const class std::basic_string<char, struct std::char_traits<char>, class
std::allocator<char> >' 'void (const char *) __attribute__((thiscall))'
`-CXXMemberCallExpr 0x3f1a008 <col:6, col:14> 'const char *'
`-MemberExpr 0x3f19fe0 <col:6, col:8> '<bound member function type>' .c_str 0x3cc22f8
`-DeclRefExpr 0x3f19fc8 <col:6> 'const std::string':'const class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char> >' lvalue ParmVar 0x3f19c80 's' 'const std::string &'
```
Reviewers: aaron.ballman, alexfh
Subscribers: aemerson
Differential Revision: http://reviews.llvm.org/D18285
llvm-svn: 264075
Zachary Turner [Tue, 22 Mar 2016 17:58:09 +0000 (17:58 +0000)]
Unicode support on Win32.
Win32 API calls that are Unicode aware require wide character
strings, but LLDB uses UTF8 everywhere. This patch does conversions
wherever necessary when passing strings into and out of Win32 API
calls.
Patch by Cameron
Differential Revision: http://reviews.llvm.org/D17107
Reviewed By: zturner, amccarth
llvm-svn: 264074
Etienne Bergeron [Tue, 22 Mar 2016 17:51:27 +0000 (17:51 +0000)]
[clang-tidy] Skip reporting of not applicable fixes.
Summary:
Invalid source location are causing clang-tidy to crash when manipulating an invalid file.
Macro definitions on the command line have locations in a virtual buffer and therefore
don't have a corresponding valid FilePath.
A recent patch added path conversion to absolute path. As the FilePath may now be empty,
the result of makeAbsolutePath may incorrectly be the folder WorkingDir. The crash occurs
in getLocation which is not able to find the appropriate FileEntry (null pointer).
```
SmallString<128> FixAbsoluteFilePath = Fix.getFilePath();
Files.makeAbsolutePath(FixAbsoluteFilePath);
FixLoc = getLocation(FixAbsoluteFilePath, Fix.getOffset());
```
With relative path, the code was not crashing because getLocation was skipping empty path.
Example of code:
```
int main() { return X; }
```
With the given command-line:
```
clang-tidy test.cc --checks=misc-macro-* -- -DX=0+0
```
Reviewers: alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D18262
llvm-svn: 264073
Sanjoy Das [Tue, 22 Mar 2016 17:51:25 +0000 (17:51 +0000)]
Add a hasOperandBundlesOtherThan helper, and use it; NFC
llvm-svn: 264072
Justin Bogner [Tue, 22 Mar 2016 17:50:05 +0000 (17:50 +0000)]
StaticAnalyzer: Avoid an unintentional copy
The range here isn't over references, so using `auto &` here incites a
copy. Switching to `auto *` would do, but we might as well list an
explicit type for clarity.
Found by -Wrange-loop-analysis.
llvm-svn: 264071
Pete Cooper [Tue, 22 Mar 2016 17:39:44 +0000 (17:39 +0000)]
Appease MSVC bots by changing visibility of AtomVector.
The AtomVector class is an internal detail of File so I moved it
to be protected in r264067. However, the MSVC bots don't like the
global declarations of type File::AtomVector in File.cpp so it needs
to go back to being public for now.
llvm-svn: 264070
Etienne Bergeron [Tue, 22 Mar 2016 17:39:36 +0000 (17:39 +0000)]
[clang-tidy] Fix redundant-string-init check with msvc 14 headers.
Summary:
The string constructors are not defined using optional parameters and are not recognized by the redundant-string-init checker.
The following patch fixes the redundant-string-init checker for the Visual Studio 14 headers file.
The matcher now accept both variant (with 1 and 2 parameters).
Also added new unittests.
Similar issue than: [[ http://reviews.llvm.org/D18285 | review ]]
In the xstring.h header, the constructors are defined this way:
```
basic_string(const _Myt& _Right) [...]
basic_string(const _Myt& _Right, const _Alloc& _Al) [...]
```
Reviewers: alexfh, hokein
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18293
llvm-svn: 264069
Yabin Cui [Tue, 22 Mar 2016 17:16:26 +0000 (17:16 +0000)]
[tsan] Disable randomized address space on linux aarch64.
Summary:
After patch https://lkml.org/lkml/2015/12/21/340 is introduced in
linux kernel, the random gap between stack and heap is increased
from 128M to 36G on 39-bit aarch64. And it is almost impossible
to cover this big range. So I think we need to disable randomized
virtual space on aarch64 linux.
Reviewers: kcc, llvm-commits, eugenis, zatrazz, dvyukov, rengolin
Subscribers: rengolin, aemerson, tberghammer, danalbert, srhines, enh
Differential Revision: http://reviews.llvm.org/D18003
llvm-svn: 264068
Pete Cooper [Tue, 22 Mar 2016 17:15:50 +0000 (17:15 +0000)]
Use owning pointers instead of raw pointers for Atom's to fix leaks.
This is a re-commit of r264022 with a fix for MSVC. The issue there was
that the code was running DefinedAtom::~Atom() for some value and instead
needed to cast to Atom before running ~Atom. Original commit message follows.
Currently each File contains an BumpPtrAllocator in which Atom's are
allocated. Some Atom's contain data structures like std::vector which
leak as we don't run ~Atom when they are BumpPtrAllocate'd.
Now each File actually owns its Atom's using an OwningAtomPtr. This
is analygous to std::unique_ptr and may be replaced by it if possible.
An Atom can therefore only be owned by a single File, so the Resolver now
moves them from one File to another. The MachOLinkingContext owns the File's
and so clears all the Atom's in ~MachOLinkingContext, then delete's all the
File's. This makes sure all Atom's have been destructed before any of the
BumpPtrAllocator's in which they run have gone away.
Should hopefully fix the remaining leaks. Will keep an eye on the bots to
make sure.
llvm-svn: 264067
David Majnemer [Tue, 22 Mar 2016 17:10:07 +0000 (17:10 +0000)]
Make build bots happy
BasicBlock's lose their names for some builders, don't mention such
names.
llvm-svn: 264066
David Majnemer [Tue, 22 Mar 2016 16:44:39 +0000 (16:44 +0000)]
[MS ABI] Assign an inheritance model for the dest of a member pointer upcast
While we correctly assigned an inheritance model for the source of a
member pointer upcast, we did not do so for the destination.
This fixes PR27030.
llvm-svn: 264065
Chris Bieneman [Tue, 22 Mar 2016 16:33:23 +0000 (16:33 +0000)]
[Perf-training] Using os.devnull instead of a temp file
This is based on post-commit feedback from Vedant. Totally didn't know that existed and worked on Windows.
Thanks Vedant!
llvm-svn: 264064
Chris Bieneman [Tue, 22 Mar 2016 16:27:35 +0000 (16:27 +0000)]
[Perf-training] Cleanup based on feedback from Sean Silvas
Sean provided feedback based on r257934 on cfe-commits. This change addresses that feedback.
llvm-svn: 264063
Simon Pilgrim [Tue, 22 Mar 2016 16:22:08 +0000 (16:22 +0000)]
[X86][SSE] Reapplied: Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.
We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.
Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).
Reapplied with a fix for PR26953 (missing vector widening legalization).
Differential Revision: http://reviews.llvm.org/D17932
llvm-svn: 264062
Reid Kleckner [Tue, 22 Mar 2016 15:46:50 +0000 (15:46 +0000)]
[asan] Add ucrtbase.dll to the list of DLLs to intercept
Reduces number of test failures in check-asan-dynamic with VS 2015.
llvm-svn: 264061
Reid Kleckner [Tue, 22 Mar 2016 15:46:43 +0000 (15:46 +0000)]
[asan] Add one more x86 encoding to the interceptor for strrchr
llvm-svn: 264060
Vedant Kumar [Tue, 22 Mar 2016 15:14:18 +0000 (15:14 +0000)]
[unittests] clang-format a line, NFC
llvm-svn: 264059
Kuba Brecka [Tue, 22 Mar 2016 14:59:46 +0000 (14:59 +0000)]
[tsan] Change nullptr to NULL in one Darwin test.
Depending on the version of libcxx, nullptr might not be available. Let's use NULL instead.
llvm-svn: 264058
Daniel Sanders [Tue, 22 Mar 2016 14:50:22 +0000 (14:50 +0000)]
[mips] Make simm6 consistent with the rest. NFC.
Summary:
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D18147
llvm-svn: 264057
Daniel Sanders [Tue, 22 Mar 2016 14:40:00 +0000 (14:40 +0000)]
[mips] Range check simm7.
Summary:
Also renamed li_simm7 to li16_imm since it's not a simm7 and has an unusual
encoding (it's a uimm7 except that 0x7f represents -1).
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D18145
llvm-svn: 264056
Daniel Jasper [Tue, 22 Mar 2016 14:32:20 +0000 (14:32 +0000)]
clang-format: [JS] do not wrap ES6 imports/exports.
"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.
Patch by Martin Probst.
llvm-svn: 264055
Daniel Sanders [Tue, 22 Mar 2016 14:29:53 +0000 (14:29 +0000)]
[mips] Range check simm5.
Summary:
We can't check the error message for this one because there's another lw/sw
available that covers a larger range. We therefore check the transition
between the two sizes.
Reviewers: vkalintiris
Subscribers: llvm-commits, dsanders
Differential Revision: http://reviews.llvm.org/D18144
llvm-svn: 264054
Daniel Sanders [Tue, 22 Mar 2016 14:17:41 +0000 (14:17 +0000)]
[mips] Range check vsplat_uimm[1234568].
Summary:
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D18143
llvm-svn: 264053
Daniel Sanders [Tue, 22 Mar 2016 13:58:53 +0000 (13:58 +0000)]
[mips] Range check uimm4_ptr, remove uimm6_ptr, and use correctly sized immediates in MSA copy/insert.
Reviewers: vkalintiris
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D18142
llvm-svn: 264052
Zinovy Nis [Tue, 22 Mar 2016 13:50:57 +0000 (13:50 +0000)]
[PATCH] Force LoopReroll to reset the loop trip count value after reroll.
It's a bug fix.
For rerolled loops SE trip count remains unchanged. It leads to incorrect work of the next passes.
My patch just resets SE info for rerolled loop forcing SE to re-evaluate it next time it requested.
I also added a verifier call in the exisitng test to be sure no invalid SE data remain. Without my fix this test would fail with -verify-scev.
Differential Revision: http://reviews.llvm.org/D18316
llvm-svn: 264051
Aaron Ballman [Tue, 22 Mar 2016 13:44:36 +0000 (13:44 +0000)]
Moving files that were placed in the wrong directory from r264049.
llvm-svn: 264050
Aaron Ballman [Tue, 22 Mar 2016 13:37:44 +0000 (13:37 +0000)]
Fix crashes from delayed template parsing code that assumed getBody() would return non-null.
Patch by Etienne Bergeron.
llvm-svn: 264049
Rafael Espindola [Tue, 22 Mar 2016 13:24:29 +0000 (13:24 +0000)]
Skip some relocations in scanRelocs.
When a tls access is optimized, a group of relocations is converted at a
time.
We were already skipping relocations that were optimized out in
relocate, but not in scanRelocs.
This is a small optimization. I got here while working on a patch that
will always keep scanRelocs and relocate in sync.
llvm-svn: 264048
George Rimar [Tue, 22 Mar 2016 12:15:26 +0000 (12:15 +0000)]
[ELF] - Process R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX relocations.
R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX relocations were added in latest ABI:
https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf
They should be generated instead of R_X86_64_GOTPCREL for cases
when relaxation is possible. Currently this patch just process them in the
same way like R_X86_64_GOTPCREL. That should work for now
and we can implement relaxations later.
There is no testcases provided as I think there is no way to generate
such relocations using llvm-mc atm.
Differential revision: http://reviews.llvm.org/D18301
llvm-svn: 264043
Marina Yatsina [Tue, 22 Mar 2016 11:23:15 +0000 (11:23 +0000)]
[ELF][gcc compatibility]: support section names with special characters (e.g. "/")
Adding support for section names with special characters in them (e.g. "/").
GCC successfully compiles such section names.
This also fixes PR24520.
Differential Revision: http://reviews.llvm.org/D15678
llvm-svn: 264038
Alexander Kornienko [Tue, 22 Mar 2016 11:03:03 +0000 (11:03 +0000)]
[ASTMatchers] New matcher hasReturnValue added
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue).
Reviewers: klimek, sbenza
Subscribers: xazax.hun, klimek, cfe-commits
Patch by Ádám Balogh!
Differential Revision: http://reviews.llvm.org/D17986
llvm-svn: 264037
Vasileios Kalintiris [Tue, 22 Mar 2016 10:41:20 +0000 (10:41 +0000)]
Fix warning about extra semicolon. NFC.
llvm-svn: 264035
Simon Atanasyan [Tue, 22 Mar 2016 08:36:48 +0000 (08:36 +0000)]
[ELF][MIPS] Delete GotSection::addMipsLocalEntry method
Now local symbols have SymbolBody so we can handle all kind of symbols
in the GotSection::addEntry method. The patch moves the code from
addMipsLocalEntry to addEntry. NFC.
Differential Revision: http://reviews.llvm.org/D18302
llvm-svn: 264032
Jonas Hahnfeld [Tue, 22 Mar 2016 08:23:24 +0000 (08:23 +0000)]
[OMPT] Make tests require OMPT_BLAME
ompt_event_barrier_{begin,end} are optional blame events.
In total it doesn't make any sense to test partially built OMPT support.
llvm-svn: 264031
Mohit K. Bhakkad [Tue, 22 Mar 2016 08:08:02 +0000 (08:08 +0000)]
[LLDB]{MIPS] Fix TestPlatformProcessConnect.py
Patch by Nitesh Jain
Reviewers: clayborg, labath.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D18082
llvm-svn: 264030
Mehdi Amini [Tue, 22 Mar 2016 07:35:51 +0000 (07:35 +0000)]
Fix unittests: resize() -> reserve()
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264029
Mehdi Amini [Tue, 22 Mar 2016 07:31:35 +0000 (07:31 +0000)]
DenseMap resize() is now named reserved(), adapt the call sites
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264028
Jonas Hahnfeld [Tue, 22 Mar 2016 07:22:49 +0000 (07:22 +0000)]
[OMPT] Create infrastructure and add first tests for OMPT
Some basic checks next to the implementation should futher lower the
possibility to introduce regressions. (Note that this would have catched
the ordering issue fixed in rL258866 and pointed to rL263940.)
The tests are implementation dependent in one point because they assume that
thread ids are assigned in ascending order. This is not defined by the standard
but currently ensured in libomp. We have to think about another way of ordering
the threads should this ever be subject to change...
Note that this isn't aiming at replacing the implementation independent
test-suite at https://github.com/OpenMPToolsInterface/ompt-test-suite!
Differential Revision: http://reviews.llvm.org/D16715
llvm-svn: 264027
Mehdi Amini [Tue, 22 Mar 2016 07:20:00 +0000 (07:20 +0000)]
Rename DenseMap::resize() into DenseMap::reserve() (NFC)
This is more coherent with usual containers.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264026
Akira Hatanaka [Tue, 22 Mar 2016 05:00:21 +0000 (05:00 +0000)]
[Objective-c] Do not set IsExact to true when the receiver is a class.
IsExact shouldn't be set to true in WeakObjectProfileTy::getBaseInfo
when the receiver is a class because having a class as the receiver
doesn't guarantee that the Base is exact.
This is a follow-up to r263818.
rdar://problem/
25208167
llvm-svn: 264025
Junmo Park [Tue, 22 Mar 2016 04:37:32 +0000 (04:37 +0000)]
Minor code cleanup. NFC.
llvm-svn: 264024
Pete Cooper [Tue, 22 Mar 2016 04:00:41 +0000 (04:00 +0000)]
Revert "Use owning pointers instead of raw pointers for Atom's to fix leaks."
This reverts commit r264022.
This breaks the Window's bots which don't like that i'm calling ~Atom when
the this pointer is a sublcass of Atom.
Reverting for now until I try find a better fix. I tried using std::unique_ptr with
a custom deleter as a quick fix, but it didn't work well in the YAML parser.
llvm-svn: 264023
Pete Cooper [Tue, 22 Mar 2016 03:44:32 +0000 (03:44 +0000)]
Use owning pointers instead of raw pointers for Atom's to fix leaks.
Currently each File contains an BumpPtrAllocator in which Atom's are
allocated. Some Atom's contain data structures like std::vector which
leak as we don't run ~Atom when they are BumpPtrAllocate'd.
Now each File actually owns its Atom's using an OwningAtomPtr. This
is analygous to std::unique_ptr and may be replaced by it if possible.
An Atom can therefore only be owned by a single File, so the Resolver now
moves them from one File to another. The MachOLinkingContext owns the File's
and so clears all the Atom's in ~MachOLinkingContext, then delete's all the
File's. This makes sure all Atom's have been destructed before any of the
BumpPtrAllocator's in which they run have gone away.
Should hopefully fix the remaining leaks. Will keep an eye on the bots to
make sure.
llvm-svn: 264022
Chris Bieneman [Tue, 22 Mar 2016 02:55:40 +0000 (02:55 +0000)]
[Perf-training] Fixing an issue with multi-threading PGO generation
When LIT parallelizes the profraw file generation we need to generate unique temp filenames then clean them up after the driver executes.
llvm-svn: 264021
Mike Spertus [Tue, 22 Mar 2016 02:29:22 +0000 (02:29 +0000)]
Visual Studio Native Visualizations for constructors and methods
With this change, the class
struct A {
A(int _i);
~A();
int foo(double d);
double bar(A *a) { return 1.3; }
};
appears in the VS2015 Locals Window as
D 0x02dbb378 struct A
|- DeclKind CXXRecord
|- Members
|- [0] implicit struct A
|- [1] Constructor {A(int _i)}
|- [2] Destructor {~A()}
|- [3] Method {int foo(double d)}
|- [4] Method {double bar(struct A *)}
|- [Raw View] /* Other stuff */
Note that these changes only benefit VS2015 as
VS2013 does not have views and only displays the
struct name "A", but the change does no apparent
harm in VS2013, so is still a win.
llvm-svn: 264020
Sanjoy Das [Tue, 22 Mar 2016 02:11:57 +0000 (02:11 +0000)]
Appease the windows buildbots
The guess is that the stdout/stderr ordering may differ between windows
/ unix.
llvm-svn: 264019
Arpith Chacko Jacob [Tue, 22 Mar 2016 01:48:56 +0000 (01:48 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.
Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.
Reviewers: ABataev
Differential Revision: http://reviews.llvm.org/D17877
Reworked test case after buildbot failure on windows.
Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp.
llvm-svn: 264018
Reid Kleckner [Tue, 22 Mar 2016 01:14:36 +0000 (01:14 +0000)]
Move -fms-compatibility-version=19 into target cflags
This reduces cflags duplication and allows us to build
sanitizer_common/tests with clang and the VS 2015 STL.
llvm-svn: 264017
Reid Kleckner [Tue, 22 Mar 2016 01:04:33 +0000 (01:04 +0000)]
[asan] Relax strdup test check lines
On the buildbot, strdup appears as frame 1 instead of frame 0. Either is
an acceptable user experience.
llvm-svn: 264016
Sanjoy Das [Tue, 22 Mar 2016 00:59:13 +0000 (00:59 +0000)]
Add "first class" lowering for deopt operand bundles
Summary:
After this change, deopt operand bundles can be lowered directly by
SelectionDAG into STATEPOINT instructions (which are then lowered to a
call or sequence of nop, with an associated __llvm_stackmaps entry0.
This obviates the need to round-trip deoptimization state through
gc.statepoint via RewriteStatepointsForGC.
Reviewers: reames, atrick, majnemer, JosephTremoulet, pgavlin
Subscribers: sanjoy, mcrosier, majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D18257
llvm-svn: 264015
Reid Kleckner [Tue, 22 Mar 2016 00:53:04 +0000 (00:53 +0000)]
Wrap 81 character line to satisfy linter
llvm-svn: 264014
Reid Kleckner [Tue, 22 Mar 2016 00:52:47 +0000 (00:52 +0000)]
[asan] Intercept strdup on Windows
Some unit tests were failing because we didn't intercept strdup. It
turns out it works just fine on 2013 and 2015 with a small patch to the
interception logic.
llvm-svn: 264013
Siva Chandra [Tue, 22 Mar 2016 00:35:31 +0000 (00:35 +0000)]
[JITLoaderGDB] Pack the jit entry struct according to the target arch.
Reviewers: clayborg
Subscribers: tberghammer, dsrbecky, lldb-commits
Differential Revision: http://reviews.llvm.org/D18334
llvm-svn: 264012
Reid Kleckner [Tue, 22 Mar 2016 00:34:53 +0000 (00:34 +0000)]
[asan] Also apply r264006 to asan_win_dynamic_runtime_thunk.cc
llvm-svn: 264011
Reid Kleckner [Tue, 22 Mar 2016 00:11:51 +0000 (00:11 +0000)]
Fix coverage-related asan tests for VS 2015
printf is an inline function in VS 2015, giving these tests an
unexpected extra point of coverage. This change works around that by
avoiding printf.
llvm-svn: 264010
Justin Lebar [Tue, 22 Mar 2016 00:09:28 +0000 (00:09 +0000)]
[CUDA] Implement atomicInc and atomicDec builtins
These functions cannot be implemented as atomicrmw or cmpxchg
instructions, so they are implemented as a call to the NVVM intrinsics
@llvm.nvvm.atomic.load.inc.32.p0i32 and
@llvm.nvvm.atomic.load.dec.32.p0i32.
Patch by Jason Henline.
Reviewers: jlebar
Differential Revision: http://reviews.llvm.org/D18322
llvm-svn: 264009
Justin Lebar [Tue, 22 Mar 2016 00:09:25 +0000 (00:09 +0000)]
[sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.
Summary: NFC
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D18327
llvm-svn: 264008
NAKAMURA Takumi [Mon, 21 Mar 2016 23:51:50 +0000 (23:51 +0000)]
Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting."
It seems the test wouldn't expect if default target is *-win32.
llvm-svn: 264007
Reid Kleckner [Mon, 21 Mar 2016 23:51:21 +0000 (23:51 +0000)]
[asan] Set the unhandled exception filter slightly later during startup
VS 2015 moved the priority of their exception filter initializer from
XIY to XCAA. We now set ours to XCAB, which makes it run after both CRT
versions but before user constructors, as it should.
Fixes null_deref.cc and a variety of related tests with VS 2015. Only 4
failures remain.
llvm-svn: 264006
Reid Kleckner [Mon, 21 Mar 2016 23:51:17 +0000 (23:51 +0000)]
[asan] Add new _*_base interceptors for VS 2015
There are some places in the CRT (such as mbctype) that directly call
_malloc_base. If you are incrementally linking a binary with ASan from
before this change, this change appears to result in a linker error.
Retrying the link succeeds for some reason.
llvm-svn: 264005
Pete Cooper [Mon, 21 Mar 2016 23:17:47 +0000 (23:17 +0000)]
Move ownership of Pass File's to the MachoLinkingContext.
In trying to fix the leaks in the MachO lld codebase, we need to have
a better model for file and atom ownership. Having the context own
everything seems like the simplest model, so change all the passes to
allocate File's on the context instead of owning files as a member.
llvm-svn: 264004
Mike Aizatsky [Mon, 21 Mar 2016 23:08:16 +0000 (23:08 +0000)]
[sancov] do not instrument nodes that are full pre-dominators
Summary:
Without tree pruning clang has 2,667,552 points.
Wiht only dominators pruning: 1,515,586.
With both dominators & predominators pruning: 1,340,534.
Resubmit of r262103.
Differential Revision: http://reviews.llvm.org/D18341
llvm-svn: 264003
Justin Lebar [Mon, 21 Mar 2016 23:05:15 +0000 (23:05 +0000)]
[CUDA] Add documentation explaining how to detect clang vs nvcc.
llvm-svn: 264002
John Thompson [Mon, 21 Mar 2016 23:05:14 +0000 (23:05 +0000)]
Fixed some cases in the modularize assistant mode where header file names didn't translate to valid module names.
llvm-svn: 264001
Nicolai Haehnle [Mon, 21 Mar 2016 22:54:02 +0000 (22:54 +0000)]
AMDGPU: Fix dangling references introduced by r263982
Fixes Valgrind errors on the test cases that were reported as failing
by buildbots.
llvm-svn: 264000
Davide Italiano [Mon, 21 Mar 2016 22:44:24 +0000 (22:44 +0000)]
[ELF] Simplify code a bit. No functional change.
llvm-svn: 263999