Commit Graph

191167 Commits

Author SHA1 Message Date
Alexei Starovoitov 4ea2f606a8 [mips] fix spelling of 'disassembler'
trivial first commit

llvm-svn: 226935
2015-01-23 21:00:08 +00:00
Hans Wennborg ae9c971a2f LowerSwitch: replace unreachable default with popular case destination
SimplifyCFG currently does this transformation, but I'm planning to remove that
to allow other passes, such as this one, to exploit the unreachable default.

This patch takes care to keep track of what case values are unreachable even
after the transformation, allowing for more efficient lowering.

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

llvm-svn: 226934
2015-01-23 20:43:51 +00:00
Oleksiy Vyalov 7ed92fbbe8 Fix CMake build - add readline dependency on ${PYTHON_LIBRARY}.
llvm-svn: 226933
2015-01-23 20:09:14 +00:00
Colin LeMahieu bc2f47a76e [Objdump] Output information about common symbols in a way closer to GNU objdump.
llvm-svn: 226932
2015-01-23 20:06:24 +00:00
Ramkumar Ramachandra c3c8b27616 [emacs] llvm-mode: fix parens, font-lock i*
In llvm-mode, with electric-pair-mode turned on, typing a literal '['
would print out '[[', and '(' would print a '(('. This was a very
annoying bug caused by overzealous syntax-table entries: the parens are
already part of the '(' and ')' class by default. Fix this.

While at it, notice that i32, i64, i1 etc. are not font-locked despite a
clear intent to do so. The issue is that regexp-opt doesn't accept
regular expressions. So, spell out the common literal integers with
different widths.

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

llvm-svn: 226931
2015-01-23 19:45:35 +00:00
Daniel Jasper d1c13736e0 clang-format: Fix another crasher caused by incomplete macro code.
We did't properly mark all of an AnnotatedLine's children as finalized
and thus would reformat the same tokens in different branches of #if/#else
sequences leading to invalid replacements.

llvm-svn: 226930
2015-01-23 19:37:25 +00:00
Kuba Brecka 9a36b3e147 [compiler-rt] Ensure AsanInitFromRtl is called from a static initializer on OS X by using ASAN_DYNAMIC=1
The idea is to ensure that the ASan runtime gets initialized early (i.e.
before other initializers/constructors) even when DYLD_INSERT_LIBRARIES
is not used. In that case, the interceptors are not installed (on OS X,
DYLD_INSERT_LIBRARIES is required for interceptors to work), and therefore
ASan gets currently initialized quite late -- from the main executable's
module initializer. The following issues are a consequence of this:

  https://code.google.com/p/address-sanitizer/issues/detail?id=363
  https://code.google.com/p/address-sanitizer/issues/detail?id=357

Both of them are fixed with this patch.

Reviewed at http://reviews.llvm.org/D7117

llvm-svn: 226929
2015-01-23 19:29:19 +00:00
Greg Fitzgerald ba2bcb0da3 Revert " Fix the ELF shared library build targets"
This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51.

llvm-svn: 226928
2015-01-23 19:24:32 +00:00
Fariborz Jahanian 30609b8a78 Objective-C modernizer. Avoid using property-dot syntax when
receiver type is not valid for property-dot syntz use.
rdar://19381786

llvm-svn: 226927
2015-01-23 19:23:42 +00:00
Kuba Brecka f1397fa7d7 [compiler-rt] Fix the prototype of ioctl interceptor
The interceptor of ioctl is using a non-standard prototype:

  INTERCEPTOR(int, ioctl, int d, unsigned request, void *arg)

At least on OS X, the request argument should be unsigned long and not 
just unsigned, and also instead of the last argument (arg), the function
should be accepting a variable number of arguments, so the prototype
should be:

  int ioctl(int fildes, unsigned long request, ...);

We can still keep using `unsigned` internally to save space, because we
know that all possible values of `request` will fit into it.

Reviewed at http://reviews.llvm.org/D7038

llvm-svn: 226926
2015-01-23 19:17:20 +00:00
Reid Kleckner 6b7156b74d Attempt to fix ::sscanf Cygwin build break reported in PR22302
llvm-svn: 226925
2015-01-23 19:16:25 +00:00
Francisco Lopes da Silva 13937abe88 Add tests for code completion of variadic prototypes
llvm-svn: 226924
2015-01-23 19:06:57 +00:00
Daniel Jasper 7509216a41 clang-format: Fix incorrect classification of "*".
Before:
  *a = b *c;

After:
  *a = b * c;

llvm-svn: 226923
2015-01-23 19:04:49 +00:00
Greg Fitzgerald 0823ea636e Fix the ELF shared library build targets
lldELF is used by each ELF backend.  lldELF's ELFLinkingContext
 also held a reference to each backend, creating a link-time
 cycle.  This patch moves the backend references to lldDriver.

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

llvm-svn: 226922
2015-01-23 18:52:44 +00:00
Kevin Enderby 69fe98da14 Add the option, -data-in-code, to llvm-objdump used with -macho to print the Mach-O data in code table.
llvm-svn: 226921
2015-01-23 18:52:17 +00:00
Reid Kleckner 5cc1569c54 Classify functions by EH personality type rather than using the triple
This mostly reverts commit r222062 and replaces it with a new enum. At
some point this enum will grow at least for other MSVC EH personalities.

Also beefs up the way we were sniffing the personality function.
Previously we would emit the Itanium LSDA despite using
__C_specific_handler.

Reviewers: majnemer

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

llvm-svn: 226920
2015-01-23 18:49:01 +00:00
Adrian Prantl 577feba44b Debug Info / PR22309: Allow union types to be emitted as unsigned constants.
llvm-svn: 226919
2015-01-23 18:01:39 +00:00
Eric Christopher a1c6e0c8ce Remove some local variables in place of just querying for them
in the couple of asserts.

llvm-svn: 226917
2015-01-23 17:22:44 +00:00
Sanjay Patel 76c9e0986c Process the -fno-signed-zeros optimization flag (PR20870)
The driver currently accepts but ignores the -fno-signed-zeros flag. 
This patch passes the flag through and enables 'nsz' fast-math-flag 
generation in IR.

The existing OpenCL flag for the same functionality is made into an
alias here. It may be removed in a subsequent patch.

This should resolve bug 20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 );
patches for the optimizer were checked in at:
http://llvm.org/viewvc/llvm-project?view=revision&revision=225050
http://llvm.org/viewvc/llvm-project?view=revision&revision=224583

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

llvm-svn: 226915
2015-01-23 16:40:50 +00:00
Alexander Kornienko 6ee521c7eb Replace size() calls on containers with empty() calls where appropriate. NFC
http://reviews.llvm.org/D7090

Patch by Gábor Horváth!

llvm-svn: 226914
2015-01-23 15:36:10 +00:00
Evgeniy Stepanov d486e09d8e [sanitizer] Fix an edge case in MemoryRangeIsAvailable.
llvm-svn: 226913
2015-01-23 15:14:27 +00:00
Alexander Kornienko e94b7c24c8 [clang-tidy] Use shrink_to_fit instead of copy and swap trick
The shrink_to_fit() method is more readable and more effective than
the copy and swap trick to reduce the capacity of a shrinkable container.
Note that, the shrink_to_fit() method is only available in C++11 and up.

Example:

std::vector<int>(v).swap(v); will be replaced with v.shrink_to_fit();

http://reviews.llvm.org/D7087

Patch by Gábor Horváth!

llvm-svn: 226912
2015-01-23 15:10:37 +00:00
Alexander Kornienko a6354cae56 [clang-tidy] Small readability-container-size-empty cleanup
Utilized the hasEitherOperand instead of explicit anyOf.

http://reviews.llvm.org/D7142

Patch by Gábor Horváth!

llvm-svn: 226911
2015-01-23 14:43:06 +00:00
Viktor Kutuzov 8f6001bf59 [Sanitizers] Intercept statfs() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 226910
2015-01-23 14:39:23 +00:00
Deepak Panickal 9d02a6699d Fix handling of data-disassemble command arguments.
llvm-svn: 226909
2015-01-23 14:31:56 +00:00
Francisco Lopes da Silva 62a9a4fc9b Sema: code completion for variadic prototypes.
llvm-svn: 226908
2015-01-23 13:17:51 +00:00
Tamas Berghammer 8cd5f6f41b Cleanup do-gtest.py
* Add comments
* Refactor output manipulation (cleanup + minor bug fixes)
* Add better error reporting on test failure

llvm-svn: 226907
2015-01-23 11:02:28 +00:00
Tamas Berghammer 5a9919ff35 Fix indentation in ValueObject.cpp (test commit)
llvm-svn: 226906
2015-01-23 10:54:21 +00:00
Toma Tabacu c405c82214 [mips] Add new error message and improve testing for parsing the .module directive.
Summary:
We used to silently ignore any empty .module's and we used to give an error saying that we found
an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number).

We now give an error saying that we "expected .module option identifier" in both of those cases.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.


Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 226905
2015-01-23 10:40:19 +00:00
Jyoti Allur f1d7050a25 This patch fixes issue with lowering below mentioned pattern :-
_foo:
        smull	 r0, r1, r1, r0
	smull	 r2, r3, r3, r2
	adds	r0, r2, r0
	adc	r1, r3, r1
	bx	lr

to

_foo:
        smull	 r0, r1, r1, r0
	smlal	 r0, r1, r3, r2
	bx	lr

llvm-svn: 226904
2015-01-23 09:10:03 +00:00
Denis Protivensky 494acc597f Test commit.
llvm-svn: 226903
2015-01-23 08:56:47 +00:00
Craig Topper 0271d10d35 [x86] Change u8imm operands to always print as unsigned. This makes shuffle masks and the like make way more sense.
llvm-svn: 226902
2015-01-23 08:00:59 +00:00
Mehdi Amini 5059813c2d DAGCombine: always constant fold FMA when target disable FP exceptions
Summary: When trying to constant fold an FMA in the DAG, getNode()
fails to fold the FMA if an operand is not finite. In this case this
patch allows the constant folding if !TLI->hasFloatingPointExceptions()

Reviewers: resistor

Reviewed By: resistor

Subscribers: hfinkel, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 226901
2015-01-23 07:07:20 +00:00
Filipe Cabecinhas 2d4e4ff77e Add USES_TERMINAL to libcxx lit tests, if available
llvm-svn: 226900
2015-01-23 06:59:51 +00:00
Lang Hames ac92bfc505 [ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
This makes it possible to move between SmallVectors of different sizes.

Thanks to Dave Blaikie and Duncan Smith for patch feedback.

llvm-svn: 226899
2015-01-23 06:25:17 +00:00
Craig Topper f9c6598a9c Fix 80 column violation
llvm-svn: 226898
2015-01-23 06:18:35 +00:00
Craig Topper 46469aa4da [X86] Add IntrNoMem to the AVX512 conflict intrinsics.
llvm-svn: 226897
2015-01-23 06:11:45 +00:00
Rafael Espindola 6565e92f3f [pr22293] Don't crash during codegen of a recursive destructor.
In ItaniumCXXABI::EmitCXXDestructors we first emit the base destructor
and then try to emit the complete one as an alias.

If in the base ends up calling the complete destructor, the GD for the
complete will be in the list of deferred decl by the time we replace
it with an alias and delete the original GV.

llvm-svn: 226896
2015-01-23 05:26:38 +00:00
Rafael Espindola 5fa925ebf6 Add STB_GNU_UNIQUE to the ELF writer.
This lets llvm-mc assemble files produced by gcc.

llvm-svn: 226895
2015-01-23 04:44:35 +00:00
Rui Ueyama 0330697bfc Don't use iterator for the same reason as r226883.
llvm-svn: 226893
2015-01-23 01:44:51 +00:00
Jason Molenda f16dbb8b07 debug printfs that got left in. I blame greg.
llvm-svn: 226892
2015-01-23 01:34:19 +00:00
Kate Stone 6d3dabc622 Workaround for what looks like an OS X-specific libedit issue
Other platforms may benefit from something similar if issues arise.  The
libedit library doesn't explicitly initialize the curses termcap library,
which it gets away with until TERM is set to VT100 where it stumbles over
an implementation assumption that may not exist on other platforms.

<rdar://problem/17581929>

llvm-svn: 226891
2015-01-23 01:06:10 +00:00
NAKAMURA Takumi 7ca79f7f96 Prune an out-of-date \param since r226476. [-Wdocumentation]
llvm-svn: 226890
2015-01-23 01:05:12 +00:00
Jason Molenda 8122bb0e19 Two fixes for compact unwind decoding for frameless large-stack-size
i386/x86_64 functions.  The stack size was being multiplied by the
pointer size incorrectly.  The register permutation placeholders
(UNWIND_X86_REG_NONE) were decrementing the stack offset of the
saved registers when it should not have been.

<rdar://problem/19570035> 

llvm-svn: 226889
2015-01-23 01:02:32 +00:00
NAKAMURA Takumi 2bbc90cca5 Reformat.
llvm-svn: 226888
2015-01-23 01:02:07 +00:00
NAKAMURA Takumi f6eee4ad67 MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]
llvm-svn: 226887
2015-01-23 01:01:52 +00:00
Jim Ingham 0895e3406c Remove the "/" from the end of rpath paths. Having it there causes the
paths we get from dladdr to have "//" in it internally, and while that is
formally correct it is just asking for somebody to misparse it... 

llvm-svn: 226886
2015-01-23 00:39:13 +00:00
Richard Smith d2a7eda2b7 Fix reference to sysroot in this test (broken in r226875).
llvm-svn: 226885
2015-01-23 00:30:44 +00:00
Kuba Brecka 4edeced078 Fix the extra whitespace from r226878.
llvm-svn: 226884
2015-01-23 00:14:22 +00:00
Rui Ueyama 92fb392786 Make access to LinkingContext::getNode safe.
llvm-svn: 226883
2015-01-23 00:09:05 +00:00