platform/upstream/llvm.git
8 years agoUpdate comment style.
Rafael Espindola [Tue, 9 Feb 2016 21:32:56 +0000 (21:32 +0000)]
Update comment style.

llvm-svn: 260286

8 years agoRevert "Correct size calculations for ELF files"
Rafael Espindola [Tue, 9 Feb 2016 21:30:10 +0000 (21:30 +0000)]
Revert "Correct size calculations for ELF files"

This reverts commit r259578.

There are enough issues with this small patch that it is better to
revert and then commit a fixed version (will be committed shortly).

llvm-svn: 260285

8 years agoIf we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver...
Greg Clayton [Tue, 9 Feb 2016 21:20:17 +0000 (21:20 +0000)]
If we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver, for use with /usr/lib/libgmalloc.dylib, then make sure we don't pass this environment variable on to any child processes.

llvm-svn: 260284

8 years ago[AArch64] This check is specific to merging instructions. NFC.
Chad Rosier [Tue, 9 Feb 2016 21:20:12 +0000 (21:20 +0000)]
[AArch64] This check is specific to merging instructions. NFC.

llvm-svn: 260283

8 years agoDon't enable -flimit-debug-info by default for the LLDB Xcode builds. This was put...
Greg Clayton [Tue, 9 Feb 2016 21:18:44 +0000 (21:18 +0000)]
Don't enable -flimit-debug-info by default for the LLDB Xcode builds. This was put in back in 2011 when -flimit-debug-info did a lot less than it does now. With llvm-dsymutil doing ODR type unique stuff we still have reasonably sized dSYM files.

llvm-svn: 260282

8 years agoRemove system-libs.test for now
Ehsan Akhgari [Tue, 9 Feb 2016 21:17:58 +0000 (21:17 +0000)]
Remove system-libs.test for now

This test fails in the ninja-x64-msvc-RA-centos6 builder, so the
UNSUPPORTED: system-windows condition is insufficient.  Removing it
for now; I will investigate how this can be fixed later.

llvm-svn: 260281

8 years agoFix a test added in r260263
Ehsan Akhgari [Tue, 9 Feb 2016 21:10:22 +0000 (21:10 +0000)]
Fix a test added in r260263

llvm-svn: 260280

8 years ago[InstCombine][GC] Handle gc.relocations of vector type
Philip Reames [Tue, 9 Feb 2016 21:09:22 +0000 (21:09 +0000)]
[InstCombine][GC] Handle gc.relocations of vector type

We introduced gc.relocates of vector-of-pointer types a couple of weeks back.  Somehow, I missed updating the InstCombine rule to account for this.  If we hit this code path with a vector-of-pointers gc.relocate, we'd crash on a cast<PointerType>.

I also took the chance to do a bit of code style cleanup.

llvm-svn: 260279

8 years agoAdd Tooling functionality to get a name for a QualType that can be used to name
Richard Smith [Tue, 9 Feb 2016 21:04:04 +0000 (21:04 +0000)]
Add Tooling functionality to get a name for a QualType that can be used to name
that type from the global scope.

Patch by Sterling Augustine, derived (with permission) from code from Cling by
Vassil Vassilev and Philippe Canal.

llvm-svn: 260278

8 years agoSimplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obvious
Richard Smith [Tue, 9 Feb 2016 20:59:05 +0000 (20:59 +0000)]
Simplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obvious
what it's actually trying to do.

llvm-svn: 260277

8 years agoFix the test added in r260266
Ehsan Akhgari [Tue, 9 Feb 2016 20:49:24 +0000 (20:49 +0000)]
Fix the test added in r260266

llvm-svn: 260276

8 years ago[AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator
Geoff Berry [Tue, 9 Feb 2016 20:47:21 +0000 (20:47 +0000)]
[AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator

Summary:
Fix case where a pre-inc/dec load/store would not be formed if the
add/sub that forms the inc/dec part of the operation was the first
instruction in the block being examined.

Reviewers: mcrosier, jmolloy, t.p.northover, junbuml

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 260275

8 years ago[AArch64] Bail even earlier if the instructions modifieds the base register. NFC.
Chad Rosier [Tue, 9 Feb 2016 20:44:41 +0000 (20:44 +0000)]
[AArch64] Bail even earlier if the instructions modifieds the base register. NFC.

llvm-svn: 260274

8 years ago[AArch64] Simplify. NFC.
Chad Rosier [Tue, 9 Feb 2016 20:27:45 +0000 (20:27 +0000)]
[AArch64] Simplify. NFC.

llvm-svn: 260273

8 years ago[AArch64] Add an assert to ensure we don't scale an offset that can't be scaled.
Chad Rosier [Tue, 9 Feb 2016 20:18:07 +0000 (20:18 +0000)]
[AArch64] Add an assert to ensure we don't scale an offset that can't be scaled.

llvm-svn: 260272

8 years agoUse __nl_symbol_ptr instead of __got in the stubs pass on x86 archs.
Pete Cooper [Tue, 9 Feb 2016 20:11:17 +0000 (20:11 +0000)]
Use __nl_symbol_ptr instead of __got in the stubs pass on x86 archs.

The non lazy atoms generated in the stubs pass use an image cache to
hold all of the pointers.  On arm archs, this is the __got section,
but on x86 archs it should be __nl_symbol_ptr.

rdar://problem/24572729

llvm-svn: 260271

8 years ago[PGO] Fix issue: explicitly defaulted assignop is not profiled
Xinliang David Li [Tue, 9 Feb 2016 20:02:59 +0000 (20:02 +0000)]
[PGO] Fix issue: explicitly defaulted assignop is not profiled

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

llvm-svn: 260270

8 years agoFix a typo in r260263
Ehsan Akhgari [Tue, 9 Feb 2016 20:02:35 +0000 (20:02 +0000)]
Fix a typo in r260263

llvm-svn: 260269

8 years agoPass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp
Reid Kleckner [Tue, 9 Feb 2016 19:53:30 +0000 (19:53 +0000)]
Pass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp

This is the third time it has crossed the 2^16 section limit. We've
already spent time optimizing this file to reduce template
instantiations, and it's not clear that there is anymore low hanging
fruit.

llvm-svn: 260267

8 years agoclang-cl: Enable plugins on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:43:13 +0000 (19:43 +0000)]
clang-cl: Enable plugins on Windows

llvm-svn: 260266

8 years agoclang-cl: Support loading plugins on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:43:11 +0000 (19:43 +0000)]
clang-cl: Support loading plugins on Windows

This builds on the support being added to LLVM to import and export
registries from DLLs.  This will allow us to pick up the registry
entries added in the DLL's copy of FrontendPluginRegistry.

This will allow us to use plugins on Windows using:
$ clang-cl -Xclang -load -Xclang plugin.dll \
           -Xclang -add-plugin -Xclang foo

llvm-svn: 260265

8 years ago[AArch64] Add a FIXME about invalid KILL markers after the ld/st opt pass.
Chad Rosier [Tue, 9 Feb 2016 19:42:19 +0000 (19:42 +0000)]
[AArch64] Add a FIXME about invalid KILL markers after the ld/st opt pass.

llvm-svn: 260264

8 years agollvm-config: Add preliminary Windows support
Ehsan Akhgari [Tue, 9 Feb 2016 19:41:14 +0000 (19:41 +0000)]
llvm-config: Add preliminary Windows support

Summary:
This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 260263

8 years agoTurn on LLVM_ENABLE_PLUGINS by default on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:37:27 +0000 (19:37 +0000)]
Turn on LLVM_ENABLE_PLUGINS by default on Windows

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 260262

8 years agoAdd support for importing and exporting Registry objects on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:37:25 +0000 (19:37 +0000)]
Add support for importing and exporting Registry objects on Windows

On Windows, the DLL containing the registry will get its own global head
and tail variables, so the entries registered in the DLL will be
invisible to the consumer.

In order to solve this, we need to export a getter function from the
plugin DLL per registry and copy over the data inside it.  This patch
adds support for this.  This will be used to support clang plugins on
Windows.

llvm-svn: 260261

8 years ago[AArch64] Remove redundant calls and clang format. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:33:42 +0000 (19:33 +0000)]
[AArch64] Remove redundant calls and clang format. NFC.

llvm-svn: 260260

8 years ago[Hexagon] Fixing relocation generation and adding tests.
Colin LeMahieu [Tue, 9 Feb 2016 19:18:02 +0000 (19:18 +0000)]
[Hexagon] Fixing relocation generation and adding tests.

llvm-svn: 260259

8 years ago[MC] Adding GOTREL expression variant.
Colin LeMahieu [Tue, 9 Feb 2016 19:17:34 +0000 (19:17 +0000)]
[MC] Adding GOTREL expression variant.

llvm-svn: 260258

8 years ago[AArch64] Hoist now common logic. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:17:18 +0000 (19:17 +0000)]
[AArch64] Hoist now common logic. NFC.

llvm-svn: 260257

8 years ago[AArch64] Rename variable to make it clear we're merging here, not pairing.
Chad Rosier [Tue, 9 Feb 2016 19:09:22 +0000 (19:09 +0000)]
[AArch64] Rename variable to make it clear we're merging here, not pairing.

llvm-svn: 260256

8 years ago[libclang] indexing: make sure to not visit init-list expressions twice.
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:24 +0000 (19:07 +0000)]
[libclang] indexing: make sure to not visit init-list expressions twice.

llvm-svn: 260255

8 years ago[libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point where they...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:21 +0000 (19:07 +0000)]
[libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point where they are reported.

It isn't much benefit and doesn't worth the complexity to try to handle them after the container is encountered.

llvm-svn: 260254

8 years ago[libclang] indexing: for a synthesized property reference have the parent be the...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:19 +0000 (19:07 +0000)]
[libclang] indexing: for a synthesized property reference have the parent be the ObjC implementation decl.

llvm-svn: 260253

8 years ago[Frontend] Handle ASTConsumer::shouldSkipFunctionBody via the MultiplexConsumer.
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:16 +0000 (19:07 +0000)]
[Frontend] Handle ASTConsumer::shouldSkipFunctionBody via the MultiplexConsumer.

llvm-svn: 260252

8 years ago[ASTUnit] Change the parameter of ASTUnit::LoadFromCompilerInvocationAction to accept...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:13 +0000 (19:07 +0000)]
[ASTUnit] Change the parameter of ASTUnit::LoadFromCompilerInvocationAction to accept a more general FrontendAction.

llvm-svn: 260251

8 years ago[libclang] indexing: Have the semantic container of synthesized ObjC getter/setter...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:07 +0000 (19:07 +0000)]
[libclang] indexing: Have the semantic container of synthesized ObjC getter/setter methods be the implementation decl.

Matches the behavior of other ObjC methods.

llvm-svn: 260250

8 years ago[AArch64] Separage the codegen logic for widening vs. pairing. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:02:12 +0000 (19:02 +0000)]
[AArch64] Separage the codegen logic for widening vs. pairing. NFC.

llvm-svn: 260249

8 years agoAligned __stub_helper section to 4-bytes.
Pete Cooper [Tue, 9 Feb 2016 18:56:37 +0000 (18:56 +0000)]
Aligned __stub_helper section to 4-bytes.

ld64 aligns most of the stub's to 2 byte alignment, expect for
the stub helper common atoms which are 4 byte aligned.

This adds a new field to StubInfo which tracks this alignment
and ensures that this is the alignment we get in the final image.

rdar://problem/24570220

llvm-svn: 260248

8 years agoMention the --all-files option in the -p help string.
Jim Ingham [Tue, 9 Feb 2016 18:53:49 +0000 (18:53 +0000)]
Mention the --all-files option in the -p help string.

llvm-svn: 260247

8 years agoSimplify EnterTokenStream API to make it more robust for memory management
David Blaikie [Tue, 9 Feb 2016 18:52:09 +0000 (18:52 +0000)]
Simplify EnterTokenStream API to make it more robust for memory management

While this won't help fix things like the bug that r260219 addressed, it
seems like good tidy up to have anyway.

(it might be nice if "makeArrayRef" always produced a MutableArrayRef &
let it decay to an ArrayRef when needed - then I'd use that for the
MutableArrayRefs in this patch)

If we had std::dynarray I'd use that instead of unique_ptr+size_t,
ideally (but then it'd have to be threaded down through the Preprocessor
all the way - no idea how painful that would be)

llvm-svn: 260246

8 years ago[llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section...
Simon Atanasyan [Tue, 9 Feb 2016 18:45:35 +0000 (18:45 +0000)]
[llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section at the same address

It is possible to have .got section and one or more zero-sized section
at the same address. This patch first checks that GOT (or GOT PLT)
section should have non-zero size using corresponding dynamic tags. Then
it looks up not empty section at the specified address.

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

llvm-svn: 260245

8 years ago[FunctionAttrs] Fix SCC logic around operand bundles
Sanjoy Das [Tue, 9 Feb 2016 18:40:40 +0000 (18:40 +0000)]
[FunctionAttrs] Fix SCC logic around operand bundles

FunctionAttrs does an "optimistic" analysis of SCCs as a unit, which
means normally it is able to disregard calls from an SCC into itself.
However, calls and invokes with operand bundles are allowed to have
memory effects not fully described by the memory effects on the call
target, so we can't be optimistic around operand-bundled calls from an
SCC into itself.

llvm-svn: 260244

8 years agoFix a formatting problems with llvm-size and the -m option.
Kevin Enderby [Tue, 9 Feb 2016 18:33:15 +0000 (18:33 +0000)]
Fix a formatting problems with llvm-size and the -m option.
It was using format() with a string for 64-bit types but was
passed a 32-bit type in places when printing values for
32-bit Mach-O files.

rdar://24542509

llvm-svn: 260243

8 years ago[AArch64] Cleanup to simplify logic when widening vs. pairing loads/stores. NFC.
Chad Rosier [Tue, 9 Feb 2016 18:10:20 +0000 (18:10 +0000)]
[AArch64] Cleanup to simplify logic when widening vs. pairing loads/stores. NFC.

The logic to pair instructions and merge narrow instructions has become cloogy
and error prone.  This patch beings to unravel these two similar, but distinct
optimizations.

llvm-svn: 260242

8 years agoRevert "Avoid forcing emission of delayed dllexported classes on template instantiation"
Reid Kleckner [Tue, 9 Feb 2016 17:48:27 +0000 (17:48 +0000)]
Revert "Avoid forcing emission of delayed dllexported classes on template instantiation"

This reverts commit r260194.

It caused PR26549. There's probably a better way to do this also.

llvm-svn: 260241

8 years ago[x86] make getOneTrueElt() a helper function ; NFC
Sanjay Patel [Tue, 9 Feb 2016 17:39:58 +0000 (17:39 +0000)]
[x86] make getOneTrueElt() a helper function ; NFC

As mentioned in http://reviews.llvm.org/D16828 , the related masked load transform
will need this logic, so I'm moving it out to make that patch smaller.

llvm-svn: 260240

8 years agoFix invalid shift operator overload in Scalar
Pavel Labath [Tue, 9 Feb 2016 17:28:01 +0000 (17:28 +0000)]
Fix invalid shift operator overload in Scalar

Summary: This also fixes an infinite recursion between lldb_private::operator>> () and Scalar::operator>>= ().

Reviewers: sagar, tberghammer, labath

Subscribers: lldb-commits

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

Patch by Marianne Mailhot-Sarrasin

llvm-svn: 260239

8 years ago[MS ABI] Cleanup emitVTableDefinitions
David Majnemer [Tue, 9 Feb 2016 17:27:52 +0000 (17:27 +0000)]
[MS ABI] Cleanup emitVTableDefinitions

Use the VFTable components to determine whether or not we should emit
RTTI data instead of duplicating the VFTableBuilder's logic.

llvm-svn: 260238

8 years agoIntroduce a cmake module to figure out whether we need to link with libatomic.
Vasileios Kalintiris [Tue, 9 Feb 2016 17:00:38 +0000 (17:00 +0000)]
Introduce a cmake module to figure out whether we need to link with libatomic.

Summary:
This fixes the tests under std/atomics for 32-bit MIPS CPUs where the
8-byte atomic operations call into the libatomic library.

Reviewers: dsanders, mclow.lists, EricWF, jroelofs, joerg

Subscribers: cfe-commits

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

llvm-svn: 260235

8 years ago[lsan] Run the tests for each supported arch and suffix each one to distinguish them.
Daniel Sanders [Tue, 9 Feb 2016 16:22:39 +0000 (16:22 +0000)]
[lsan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when lsan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260232

8 years ago[dfsan] Run the tests for each supported arch and suffix each one to distinguish...
Daniel Sanders [Tue, 9 Feb 2016 16:20:37 +0000 (16:20 +0000)]
[dfsan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260231

8 years ago[msan] Run the tests for each supported arch and suffix each one to distinguish them.
Daniel Sanders [Tue, 9 Feb 2016 16:18:15 +0000 (16:18 +0000)]
[msan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, srhines, llvm-commits

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

llvm-svn: 260230

8 years ago[sanitizer_common] Correct the nits that should have been committed as part of r260227.
Daniel Sanders [Tue, 9 Feb 2016 16:14:31 +0000 (16:14 +0000)]
[sanitizer_common] Correct the nits that should have been committed as part of r260227.

llvm-svn: 260229

8 years ago[AArch64] Rename variable to improve readability. NFC.
Chad Rosier [Tue, 9 Feb 2016 15:59:57 +0000 (15:59 +0000)]
[AArch64] Rename variable to improve readability. NFC.

llvm-svn: 260228

8 years ago[sanitizer_common] Add suffix to lit testsuite name to distinguish subtargets.
Daniel Sanders [Tue, 9 Feb 2016 15:52:35 +0000 (15:52 +0000)]
[sanitizer_common] Add suffix to lit testsuite name to distinguish subtargets.

Summary:
This fixes duplicate test names in the test results, so:
  PASS: SanitizerCommon-asan :: fopen_nullptr.c (304 of 431)
  PASS: SanitizerCommon-asan :: fopen_nullptr.c (305 of 431)
is now:
  PASS: SanitizerCommon-asan-i386-Linux :: fopen_nullptr.c (282 of 431)
  PASS: SanitizerCommon-asan-x86_64-Linux :: fopen_nullptr.c (316 of 431)

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 260227

8 years ago[AArch64] Remove stale comment.
Chad Rosier [Tue, 9 Feb 2016 15:51:33 +0000 (15:51 +0000)]
[AArch64] Remove stale comment.

llvm-svn: 260226

8 years ago[clang-tidy] Add -target in misc-misplaced-widening-cast test so it will work on...
Daniel Marjamaki [Tue, 9 Feb 2016 15:43:05 +0000 (15:43 +0000)]
[clang-tidy] Add -target in misc-misplaced-widening-cast test so it will work on various bots

llvm-svn: 260225

8 years agoUse the plt entry as the address of some symbols.
Rafael Espindola [Tue, 9 Feb 2016 15:11:01 +0000 (15:11 +0000)]
Use the plt entry as the address of some symbols.

This is the function equivalent of a copy relocation.

Since functions are expected to change sizes, we cannot use copy
relocations. In situations where one would be needed, what is done
instead is:
* Create a plt entry
* Output an undefined symbol whose addr is the plt entry.

The dynamic linker makes sure any shared library uses the plt entry as
the function address.

llvm-svn: 260224

8 years ago[clang-tidy] Add 'misc-misplaced-widening-cast' check.
Daniel Marjamaki [Tue, 9 Feb 2016 14:08:49 +0000 (14:08 +0000)]
[clang-tidy] Add 'misc-misplaced-widening-cast' check.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260223

8 years agoRegistering the gnuNullExpr AST matcher as a dynamic matcher so that it is available...
Aaron Ballman [Tue, 9 Feb 2016 14:04:49 +0000 (14:04 +0000)]
Registering the gnuNullExpr AST matcher as a dynamic matcher so that it is available from clang-query.

llvm-svn: 260222

8 years agoFix comment for MD5Hash.
Teresa Johnson [Tue, 9 Feb 2016 13:28:44 +0000 (13:28 +0000)]
Fix comment for MD5Hash.

llvm-svn: 260221

8 years ago[OPENMP] Fix test incompatibility with arm buildbots.
Alexey Bataev [Tue, 9 Feb 2016 12:16:42 +0000 (12:16 +0000)]
[OPENMP] Fix test incompatibility with arm buildbots.

llvm-svn: 260220

8 years agoFix possible OOB access found by buildbot
Alexey Bataev [Tue, 9 Feb 2016 11:01:58 +0000 (11:01 +0000)]
Fix possible OOB access found by buildbot

llvm-svn: 260219

8 years agoAdd AST matcher reference to documentation directory when building HTML docs.
Manuel Klimek [Tue, 9 Feb 2016 10:59:21 +0000 (10:59 +0000)]
Add AST matcher reference to documentation directory when building HTML docs.

llvm-svn: 260218

8 years ago[clang-tidy] Make readability-container-size-empty work with inline namespaces. Fix...
Gabor Horvath [Tue, 9 Feb 2016 10:20:48 +0000 (10:20 +0000)]
[clang-tidy] Make readability-container-size-empty work with inline namespaces. Fix PR25812.

llvm-svn: 260217

8 years agoFix a typo in an xfail decorator in TestExprsChar
Tamas Berghammer [Tue, 9 Feb 2016 10:10:42 +0000 (10:10 +0000)]
Fix a typo in an xfail decorator in TestExprsChar

llvm-svn: 260216

8 years ago[OPENMP] Allow to use the variable in the same 'threadprivate'
Alexey Bataev [Tue, 9 Feb 2016 09:41:42 +0000 (09:41 +0000)]
[OPENMP] Allow to use the variable in the same 'threadprivate'
directive.

llvm-svn: 260215

8 years agoDo not mark variable as threadprivate if it was marked already.
Alexey Bataev [Tue, 9 Feb 2016 09:41:33 +0000 (09:41 +0000)]
Do not mark variable as threadprivate if it was marked already.

llvm-svn: 260214

8 years ago[OPENMP] Allow to reference threadprivate variable in same directive.
Alexey Bataev [Tue, 9 Feb 2016 09:41:09 +0000 (09:41 +0000)]
[OPENMP] Allow to reference threadprivate variable in same directive.

llvm-svn: 260213

8 years ago[clang-tidy] Replace a custom ASTMatcher with a built-in one.
Gabor Horvath [Tue, 9 Feb 2016 09:26:11 +0000 (09:26 +0000)]
[clang-tidy] Replace a custom ASTMatcher with a built-in one.

llvm-svn: 260212

8 years agoFixed preprocessed output of the first token for pragmas.
Alexey Bataev [Tue, 9 Feb 2016 08:51:26 +0000 (08:51 +0000)]
Fixed preprocessed output of the first token for pragmas.
Clang did not expanded macros in the very first token of the pragmas
during preprocessed output

llvm-svn: 260211

8 years ago[X86][AVX2] Fix SIGN_EXTEND vector handling on AVX2 targets.
Simon Pilgrim [Tue, 9 Feb 2016 08:19:19 +0000 (08:19 +0000)]
[X86][AVX2] Fix SIGN_EXTEND vector handling on AVX2 targets.

On AVX2 target we are poorly legalizing SIGN_EXTEND ops for which the input's legalized type doesn't have the same number of elements as the destination, resulting in an ANY_EXTEND followed by a SIGN_EXTEND_INREG.

This patch uses the existing SIGN_EXTEND -> SIGN_EXTEND_VECTOR_INREG combine to extend the input to the size of the result and using SIGN_EXTEND_VECTOR_INREG instead.

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

llvm-svn: 260210

8 years agolld/test/mach-o/dependency_info.yaml: Forgot to remove XFAIL:win32.
NAKAMURA Takumi [Tue, 9 Feb 2016 07:44:10 +0000 (07:44 +0000)]
lld/test/mach-o/dependency_info.yaml: Forgot to remove XFAIL:win32.

llvm-svn: 260209

8 years agolld/test/mach-o/dependency_info.yaml: Tweak for dos path.
NAKAMURA Takumi [Tue, 9 Feb 2016 07:30:24 +0000 (07:30 +0000)]
lld/test/mach-o/dependency_info.yaml: Tweak for dos path.

llvm-svn: 260208

8 years agocheck-lld: Introduce %python.
NAKAMURA Takumi [Tue, 9 Feb 2016 07:30:18 +0000 (07:30 +0000)]
check-lld: Introduce %python.

llvm-svn: 260207

8 years agoIntroduce the feature 'demangler' in check-lld. Mark lld/test/old-elf/X86_64/demangle...
NAKAMURA Takumi [Tue, 9 Feb 2016 07:30:11 +0000 (07:30 +0000)]
Introduce the feature 'demangler' in check-lld. Mark lld/test/old-elf/X86_64/demangle.test as REQUIRES:demangler.

llvm-svn: 260206

8 years agoDisable lld/test/old-elf/group-cmd-search.test on win32. "XFAIL:win32" was insufficient.
NAKAMURA Takumi [Tue, 9 Feb 2016 07:30:04 +0000 (07:30 +0000)]
Disable lld/test/old-elf/group-cmd-search.test on win32. "XFAIL:win32" was insufficient.

llvm-svn: 260205

8 years ago[GCC] GOMP_task: Change argument type of if_cond from int to bool
Jonas Hahnfeld [Tue, 9 Feb 2016 07:07:30 +0000 (07:07 +0000)]
[GCC] GOMP_task: Change argument type of if_cond from int to bool

(libgomp has bool as well)

This was causing a test failure in omp_test_if.c when building with GCC in
Debug mode. I have verified that GCC versions 4.9.2 and 5.3.0 now work and
compile-tested this change with clang 3.7.1 and Intel Compiler 16.0.

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

llvm-svn: 260204

8 years ago[CMake] Updating caches README with explanations of useful cache files.
Chris Bieneman [Tue, 9 Feb 2016 06:49:08 +0000 (06:49 +0000)]
[CMake] Updating caches README with explanations of useful cache files.

This is in response to silvas' post-commit suggestion.

llvm-svn: 260203

8 years agoMinor updates to failing tests. NFC
Marshall Clow [Tue, 9 Feb 2016 06:38:56 +0000 (06:38 +0000)]
Minor updates to failing tests. NFC

llvm-svn: 260202

8 years ago[CMake] Providing a CMake cache for 3-stage builds
Chris Bieneman [Tue, 9 Feb 2016 06:01:47 +0000 (06:01 +0000)]
[CMake] Providing a CMake cache for 3-stage builds

This cache file can be used to generate a 3-stage clang build. You can configure using the following CMake command:

cmake -C <path to clang>/cmake/caches/3-stage.cmake -G Ninja <path to llvm>

You can then run "ninja stage3-clang" to build stage1, stage2 and stage3 clangs.

This is useful for finding non-determinism the compiler by verifying that stage2 and stage3 are identical.

llvm-svn: 260201

8 years agoAdd comments to some tests
Xinliang David Li [Tue, 9 Feb 2016 05:47:08 +0000 (05:47 +0000)]
Add comments to some tests

llvm-svn: 260200

8 years agoFix an issue where pressing CTRL+C in the interactive script interpreter causes LLDB...
Enrico Granata [Tue, 9 Feb 2016 05:46:47 +0000 (05:46 +0000)]
Fix an issue where pressing CTRL+C in the interactive script interpreter causes LLDB to crash

This is because PyThreadState_Get() assumes a non-NULL thread state and crashes otherwise; but PyThreadState_GET is just a shortcut (in non-Python-debugging builds) for the global variable that holds the thread state

The behavior of CTRL+C is slightly more erratic than one would like. CTRL+C in the middle of execution of Python code will cause that execution to be interrupted (e.g. time.sleep(1000)), but a CTRL+C at the prompt will just cause a KeyboardInterrupt and not exit the interpreter - worse, it will only trigger the exception once one presses ENTER.

None of this is optimal, of course, but I don't have a lot of time to appease the Python deities with the proper spells right now, and fixing the crasher is already a good thing in and of itself

llvm-svn: 260199

8 years agoFurther reduce test overhead
Xinliang David Li [Tue, 9 Feb 2016 05:36:57 +0000 (05:36 +0000)]
Further reduce test overhead

llvm-svn: 260198

8 years agoRefactor PGO function naming and MD5 hashing support out of ProfileData
Teresa Johnson [Tue, 9 Feb 2016 05:12:44 +0000 (05:12 +0000)]
Refactor PGO function naming and MD5 hashing support out of ProfileData

Summary:
Move the function renaming logic into the Function class, and the
MD5Hash routine into the MD5 header.

This will enable these routines to be shared with ThinLTO, which
will be changed to store the MD5 hash instead of full function name
in the combined index for significant size reductions. And using the same
function naming for locals in the function index facilitates future
integration with indirect call value profiles.

Reviewers: davidxl

Subscribers: llvm-commits

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

llvm-svn: 260197

8 years agoUse std::forward to make ErrorOr<T> constructible from a value that has a user-define...
Nick Lewycky [Tue, 9 Feb 2016 04:47:58 +0000 (04:47 +0000)]
Use std::forward to make ErrorOr<T> constructible from a value that has a user-defined conversion to T. No functionality change intended.

llvm-svn: 260196

8 years agoUse the reserved spellings for attributes
Saleem Abdulrasool [Tue, 9 Feb 2016 04:05:37 +0000 (04:05 +0000)]
Use the reserved spellings for attributes

Change the no_sanitize attribute to use the reserved spelling.

llvm-svn: 260195

8 years agoAvoid forcing emission of delayed dllexported classes on template instantiation
Reid Kleckner [Tue, 9 Feb 2016 02:51:17 +0000 (02:51 +0000)]
Avoid forcing emission of delayed dllexported classes on template instantiation

Fixes PR26490

llvm-svn: 260194

8 years ago[GMR/OperandBundles] Teach getModRefBehavior about operand bundles
Sanjoy Das [Tue, 9 Feb 2016 02:31:47 +0000 (02:31 +0000)]
[GMR/OperandBundles] Teach getModRefBehavior about operand bundles

In general, memory restrictions on a called function (e.g. readnone)
cannot be transferred to a CallSite that has operand bundles.  It is
possible to make this inference smarter, but lets fix the behavior to be
correct first.

llvm-svn: 260193

8 years ago[TestExprsChar] Fix a typo is failure archs list
Siva Chandra [Tue, 9 Feb 2016 02:18:50 +0000 (02:18 +0000)]
[TestExprsChar] Fix a typo is failure archs list

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 260192

8 years agoAdd cmdline options for LC_DATA_IN_CODE load command.
Pete Cooper [Tue, 9 Feb 2016 02:10:39 +0000 (02:10 +0000)]
Add cmdline options for LC_DATA_IN_CODE load command.

Also added the defaults for whether to generate this load command, which
the cmdline options are able to override.

There was also a difference to ld64 which is fixed here in that ld64 will
generate an empty data in code command if requested.

rdar://problem/24472630

llvm-svn: 260191

8 years agoRemove TrailingObjects::operator delete. It's still suffering from
Richard Smith [Tue, 9 Feb 2016 02:09:16 +0000 (02:09 +0000)]
Remove TrailingObjects::operator delete. It's still suffering from
compiler-specific issues. Instead, repeat an 'operator delete' definition in
each derived class that is actually deleted, and give up on the static type
safety of an error when sized delete is accidentally used on a type derived
from TrailingObjects.

llvm-svn: 260190

8 years agoRemove 'llvm::TrailingObjects::operator delete', clang side.
Richard Smith [Tue, 9 Feb 2016 01:57:24 +0000 (01:57 +0000)]
Remove 'llvm::TrailingObjects::operator delete', clang side.

llvm-svn: 260189

8 years agoGenerate LC_FUNCTION_STARTS load command.
Pete Cooper [Tue, 9 Feb 2016 01:38:13 +0000 (01:38 +0000)]
Generate LC_FUNCTION_STARTS load command.

This load command generates data in the LINKEDIT section which
is a list of ULEB128 delta's to all of the functions in the __text section.

It is then 0 terminated and pointer aligned to pad.

ld64 exposes the -function-starts and no-function-starts cmdline options
to override behaviour from the defaults based on file types.

rdar://problem/24472630

llvm-svn: 260188

8 years agoFix the LLVM_ENABLE_MODULES build after adding TargetOpcodes.def in r259726.
David L Kreitzer [Tue, 9 Feb 2016 01:35:45 +0000 (01:35 +0000)]
Fix the LLVM_ENABLE_MODULES build after adding TargetOpcodes.def in r259726.

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

llvm-svn: 260186

8 years agoWe should never dead strip mach header symbols.
Pete Cooper [Tue, 9 Feb 2016 01:34:13 +0000 (01:34 +0000)]
We should never dead strip mach header symbols.

This was a bug in our handling of these symbols compared to ld64.

Turns out that ld64 always marks these symbols as being not dead stripped.

llvm-svn: 260185

8 years agoReorder enum entry as its used for atom sorting.
Pete Cooper [Tue, 9 Feb 2016 01:27:30 +0000 (01:27 +0000)]
Reorder enum entry as its used for atom sorting.

The atom content type enum is used as a tie breaker to sort atoms.
In that case, we want MachHeader to be before typeCode as it really will
be before the code in the final executable.

Test case to follow in the next commit or two.

llvm-svn: 260184

8 years agoAdd an "addUsedAAAnalyses" helper function
Sanjoy Das [Tue, 9 Feb 2016 01:21:57 +0000 (01:21 +0000)]
Add an "addUsedAAAnalyses" helper function

Summary:
Passes that call `getAnalysisIfAvailable<T>` also need to call
`addUsedIfAvailable<T>` in `getAnalysisUsage` to indicate to the
legacy pass manager that it uses `T`.  This contract was being
violated by passes that used `createLegacyPMAAResults`.  This change
fixes this by exposing a helper in AliasAnalysis.h,
`addUsedAAAnalyses`, that is complementary to createLegacyPMAAResults
and does the right thing when called from `getAnalysisUsage`.

Reviewers: chandlerc

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 260183

8 years agoRemove SCEVAAWrapperPass from createLegacyPMAAResults; NFC
Sanjoy Das [Tue, 9 Feb 2016 01:21:50 +0000 (01:21 +0000)]
Remove SCEVAAWrapperPass from createLegacyPMAAResults; NFC

Summary:
createLegacyPMAAResults is only called by CGSCC and Module passes, so
the call to getAnalysisIfAvailable<SCEVAAWrapperPass>() never
succeeds (SCEVAAWrapperPass is a function pass).

Reviewers: chandlerc

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 260182

8 years agoFix undefined behavior when compiling in C++14 due to sized operator delete
Richard Smith [Tue, 9 Feb 2016 01:05:04 +0000 (01:05 +0000)]
Fix undefined behavior when compiling in C++14 due to sized operator delete
being called with the wrong size: convert CGFunctionInfo to use TrailingObjects
and ask TrailingObjects to provide a working 'operator delete' for us.

llvm-svn: 260181