Commit Graph

213157 Commits

Author SHA1 Message Date
Matthias Gehre 0f629153af [clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def
Summary:
Import the cert check for variadic function definitions into
cppcoreguidelines module to check part of
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-type8-avoid-reading-from-varargs-or-passing-vararg-arguments-prefer-variadic-template-parameters-instead

Reviewers: alexfh, sbenza, bkramer, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 250468
2015-10-15 22:40:45 +00:00
Adrian McCarthy 6ecdbc87e6 Factor the execution of the test method into a separate function to ensure that any exceptions that are thrown go out of scope and no longer hold references to SB objects that need to be freed before teardown.
Differential Revision: http://reviews.llvm.org/D13788

llvm-svn: 250467
2015-10-15 22:39:55 +00:00
Rui Ueyama c7cc6ecf08 ELF2: Use ELFT to template OutputSections.
This patch is to use ELFT instead of Is64Bits to template OutputSection
and its subclasses. This increases code size slightly because it creates
two identical functions for some classes, but that's only 20 KB out of
33 MB, so it's negligible.

This is as per discussion with Rafael. He's not fan of the idea but OK
with this. We'll revisit later to this topic.

llvm-svn: 250466
2015-10-15 22:27:29 +00:00
Stephane Sezer cdb2a11e04 Minor indentation fix in StackFrameList.cpp.
llvm-svn: 250465
2015-10-15 22:24:17 +00:00
Davide Italiano a0ec2f5f99 [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.
llvm-svn: 250464
2015-10-15 22:04:55 +00:00
Rui Ueyama c6ef3f28fc ELF2: Do not treat .strtab specially when creating sections.
String table is added to end of the file so that all the other sections
are finalized before string table. But we can just add section names to
the string table before calling finalize() on any section instead.

llvm-svn: 250463
2015-10-15 21:50:30 +00:00
Rui Ueyama 5f1eee1aac ELF2: Move HashTableSection::hash out of the class.
Because the function does not depend on the class.

llvm-svn: 250462
2015-10-15 21:27:17 +00:00
Evgeniy Stepanov 9addbc9fc1 Revert "[safestack] Fast access to the unsafe stack pointer on AArch64/Android."
Breaks the hexagon buildbot.

llvm-svn: 250461
2015-10-15 21:26:49 +00:00
Teresa Johnson 8f865a41fb Add llvm-bcanalyzer to list of clang test dependences
This addresses a bot failure from r250455, since new Misc/thinlto.c
test uses it.

llvm-svn: 250460
2015-10-15 21:06:53 +00:00
Adrian Prantl 96b1551d53 Replace a forward declaration with an #include.
When building with modules the forward-declared inner class
DebugLocStream::ListBuilder causes clang to fall over.

llvm-svn: 250459
2015-10-15 20:58:55 +00:00
Rui Ueyama 2317d0d4d6 Remove a getter/setter that don't hide anything.
llvm-svn: 250458
2015-10-15 20:55:22 +00:00
Rui Ueyama 96b190428e Fix style.
llvm-svn: 250457
2015-10-15 20:55:20 +00:00
Evgeniy Stepanov 142947e9f0 [safestack] Fast access to the unsafe stack pointer on AArch64/Android.
Android libc provides a fixed TLS slot for the unsafe stack pointer,
and this change implements direct access to that slot on AArch64 via
__builtin_thread_pointer() + offset.

This change also moves more code into TargetLowering and its
target-specific subclasses to get rid of target-specific codegen
in SafeStackPass.

This change does not touch the ARM backend because ARM lowers
builting_thread_pointer as aeabi_read_tp, which is not available
on Android.

llvm-svn: 250456
2015-10-15 20:50:16 +00:00
Teresa Johnson 945bc50f21 Recommit "Clang support for -flto=thin."
This recommits r250398 with fixes to the tests for bot failures.

Add "-target x86_64-unknown-linux" to the clang invocations that
check for the gold plugin.

llvm-svn: 250455
2015-10-15 20:35:53 +00:00
Todd Fiala 3b82908f0f Fixup previous commit.
Looks like I blasted something into my editor...

llvm-svn: 250454
2015-10-15 20:32:25 +00:00
Todd Fiala 125b1bd361 Modify pylint/flake8 path helper to add lldb python module to path.
It was adding all the test infrastructure paths properly, but it
was not adding the lldb module.  The current approach only adds the
lldb from the path.  That can be improved (in the comments) to add
the one from the related build directory if it can be ascertained.

With this change, lldb tests can be run through pylint/flake8
and have the lldb module found and used as part of the checks.

llvm-svn: 250453
2015-10-15 20:27:23 +00:00
Eric Fiselier f2be7c28fc Fix handling of -Wno-pedantic
llvm-svn: 250452
2015-10-15 20:27:15 +00:00
Chris Bieneman 01dda1a46d [CMake] Adding LLVM_CREATE_XCODE_TOOLCHAIN to the CMake documentation page.
llvm-svn: 250451
2015-10-15 20:12:08 +00:00
Chris Bieneman 09178283c2 [CMake] [Darwin] Add support for generating Xcode-compatible toolchains that xcodebuild and xcrun can search
Summary:
Sometimes you want to install a custom compiler and use it like the system compiler without overriding the system compiler. This patch lets you create xctoolchains that the darwin command line tools can use.

To use this patch set LLVM_CREATE_XCODE_TOOLCHAIN=On in your CMake invocation and build the `install-code-toolchain` target.

After installation you can set the envar EXTERNAL_TOOLCHAINS_DIR to your installed Toolchains directory, and the TOOLCHAINS envar to the toolchain identifier (ex org.llvm.3.8.0svn). This will then cause /usr/bin/clang to call your newly installed clang.

Reviewers: Bigcheese, bogner

Subscribers: tobiasfar, llvm-commits

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

llvm-svn: 250450
2015-10-15 20:09:01 +00:00
Eric Christopher abde1c2b51 The target-feature command line option doesn't take a comma delimited
string, so split them into multiple options.

llvm-svn: 250449
2015-10-15 20:04:42 +00:00
Eric Christopher 4fb4fbc5d6 Add the minimum target features that these tests depend upon.
llvm-svn: 250448
2015-10-15 20:04:40 +00:00
Rui Ueyama 6607227fc1 ELF2: Rename SymVA -> SA if SymVA includes addend.
llvm-svn: 250447
2015-10-15 19:52:27 +00:00
Adrian Prantl d8596384e7 Add a missing include of cstddef needed for size_t.
llvm-svn: 250446
2015-10-15 19:41:54 +00:00
Rui Ueyama 9e82fa22e4 ELF2: s/R/SA/ in PPC64 relocations because R is S + A.
llvm-svn: 250445
2015-10-15 19:39:36 +00:00
Zachary Turner 9c40264fda Introduce a `PythonFile` object, and use it everywhere.
Python file handling got an overhaul in Python 3, and it affects
the way we have to interact with files.  Notably:

1) `PyFile_FromFile` no longer exists, and instead we have to use
   `PyFile_FromFd`.  This means having a way to get an fd from
   a FILE*.  For this we reuse the lldb_private::File class to
   convert between FILE*s and fds, since there are some subtleties
   regarding ownership rules when FILE*s and fds refer to the same
   file.
2) PyFile is no longer a builtin type, so there is no such thing as
   `PyFile_Check`.  Instead, files in Python 3 are just instances
   of `io.IOBase`.  So the logic for checking if something is a file
   in Python 3 is to check if it is a subclass of that module.

Additionally, some unit tests are added to verify that `PythonFile`
works as expected on Python 2 and Python 3, and
`ScriptInterpreterPython` is updated to use `PythonFile` instead of
manual calls to the various `PyFile_XXX` methods.

llvm-svn: 250444
2015-10-15 19:35:48 +00:00
Rafael Espindola b26d807033 Use OutputSectionBase in a few more places. NFC.
Just making room for having another output section type.

llvm-svn: 250443
2015-10-15 19:31:49 +00:00
Daniel Jasper f39757d0c0 clang-format: Basic escaping when outputting XML.
llvm-svn: 250440
2015-10-15 18:39:31 +00:00
Tobias Grosser b860289dbd Add ScopInfo test case for r250411
llvm-svn: 250439
2015-10-15 18:26:06 +00:00
JF Bastien 2cdd5e4710 x86: preserve flags when folding atomic operations
D4796 taught LLVM to fold some atomic integer operations into a single
instruction. The pattern was unaware that the instructions clobbered
flags. I fixed some of this issue in D13680 but had missed INC/DEC.

This patch adds the missing EFLAGS definition.

llvm-svn: 250438
2015-10-15 18:24:52 +00:00
Rafael Espindola 826941a69a Rename variable to make it clear it includes the addend.
Thanks to Rui for the suggestion.

llvm-svn: 250437
2015-10-15 18:19:39 +00:00
Justin Bogner c2e54af7d3 docs: Stop using DEBUG() without DEBUG_TYPE in the ProgrammersManual
The DEBUG() macro has required that a DEBUG_TYPE be set since r206822.
Update the programmers manual to reflect that, and also update the
wording to point out that DEBUG_TYPE should be defined after #includes.

llvm-svn: 250436
2015-10-15 18:17:44 +00:00
Tobias Grosser 473a5c3253 test: Correctly check for branch statements
In r250408 'CHECK-NEXT: br' lines were removed as they also matched a
'%polly.subregion.iv.inc' instruction and did consequently not check what they
were supposed to check. However, without these lines we can not test that the
.s2a instructions that are not any more generated since r250411 really are not
emitted. Hence, we add back the CHECK-NEXT lines to ensure there are really no
instructions generated between the store that we check for and the branch at the
end of the basic block. To ensure we do not match too early, we now check for
'br i1' or 'br label'.

llvm-svn: 250435
2015-10-15 18:04:20 +00:00
Benjamin Kramer bacc7ba7aa [SelectionDAG] Remove dead code. NFC.
Carefully selected parts without deleting graph stuff and dumping methods.

llvm-svn: 250434
2015-10-15 17:54:06 +00:00
Benjamin Kramer 7fa42c8a8c [AsmPrinter] Prune dead code. NFC.
I left all (dead) print and dump methods in place.

llvm-svn: 250433
2015-10-15 17:16:32 +00:00
Rui Ueyama d9189ceb23 ELF2: Implement __start_SECNAME and __stop_SECNAME.
If a section name is valid as a C identifier (which is rare because of
the leading '.'), linkers are expected to define __start_<secname> and
__stop_<secname> symbols. They are at beginning and end of the section,
respectively. This is not requested by the ELF standard, but GNU ld and
gold provide this feature.

llvm-svn: 250432
2015-10-15 17:11:03 +00:00
Kevin B. Smith 89760f04f9 Change test to use FileCheck rather than grep.
Differential Revision: http://reviews.llvm.org/D13751

llvm-svn: 250431
2015-10-15 17:05:12 +00:00
Philip Reames a956cc7f08 Revert 250343 and 250344
Turns out this approach is buggy.  In discussion about follow on work, Sanjoy pointed out that we could be subject to circular logic problems.  

Consider:
 if (i u< L) leave()
 if ((i + 1) u< L) leave()
 print(a[i] + a[i+1]) 

If we know that L is less than UINT_MAX, we could possible prove (in a control dependent way) that i + 1 does not overflow.  This gives us:
 if (i u< L) leave()
 if ((i +nuw 1) u< L) leave()
 print(a[i] + a[i+1]) 

If we now do the transform this patch proposed, we end up with:
 if ((i +nuw 1) u< L) leave_appropriately()
 print(a[i] + a[i+1]) 

That would be a miscompile when i==-1.  The problem here is that the control dependent nuw bits got used to prove something about the first condition.  That's obviously invalid.

This won't happen today, but since I plan to enhance LVI/CVP with exactly that transform at some point in the not too distant future...

llvm-svn: 250430
2015-10-15 16:51:00 +00:00
JF Bastien 5b327712b0 x86 FP atomic codegen: don't drop globals, stack
Summary:
x86 codegen is clever about generating good code for relaxed
floating-point operations, but it was being silly when globals and
immediates were involved, forgetting where the global was and
loading/storing from/to the wrong place. The same applied to hard-coded
address immediates.

Don't let it forget about the displacement.

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

A very similar bug when doing floating-points atomics to the stack is
also fixed by this patch.

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

Reviewers: pete

Subscribers: llvm-commits, majnemer, rsmith

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

llvm-svn: 250429
2015-10-15 16:46:29 +00:00
Benjamin Kramer 2811b04874 Put back doxygen comment accidentally dropped in r250418.
llvm-svn: 250428
2015-10-15 16:46:25 +00:00
Diego Novillo 38be33302c Sample Profiles - Adjust integer types. Mostly NFC.
This adjusts all integers in the reader/writer to reflect the types
stored on profile files. They should all be unsigned 32-bit or 64-bit
values. Changed all associated internal types to be uint32_t or
uint64_t.

The only place that needed some adjustments is in the sample profile
transformation. Altough the weight read from the profile are 64-bit
values, the internal API for branch weights only accepts 32-bit values.
The pass now saturates weights that overflow uint32_t.

llvm-svn: 250427
2015-10-15 16:36:21 +00:00
Todd Fiala 4f3589c779 Fix broken assert in DWARFDIE.cpp on OS X
See:
http://reviews.llvm.org/D13777

llvm-svn: 250426
2015-10-15 16:35:59 +00:00
Tim Northover 0515291c52 Prevent assertion with "llc -debug" and anonymous symbols.
llvm-svn: 250425
2015-10-15 16:18:27 +00:00
Hal Finkel 33e17a7c73 [ELF2/PPC64] Error on R_PPC64_ADDR16 overflow
R_PPC64_ADDR16 is not a truncated relocation, and should error if the address
cannot be represented in 16 bits.

llvm-svn: 250424
2015-10-15 16:17:30 +00:00
Hal Finkel 000561c2f5 Revert "r250372 - [ELF2/PPC64] Remove now-dead weak/undef check"
Unfortunately, the check was not as dead as I had thought, and adjusting the
starting VA again exposed the problem. We end up trying to relocate the bl
(using a 24-bit relative offset) to a symbol address of zero, and in general,
that does not fit.

Thus, reverting for now, and adding a test case.

llvm-svn: 250423
2015-10-15 16:12:35 +00:00
Nico Weber 2cd92f1cc7 clang-format/java: Break after annotations on fields in Chromium style.
Chromium follows the Android style guide for Java code, and that doesn't make
the distinction between fields and non-fields that the Google Java style guide
makes:

https://source.android.com/source/code-style.html#use-standard-java-annotations
https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations

llvm-svn: 250422
2015-10-15 16:03:01 +00:00
Rafael Espindola aa19708f88 Centralize the handling of r_addend. NFC.
When a relocation points to a SHF_MERGE section, the addend has special meaning.
It should be used to find what in the section the relocation points to. It
should not be added to the output position.

Centralizing it means that the above rule will be implemented once, not once
per target.

llvm-svn: 250421
2015-10-15 15:52:12 +00:00
NAKAMURA Takumi 9ea61afc86 Lit: Rework r249161; Move RLIMIT_NPROC to main.py.
The message "raised the process limit..." prevented the progress bar.

llvm-svn: 250420
2015-10-15 15:37:13 +00:00
Rafael Espindola ae81a7bf49 Use OutputSectionBase in a few cases where we don't need a OutputSection.
NFC. This is just preparation for adding a new OutputSection dedicated to
SHF_MERGE input sections.

llvm-svn: 250419
2015-10-15 15:29:53 +00:00
Benjamin Kramer c2d2b4259c [CodeGen] Remove dead code. NFC.
llvm-svn: 250418
2015-10-15 15:29:40 +00:00
Benjamin Kramer 6db3338cb1 [ScalarOpts] Remove dead code.
Does not touch debug dumpers. NFC.

llvm-svn: 250417
2015-10-15 15:08:58 +00:00