Aaron Ballman [Fri, 11 Sep 2015 11:51:24 +0000 (11:51 +0000)]
Fixed HasDeclarationMatcher to properly convert all types into decls where possible. Added objcObjectPointerType(), objcInterfaceDecl(), templateTypeParmType(), injectedClassNameType(), and unresolvedUsingTypenameDecl(). Updated documentation for pointerType() to call out that it does not match ObjCObjectPointerType types. Changed pointsTo() to handle ObjCObjectPointerType as well as PointerType.
While this may seem like a lot of unrelated changes, they all relate back to fixing HasDeclarationMatcher.
This now allows us to write a matcher like:
varDecl(hasType(namedDecl(hasName("Foo"))))
that matches code using typedefs, objc interfaces, template type parameters, injected class names, or unresolved using typenames.
llvm-svn: 247404
Bruce Mitchener [Fri, 11 Sep 2015 11:17:30 +0000 (11:17 +0000)]
[lldb-mi] No need to call Format with no varargs.
Summary:
There's no need to call CMIUtilString::Format
with a string and no args.
Reviewers: abidh, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12796
llvm-svn: 247403
Bruce Mitchener [Fri, 11 Sep 2015 10:37:17 +0000 (10:37 +0000)]
Clean up build of JITLoader/GDB in autoconf build.
Summary:
This builds on all platforms, so remove duplication in build
configuration.
Reviewers: labath, clayborg, emaste
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12792
llvm-svn: 247402
Alexey Bataev [Fri, 11 Sep 2015 10:29:41 +0000 (10:29 +0000)]
[OPENMP] Preserve alignment of the original variables for the captured references.
Patch makes codegen to preserve alignment of the shared variables captured and used in OpenMP regions.
llvm-svn: 247401
Tamas Berghammer [Fri, 11 Sep 2015 10:04:00 +0000 (10:04 +0000)]
Improve the arm/aarch64 mapping symbol handling
Change the mapping symbol handling to handle the case when the mapping
symbols are prefixed with an arbitrary prefix. This isn't strictly standard
compliance, but if all symbols in an object file is prefixed with objcopy
then the prefix will be added to the mapping symbol also. We still want to
treat these symbols as mapping symbols to get the correct address class data.
Differential revision: http://reviews.llvm.org/D12755
llvm-svn: 247400
Angel Garcia Gomez [Fri, 11 Sep 2015 10:02:07 +0000 (10:02 +0000)]
Another patch for modernize-loop-convert.
Summary:
1. Avoid converting loops that iterate over the size of a container and don't use its elements, as this would result in an unused-result warning.
2. Never capture the elements by value on lambdas, thus avoiding doing unnecessary copies and errors with non-copyable types.
3. The 'const auto &' instead of 'auto &' substitution on const containers now works on arrays and pseudoarrays as well.
4. The error about multiple replacements in the same macro call is now documented in the tests (not solved though).
5. Due to [1], I had to add a dummy usage of the range element (like "(void) *It;" or similars) on the tests that had empty loops.
6. I removed the braces from the CHECK comments. I think that there is no need for them, and they confuse vim.
Reviewers: klimek
Subscribers: alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D12734
llvm-svn: 247399
Michael Kruse [Fri, 11 Sep 2015 09:01:55 +0000 (09:01 +0000)]
Add Polly header files to IDE projects
llvm-svn: 247398
NAKAMURA Takumi [Fri, 11 Sep 2015 08:56:12 +0000 (08:56 +0000)]
clang/test/Modules/ExtDebugInfo.cpp: Use %itanium_abi_triple.
llvm-svn: 247397
NAKAMURA Takumi [Fri, 11 Sep 2015 08:53:29 +0000 (08:53 +0000)]
clang/test/Modules/ExtDebugInfo.cpp: Use [[@LINE]].
llvm-svn: 247396
NAKAMURA Takumi [Fri, 11 Sep 2015 08:20:56 +0000 (08:20 +0000)]
PPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.
It caused crash in MachineInstr::hasPropertyInBundle() since r247237.
llvm-svn: 247395
NAKAMURA Takumi [Fri, 11 Sep 2015 08:16:30 +0000 (08:16 +0000)]
clang-tidy/misc-sizeof-container.cpp: Add explicit triple.
For targeting LLP64, like Windows x86, size_t is not unsigned long.
tools/clang/tools/extra/test/clang-tidy/Output/misc-sizeof-container.cpp.tmp.cpp:33:12: error: target of using declaration conflicts with declaration already in scope [clang-diagnostic-error]
using std::size_t;
^
llvm-svn: 247394
NAKAMURA Takumi [Fri, 11 Sep 2015 08:16:22 +0000 (08:16 +0000)]
clang-tidy/readability-inconsistent-declaration-parameter-name.cpp: Appease MS-incompatibility [-fno-delayed-template-parsing]
llvm-svn: 247393
NAKAMURA Takumi [Fri, 11 Sep 2015 08:13:32 +0000 (08:13 +0000)]
Fix \param in r247251. [-Wdocumentation]
llvm-svn: 247392
NAKAMURA Takumi [Fri, 11 Sep 2015 08:03:17 +0000 (08:03 +0000)]
Fix llvm/test/tools/gold/X86/bad-alias.ll.
llvm-svn: 247391
Bruce Mitchener [Fri, 11 Sep 2015 08:02:50 +0000 (08:02 +0000)]
[lldb-mi] Fix failure in log file initialization.
I broke this in r247388.
llvm-svn: 247390
Alexey Bataev [Fri, 11 Sep 2015 04:54:28 +0000 (04:54 +0000)]
[OPENMP] Fix printing of array section with single index.
llvm-svn: 247389
Bruce Mitchener [Fri, 11 Sep 2015 04:50:44 +0000 (04:50 +0000)]
[lldb-mi] Remove MIUtilSystem*.
Summary:
This platform-specific code wasn't fully implemented and wasn't
actually needed. There was one call for the log file path and
that has been addressed.
This lets us also remove an error message from MICmnLogMediumFile
as it is no longer used.
Reviewers: ki.stfu, domipheus, abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12764
llvm-svn: 247388
Rui Ueyama [Fri, 11 Sep 2015 04:29:03 +0000 (04:29 +0000)]
COFF: Teach ICF to merge cyclic graphs.
Previously, LLD's ICF couldn't merge cyclic graphs. That was unfortunate
because, in COFF, cyclic graphs are not exceptional at all. That is
pretty common.
In this patch, sections are grouped by Tarjan's strongly connected
component algorithm to get acyclic graphs. And then we try to merge
SCCs whose outdegree is zero, and remove them from the graph. This
makes other SCCs to have outdegree zero, so we can repeat the
process until all SCCs are removed. When comparing two SCCs, we handle
cycles properly.
This algorithm works better than previous one. Previously, self-linking
produced a 29.0MB executable. It now produces a 27.7MB. There's still some
gap compared to MSVC linker which produces a 27.1MB executable for the
same input. So the gap is narrowed, but still LLD is not on par with MSVC.
I'll investigate that later.
llvm-svn: 247387
Frederic Riss [Fri, 11 Sep 2015 04:17:30 +0000 (04:17 +0000)]
[dsymutil] Discard useless location attributes.
When cloning the debug info for a function that hasn't been linked,
strip the DIEs from all location attributes that wouldn't contain any
meaningful information anyway.
This kind of situation can happen when a function got discarded by the
linker, but its debug information is still wanted in the final link
because it was marked as required as some other DIE dependency. The easiest
way to get into that situation is to have using directives. They get
linked unconditionally, but their targets might not always be present.
llvm-svn: 247386
Frederic Riss [Fri, 11 Sep 2015 04:17:25 +0000 (04:17 +0000)]
[dsymutil] Rename some variables NFC.
lldb doesn't like having variables named as an existing type. In order to
ease debugging, rename those variables to avoid that conflict.
llvm-svn: 247385
Richard Smith [Fri, 11 Sep 2015 03:58:07 +0000 (03:58 +0000)]
[modules] Don't load files specified by -fmodule-file= when modules are
disabled. (We still allow this via -cc1 / -Xclang, primarily for testing.)
llvm-svn: 247384
Bruce Mitchener [Fri, 11 Sep 2015 03:52:08 +0000 (03:52 +0000)]
Link liblldb.so with LLVMObjCARCOpts.a
Summary:
Problems reported on NetBSD:
```
llvm[4]: Linking Debug+Asserts executable lldb
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCExpandPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCOptPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCAPElimPass()'
/tmp/build-llvm/Debug+Asserts/lib/liblldb.so: undefined reference to `llvm::createObjCARCContractPass()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/tmp/llvm/Makefile.rules:1434: recipe for target '/tmp/build-llvm/Debug+Asserts/bin/lldb' failed
```
Reviewers: joerg, sas
Subscribers: brucem, sas, lldb-commits
Change by Kamil Rytarowski <n54@gmx.com>
Differential Revision: http://reviews.llvm.org/D12749
llvm-svn: 247383
David Blaikie [Fri, 11 Sep 2015 03:42:32 +0000 (03:42 +0000)]
Update polly for explicit type parameter to global alias change
llvm-svn: 247382
David Blaikie [Fri, 11 Sep 2015 03:28:37 +0000 (03:28 +0000)]
Fix the gold test cases after alias changes
llvm-svn: 247381
David Blaikie [Fri, 11 Sep 2015 03:22:18 +0000 (03:22 +0000)]
[opaque pointer type] update test cases for explicit pointee types on global aliases
llvm-svn: 247380
David Blaikie [Fri, 11 Sep 2015 03:22:12 +0000 (03:22 +0000)]
[opaque pointer type] update test cases for explicit pointee types on global aliases
llvm-svn: 247379
David Blaikie [Fri, 11 Sep 2015 03:22:04 +0000 (03:22 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases
update.py:
import fileinput
import sys
import re
alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias"
plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)")
cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)")
gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)")
def conv(line):
m = re.match(cast, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(gep, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(plain, line)
if m:
return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n"
return line
for line in sys.stdin:
sys.stdout.write(conv(line))
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
llvm-svn: 247378
Richard Smith [Fri, 11 Sep 2015 03:14:00 +0000 (03:14 +0000)]
[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
The former setup once resulted in us ignoring the module for C compilations,
but Clang now errors on this if the header is included from C code (which it is).
llvm-svn: 247377
Cong Hou [Fri, 11 Sep 2015 02:47:30 +0000 (02:47 +0000)]
Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.
llvm-svn: 247376
Richard Smith [Fri, 11 Sep 2015 02:22:03 +0000 (02:22 +0000)]
[modules] Slightly defang an assert that produces false-positives on the selfhost bot.
llvm-svn: 247375
Michael Zolotukhin [Fri, 11 Sep 2015 02:01:15 +0000 (02:01 +0000)]
Docs: Document __builtin_nontemporal_load and __builtin_nontemporal_store.
Summary:
In r247104 I added the builtins for generating non-temporal memory operations,
but now I realized that they lack documentation. This patch adds some.
Differential Revision: http://reviews.llvm.org/D12785
llvm-svn: 247374
Argyrios Kyrtzidis [Fri, 11 Sep 2015 01:44:56 +0000 (01:44 +0000)]
[sema] Fix assertion hit when using libclang to index a particular C++ snippet involving templates.
Assertion hit was in ClassTemplateSpecializationDecl::getSourceRange().
llvm-svn: 247373
Duncan P. N. Exon Smith [Fri, 11 Sep 2015 01:34:59 +0000 (01:34 +0000)]
AsmWriter: Avoid O(N^2) processing of metadata
Fix embarrassing bugs I introduced to the `SlotTracker` in or around
r235785. I had us iterating through every instruction in a function
(and hitting a map in the LLVMContext) for every basic block in the
function.
While there, completely avoid the call to
`SlotTracker::processFunctionMetadata()` from
`SlotTracker::processFunction()` if we've speculatively done this
already in `SlotTracker::processModule()` by checking
`ShouldInitializeAllMetadata` (this wasn't an algorithmic problem, but
it's touching the same line of code).
Fixes PR24699.
llvm-svn: 247372
Mehdi Amini [Fri, 11 Sep 2015 01:33:48 +0000 (01:33 +0000)]
Revert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite"
This reverts commit r247356.
Breaks test/Transforms/InstCombine/pr8547.ll with:
Wrong types for attribute: byval inalloca nest noalias nocapture nonnull readnone readonly sret dereferenceable(1) dereferenceable_or_null(1)
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 nonnull %conv2) #0
LLVM ERROR: Broken function found, compilation aborted!
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 247371
Rafael Espindola [Fri, 11 Sep 2015 01:14:39 +0000 (01:14 +0000)]
Add a DT_SYMTAB entry in the dynamic section.
With this a trivial shared binary runs with the glibc dynamic linker:
LD_LIBRARY_PATH=. /lib64/ld-2.20.so ./t
llvm-svn: 247370
Adrian Prantl [Fri, 11 Sep 2015 01:03:26 +0000 (01:03 +0000)]
Module Debugging: Emit forward declarations for types that are defined in
clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified.
llvm-svn: 247369
Adrian Prantl [Fri, 11 Sep 2015 01:03:19 +0000 (01:03 +0000)]
Cleanup: Let CGDebugInfo::ModuleRefCache use a TrackingMDNode (NFC).
llvm-svn: 247368
David Majnemer [Fri, 11 Sep 2015 00:53:15 +0000 (00:53 +0000)]
[MS ABI] Remove another call to RequireCompleteType
I cannot come up with a testcase which would rely on this call to
RequireCompleteType, I believe that it is superfluous given the current
state of clang.
llvm-svn: 247367
Bruce Mitchener [Fri, 11 Sep 2015 00:31:33 +0000 (00:31 +0000)]
Clean up building & linking of Process/elf-core.
Summary:
* cmake/LLDBDependencies.cmake: elf-core is already included
globally in LLDB_USED_LIBS, so it doesn't need to be re-added
on individual platforms.
* lib/Makefile: elf-core is linked on each platform, so move it
to the global list of used libraries.
* source/Plugins/Makefile: elf-core is built on each platform, so
move it to the global list of things to build.
Reviewers: clayborg, labath
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12762
llvm-svn: 247366
Rafael Espindola [Fri, 11 Sep 2015 00:30:13 +0000 (00:30 +0000)]
Create a dynamic symbol table.
For now it includes every symbol in the regular table. Since we don't
create dynamic relocations yet, we don't have a good way of knowing which
symbols are actually needed.
llvm-svn: 247365
Kostya Serebryany [Fri, 11 Sep 2015 00:20:58 +0000 (00:20 +0000)]
[libFuzzer] perform fewer crossover operations compared to plain mutations
llvm-svn: 247364
Rafael Espindola [Fri, 11 Sep 2015 00:10:11 +0000 (00:10 +0000)]
Cache the bss output section in the writer, not in the symbol table.
There is soon going to be two symbol tables, but there will still be only one
output bss.
llvm-svn: 247363
Reid Kleckner [Fri, 11 Sep 2015 00:09:39 +0000 (00:09 +0000)]
[Driver] Use UniversalCRT on Windows if available
Summary:
With Visual Studio 2015 release, a part of runtime library was extracted
and now comes with Windows Kits. This patch enables clang to use
Universal CRT library if %INCLUDE or %LIB environment varaibles are not
specified.
See also https://llvm.org/bugs/show_bug.cgi?id=24741
Patch by Igor Kudrin
Reviewers: zturner, hans, rnk
Subscribers: ruiu, cfe-commits
Differential Revision: http://reviews.llvm.org/D12695
llvm-svn: 247362
Reid Kleckner [Thu, 10 Sep 2015 23:59:45 +0000 (23:59 +0000)]
Add .exe check to Execute to fix clang-modernize tests broken in r247358
llvm-svn: 247361
Michael Zolotukhin [Thu, 10 Sep 2015 23:56:10 +0000 (23:56 +0000)]
Docs: Add missing new line before a list.
llvm-svn: 247360
Richard Smith [Thu, 10 Sep 2015 23:30:27 +0000 (23:30 +0000)]
[modules] Add another .def file to our list of textual headers.
llvm-svn: 247359
Reid Kleckner [Thu, 10 Sep 2015 23:28:06 +0000 (23:28 +0000)]
ScanDirForExecutable on Windows fails to find executables with the "exe" extension in name
When the driver tries to locate a program by its name, e.g. a linker, it
scans the paths provided by the toolchain using the ScanDirForExecutable
function. If the lookup fails, the driver uses
llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName,
ScanDirForExecutable is not aware of file extensions. If the program has
the "exe" extension in its name, which is very common on Windows,
ScanDirForExecutable won't find it under the toolchain-provided paths.
This patch changes the Windows version of the "`can_execute`" function
called by ScanDirForExecutable to respect file extensions, similarly to
llvm::sys::findProgramByName.
Patch by Oleg Ranevskyy
Reviewers: rnk
Differential Revision: http://reviews.llvm.org/D12711
llvm-svn: 247358
Cong Hou [Thu, 10 Sep 2015 23:10:42 +0000 (23:10 +0000)]
Pass BranchProbability/BlockMass by value instead of const& as they are small. NFC.
llvm-svn: 247357
Chen Li [Thu, 10 Sep 2015 23:04:49 +0000 (23:04 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite
Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of passing arguments at callsite. In this way it can handle cases where the argument does not have nonnull attribute but has a dominating null check from the CFG.
Reviewers: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12779
llvm-svn: 247356
Rafael Espindola [Thu, 10 Sep 2015 22:49:06 +0000 (22:49 +0000)]
Make a few details of the string and symbol table private.
This is in preparation to adding a dynamic string table.
llvm-svn: 247355
Rafael Espindola [Thu, 10 Sep 2015 22:46:38 +0000 (22:46 +0000)]
Mark another method const. Sorry for missing this one the first time.
llvm-svn: 247354
Chen Li [Thu, 10 Sep 2015 22:35:41 +0000 (22:35 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return value
Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of gc.relocate return value. In this way it can handle cases where the relocated value does not have nonnull attribute but has a dominating null check from the CFG.
Reviewers: reames
Subscribers: llvm-commits, sanjoy
Differential Revision: http://reviews.llvm.org/D12772
llvm-svn: 247353
Filipe Cabecinhas [Thu, 10 Sep 2015 22:34:39 +0000 (22:34 +0000)]
Remove gcc warning when comparing an unsigned var for >= 0
llvm-svn: 247352
Reid Kleckner [Thu, 10 Sep 2015 22:31:45 +0000 (22:31 +0000)]
Handle '-r' option properly
Summary:
This fixs the bug
https://llvm.org/bugs/show_bug.cgi?id=12587
Patch by Yunlian Jiang
Reviewers: Bigcheese, rnk
Differential Revision: http://reviews.llvm.org/D10279
llvm-svn: 247351
John McCall [Thu, 10 Sep 2015 22:27:50 +0000 (22:27 +0000)]
Support noreturn in limited contexts on Objective-C message sends.
rdar://6198039
llvm-svn: 247350
Reid Kleckner [Thu, 10 Sep 2015 22:11:13 +0000 (22:11 +0000)]
[SEH] Use cleanupendpad so that WinEHPrepare gets the coloring right
Cleanupendpad is a lot like catchendpad, so we can reuse the same
EHScopeStack type.
llvm-svn: 247349
Reid Kleckner [Thu, 10 Sep 2015 22:00:02 +0000 (22:00 +0000)]
[WinEH] Push and pop EBP for 32-bit funclets
The Win32 EH runtime caller does not preserve EBP, even though it does
preserve the CSRs (EBX, ESI, EDI) for us. The result was that each
finally funclet call would leave the frame pointer off by 12 bytes.
llvm-svn: 247348
Roman Divacky [Thu, 10 Sep 2015 21:56:16 +0000 (21:56 +0000)]
Unbreak building on FreeBSD.
llvm-svn: 247347
David Majnemer [Thu, 10 Sep 2015 21:52:00 +0000 (21:52 +0000)]
[MS ABI] Make member pointers return true for isIncompleteType
The type of a member pointer is incomplete if it has no inheritance
model. This lets us reuse more general logic already embedded in clang.
llvm-svn: 247346
Matt Arsenault [Thu, 10 Sep 2015 21:51:19 +0000 (21:51 +0000)]
AMDGPU: Simplify debug printing
llvm-svn: 247345
Matt Arsenault [Thu, 10 Sep 2015 21:51:15 +0000 (21:51 +0000)]
AMDGPU: Use StringRef value
llvm-svn: 247344
James Y Knight [Thu, 10 Sep 2015 21:49:06 +0000 (21:49 +0000)]
[SPARC] Switch to the Machine Scheduler.
The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.
Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.
(Actually committing the test changes too, this time, unlike r247315)
llvm-svn: 247343
Rafael Espindola [Thu, 10 Sep 2015 21:48:36 +0000 (21:48 +0000)]
Mark two methods const.
While at it, optimize getOffset a bit.
llvm-svn: 247342
Reid Kleckner [Thu, 10 Sep 2015 21:46:36 +0000 (21:46 +0000)]
Fix SEH state numbering algorithm to handle cleanupendpads
WinEHPrepare's new coloring algorithm really expects to see
cleanupendpads now, so Clang will start emitting them soon.
llvm-svn: 247341
Jonathan Peyton [Thu, 10 Sep 2015 21:33:50 +0000 (21:33 +0000)]
[OMPT] Fix assertion that arises when waiting for proxy tasks on runtime shutdown
This only triggered when built in debug mode with OMPT enabled:
__kmp_wait_template expected the state of the current thread to be either
ompt_state_idle or ompt_state_wait_barrier{,_implicit,_explicit}.
Patch by Jonas Hahnfeld
Differential Revision: http://reviews.llvm.org/D12754
llvm-svn: 247339
Tobias Grosser [Thu, 10 Sep 2015 21:32:29 +0000 (21:32 +0000)]
XFAIL tests that require an additional LLVM patch to work
llvm-svn: 247338
Matthew Simpson [Thu, 10 Sep 2015 21:12:57 +0000 (21:12 +0000)]
[LV] Relax Small Size Reduction Type Requirement
This patch enables small size reductions in which the source types are smaller
than the reduction type (e.g., computing an i16 sum from the values in an i8
array). The previous behavior was to only allow small size reductions if the
source types and reduction type were the same. The change accounts for the fact
that the existing sign- and zero-extend instructions in these cases should
still be included in the cost model.
Differential Revision: http://reviews.llvm.org/D12770
llvm-svn: 247337
Lang Hames [Thu, 10 Sep 2015 21:05:58 +0000 (21:05 +0000)]
[RuntimeDyld] Support non-zero addends for the MachO X86_64 SUBTRACTOR reloc.
This functionality was accidentally left out of r247119.
llvm-svn: 247336
Lang Hames [Thu, 10 Sep 2015 20:44:36 +0000 (20:44 +0000)]
[RuntimeDyld] Fix a bug in debugging output: all sections should be dumped
before any relocations have been applied, and again after all relocations have
been applied.
Previously each section was dumped before and after relocations targetting it
were applied, but this only shows the impact of relocations that point to other
symbols in the same section.
llvm-svn: 247335
Chandler Carruth [Thu, 10 Sep 2015 20:34:57 +0000 (20:34 +0000)]
Add an explicit 'inline' specifier to these static functions. GCC is
warning on them having always_inline attribute for reasons I don't fully
understand -- static functions are just as inlinable as inline
functions in terms of linkage.
llvm-svn: 247334
Jonathan Peyton [Thu, 10 Sep 2015 20:34:32 +0000 (20:34 +0000)]
Fix depth field bug and resize() function in hierarchical barrier
This is a follow up to the hierarchy cleanup patch.
Added some clarifying comments to hierarchy_info.
Fixed a bug with the depth field not being updated cleanly during a resize.
Fixed resize to first check capacity as determined by maxLevels before actually doing the full resize.
Differential Revision: http://reviews.llvm.org/D12562
llvm-svn: 247333
Piotr Padlewski [Thu, 10 Sep 2015 20:18:30 +0000 (20:18 +0000)]
Revert "Generating assumption loads of vptr after ctor call (fixed)"
It seems that there is small bug, and we can't generate assume loads
when some virtual functions have internal visibiliy
This reverts commit
982bb7d966947812d216489b3c519c9825cacbf2.
llvm-svn: 247332
Reid Kleckner [Thu, 10 Sep 2015 20:07:25 +0000 (20:07 +0000)]
Correct the return type of CreateCleanupEndPad
llvm-svn: 247331
Rafael Espindola [Thu, 10 Sep 2015 20:02:22 +0000 (20:02 +0000)]
Fix a warning when building with gcc.
It was
/Writer.cpp:119:45: warning: enumeral and non-enumeral type in conditional expression
llvm-svn: 247330
Greg Clayton [Thu, 10 Sep 2015 19:46:25 +0000 (19:46 +0000)]
A little more cleanup in the build script that creates a list of archive directories to make things more clear.
llvm-svn: 247329
James Y Knight [Thu, 10 Sep 2015 19:42:03 +0000 (19:42 +0000)]
Revert "[SPARC] Switch to the Machine Scheduler."
This reverts commit r247315.
Accidentally omitted test changes; will resubmit full change shortly.
llvm-svn: 247328
Nico Weber [Thu, 10 Sep 2015 19:35:31 +0000 (19:35 +0000)]
Move sel-address.mm from test/CodeGenCXX to test/SemaObjCXX, it's not a codegen test.
llvm-svn: 247327
Jonathan Peyton [Thu, 10 Sep 2015 19:22:07 +0000 (19:22 +0000)]
Cleanup of affinity hierarchy code.
Some of this is improvement to code suggested by Hal Finkel. Four changes here:
1.Cleanup of hierarchy code to handle all hierarchy cases whether affinity is available or not
2.Separated this and other classes and common functions out to a header file
3.Added a destructor-like fini function for the hierarchy (and call in __kmp_cleanup)
4.Remove some redundant code that is hopefully no longer needed
Differential Revision: http://reviews.llvm.org/D12449
llvm-svn: 247326
Peter Collingbourne [Thu, 10 Sep 2015 19:18:08 +0000 (19:18 +0000)]
CFI: Run the tests only on supported architectures/OSs.
Specifically, only run the cfi-icall tests on x86/x86_64, and add
an XFAIL for darwin.
llvm-svn: 247325
Peter Collingbourne [Thu, 10 Sep 2015 19:18:05 +0000 (19:18 +0000)]
Driver: Support cfi-icall on all OSs when targeting x86/x86_64.
llvm-svn: 247324
Rui Ueyama [Thu, 10 Sep 2015 18:51:36 +0000 (18:51 +0000)]
Fix Clang-tidy misc-use-override warnings, other minor fixes.
Patch from Eugene Zelenko!
llvm-svn: 247323
David Majnemer [Thu, 10 Sep 2015 18:50:09 +0000 (18:50 +0000)]
[IR] Conservatively mark 'catchpad' as accessing memory
The exact semantics of 'catchpad' are really in the hands of the
personality routine so we shouldn't assume that they have no side
effects.
llvm-svn: 247322
Kostya Serebryany [Thu, 10 Sep 2015 18:48:38 +0000 (18:48 +0000)]
[libFuzzer] refactor the code to allow building libFuzzer on platforms that don't have dfsan and don't support weak functions
llvm-svn: 247321
Jonathan Peyton [Thu, 10 Sep 2015 18:44:30 +0000 (18:44 +0000)]
Fix hanging barriers if number of parallel regions exceeds UINT_MAX
The fix is to make b_arrived flag 64 bit in both structures - kmp_balign_team_t
and kmp_balign_t. Otherwise when flag in kmp_balign_team_t wrapped over
UINT_MAX the library hangs.
Differential Revision: http://reviews.llvm.org/D12563
llvm-svn: 247320
Adrian Prantl [Thu, 10 Sep 2015 18:39:45 +0000 (18:39 +0000)]
Add a getDeclContextDescriptor() helper function to CGDebugInfo. (NFC)
llvm-svn: 247319
Reid Kleckner [Thu, 10 Sep 2015 18:39:41 +0000 (18:39 +0000)]
[SEH] Use catchret in the new EH IR like we do for C++
Also add tests for SEH with the new IRGen.
llvm-svn: 247318
Artem Belevich [Thu, 10 Sep 2015 18:24:23 +0000 (18:24 +0000)]
[CUDA] Postprocess bitcode linked in during device-side CUDA compilation.
Link in and internalize the symbols we need from supplied bitcode library.
Differential Revision: http://reviews.llvm.org/D11664
llvm-svn: 247317
Chris Bieneman [Thu, 10 Sep 2015 18:22:33 +0000 (18:22 +0000)]
[CMake] Add lto subdirectory explicitly.
This is required because ExternalProject_Add requires all targets specified in the DEPENDS argument must exist before calling ExternalProject_Add.
I have a follow-up patch to clang that enables using the just-built libLTO in bootstrap builds, so we need to be able to add the LTO target as a dependency in clang.
llvm-svn: 247316
James Y Knight [Thu, 10 Sep 2015 18:20:45 +0000 (18:20 +0000)]
[SPARC] Switch to the Machine Scheduler.
The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.
Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.
llvm-svn: 247315
Matthew Simpson [Thu, 10 Sep 2015 18:12:47 +0000 (18:12 +0000)]
[SCEV] Consistently Handle Expressions That Cannot Be Divided
This patch addresses the issue of SCEV division asserting on some
input expressions (e.g., non-affine expressions) and quietly giving
up on others. When giving up, we set the quotient to be equal to
zero and the remainder to be equal to the numerator. With this
patch, we always quietly give up when we cannot perform the
division.
This patch also adds a test case for DependenceAnalysis that
previously caused an assertion.
Differential Revision: http://reviews.llvm.org/D11725
llvm-svn: 247314
JF Bastien [Thu, 10 Sep 2015 18:08:35 +0000 (18:08 +0000)]
[MergeFuncs] Fix callsite attributes in thunk generation
This change correctly sets the attributes on the callsites
generated in thunks. This makes sure things such as sret, sext, etc.
are correctly set, so that the call can be a proper tailcall.
Also, the transfer of attributes in the replaceDirectCallers function
appears to be unnecessary, but until this is confirmed it will remain.
Author: jrkoenig
Reviewers: dschuff, jfb
Subscribers: llvm-commits, nlewycky
Differential revision: http://reviews.llvm.org/D12581
llvm-svn: 247313
David Blaikie [Thu, 10 Sep 2015 18:03:45 +0000 (18:03 +0000)]
Tidy up some alias syntax to make explicit pointer type migration easier
llvm-svn: 247312
Jordan Rose [Thu, 10 Sep 2015 17:55:02 +0000 (17:55 +0000)]
[CMake] s/LLVM_SOURCE_DIR/LLVM_MAIN_SRC_DIR/
Fix-up for r247305 to use the right variable. There's another use of
LLVM_SOURCE_DIR in this file that is probably also questionable, but it's
for Windows so I'm going to leave it alone.
llvm-svn: 247311
Johannes Doerfert [Thu, 10 Sep 2015 17:51:27 +0000 (17:51 +0000)]
Runtime error check elimination
Hoist runtime checks in the loop nest if they guard an "error" like event.
Such events are recognized as blocks with an unreachable terminator or a call
to the ubsan function that deals with out of bound accesses. Other "error"
events can be added easily.
We will ignore these blocks when we detect/model/optmize and code generate SCoPs
but we will make sure that they would not have been executed using the assumption
framework.
llvm-svn: 247310
Philip Reames [Thu, 10 Sep 2015 17:44:47 +0000 (17:44 +0000)]
[SimplifyCFG] Use known bits to eliminate dead switch defaults
This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans.
If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known.
Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad. If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default.
Differential Revision: http://reviews.llvm.org/D12497
llvm-svn: 247309
Chris Bieneman [Thu, 10 Sep 2015 17:28:51 +0000 (17:28 +0000)]
[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
llvm-svn: 247308
Artem Belevich [Thu, 10 Sep 2015 17:26:58 +0000 (17:26 +0000)]
[CUDA] Allow trivial constructors as initializer for __shared__ variables.
Differential Revision: http://reviews.llvm.org/D12739
llvm-svn: 247307
Chris Bieneman [Thu, 10 Sep 2015 17:23:32 +0000 (17:23 +0000)]
[CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden
llvm-svn: 247306
Jordan Rose [Thu, 10 Sep 2015 17:18:51 +0000 (17:18 +0000)]
[CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.
This amends chapuni's r246156 to handle an Xcode quirk, one even called out
in the CMake documentation:
Some native build systems may not like targets that have only object files,
so consider adding at least one real source file to any target that
references $<TARGET_OBJECTS:objlib>.
I've limited the scope of this hack to Xcode for now.
llvm-svn: 247305
Adrian Prantl [Thu, 10 Sep 2015 17:13:58 +0000 (17:13 +0000)]
Debug Info: Allow a DIModule to appear as the scope of other entities.
llvm-svn: 247304