Commit Graph

184753 Commits

Author SHA1 Message Date
Bjorn Steinbrink d20816fde9 Allow call-slop optzn for destinations with a suitable dereferenceable attribute
Summary:
Currently, call slot optimization requires that if the destination is an
argument, the argument has the sret attribute. This is to ensure that
the memory access won't trap. In addition to sret, we can also allow the
optimization to happen for arguments that have the new dereferenceable
attribute, which gives the same guarantee.

Subscribers: llvm-commits

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

llvm-svn: 219950
2014-10-16 19:43:08 +00:00
Nick Kledzik 5172067391 [mach-o] Add support for upward linking
To deal with cycles in shared library dependencies, the darwin linker supports
marking specific link dependencies as "upward".  An upward link is when a
lower level library links against a higher level library.

llvm-svn: 219949
2014-10-16 19:31:28 +00:00
Rui Ueyama b38b96ab4c [PECOFF] Support delay-load import table for x86
This patch creates the import address table and sets its
address to the delay-load import table. This also creates
wrapper functions for __delayLoadHelper2.

x86 only for now.

llvm-svn: 219948
2014-10-16 19:30:44 +00:00
Jonathan Roelofs ec81c0b40d Fix lang-ref doc bug: s/icmp lt/icmp slt/
llvm-svn: 219947
2014-10-16 19:28:10 +00:00
Kostya Serebryany 87b70fc823 [asan] make sure coverage is dumped even if leaks are reported
llvm-svn: 219946
2014-10-16 18:59:07 +00:00
Nick Kledzik 15558914ab [llvm-objdump] Fix -private-headers for mach-o to print all LC_*_DYLIB variants
llvm-svn: 219945
2014-10-16 18:58:20 +00:00
Sanjay Patel c699a6117b fold: sqrt(x * x * y) -> fabs(x) * sqrt(y)
If a square root call has an FP multiplication argument that can be reassociated,
then we can hoist a repeated factor out of the square root call and into a fabs().

In the simplest case, this:

   y = sqrt(x * x);

becomes this:

   y = fabs(x);

This patch relies on an earlier optimization in instcombine or reassociate to put the
multiplication tree into a canonical form, so we don't have to search over
every permutation of the multiplication tree.

Because there are no IR-level FastMathFlags for intrinsics (PR21290), we have to
use function-level attributes to do this optimization. This needs to be fixed
for both the intrinsics and in the backend.

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

llvm-svn: 219944
2014-10-16 18:48:17 +00:00
David Blaikie d70f3c20b8 DebugInfo: Follow up to r219736, also test/demonstrate that we emit the constant value in this case as well.
llvm-svn: 219943
2014-10-16 18:38:36 +00:00
Aaron Ballman 78be534c87 Fixing comment grammar; NFC.
llvm-svn: 219942
2014-10-16 18:09:29 +00:00
Hans Wennborg 1e46ef4e08 Speculatively fix GCC 4.7 build after r219938
llvm-svn: 219941
2014-10-16 17:57:41 +00:00
Aaron Ballman ae2144ec3f Switching to range-based for loops; NFC.
llvm-svn: 219940
2014-10-16 17:53:07 +00:00
Samuel Benzaquen b6f73bc510 Fix code to follow the "Don’t use else after a return" rule.
Summary:
Fix code to follow the "Don’t use else after a return" rule.
This is a followup from rL219792.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 219939
2014-10-16 17:50:19 +00:00
David Blaikie 92c8c95943 Use iterators and algorithms to possibly make this code a bit tidier
(also, the code executed once the element was found was split half
inside the loop and half after it - now put it all together after the
find operation)

I'm a bit concerned that this code is rather untested (commenting out
this whole function and running check-clang doesn't fail any tests)...

And I wish I had polymorphic lambdas.

llvm-svn: 219938
2014-10-16 17:23:58 +00:00
Alexey Samsonov 74246aaf89 Remove one of SanitizerBlacklist::isIn() overloads. NFC.
The final goal is to get rid of all the rest overloads that
accept LLVM objects (llvm::Function and llvm::GlobalVariable),
and pass in source-level entities instead.

llvm-svn: 219937
2014-10-16 17:10:38 +00:00
Jason Molenda 48c0440d97 Fix MemoryHistory plugin to check whether the plugin
was able to create itself before returning the shared
pointer to it.
clang warning.

llvm-svn: 219936
2014-10-16 16:59:23 +00:00
Hans Wennborg 0abd4c4ed2 Use array_lengthof; NFC.
llvm-svn: 219935
2014-10-16 16:54:36 +00:00
Juergen Ributzka 03a0611061 [AArch64] Fix miscompile of sdiv-by-power-of-2.
When the constant divisor was larger than 32bits, then the optimized code
generated for the AArch64 backend would emit the wrong code, because the shift
was defined as a shift of a 32bit constant '(1<<Lg2(divisor))' and we would
loose the upper 32bits.

This fixes rdar://problem/18678801.

llvm-svn: 219934
2014-10-16 16:41:15 +00:00
Bradley Smith 04ee8aa1fc [AArch64] Enable A53 erratum workaround (835769) by default for Android targets
llvm-svn: 219933
2014-10-16 16:35:14 +00:00
Saleem Abdulrasool 2eff71d76e tests: move test to more appropriate location
The test is a C++ semantic analysis test, move it to SemaCXX from Sema.  NFC.

llvm-svn: 219932
2014-10-16 16:12:41 +00:00
Vasileios Kalintiris 167c372118 [mips] Account for endianess when expanding BuildPairF64/ExtractElementF64 nodes.
Summary:
In order to support big endian targets for the BuildPairF64 nodes we
just need to swap the low/high pair registers. Additionally, for the
ExtractElementF64 nodes we have to calculate the correct stack offset
with respect to the node's register/operand that we want to extract.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 219931
2014-10-16 15:41:51 +00:00
Tom Stellard ade13b2a4e OpenCL: Emit global variables in the constant addr space as constant globals
llvm-svn: 219929
2014-10-16 15:29:19 +00:00
Tom Stellard 2391c35d79 OpenCL: Add -ffake-address-space-map to a test
The ensures there is an explicit address space id in the output.

llvm-svn: 219928
2014-10-16 15:29:17 +00:00
Vasileios Kalintiris 711028f718 [mips] Marked the DI/EI instruction aliases as MIPS32r2
Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 219927
2014-10-16 15:23:52 +00:00
Alexander Kornienko 27f126b006 [clang-tidy] Minor fixes for the NamespaceCommentCheck.
* Make SmallVector size enough for all groups.
  * Allow trailing period in the comment.
  * Fix "// anonymous namespace qqq".

llvm-svn: 219926
2014-10-16 15:11:54 +00:00
Vasileios Kalintiris f445a56b61 Test commit access: remove extra new line at the end of file
llvm-svn: 219925
2014-10-16 14:37:00 +00:00
Renato Golin 6d41f7ae22 UBSAN stable runtime more generic with arm* targets
llvm-svn: 219924
2014-10-16 12:43:10 +00:00
Alexander Kornienko 1efc425551 [clang-tidy] Default options in modules.
Summary:
This patch allows modules to specify default options for the checks
defined in them. This way a sufficiently configurable check can be registered in
multiple modules with different default options. E.g. the SpacesBeforeComments
option may be set to 1 for the "llvm-namespace-comments" check and to 2 for the
"google-readability-namespace-comment" check without modifying or extending the
check code.

This patch also registers the google-readability-braces-around-statements check
with suitable defaults.

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 219923
2014-10-16 11:27:57 +00:00
Benjamin Kramer 0445380f4f Add missing header guard.
llvm-svn: 219922
2014-10-16 10:10:07 +00:00
Daniel Jasper 1a31bab301 clang-format: Fix behavior with comments before conditional expressions
Before:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
                   ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa
                                     : bbbbbbbbbbbbbbbbbbbb);

After:
  SomeFunction(aaaaaaaaaaaaaaaaa,
               // comment.
               ccccccccccccccccc ? aaaaaaaaaaaaaaaaaaaa : bbbbbbbbbbbbbbbbbbbb);

llvm-svn: 219921
2014-10-16 09:10:11 +00:00
Jason Molenda 823d8f6246 Most of this function checks to see if m_process is non-null before
dereferencing it, except for this one section of code.  Add a null
check around it.
clang static analyzer fix.

llvm-svn: 219920
2014-10-16 08:43:27 +00:00
Daniel Jasper ea772b4df2 clang-format: [ObjC] Fix method expression detection.
Before:
  return (a)[foo bar : baz];

After:
  return (a)[foo bar:baz];

llvm-svn: 219919
2014-10-16 08:38:51 +00:00
Jason Molenda 9bc86593a2 Another logical-or vrs. bitwise-or mixup in ClangUserExpression.
clang unreachable code warning.

llvm-svn: 219918
2014-10-16 08:27:27 +00:00
Jason Molenda b3795a4f5e Enable warnings in the debugserver project file..
llvm-svn: 219917
2014-10-16 08:16:29 +00:00
Jason Molenda 0060a38e7b A series of bit-flag values should be bitwise-or'ed not logical-or'ed.
clang unreachable code warning.

llvm-svn: 219916
2014-10-16 08:15:11 +00:00
Jason Molenda f8a7cfad6d Remove unreachable code.
llvm-svn: 219915
2014-10-16 08:08:13 +00:00
Jason Molenda 637822e3d1 Remove unreachable code.
llvm-svn: 219914
2014-10-16 08:07:54 +00:00
Jason Molenda 97e704b2af Add /* DISABLES CODE */ annotation before if (0) to mark it as intentional.
llvm-svn: 219913
2014-10-16 08:07:20 +00:00
Jason Molenda a68e4dcd7e Remove unreachable code.
llvm-svn: 219912
2014-10-16 08:05:49 +00:00
Jason Molenda 665f12a870 Remove unreachable code.
llvm-svn: 219911
2014-10-16 08:05:22 +00:00
Jason Molenda ecafcb867a Xcode recommended these changes to the project file. It recommended
a number of warnings to be enabled.  The one making the most noise
across the code base right now is CLANG_WARN_UNREACHABLE_CODE = YES.

llvm-svn: 219910
2014-10-16 08:04:28 +00:00
Jason Molenda 60b5da6c3c Remove unused initialization.
clang static analyzer fixit.

llvm-svn: 219909
2014-10-16 07:53:46 +00:00
Jason Molenda 18f5fd3a43 Remove dead store.
clang static analyzer fixit.

llvm-svn: 219908
2014-10-16 07:52:17 +00:00
Jason Molenda 8b5f2cfc19 Remove dead store.
clang static analyzer fixit.

llvm-svn: 219907
2014-10-16 07:49:27 +00:00
Renato Golin 45abb8c969 Adds stable-runtime to ubsan to avoid broken ARM tests with asan
llvm-svn: 219906
2014-10-16 07:48:27 +00:00
Jason Molenda 1e6cf05763 Remove dead store.
clang static analyzer fixit.

llvm-svn: 219905
2014-10-16 07:47:37 +00:00
Jason Molenda 5cf1e237f0 Remove unused variable.
clang static analyzer fixit.

llvm-svn: 219904
2014-10-16 07:41:32 +00:00
Justin Bogner ba7add3a80 Frontend: Fix some underscore-then-capital UB
llvm-svn: 219903
2014-10-16 06:00:55 +00:00
Akira Hatanaka 5c221ef98f Reapply r219832 - InstCombine: Narrow switch instructions using known bits.
The code committed in r219832 asserted when it attempted to shrink a switch
statement whose type was larger than 64-bit.

llvm-svn: 219902
2014-10-16 06:00:46 +00:00
Alexander Eremin 670c62770e specify dwarf version for Solaris
llvm-svn: 219901
2014-10-16 05:55:24 +00:00
David Blaikie 0f62c8d8f8 PR21246: DebugInfo: Emit the appropriate type (cv qualifiers, reference-ness, etc) for non-type template parameters
Plumb through the full QualType of the TemplateArgument::Declaration, as
it's insufficient to only know whether the type is a reference or
pointer (that was necessary for mangling, but insufficient for debug
info). This shouldn't increase the size of TemplateArgument as
TemplateArgument::Integer is still longer by another 32 bits.

Several bits of code were testing that the reference-ness of the
parameters matched, but this seemed to be insufficient (various other
features of the type could've mismatched and wouldn't've been caught)
and unnecessary, at least insofar as removing those tests didn't cause
anything to fail.

(Richard - perchaps you can hypothesize why any of these checks might
need to test reference-ness of the parameters (& explain why
reference-ness is part of the mangling - I would've figured that for the
reference-ness to be different, a prior template argument would have to
be different). I'd be happy to add them in/beef them up and add test
cases if there's a reason for them)

llvm-svn: 219900
2014-10-16 04:21:25 +00:00