Commit Graph

209629 Commits

Author SHA1 Message Date
Andrew Kaylor 2a9a6d8c38 Fix build warning
llvm-svn: 246903
2015-09-05 01:00:51 +00:00
Michael J. Spencer 1b3fffa6e0 [elf2] Add 32S and 64 relocations (needed for musl).
It wasn't obvious what the assembly was to generate these relocations, so I did the test with yaml.

llvm-svn: 246902
2015-09-05 00:36:03 +00:00
Michael J. Spencer baae538cc6 [elf2] Correctly handle sections with an alignment of 0. Spec says to treat it as an alignment of 1.
llvm-svn: 246901
2015-09-05 00:25:33 +00:00
Hal Finkel b1518d6c24 [PowerPC] Fix and(or(x, c1), c2) -> rlwimi generation
PPCISelDAGToDAG has a transformation that generates a rlwimi instruction from
an input pattern that looks like this:

  and(or(x, c1), c2)

but the associated logic does not work if there are bits that are 1 in c1 but 0
in c2 (these are normally canonicalized away, but that can't happen if the 'or'
has other users. Make sure we abort the transformation if such bits are
discovered.

Fixes PR24704.

llvm-svn: 246900
2015-09-05 00:02:59 +00:00
Andrew Kaylor a212aba680 Fix build warning
llvm-svn: 246899
2015-09-04 23:58:32 +00:00
Evgeniy Stepanov 4dd7104549 Fix passed env var name in lit for Android tests.
The variable is actually called ANDROID_SERIAL.
This was not exercised on the bots until today.
Should fix the sanitizer-x86_64-linux failures.

llvm-svn: 246898
2015-09-04 23:52:04 +00:00
Andrew Kaylor a89baa21b8 Fixing bad test syntax.
llvm-svn: 246897
2015-09-04 23:47:34 +00:00
Andrew Kaylor 50e4e86c26 [WinEH] Teach SimplfyCFG to eliminate empty cleanup pads.
Differential Revision: http://reviews.llvm.org/D12434

llvm-svn: 246896
2015-09-04 23:39:40 +00:00
Eric Fiselier c681dc26db Test commit for sphinx docs try2
llvm-svn: 246895
2015-09-04 23:19:11 +00:00
Siva Chandra fdc11d5895 [TestMiBreak] Replace expectedFlakeyLinux with an appropriate expectedFailureAll
Reviewers: chaoren

Subscribers: lldb-commits

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

llvm-svn: 246894
2015-09-04 23:11:38 +00:00
Eric Fiselier cc44cbbde4 Test commit to see if libcxx.llvm.org/docs builds
llvm-svn: 246893
2015-09-04 22:57:00 +00:00
Michael J. Spencer f832541066 [elf2] Fix include order.
llvm-svn: 246892
2015-09-04 22:48:30 +00:00
Evgeniy Stepanov de77b1cdf3 [asan] Detect asanwrapper binary in android tests.
Tests need to be run either via asanwrapper or asanwrapper64
depending in the binary bitness. This matters when testing on an
aarch64 device.

llvm-svn: 246891
2015-09-04 22:39:21 +00:00
George Burgess IV b40cd567c3 Fix a bug in __builtin_object_size cast removal
Apparently there are many cast kinds that may cause implicit pointer
arithmetic to happen. In light of this, the cast ignoring logic
introduced in r246877 has been changed to only ignore a small set of
cast kinds, and a test for this behavior has been added.

Thanks to Richard for catching this before it became a bug report. :)

llvm-svn: 246890
2015-09-04 22:36:18 +00:00
Reid Kleckner 3baf9c8ace Relax partial-init test case for ARM
llvm-svn: 246889
2015-09-04 22:32:51 +00:00
Kostya Serebryany e641dd6479 [libFuzzer] more accurate logic for traces, 80-char fix
llvm-svn: 246888
2015-09-04 22:32:25 +00:00
Greg Clayton ea4a5bb8bb Check for null compile unit so we don't crash.
llvm-svn: 246887
2015-09-04 22:29:46 +00:00
Michael J. Spencer 1b348a68e5 [elf2] Add basic archive file support.
llvm-svn: 246886
2015-09-04 22:28:10 +00:00
Siva Chandra 2becc987ef Convert "long" input to "long long" in typemap for lldb::tid_t.
Summary: lldb::tid_t is 64 bit, but "long" need not always be 64 bit.

Reviewers: chying, clayborg

Subscribers: lldb-commits

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

llvm-svn: 246885
2015-09-04 22:26:52 +00:00
Enrico Granata 964211f25f Add a --language (-l) option to type category {enable|disable} to allow people to turn on and off formatters for a given language
llvm-svn: 246884
2015-09-04 22:07:48 +00:00
Hal Finkel 0e2b975eb6 Don't crash on a self-alias declaration
We were crashing in CodeGen given input like this:

  int self_alias(void) __attribute__((weak, alias("self_alias")));

such a self-alias is invalid, but instead of diagnosing the situation, we'd
proceed to produce IR for both the function declaration and the alias. Because
we already had a function named 'self_alias', the alias could not be named the
same thing, and so LLVM would pick a different name ('self_alias1' for example)
for that value. When we later called CodeGenModule::checkAliases, we'd look up
the IR value corresponding to the alias name, find the function declaration
instead, and then assert in a cast to llvm::GlobalAlias. The easiest way to prevent
this is simply to avoid creating the wrongly-named alias value in the first
place and issue the diagnostic there (instead of in checkAliases). We detect a
related cycle case in CodeGenModule::EmitAliasDefinition already, so this just
adds a second such check.

Even though the other test cases for this 'alias definition is part of a cycle'
diagnostic are in test/Sema/attr-alias-elf.c, I've added a separate regression
test for this case. This is because I can't add this check to
test/Sema/attr-alias-elf.c without disturbing the other test cases in that
file. In order to avoid construction of the bad IR values, this diagnostic
is emitted from within CodeGenModule::EmitAliasDefinition (and the relevant
declaration is not added to the Aliases vector). The other cycle checks are
done within the CodeGenModule::checkAliases function based on the Aliases
vector, called from CodeGenModule::Release.  However, if there have been errors
earlier, HandleTranslationUnit does not call Release, and so checkAliases is
never called, and so none of the other diagnostics would be produced.

Fixes PR23509.

llvm-svn: 246882
2015-09-04 21:49:21 +00:00
Richard Smith 81c7248cac Fix crash on invalid if we can't find a suitable PCH file in a specified
directory, and our frontend action cares whether the frontend setup actually
succeeded.

llvm-svn: 246881
2015-09-04 21:44:32 +00:00
Reid Kleckner 5ee4b9a11f Don't use unreachable as a placeholder, it confuses EmitBlock
This fixes an issue raised in D12412, where we generated invalid IR.

Thanks to Vedant Kumar for coming up with the initial work around.

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

llvm-svn: 246880
2015-09-04 21:39:15 +00:00
Angel Garcia Gomez bd0ec69e0a Avoid repeated replacements on loop-convert check.
Summary: The InitListExpr subtree is visited twice, this caused the check to do multiple replacements. Added a set to avoid it.

Reviewers: klimek, alexfh

Subscribers: cfe-commits, alexfh

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

llvm-svn: 246879
2015-09-04 21:37:05 +00:00
Rui Ueyama ef907ec82d COFF: Implement a better algorithm for ICF.
Identical COMDAT Folding is a feature to merge COMDAT sections
by contents. Two sections are considered the same if their contents,
relocations, attributes, etc, are all the same.

An interesting fact is that MSVC linker takes "iterations" parameter
for ICF because the algorithm they are using is iterative. Merging
two sections could make more sections to be mergeable because
different relocations could now point to the same section. ICF is
repeated until we get a convergence (until no section can be merged).
This algorithm is not fast. Usually it needs three iterations until a
convergence is obtained.

In the new algorithm implemented in this patch, we consider sections
and relocations as a directed acyclic graph, and we try to merge
sections whose outdegree is zero. Sections with outdegree zero are then
removed from the graph, which makes  other sections to have outdegree
zero. We repeat that until all sections are processed. In this
algorithm, we don't iterate over the same sections many times.

There's an apparent issue in the algorithm -- the section graph is
not guaranteed to be acyclic. It's actually pretty often cyclic.
So this algorithm cannot eliminate all possible duplicates.
That's OK for now because the previous algorithm was not able to
eliminate cycles too. I'll address the issue in a follow-up patch.

llvm-svn: 246878
2015-09-04 21:35:54 +00:00
George Burgess IV 3a03fabdd0 Increase accuracy of __builtin_object_size.
Improvements:

- For all types, we would give up in a case such as:
    __builtin_object_size((char*)&foo, N);
  even if we could provide an answer to
    __builtin_object_size(&foo, N);
  We now provide the same answer for both of the above examples in all
  cases.

- For type=1|3, we now support subobjects with unknown bases, as long
  as the designator is valid.

Thanks to Richard Smith for the review + design planning.

Review: http://reviews.llvm.org/D12169
llvm-svn: 246877
2015-09-04 21:28:13 +00:00
Enrico Granata c6bbb8b69a Never mind, I see what the problem is on the Windows build. Attempt a fix
llvm-svn: 246876
2015-09-04 21:22:54 +00:00
Evgeniy Stepanov dc8616b541 [asan] Fix >80 chars line.
llvm-svn: 246875
2015-09-04 21:19:48 +00:00
Rui Ueyama 434de7a33f Remove unused variable.
llvm-svn: 246874
2015-09-04 21:05:30 +00:00
Enrico Granata 33e97e63a5 Move the C++ data formatters to the C++ language plugin
llvm-svn: 246873
2015-09-04 21:01:18 +00:00
Sean Callanan 7a518c3dab I accidentally committed some project-file changes. Undid those.
llvm-svn: 246872
2015-09-04 20:54:25 +00:00
Sean Callanan bc8ac34e61 This patch separates the generic portion of ClangExpressionVariable, which
stores information about a variable that different parts of LLDB use, from the
compiler-specific portion that only the expression parser cares about.

http://reviews.llvm.org/D12602

llvm-svn: 246871
2015-09-04 20:49:51 +00:00
Adrian McCarthy a729204103 Sleep-and-retry after a failure to delete a log file, which may be because antimalware is holding the handle to the just-created file.
Differential Revision: http://reviews.llvm.org/D12641

llvm-svn: 246870
2015-09-04 20:48:48 +00:00
Rui Ueyama 2dcc23580e COFF: Use section content checksum for ICF.
Previously, we calculated our own hash values for section contents.
Of coruse that's slow because we had to access all bytes in sections.
Fortunately, COFF objects usually contain hash values for COMDAT
sections. We can use that to speed up Identical COMDAT Folding.

llvm-svn: 246869
2015-09-04 20:45:50 +00:00
Davide Italiano baec437f54 [llvm-readobj] MachO: dump the correct field.
This was found while converting a test from macho-dump to llvm-readobj
and will once I commit the converted test.

llvm-svn: 246868
2015-09-04 20:43:00 +00:00
Evgeniy Stepanov add0f2aad5 [asan] Disable asm instrumentation tests on android/x86.
https://github.com/google/sanitizers/issues/353

llvm-svn: 246866
2015-09-04 20:26:58 +00:00
Yaron Keren 771e31964d Remove two unused includes and C++11 rangify for loops.
llvm-svn: 246865
2015-09-04 20:24:24 +00:00
Hans Wennborg 5427a69545 Don't allow dllexport/import on static local variables
They might technically have external linkage, but it still doesn't make sense
for the user to try and export such variables. This matches MSVC's and MinGW's
behaviour.

llvm-svn: 246864
2015-09-04 19:59:39 +00:00
Simon Pilgrim 0fccef6ac2 [X86][AVX] Test tidyup + regeneration. NFCI.
llvm-svn: 246863
2015-09-04 19:47:56 +00:00
Peter Collingbourne 07dcb58f8a Add powerpc64 to parallel.ll unsupported architecture list.
llvm-svn: 246862
2015-09-04 19:45:36 +00:00
Davide Italiano ad6c81c628 [ELF2] Writer: Fold variables, use setVisibility(). NFCI.
llvm-svn: 246861
2015-09-04 19:42:14 +00:00
Aaron Ballman c129c69105 Fixing a bug where hasType(decl()) would fail to match on C code involving structs or unions.
llvm-svn: 246860
2015-09-04 18:34:48 +00:00
Hafiz Abid Qadeer 23a4df27ab Use correct #ifdef check for ProcessWindowsLog::Terminate() call.
The call to ProcessWindowsLog::Initialize() is protected by #if defined(_MSC_VER).
But the call to ProcessWindowsLog::Terminate() was using __WIN32__. This commit
makes it use _MSC_VER too.

Committing as it seems obvious change.

llvm-svn: 246859
2015-09-04 16:34:19 +00:00
Hafiz Abid Qadeer e7a71480b0 Fix CMICmdArgValConsume to correctly handle "--".
CMICmdArgValConsume::Validate was not removing it from the input stream.

llvm-svn: 246858
2015-09-04 16:10:48 +00:00
Ed Schouten e8eab68b55 Put ext_implicit_lib_function_decl in ImplicitFunctionDeclare.
If we build with -Werror=implicit-function-declaration, only implicit
function declarations of non-library functions throw compiler errors.
For library functions, we only produce a warning. There is no way to
promote both of these cases to an error without promoting other
warnings.

It makes little sense to introduce an additional compiler flag just to
control this specific warning. In my opinion it should just be part of
the same group.

llvm-svn: 246857
2015-09-04 16:07:39 +00:00
Alexander Kornienko 13f0bb8b3a [clang-tidy] Fix llvm-include-order check on Windows.
IncludeDirectives struct used a StringRef that pointed to a stack variable
(SmallString<128> FilenameBuffer from PPDirectives.cpp:1513).

http://reviews.llvm.org/D12632

Patch by Marek Kurdej!

llvm-svn: 246856
2015-09-04 15:46:51 +00:00
Ben Craig dfe3d56d87 Adding full stops to comments
Also, test commit

llvm-svn: 246855
2015-09-04 15:28:13 +00:00
Alexander Kornienko c0ebfbe5e1 [clang-tidy] Fix add_new_check.py.
This fixes the case where the check should be added at the end of
the list of checks in CMakeLists.txt of the corresponding module.
Before it was added after LINK_LIBS line.

http://reviews.llvm.org/D12629

Patch by Marek Kurdej!

llvm-svn: 246854
2015-09-04 14:56:57 +00:00
Alexey Bataev 5a1954780f [OPENMP] Fix false diagnostic on instantiation-dependent exprs for atomic constructs.
Some of instantiation-dependent expressions could cause false diagnostic to be emitted about unsupported atomic constructs. Relaxed rules for detection of incorrect expressions.

llvm-svn: 246853
2015-09-04 12:55:50 +00:00
Tamas Berghammer 980662ee9d Fix TestLoadUnload.test_load_unload for android API > 21
* Change Module::MatchesModuleSpec to return true in case the file spec
  in the specified module spec matches with the platform file spec, but
  not with the local file spec
* Change the module_resolver used when resolving a remote shared module
  to always set the platform file spec to the file spec requested

Differential revision: http://reviews.llvm.org/D12601

llvm-svn: 246852
2015-09-04 12:42:41 +00:00