LLVM/llvm 356943lld/trunk/test/ELF debug-line-obj.s debug-line-str.s

[lld] Prevent duplicate files in debug line header in dwarf 5.

Changes to a couple of tests that will start failing after https://reviews.llvm.org/D59515 
is submitted.

Reviewers: echristo, ruiu, espindola

Reviewed By: echristo, ruiu

Subscribers: emaste, arichardson, MaskRay, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59671

LLVM/llvm 356942lldb/trunk/source/API SystemInitializerFull.cpp, lldb/trunk/source/Plugins/ScriptInterpreter/Python ScriptInterpreterPython.cpp ScriptInterpreterPython.h

[ScriptInterpreterPython] Move SWIG initialization into the Python plugin (NFC)

Abstract initialization of the Python SWIG support in the Python plugin.

LLVM/llvm 356941llvm/trunk/include/llvm/MC MCDwarf.h, llvm/trunk/lib/DebugInfo/DWARF DWARFDebugLine.cpp

[llvm] Prevent duplicate files in debug line header in dwarf 5.


Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Reviewers: dblaikie, probinson, aprantl, espindola

    [8 lines not shown]

LLVM/llvm 356940cfe/trunk/lib/Analysis ThreadSafetyCommon.cpp, cfe/trunk/test/SemaObjCXX warn-thread-safety-analysis.mm thread-safety-analysis.h

Thread Safety: also look at ObjC methods

SExprBuilder::translateDeclRefExpr was only looking at FunctionDecl and not also looking 
at ObjCMethodDecl. It should consider both because the attributes can be used on 
Objective-C as well.


Reviewers: dexonsmith, erik.pilkington

Subscribers: jkorous, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59523

LLVM/llvm 356939llvm/trunk/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/trunk/test/Transforms/SLPVectorizer/X86 PR39774.ll

[SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode

As discussed on D59738, this generalizes reorderInputsAccordingToOpcode to handle multiple 
+ non-commutative instructions so we can get rid of reorderAltShuffleOperands and make use 
of the extra canonicalizations that reorderInputsAccordingToOpcode brings.

Differential Revision: https://reviews.llvm.org/D59784

LLVM/llvm 356938llvm/trunk/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/trunk/test/CodeGen/X86 avx512-insert-extract.ll select.ll

[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC

First half of PR40800, this patch adds DAG undef handling to icmp instructions to match 
the behaviour in llvm::ConstantFoldCompareInstruction and SimplifyICmpInst, this permits 
constant folding of vector comparisons where some elements had been reduced to UNDEF (by 
SimplifyDemandedVectorElts etc.).

This involved a lot of tweaking to reduced tests as bugpoint loves to reduce icmp 
arguments to undef........

Differential Revision: https://reviews.llvm.org/D59363

LLVM/llvm 356937llvm/trunk/lib/CodeGen CodeGenPrepare.cpp

[CGP] Build the DominatorTree lazily

In r355512 CGP was changed to build the DominatorTree only once per
function traversal, to avoid repeatedly building it each time it was
accessed. This solved one compile time issue but introduced another. In
the second case, we now were building the DT unnecessarily many times
when we performed many function traversals (i.e. more than once per
function when running CGP because of changes made each time).

Change to saving the DT in the CodeGenPrepare object, and building it
lazily when needed. It is reset whenever we need to rebuild it.

The case that exposed the issue there are 617 functions, and we walk
them (i.e. execute the "while (MadeChange)" loop in runOnFunction) a
total of 12083 times (so previously we were building the DT 12083
times). With this patch we only build the DT 844 times (average of 1.37
times per function). We dropped the total time to compile this file from
538.11s without this patch to 339.63s with it.

There is still an issue as CGP is taking much longer than all other
passes even with this patch, and before a recent compiler release cut at
r355392 the total time to this compile was only 97 sec with a huge
reduction in CGP time. I suspect that one of the other recent changes to
CGP led to iterating each function many more times on average, but I

    [9 lines not shown]

LLVM/llvm 356936openmp/trunk/runtime/test/ompt/misc interoperability.cpp

Fix interoperability test compilation on FreeBSD

While building the 8.0 releases on FreeBSD, I encountered the following
error in the regression tests, where ompt/misc/interoperability.cpp
failed to compile, with:

projects/openmp/runtime/test/ompt/misc/interoperability.cpp:7:10: fatal error: 'alloca.h' 
file not found
#include <alloca.h>

Like on NetBSD, alloca(3) is defined in <stdlib.h> instead.

Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim

Reviewed By: jlpeyton

Subscribers: jdoerfert, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D59736

LLVM/llvm 356935pstl/trunk/test test_partial_sort.cpp

[pstl] Gate usage of TBB in test on whether TBB is used as a backend

__PSTL_USE_PAR_POLICIES is the wrong macro to use there, since the PSTL
could conceivably be using parallel policies but not TBB as a backend.

LLVM/llvm 356934openmp/trunk/runtime/src kmp_wrapper_getpid.h

Fix gettid warnings on FreeBSD

[Split off from D59451 to get this fix in separately]

While building the 8.0 releases on FreeBSD, I encountered the following
warnings in openmp quite a few times:

In file included from projects/openmp/runtime/src/kmp_settings.cpp:27:
projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: #warning is a language 
extension [-Wpedantic]
#warning No gettid found, use getpid instead
projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: No gettid found, use 
getpid instead [-W#warnings]
2 warnings generated.

I added a gettid wrapper that uses FreeBSD's pthread_getthreadid_np(3)
function for this.

Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim

Reviewed By: jlpeyton

    [6 lines not shown]

LLVM/llvm 356933openmp/trunk/runtime/src kmp_runtime.cpp

[OpenMP] Fix pause check with version info

Add 5.0 guard to pause code for now.

Patch by Terry Wilmarth

Differential Revision: https://reviews.llvm.org/D59428

LLVM/llvm 356932lld/trunk/test/wasm target-feature-required.yaml target-feature-used.yaml, lld/trunk/wasm Writer.cpp Driver.cpp

Revert "[WebAssembly] Add linker options to control feature checking"

This reverts commit 5991328c96b6146999cfa74ede42901f8c01f2fa.

LLVM/llvm 356931cfe/trunk/lib/Driver Driver.cpp, cfe/trunk/test/Driver immediate-options.c

clang -dumpversion returns 4.2.1 for legacy reason, update it

It has been introduced in 2011 for gcc compat:
it is probably time to remove it to remove the confusion.

reported: https://bugs.llvm.org/show_bug.cgi?id=38836

Reviewers: ddunbar, rnk

Reviewed By: rnk

Subscribers: jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D56803

LLVM/llvm 356930llvm/trunk/test/CodeGen/X86 vector-zext.ll

[x86] add another vector zext test; NFC

Goes with the proposal in D59777

LLVM/llvm 356929cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive SMTAPI.h SMTConv.h, cfe/trunk/lib/StaticAnalyzer/Core Z3ConstraintManager.cpp

Moved everything SMT-related to LLVM and updated the cmake scripts.

Differential Revision: https://reviews.llvm.org/D54978

LLVM/llvm 356928cfe/trunk/lib/Format TokenAnnotator.cpp, cfe/trunk/unittests/Format FormatTestObjC.cpp

[clang-format] Refine structured binding detection

Revision r356575 had the unfortunate consequence that now clang-format never
detects an ObjC call expression after `&&`.

This patch tries harder to distinguish between C++17 structured bindings and
ObjC call expressions and adds a few regression tests.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59774

LLVM/llvm 356927lldb/trunk/source/Utility Args.cpp, lldb/trunk/unittests/Utility ArgsTest.cpp

[Args] Handle backticks to prevent crash.

Currently LLDB crashes when autocompleting a command that ends with a
backtick because the quote character wasn't handled. This fixes that and
adds a unit test for this function.

Differential revision: https://reviews.llvm.org/D59779

LLVM/llvm 356926llvm/trunk/lib/CodeGen MachineScheduler.cpp, llvm/trunk/test/CodeGen/AMDGPU sched-assert-onlydbg-value-empty-region.mir

MISched: Don't schedule regions with 0 instructions

I think this is correct, but may not necessarily be the correct fix
for the assertion I'm really trying to solve. If a scheduling region
was found that only has dbg_value instructions, the RegPressure
tracker would end up in an inconsistent state because it would skip
over any debug instructions and point to an instruction outside of the
scheduling region. It may still be possible for this to happen if
there are some real schedulable instructions between dbg_values, but I
haven't managed to break this.

The testcase is extremely sensitive and I'm not sure how to make it
more resistent to future scheduler changes that would avoid stressing
this situation.

LLVM/llvm 356925cfe/trunk/lib/Sema SemaDecl.cpp SemaExpr.cpp

[Sema][NFCI] Don't allocate storage for the various CorrectionCandidateCallback unless we 
are going to do some typo correction

The various CorrectionCandidateCallbacks are currently heap-allocated
unconditionally. This was needed because of delayed typo correction.
However these allocations represent currently 15.4% of all allocations
(number of allocations) when parsing all of Boost (!), mostly because
of ParseCastExpression, ParseStatementOrDeclarationAfterAttrtibutes
and isCXXDeclarationSpecifier. Note that all of these callback objects
are small. Let's not do this.

Instead initially allocate the callback on the stack, and only do a
heap allocation if we are going to do some typo correction. Do this by:

1. Adding a clone function to each callback, which will do a polymorphic
   clone of the callback. This clone function is required to be implemented
   by every callback (of which there is a fair amount). Make sure this is
   the case by making it pure virtual.

2. Use this clone function when we are going to try to correct a typo.

This additionally cut the time of -fsyntax-only on all of Boost by 0.5%
(not that much, but still something). No functional changes intended.

Differential Revision: https://reviews.llvm.org/D58827

    [2 lines not shown]

LLVM/llvm 356924llvm/trunk/utils/release merge-request.sh

merge-request.sh: Update 8.0 metabug for 8.0.1

LLVM/llvm 356923clang-tools-extra/trunk/docs ReleaseNotes.rst

Attempt to fix sphinx bot after r356897

LLVM/llvm 356922llvm/trunk/lib/Target/AMDGPU SIWholeQuadMode.cpp

AMDGPU: Preserve LiveIntervals in WQM

This seems to already be done, but wasn't marked.

LLVM/llvm 356921pstl/trunk/test utils.h

[pstl] Make sure unit tests exit with a non-zero error code when they fail

The previous test system would only print errors to stderr, however CMake
(and lit) detect failure via the program returning a non-zero error code.
So all the tests would always pretend they passed.
+15-161 files

LLVM/llvm 356920cfe/trunk CMakeLists.txt

[clang] Remove cmake warning message (NFC)

Recognize an empty string for CLANG_DEFAULT_UNWINDLIB as a valid option.

LLVM/llvm 356919llvm/trunk/test/tools/llvm-objcopy/ELF preserve-segment-contents.test preserve-segment-contents-ehdr-phdrs.test, llvm/trunk/tools/llvm-objcopy/ELF Object.cpp Object.h

[llvm-objcopy]Preserve data in segments not covered by sections

llvm-objcopy previously knew nothing about data in segments that wasn't
covered by section headers, meaning that it wrote zeroes instead of what
was there. As it is possible for this data to be useful to the loader,
this patch causes llvm-objcopy to start preserving this data. Data in
sections that are explicitly removed continues to be written as zeroes.

This fixes https://bugs.llvm.org/show_bug.cgi?id=41005.

Reviewed by: jakehehrlich, rupprecht

Differential Revision: https://reviews.llvm.org/D59483

LLVM/llvm 356918libcxx/trunk/include optional, libcxx/trunk/test/std/utilities/optional/optional.object/optional.object.ctor ctor.fail.cpp

Cleaup of requirements for optional. While researching LWG3196, I realized that optional 
did not reject 'const in_place_t' like it should. Added a test as well, and a check for 
arrays (which were already disallowed, but now we get a better error message). Should not 
affect anyone's code.

LLVM/llvm 356917pstl/trunk/include/pstl/internal algorithm_impl.h

[PSTL][NFC] Add missing #include

LLVM/llvm 356916clang-tools-extra/trunk/clangd/clients/clangd-vscode/src extension.ts

[clangd] Add .cu files to VSCode extension

clangd should be able to handle those with a proper compilation
database. However, users using 'nvcc' might start seeing spurious errors
in '.cu' files after this change.

My plan is to land and release this, but be ready to revert in
case of negative user feedback.

Reviewers: hokein

Reviewed By: hokein

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59759

LLVM/llvm 356915llvm/trunk/test/Transforms/SLPVectorizer/X86 alternate-int.ll

[SLPVectorizer] Update file missed in rL356913

Differential Revision: https://reviews.llvm.org/D59738

LLVM/llvm 356914llvm/trunk/test/CodeGen/X86 vector-zext.ll

[x86] add tests for vector zext; NFC

The AVX1 lowering is poor.

LLVM/llvm 356913llvm/trunk/test/Transforms/LoopVectorize/X86 metadata-enable.ll, llvm/trunk/test/Transforms/SLPVectorizer/AArch64 getelementptr.ll

[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization

Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to 
rely on chance more than anything else and also have a tendency to fight existing 
instcombine canonicalization which moves constants to the RHS of commutable binary ops.

This is prep work towards:
(a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar 
(b) improving reordering to optimized cases with commutable and non-commutable 
instructions to still find splat/consecutive ops.

Differential Revision: https://reviews.llvm.org/D59738

LLVM/llvm 356912cfe/trunk/lib/Format TokenAnnotator.cpp, cfe/trunk/unittests/Format FormatTestProto.cpp

Revert "[clang-format] Keep protobuf "package" statement on one line"

This reverts commit r356835. This patch causes a regression, see the
test below:

verifyFormat("// Detached comment\n\n"
             "// Leading comment\n"
             "syntax = \"proto2\"; // trailing comment\n\n"
             "// in foo.bar package\n"
             "package foo.bar; // foo.bar package\n");

LLVM/llvm 356911lldb/trunk/lit/Driver TestRepl.test, lldb/trunk/tools/driver Driver.cpp

Update the lldb driver to support the -O and -S options when passing --repl

At the moment when --repl is passed to lldb it silently ignores any
commands passed via the options below:

--one-line-before-file <command>
                     Tells the debugger to execute this one-line lldb command before any 
file provided on the command line has been loaded.
--one-line <command>
                     Tells the debugger to execute this one-line lldb command after any 
file provided on the command line has been loaded.
--source-before-file <file>
                     Tells the debugger to read in and execute the lldb commands in the 
given file, before any file has been loaded.
--source <file>
                     Tells the debugger to read in and execute the lldb commands in the 
given file, after any file has been loaded.
-O <value>           Alias for --one-line-before-file
-o <value>           Alias for --one-line
-S <value>           Alias for --source-before-file
-s <value>           Alias for --source

The -O and -S options are quite useful when writing tests for the REPL
though, e.g. to change settings prior to entering REPL mode. This
patch updates the driver to still respect the commands supplied via -O

    [8 lines not shown]

LLVM/llvm 356910lldb/trunk/examples/customization/bin-utils binutils.py, lldb/trunk/examples/python mach_o.py

Python 2/3 compat: StringIO

Differential Revision: https://reviews.llvm.org/D59582

LLVM/llvm 356909lldb/trunk/examples/python lldbtk.py

Python 2/3 compat: tkinter

Differential Revision: https://reviews.llvm.org/D59586

LLVM/llvm 356908lldb/trunk/examples/summaries/cocoa CFArray.py CFBag.py

Python 2/3 compat: str vs basestring

Differential Revision: https://reviews.llvm.org/D59589

LLVM/llvm 356907llvm/trunk/tools/llvm-config llvm-config.cpp

Revert 356905

Commited from wrong directory...

LLVM/llvm 356906lldb/trunk/utils/lui lui.py sandbox.py

Python 2/3 compat: queue vs Queue

Differential Revision: https://reviews.llvm.org/D59590

LLVM/llvm 356905llvm/trunk/tools/llvm-config llvm-config.cpp

Python 2/3 compat: queue vs Queue

Differential Revision: https://reviews.llvm.org/D59590

LLVM/llvm 356904lldb/trunk/examples/summaries/cocoa CFString.py

Python 2/3 compat: unichr vs chr

LLVM/llvm 356903libcxx/trunk CMakeLists.txt, libcxx/trunk/lib CMakeLists.txt

[libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms

I can't see a good reason to disallow this, even though it isn't the
standard way we build libc++ for Apple platforms.

Making this work on Apple platforms requires using different flags for
--whole-archive and removing the -D flag when running `ar` to merge
archives because that flag isn't supported by the `ar` shipped on Apple
platforms. This shouldn't be an issue since the -D option appears to be
enabled by default in GNU `ar`.

Reviewers: phosek, EricWF, serge-sans-paille

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Differential Revision: https://reviews.llvm.org/D59513

LLVM/llvm 356902clang-tools-extra/trunk/clang-tidy add_new_check.py

[clang-tidy] ClangTidy.h -> ClangTidyCheck.h

LLVM/llvm 356901llvm/trunk/lib/ObjectYAML MinidumpYAML.cpp

MinidumpYAML.cpp: Fix some code standard violations missed during review

functions should begin with lower case letters. NFC.

LLVM/llvm 356900pstl/trunk CMakeLists.txt

[pstl][CMake] Move include() closer to its point of use

LLVM/llvm 356899llvm/trunk/test/CodeGen/X86 regalloc-copy-hints.mir

[RegAlloc]  Simplify MIR test

Remove the IR part from test/CodeGen/X86/regalloc-copy-hints.mir (added by

To make the test remain functional, the parts of the MBB names referring to
BB names have been removed, as well as all machine memory operands.

LLVM/llvm 356898lldb/trunk/lit/Minidump dump-all.test fb-dump.test, lldb/trunk/source/Plugins/Process/minidump MinidumpTypes.h MinidumpParser.cpp

Minidump: Use minidump constants defined in llvm

This patch begins the process of migrating the "minidump" plugin to the
minidump parser in llvm. The llvm parser is not fully finished yet, but
even now, a lot of things can be switched over. The gradual migration
process will allow us to easier detect if things break than doing a big
one-step migration. Doing it early will allow us to make sure that the
llvm parser fits the use case that we need in lldb.

In this patch I start with the various minidump constants, which have
their llvm equivalent. It doesn't contain any functional changes. The
diff just reflects the different naming of things in llvm.

LLVM/llvm 356897clang-tools-extra/trunk/clang-include-fixer IncludeFixer.cpp, clang-tools-extra/trunk/clang-include-fixer/find-all-symbols STLPostfixHeaderMap.cpp

Rename directory housing clang-include-fixer to be eponymous

Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.

Similar to r356254. No intended behavior change.

Differential Revision: https://reviews.llvm.org/D59750

LLVM/llvm 356896lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new TestMiniDumpUUID.py linux-arm-uuids-elf-build-id-20.dmp, lldb/trunk/source/Plugins/Process/minidump MinidumpParser.cpp MinidumpTypes.cpp

Reapply minidump changes reverted in r356806

The changes were reverted due to ubsan errors (unaligned accesses). Here
I fix those errors by first copying the data into aligned storage.
Besides fixing alignment issues, this also fixes reading of minidump
strings on big-endian systems.

LLVM/llvm 356895llvm/trunk/lib/ExecutionEngine/IntelJITEvents IntelJITEventListener.cpp

[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."

Following r354972 the Intel JIT Listener would not report line table
information because the section indices did not match. There was
a similar issue with the PerfJitEventListener. This change performs
the section index lookup when building the object address used to
query the line table information.

Differential Revision: https://reviews.llvm.org/D59490

LLVM/llvm 356894clang-tools-extra/trunk/clangd StdSymbolMap.inc, clang-tools-extra/trunk/clangd/include-mapping gen_std.py

[clangd] Add std subnamespace symbols to the symbol map.

Reviewers: ioeric, serge-sans-paille

Reviewed By: ioeric

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59364