Commit Graph

274799 Commits

Author SHA1 Message Date
Benjamin Kramer b560a9a1b8 [clangd] Don't crash on empty textDocument/didChange.
Found by clangd-fuzzer.

llvm-svn: 316652
2017-10-26 10:36:20 +00:00
Simon Dardis 56a02ce91a Update my email addresses, NFC.
llvm-svn: 316651
2017-10-26 10:16:54 +00:00
Benjamin Kramer 74a1895422 [clangd] Don't use /// for non-doxygen comments.
llvm-svn: 316650
2017-10-26 10:07:04 +00:00
Benjamin Kramer 09113ae2c5 [clangd] Add a simple fuzzer. It crashes a lot :)
llvm-svn: 316649
2017-10-26 10:03:11 +00:00
George Rimar d605f414db [ELF] - Dedupliсate FDEs when sections are ICFed.
When LLD do ICF for 2 identical sections it leaves 2 duplicate entries in .eh_frame
pointing to the same address. After that it fixes .eh_frame_header's header,
so that it says it contains single FDE, though section itself contains 2 
(it contains garbage data at tail).

As a result excessive entries in .eh_frame and excessive dummy data in .eh_frame_header
emited to output. Patch fixes that. This is PR34518.

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

llvm-svn: 316648
2017-10-26 09:13:19 +00:00
Hiroshi Inoue b72b1fb0de [PowerPC] Use record-form instruction for Less-or-Equal -1 and Greater-or-Equal 1
Currently a record-form instruction is used for comparison of "greater than -1" and "less than 1" by modifying the predicate (e.g. LT 1 into LE 0) in addition to the naive case of comparison against 0.
This patch also enables emitting a record-form instruction for "less than or equal to -1" (i.e. "less than 0") and "greater than or equal to 1" (i.e. "greater than 0") to increase the optimization opportunities.

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

llvm-svn: 316647
2017-10-26 09:01:51 +00:00
Benjamin Kramer e3962aebca Fix overloaded static functions in SemaCodeComplete
https://bugs.llvm.org/show_bug.cgi?id=33904
Happens when static function is accessed via the class variable. That leads to incorrect overloads number because the variable is considered as the first argument.

struct Bar {
  static void foo(); static void foo(int);
};

int main() {
  Bar b;
  b.foo(/*complete here*/); // did not work before
  Bar::foo(/*complete here*/); // worked fine
}

Patch by Ivan Donchevskii!

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

llvm-svn: 316646
2017-10-26 08:41:28 +00:00
Haojian Wu d2825825f8 [clang-tidy ObjC] [2/3] Support non-C++ files in ClangTidyTest
Summary:
This is part 2 of 3 of a series of changes to improve
Objective-C linting in clang-tidy.

Currently, `clang::tidy::test::runCheckOnCode()` assumes all files
are C++ and unconditionally adds `-std=c++11` to the list of
`clang-tidy` options.

This updates the logic to check the extension of the source file
and only add `-std=c++11` if the extension indicates C++ or
Objective-C++.

Depends On D39188

Test Plan:

  ninja ClangTidyTests && \
  ./tools/clang/tools/extra/unittests/clang-tidy/ClangTidyTests

Patch by Ben Hamilton!

Reviewers: hokein, alexfh

Reviewed By: hokein

Subscribers: Wizard

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

llvm-svn: 316645
2017-10-26 08:37:25 +00:00
Hans Wennborg caceb64067 Tidy up CountingFunctionInserter a little. NFC.
Use StringRef for CountingFunctionName, remove erroneous comment
copied from InstructionNamer, and drop some trailing whitespace.

llvm-svn: 316644
2017-10-26 08:29:08 +00:00
Haojian Wu abcd64ccbf [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checks
Summary:
This is part 1 of 3 of a series of changes to improve Objective-C
linting in clang-tidy.

This introduces a new clang-tidy module, `objc`, specifically for
Objective-C / Objective-C++ checks.

The module is currently empty; D39142 adds the first check.

Test Plan: `ninja check-clang-tools`

Patch by Ben Hamilton!

Reviewers: hokein, alexfh

Reviewed By: hokein

Subscribers: Wizard, mgorny

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

llvm-svn: 316643
2017-10-26 08:23:20 +00:00
Michael Kruse 37d57dac63 [DeLICM] Add more tests for loop layouts. NFC.
llvm-svn: 316642
2017-10-26 08:03:28 +00:00
Craig Topper 0551556ed2 [AsmParser][TableGen] Add VariantID argument to the generated mnemonic spell check function so it can use the correct table based on variant.
I'm considering implementing the mnemonic spell checker for x86, and that would require the separate intel and att variants.

llvm-svn: 316641
2017-10-26 06:46:41 +00:00
Craig Topper 2a06028c0a [AsmParser][TableGen] Make the generated mnemonic spell checker function a file local static function.
Also only emit in targets that specificially request it. This is required so we don't get an unused static function error.

llvm-svn: 316640
2017-10-26 06:46:40 +00:00
Craig Topper 619b15283d [X86] Use correct type for return value of ComputeAvailableFeatures in the AsmParser. NFC
There aren't enough used bits to make this a functional change, but we should fix it for consistency.

llvm-svn: 316639
2017-10-26 06:46:38 +00:00
Vitaly Buka f3e0f76196 [sanitizer] Fix internal symbolized build on Debian 9
llvm-svn: 316637
2017-10-26 06:08:01 +00:00
Alex Shlyapnikov 797bdbbce7 [LSan] Enable -fsanitize=leak for PPC64 Linux.
Summary: .

Reviewers: eugenis

Subscribers: cfe-commits

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

llvm-svn: 316636
2017-10-26 03:09:53 +00:00
Igor Kudrin 85e68a6601 [lit] Respect LLVM_LIT_TOOLS_DIR when looking for 'tar' on Windows.
Changes in D38977 expect 'tar' to be found in one of PATH directories.
On Windows, one might opt to use LLVM_LIT_TOOLS_DIR rather than add MSYS
tools directory to the PATH. In that case, tests for lld failed on run.

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

llvm-svn: 316635
2017-10-26 02:31:36 +00:00
Eugene Zelenko 5c2aecef78 [Transforms] Revert r316630 changes in Scalar/MergeICmps.cpp to fix broken build bots (NFC).
llvm-svn: 316634
2017-10-26 01:25:14 +00:00
Alex Shlyapnikov 02bda37492 [LSan] Adjust LSan allocator limits for PPC64.
Summary: Now the limits are the same as for ASan allocator.

Reviewers: cryptoad

Subscribers: llvm-commits

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

llvm-svn: 316633
2017-10-26 01:22:48 +00:00
George Karpenkov 65839bd429 [Analyzer] [Tests] Consistently use exit codes. Use code=42 to signify different results
llvm-svn: 316632
2017-10-26 01:13:22 +00:00
Alex Lorenz f757961c0f Allow StmtPrinter to supress implicit 'this' and 'self' base expressions
This will be useful for certain refactoring actions.

rdar://34202062

llvm-svn: 316631
2017-10-26 00:56:54 +00:00
Eugene Zelenko 5adb96cc92 [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 316630
2017-10-26 00:55:39 +00:00
Pavel Labath 8c80a377ba Makefile.rules: move CFLAGS_EXTRAS to the end of compile line
This makes sure that any options specified there override generic
compiler options.

This fixes TestBreakpointIt.py

llvm-svn: 316629
2017-10-25 23:56:17 +00:00
Kostya Serebryany 3c9e59d0f6 [libFuzzer] trying to make a test more stable on Mac
llvm-svn: 316627
2017-10-25 23:24:45 +00:00
Rui Ueyama 5ace35cba5 Fix SizeOfImage in the PE header.
IIUC, SizeOfImage is the distance from the end of the last section to
the image base, rounded up to the page size. So the previous code is
wrong.

Should fix https://bugs.llvm.org/show_bug.cgi?id=34949

(It is nice to know that lld is already being used to create Putty
distribution binaries.)

llvm-svn: 316626
2017-10-25 23:00:40 +00:00
Matthew Simpson 99f57933ba Attempt to unbreak the expensive-checks-win bot
llvm-svn: 316625
2017-10-25 22:46:34 +00:00
Bob Haarman b8a59c8aa5 [lld] unified COFF and ELF error handling on new Common/ErrorHandler
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits

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

llvm-svn: 316624
2017-10-25 22:28:38 +00:00
Jonathan Peyton 5e6cb9022c Fix fatal error message displaying
Replacing call to __kmp_msg(kmp_ms_fatal,...) with __kmp_fatal(...) caused an
issue when incomplete message is displayed in case an error message is followed
by another message (e.g. by a hint messa)ge. This is because __kmp_fatal()
passes incomplete list of arguments to __kmp_msg().

Patch by Olga Malysheva

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

llvm-svn: 316623
2017-10-25 22:05:02 +00:00
Rui Ueyama 8e38ea8b9e Unassign sections if they are "assigned" to /DISCARD/.
"/DISCARD/" is a special section name in the linker script to discard
input sections. Previously, we handled it as if it were a real section,
so an input section can be assigned but dead. However, allowing sections
to be

 - assigned and alive (will be emitted),
 - not assigned and dead (removed), or
 - assigned but dead (???)

feels logically wrong and practically error-prone. This patch removes
the last combination of the states.

llvm-svn: 316622
2017-10-25 22:03:21 +00:00
Alex Lorenz fbd17e17f5 Handle PragmaDebug in PPChainedCallbacks
The test is in clang-tools-extra/test/pp-trace

llvm-svn: 316621
2017-10-25 22:01:23 +00:00
Kostya Kortchinsky f9008a3a06 [scudo] Remove comment about security of the 32-bit allocator
Summary:
The 32-bit allocator is now on par with the 64-bit in terms of security (chunks
randomization is done, batches separation is done).

Unless objection, the comment can go away.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 316620
2017-10-25 22:00:26 +00:00
Jonas Devlieghere f63ee64c4b Re-land "[dwarfdump] Add -lookup option"
Add the option to lookup an address in the debug information and print
out the file, function, block and line table details.

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

llvm-svn: 316619
2017-10-25 21:56:41 +00:00
George Karpenkov a932c8745c [Analyzer] [Tests] Do not discard output from CmpRuns.py when running integration tests
Contrary to the deleted comment, in most cases CmpRuns.py produces a
fairly small amount of output, which is useful to see straight away to
see what has changed when executing the integration tests.

llvm-svn: 316618
2017-10-25 21:49:46 +00:00
George Karpenkov 134d8473ef [Analyzer] Give more descriptive name to BdyFrm field.
Discussion at: https://reviews.llvm.org/D39220

llvm-svn: 316617
2017-10-25 21:49:41 +00:00
Alexander Richardson d3aa475988 Fix CodeGen/AMDGPU/fcanonicalize-elimination.ll on FreeBSD 11.0
Summary:
On FreeBSD11.0 the FileCheck NOT string "1.0" will be matched by
`.amd_amdgpu_isa "amdgcn-unknown-freebsd11.0--gfx802"` at the end of the
file. Add a CHECK for that directive to avoid failing the test.

Reviewers: rampitec, kzhuravl

Reviewed By: rampitec, kzhuravl

Subscribers: emaste, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits, krytarowski

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

llvm-svn: 316616
2017-10-25 21:44:21 +00:00
Sanjoy Das 8499ebf2e9 [SCEV] Fix an assertion failure in the max backedge taken count
Max backedge taken count is always expected to be a constant; and this is
usually true by construction -- it is a SCEV expression with constant inputs.
However, if the max backedge expression ends up being computed to be a udiv with
a constant zero denominator[0], SCEV does not fold the result to a constant
since there is no constant it can fold it to (SCEV has no representation for
"infinity" or "undef").

However, in computeMaxBECountForLT we already know the denominator is positive,
and thus at least 1; and we can use this fact to avoid dividing by zero.

[0]: We can end up with a constant zero denominator if the signed range of the
stride is more precise than the unsigned range.

llvm-svn: 316615
2017-10-25 21:41:00 +00:00
Sanjoy Das f15a861601 Add a comment to clarify a future change
llvm-svn: 316614
2017-10-25 21:40:59 +00:00
Evgeniy Stepanov 0b8602791b [msan] Intercept __strxfrm_l.
llvm-svn: 316613
2017-10-25 21:40:17 +00:00
Balaram Makam 52252fe20d Revert r316582 [Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.
Summary: This reverts commit r316582. It looks like this commit broke tests on one buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/5719

. . .
Failing Tests (1):
    LLVM :: Transforms/CalledValuePropagation/simple-arguments.ll

Reviewers:

Subscribers:

llvm-svn: 316612
2017-10-25 21:32:54 +00:00
Justin Lebar 066494d8c1 [CUDA] Print an error if you try to compile with < sm_30 on CUDA 9.
Summary:
CUDA 9's minimum sm is sm_30.

Ideally we should also make sm_30 the default when compiling with CUDA
9, but that seems harder than it should be.

Subscribers: sanjoy

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

llvm-svn: 316611
2017-10-25 21:32:06 +00:00
Mitch Phillips 5ff01cdc59 Add FileVerifier::isCFIProtected().
Add a CFI protection check that is implemented by building a graph and inspecting the output to deduce if the indirect CF instruction is CFI protected. Also added the output of this instruction to printIndirectInstructions().

Reviewers: vlad.tsyrklevich

Subscribers: llvm-commits, kcc, pcc, mgorny

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

llvm-svn: 316610
2017-10-25 21:21:16 +00:00
Pavel Labath 13e37d4d0a Move StopInfoOverride callback to the new architecture plugin
This creates a new Architecture plugin and moves the stop info override
callback to this place. The motivation for this is to remove complex
dependencies from the ArchSpec class because it is used in a lot of
places that (should) know nothing about Process instances and StopInfo
objects.

I also add a test for the functionality covered by the override
callback.

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

llvm-svn: 316609
2017-10-25 21:05:31 +00:00
Pavel Labath c2400fc0d5 Move testcases/arm_emulation to testcases/arm/emulation
This creates space for addidional arm-specific tests. I will be adding
one of those in a follow-up commit.

llvm-svn: 316608
2017-10-25 21:05:10 +00:00
Evgeniy Stepanov 117627c9a1 Enable -pie and --enable-new-dtags by default on Android.
Summary:
Also enable -no-pie on Gnu toolchain (previously available on Darwin only).

Non-PIE executables won't even start on recent Android, and DT_RPATH is ignored by the loader.

Reviewers: srhines, danalbert

Subscribers: cfe-commits

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

llvm-svn: 316606
2017-10-25 20:39:22 +00:00
Erich Keane 818cf5bcb3 Ignore implicity casts for zero-as-null-pointer-constant warning
The repro in https://bugs.llvm.org/show_bug.cgi?id=34362
caused the left nullptr to be cast to a int* implicitly, which
resulted diagnosing this falsely.

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

llvm-svn: 316605
2017-10-25 20:23:13 +00:00
David Blaikie cc7763ba92 Hexagon: Fold a single-use textual header into its use
llvm-svn: 316604
2017-10-25 19:52:21 +00:00
Aditya Nandakumar d2a954d0ae Make the combiner check if shifts are legal before creating them
Summary: Make sure shifts are legal/specified by the legalizerinfo before creating it

Reviewers: qcolombet, dsanders, rovka, t.p.northover

Subscribers: llvm-commits

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

llvm-svn: 316602
2017-10-25 18:49:18 +00:00
Krzysztof Parzyszek 27056da9a8 [Hexagon] Account for negative offset when limiting max deviation
In getOffsetRange, Max can be set to 0 to force the extender replacement
to be at or below the original value. This would cause the new offset to
be non-negative, which is preferred for memory instructions (to reduce
the likelihood of it getting constant-extended due to predication). The
problem happens when the range is shifted by an offset (present in the
instruction being examined) and the offset is negative. The entire range
for the allowable deviation will then be strictly negative. This creates
a problem, since 0 is assumed to be a valid deviation.

llvm-svn: 316601
2017-10-25 18:46:40 +00:00
Rui Ueyama cfa171d68c Simplify.
ArrayRef<T>() equals to ArrayRef<T>(nullptr, 0), so it looks like
we don't need to handle size 0 as a special case.

llvm-svn: 316600
2017-10-25 18:09:54 +00:00
Saleem Abdulrasool 2a5015b11b CodeGen: fix PPC Darwin variadics
Darwin uses char * for the variadic list type (va_list).  We use the PPC
SVR4 ABI for PPC, which uses a structure type for the va_list.  When
constructing the GEP, we would fail due to the incorrect handling for
the va_list.  Correct this to use the right type.

llvm-svn: 316599
2017-10-25 17:56:50 +00:00