Commit Graph

149540 Commits

Author SHA1 Message Date
Fariborz Jahanian 478536b1c1 improve of note message and minor refactoring of my last
patch (r181847).

llvm-svn: 181896
2013-05-15 15:27:35 +00:00
Ulrich Weigand 0684076858 Remove MCELFObjectTargetWriter::adjustFixupOffset hack
Now that PowerPC no longer uses adjustFixupOffset, and no other
back-end (ever?) did, we can remove the infrastructure itself
(incidentally addressing a FIXME to that effect).

llvm-svn: 181895
2013-05-15 15:07:42 +00:00
Ulrich Weigand 2fb140ef31 [PowerPC] Remove need for adjustFixupOffst hack
Now that applyFixup understands differently-sized fixups, we can define
fixup_ppc_lo16/fixup_ppc_lo16_ds/fixup_ppc_ha16 to properly be 2-byte
fixups, applied at an offset of 2 relative to the start of the 
instruction text.

This has the benefit that if we actually need to generate a real
relocation record, its address will come out correctly automatically,
without having to fiddle with the offset in adjustFixupOffset.

Tested on both 64-bit and 32-bit PowerPC, using external and
integrated assembler.

llvm-svn: 181894
2013-05-15 15:07:06 +00:00
Richard Sandiford ffd144174d [SystemZ] Make use of SUBTRACT HALFWORD
Thanks to Ulrich Weigand for noticing that this instruction was missing.

llvm-svn: 181893
2013-05-15 15:05:29 +00:00
Ulrich Weigand e7050ad0a1 [PowerPC] Add test case for r181891
llvm-svn: 181892
2013-05-15 15:02:12 +00:00
Ulrich Weigand 56f5b28d2e [PowerPC] Correctly handle fixups of other than 4 byte size
The PPCAsmBackend::applyFixup routine handles the case where a
fixup can be resolved within the same object file.  However,
this routine is currently hard-coded to assume the size of
any fixup is always exactly 4 bytes.

This is sort-of correct for fixups on instruction text; even
though it only works because several of what really would be
2-byte fixups are presented as 4-byte fixups instead (requiring
another hack in PPCELFObjectWriter::adjustFixupOffset to clean
it up).

However, this assumption breaks down completely for fixups
on data, which legitimately can be of any size (1, 2, 4, or 8).

This patch makes applyFixup aware of fixups of varying sizes,
introducing a new helper routine getFixupKindNumBytes (along
the lines of what the ARM back end does).  Note that in order
to handle fixups of size 8, we also need to fix the return type
of adjustFixupValue to uint64_t to avoid truncation.

Tested on both 64-bit and 32-bit PowerPC, using external and
integrated assembler.

llvm-svn: 181891
2013-05-15 15:01:46 +00:00
Kostya Serebryany 2b824f3575 [asan] disable BuiltinLongJmpTest on PowerPC
llvm-svn: 181890
2013-05-15 15:01:14 +00:00
Daniel Jasper 9dc096c8e6 Fix test breakage caused by change in clang-format.
llvm-svn: 181888
2013-05-15 14:27:33 +00:00
Daniel Jasper abca58c9ee Don't put short namespace on a single line.
Before:
namespace abc { class SomeClass; }
namespace def { void someFunction() {} }

After:
namespace abc {
class Def;
}
namespace def {
void someFunction() {}
}

Rationale:
a) Having anything other than forward declaration on the same line
   as a namespace looks confusing.
b) Formatting namespace-forward-declaration-combinations different
   from other stuff is inconsistent.
c) Wasting vertical space close to such forward declarations really
   does not affect readability.

llvm-svn: 181887
2013-05-15 14:09:55 +00:00
Arnaud A. de Grandmaison ca08b076f3 Add Jade to the list of external projects using LLVM in the release notes.
Patch by: Antoine Lorence <Antoine.Lorence@insa-rennes.fr>

llvm-svn: 181886
2013-05-15 14:05:01 +00:00
Sylvestre Ledru 99446cfb1a Include also sys/wait.h in the case of a FreeBSD kernel with a glibc (Debian KFreeBSD for example)
llvm-svn: 181885
2013-05-15 13:56:44 +00:00
Daniel Jasper 6f05e59f23 Improve recognition of template definitions.
In the long run, this will probably be better fixed by a proper
expression parser..

Before:
  template <typename F>
  Matcher(const Matcher<F> & Other,
          typename enable_if_c < is_base_of<F, T>::value &&
              !is_same<F, T>::value > ::type * = 0)
      : Implementation(new ImplicitCastMatcher<F>(Other)) {}

After:
  template <typename F>
  Matcher(const Matcher<F> & Other,
          typename enable_if_c<is_base_of<F, T>::value &&
                               !is_same<F, T>::value>::type * = 0)
      : Implementation(new ImplicitCastMatcher<F>(Other)) {}

llvm-svn: 181884
2013-05-15 13:46:48 +00:00
Richard Sandiford 619859f42e [SystemZ] Add more future work items to the README
Based on an analysis by Ulrich Weigand.

llvm-svn: 181882
2013-05-15 12:53:31 +00:00
Kostya Serebryany 2b42716213 [asan] fix powerpc build and one test; fix lint
llvm-svn: 181881
2013-05-15 12:36:29 +00:00
Hans Wennborg 8f62c5ca22 Better diagnostics for string initialization.
This commit improves Clang's diagnostics for string initialization.
Where it would previously say:

  /tmp/a.c:3:9: error: array initializer must be an initializer list
  wchar_t s[] = "Hi";
          ^
  /tmp/a.c:4:6: error: array initializer must be an initializer list or string literal
  char t[] = L"Hi";
       ^

It will now say

  /tmp/a.c:3:9: error: initializing wide char array with non-wide string literal
  wchar_t s[] = "Hi";
          ^
  /tmp/a.c:4:6: error: initializing char array with wide string literal
  char t[] = L"Hi";
       ^

As a bonus, it also fixes the fact that Clang would previously reject
this valid C11 code:

  char16_t s[] = u"hi";
  char32_t t[] = U"hi";

because it would only recognize the built-in types for char16_t and
char32_t, which do not exist in C.

llvm-svn: 181880
2013-05-15 11:03:04 +00:00
Richard Sandiford 78a8ef87ca [SystemZ] Consolidate disassembler tests for valid input into 2 big tests
llvm-svn: 181879
2013-05-15 11:00:31 +00:00
Richard Sandiford 364d821ebc [SystemZ] Consolidate assembler tests into 4 big tests
llvm-svn: 181878
2013-05-15 09:58:19 +00:00
Daniel Jasper c6fbc2192c Break function declarations after multi-line return types.
Before:
template <typename A>
SomeLoooooooooooooooooooooongType<
    typename some_namespace::SomeOtherType<A>::Type> Function() {}

After:
template <typename A>
SomeLoooooooooooooooooooooongType<
    typename some_namespace::SomeOtherType<A>::Type>
Function() {}

llvm-svn: 181877
2013-05-15 09:35:08 +00:00
Sylvestre Ledru e2af9ea00f Only include under arm and an Apple system. Otherwise, it will fail under a GNU/Linux under ARM
llvm-svn: 181876
2013-05-15 09:32:35 +00:00
Timur Iskhodzhanov 0588513e79 Fix build on Windows
llvm-svn: 181873
2013-05-15 09:00:30 +00:00
Daniel Jasper 00aca707d5 Don't merge one-line functions in weird brace styles.
llvm-svn: 181872
2013-05-15 08:30:06 +00:00
Daniel Jasper d2ae41a7c6 Remove diagnostics from clang-format.
We only ever implemented one and that one is not actually all that
helpful (e.g. gets incorrectly triggered by macros).

llvm-svn: 181871
2013-05-15 08:14:19 +00:00
Daniel Jasper 5dad58e9df Improve formatting of function types.
The function type detection in r181438 and r181764 detected function
types too eagerly. This led to inconsistent formatting of inline
assembly and (together with r181687) to an incorrect formatting of calls
in macros.

Before: #define DEREF_AND_CALL_F(parameter) f (*parameter)
After:  #define DEREF_AND_CALL_F(parameter) f(*parameter)
llvm-svn: 181870
2013-05-15 07:51:51 +00:00
David Blaikie 7d17010db5 Use only explicit bool conversion operator
The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

DiagnosticBuilder kept its implicit conversion operator owing to the
prevalent use of it in return statements.

One bug was found in ExprConstant.cpp involving a comparison of two
PointerUnions (PointerUnion did not previously have an operator==, so
instead both operands were converted to bool & then compared). A test
is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix
(adding operator== to PointerUnion in LLVM).

llvm-svn: 181869
2013-05-15 07:37:26 +00:00
David Blaikie 041f1aa3e2 Use only explicit bool conversion operators
BitVector/SmallBitVector::reference::operator bool remain implicit since
they model more exactly a bool, rather than something else that can be
boolean tested.

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

One behavior change (YAMLParser) was made, though no test case is
included as I'm not sure how to reach that code path. Essentially any
comparison of llvm::yaml::document_iterators would be invalid if neither
iterator was at the end.

This helped uncover a couple of bugs in Clang - test cases provided for
those in a separate commit along with similar changes to `operator bool`
instances in Clang.

llvm-svn: 181868
2013-05-15 07:36:59 +00:00
Jakob Stoklund Olesen 248520bdea Use correct types for SPARC v9.
It's an LP64 platform.

llvm-svn: 181867
2013-05-15 03:22:33 +00:00
Enrico Granata c8fcaab6ce <rdar://problem/13883385>
Python breakpoint actions can return False to say that they don't want to stop at the breakpoint to which they are associated
Almost all of the work to support this notion of a breakpoint callback was in place, but two small moving parts were missing:
a) the SWIG wrapper was not checking the return value of the script
b) when passing a Python function by name, the call statement was dropping the return value of the function
This checkin addresses both concerns and makes this work
Care has been taken that you only keep running when an actual value of False has been returned, and that any other value (None included) means Stop!

llvm-svn: 181866
2013-05-15 02:46:08 +00:00
Jim Grosbach d10f1c04aa ARM: Improve codegen for vget_low_* and vget_high_ intrinsics.
These intrinsics use the __builtin_shuffle() function to extract the
low and high half, respectively, of a 128-bit NEON vector. Currently,
they're defined to use bitcasts to simplify the emitter, so we get code
like:
uint16x4_t vget_low_u32(uint16x8_t __a) {
  return (uint32x2_t) __builtin_shufflevector((int64x2_t) __a,
                                              (int64x2_t) __a,
                                              0);
}

While this works, it results in those bitcasts going all the way through
to the IR, resulting in code like:
  %1 = bitcast <8 x i16> %in to <2 x i64>
  %2 = shufflevector <2 x i64> %1, <2 x i64> undef, <1 x i32>
  %zeroinitializer
  %3 = bitcast <1 x i64> %2 to <4 x i16>

We can instead easily perform the operation directly on the input vector
like:

uint16x4_t vget_low_u16(uint16x8_t __a) {
  return __builtin_shufflevector(__a, __a, 0, 1, 2, 3);
}

Not only is that much easier to read on its own, it also results in
cleaner IR like:

  %1 = shufflevector <8 x i16> %in, <8 x i16> undef,
                     <4 x i32> <i32 0, i32 1, i32 2, i32 3>

This is both easier to read and easier for the back end to reason
about effectively since the operation is obfuscating the source with
bitcasts.

rdar://13894163

llvm-svn: 181865
2013-05-15 02:40:04 +00:00
NAKAMURA Takumi 2006ba945f ELFRelocationEntry::operator<(): Try to stabilize the order. r_offset was insufficient to sort Relocs.
It should fix llvm/test/CodeGen/ARM/ehabi-mc-compact-pr*.ll on some hosts.

  RELOCATION RECORDS FOR [.ARM.exidx]:
  0 R_ARM_PREL31 .text
  0 R_ARM_NONE __aeabi_unwind_cpp_pr0

FIXME: I am not sure of the directions of extra comparators, in Type and Index.
For now, they are different from the direction in r_offset.

llvm-svn: 181864
2013-05-15 02:16:23 +00:00
Jim Ingham 362e39a0a7 Change the mechanism around SBValue::GetSP() so that it always requires the target API lock AND the
process StopLocker (if there is a process) before it will hand out SBValues.  We were doing this in 
an ad hoc fashion previously, and then playing whack-a-mole whenever we found a place where we should
have been doing this but weren't.  Really, it doesn't make sense to be poking at SBValues when the target
is running, the dynamic and synthetic values can't really be computed, and the underlying memory may be
incoherent.

<rdar://problem/13819378> Sometimes when stepping fast, my inferior is killed by debugserver

llvm-svn: 181863
2013-05-15 02:16:21 +00:00
Arnold Schwaighofer 09cee97270 LoopVectorize: Fix comments
No functionality change.

llvm-svn: 181862
2013-05-15 02:02:45 +00:00
Jordan Rose 4fec903717 Use 'env' in tests that set environment variables.
Patch by David Fang!

llvm-svn: 181861
2013-05-15 01:45:37 +00:00
Arnold Schwaighofer 2d920477a4 LoopVectorize: Hoist conditional loads if possible
InstCombine can be uncooperative to vectorization and sink loads into
conditional blocks. This prevents vectorization.

Undo this optimization if there are unconditional memory accesses to the same
addresses in the loop.

radar://13815763

llvm-svn: 181860
2013-05-15 01:44:30 +00:00
Jim Ingham b78d73fe76 Don’t pop the process input reader for a “stop” event if ShouldBroadcastEvent has restarted the process.
llvm-svn: 181859
2013-05-15 01:21:48 +00:00
Jim Ingham c0dfddb302 Didn't mean to check in this change...
llvm-svn: 181858
2013-05-15 01:12:43 +00:00
Jim Ingham bd4a5eccd6 Need to add the LLDB.framework directory to the rpath for the driver programs or they won't run.
llvm-svn: 181857
2013-05-15 01:11:30 +00:00
Greg Clayton 9e57dcd359 <rdar://problem/13892319>
The command "po" by itself yields odd errors. I fixed the alias.

llvm-svn: 181856
2013-05-15 01:03:08 +00:00
Enrico Granata a3962a77cd <rdar://problem/13821289>
Changes to the libc++ std::string data formatter

llvm-svn: 181855
2013-05-15 00:47:46 +00:00
Richard Trieu 1c6f15d755 Move a test that requires 64-bit mode to a separate test with a triple in
the run line.

llvm-svn: 181854
2013-05-15 00:44:06 +00:00
Aaron Ballman e475dcddc9 Unbreaking the MSVC build by adding an include. It broke with r181832.
llvm-svn: 181853
2013-05-14 23:52:21 +00:00
Rui Ueyama 5f689e24de [lld] Fix compiler warning that shift count is too big on P64.
llvm-svn: 181852
2013-05-14 23:51:50 +00:00
Jakob Stoklund Olesen 0925b24d9a Speed up Value::isUsedInBasicBlock() for long use lists.
This is expanding Ben's original heuristic for short basic blocks to
also work for longer basic blocks and huge use lists.

Scan the basic block and the use list in parallel, terminating the
search when the shorter list ends. In almost all cases, either the basic
block or the use list is short, and the function returns quickly.

In one crazy test case with very long use chains, CodeGenPrepare runs
400x faster. When compiling ARMDisassembler.cpp it is 5x faster.

<rdar://problem/13840497>

llvm-svn: 181851
2013-05-14 23:45:56 +00:00
Greg Clayton f21feadcd9 A first pass at auto completion for variables and their children. This is currently hooked up for "frame variable" only. With a little work we can also enable it for the "expression" command and also for other things.
llvm-svn: 181850
2013-05-14 23:43:18 +00:00
Richard Trieu c750907218 Add static_cast to assertion to silence sign/unsigned comparison warning.
llvm-svn: 181849
2013-05-14 23:41:50 +00:00
Sylvestre Ledru 149e281aa8 Fix two typo
llvm-svn: 181848
2013-05-14 23:36:24 +00:00
Fariborz Jahanian 773df4a11f Objective-C [diagnostics] [QOI], when method is not
found for a receiver, note where receiver class
is declaraed (this is most common when receiver is a forward
class). // rdar://3258331

llvm-svn: 181847
2013-05-14 23:24:17 +00:00
Douglas Gregor 230826cc42 Don't mark a type specifier as "owned" if there is no declaration to own.
This simplifies error recovery elsewhere, eliminating the crash in
<rdar://problem/13853540>.

llvm-svn: 181846
2013-05-14 23:22:32 +00:00
Greg Clayton 609a433159 Unbreak the linux buildbot tests. This still fails for the clang that is being used on linux.
llvm-svn: 181845
2013-05-14 23:21:47 +00:00
NAKAMURA Takumi b734a9dbc6 ExceptionDemo: Corresponding to r181820, SectionMemoryManager should belong to RTDyldMemoryManager.
llvm-svn: 181844
2013-05-14 23:05:00 +00:00
Ahmed Bougacha 9dab0cc6c3 Object: Fix Mach-O relocation printing.
There were two problems that made llvm-objdump -r crash:
- for non-scattered relocations, the symbol/section index is actually in the
  (aptly named) symbolnum field.
- sections are 1-indexed.

llvm-svn: 181843
2013-05-14 22:41:29 +00:00