Commit Graph

150283 Commits

Author SHA1 Message Date
Daniel Jasper 7b27a10b1e Improve indentation of assignments.
Before:
unsigned OriginalStartColumn = SourceMgr.getSpellingColumnNumber(
    Current.FormatTok.getStartOfNonWhitespace()) -
                               1;

After:
unsigned OriginalStartColumn =
    SourceMgr.getSpellingColumnNumber(
        Current.FormatTok.getStartOfNonWhitespace()) -
    1;

llvm-svn: 182733
2013-05-27 12:45:09 +00:00
Manuel Klimek 75081b5cf8 Address post-review comment from dblakie.
llvm-svn: 182732
2013-05-27 12:36:28 +00:00
Daniel Jasper 32a796bc5b Fix hacky way of preventing a certain type of line break.
In general, we like to avoid line breaks like:

  ...
  SomeParameter, OtherParameter).DoSomething(
  ...

as they tend to make code really hard to read (how would you even indent the
next line?). Previously we have implemented this in a hacky way, which has now
shown to lead to problems. This fixes a few weird looking formattings, such as:

Before:
aaaaa(
    aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
        .aaaaa(aaaaa),
    aaaaaaaaaaaaaaaaaaaaa);
After:
aaaaa(aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
            aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).aaaaa(aaaaa),
      aaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 182731
2013-05-27 11:50:16 +00:00
Sergey Matveev 39e8a6d87e [lsan] Begin converting LSan tests to output tests.
In this CL all old tests are removed and one LIT test is added.

llvm-svn: 182730
2013-05-27 11:41:46 +00:00
Sergey Matveev 1814e9eae3 Add -fsanitize=leak to driver options.
If -fsanitize=leak is specified, link the program with the
LeakSanitizer runtime. Ignore this option when -fsanitize=address is specified,
because AddressSanitizer has this functionality built in.

llvm-svn: 182729
2013-05-27 11:17:01 +00:00
Sergey Matveev 9cda3df8bd [sanitizer] Move FindThreadByOSIdLocked from lsan to sanitizer_common.
llvm-svn: 182728
2013-05-27 10:35:51 +00:00
Alexey Samsonov 9c2bcf8c15 Improve support for compiler-rt tests in CMake build.
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!

llvm-svn: 182726
2013-05-27 09:35:24 +00:00
Hal Finkel 8ebfe6c263 PPC: Add a isConsecutiveLS utility function
isConsecutiveLS is a slightly more general form of
SelectionDAG::isConsecutiveLoad. Aside from also handling stores, it also does
not assume equality of the chain operands is necessary. In the case of the PPC
backend, this chain condition is checked in a more general way by the
surrounding code.

Mostly, this part of the refactoring in preparation for supporting optimized
unaligned stores.

llvm-svn: 182723
2013-05-27 02:06:39 +00:00
NAKAMURA Takumi d5c2e60b19 llvm-objdump.cpp: Appease MSC16 x64. utostr(n++) causes internal compiler error.
llvm-svn: 182722
2013-05-27 00:02:48 +00:00
Rui Ueyama 4cf437a1e9 [PECOFF] Skip section names in the symbol table because they are not atoms.
llvm-svn: 182721
2013-05-26 23:09:01 +00:00
Richard Smith b7df8a7014 Tests and status for DR51-99.
llvm-svn: 182720
2013-05-26 22:03:53 +00:00
Hal Finkel 7d8a691b5d Prefer to duplicate PPC Altivec loads when expanding unaligned loads
When expanding unaligned Altivec loads, we use the decremented offset trick to
prevent page faults. Unfortunately, if we have a sequence of consecutive
unaligned loads, this leads to suboptimal code generation because the 'extra'
load from the first unaligned load can be combined with the base load from the
second (but only if the decremented offset trick is not used for the first).
Search up and down the chain, through loads and token factors, looking for
consecutive loads, and if one is found, don't use the offset reduction trick.
These duplicate loads are later combined to yield the desired sequence (in the
future, we might want a more-powerful chain search, but that will require some
changes to allow the combiner routines to access the AA object).

This should complete the initial implementation of the optimized unaligned
Altivec load expansion. There is some refactoring that should be done, but
that will happen when the unaligned store expansion is added.

llvm-svn: 182719
2013-05-26 18:08:30 +00:00
Kai Nacke 4157b371f6 Add LDC compiler to list of external OS projects using LLVM 3.3
llvm-svn: 182718
2013-05-26 17:37:43 +00:00
Andrew Trick c66d26adf0 Fix PR16143: Insert DEBUG_VALUE before terminator.
llvm-svn: 182717
2013-05-26 08:58:50 +00:00
Nico Weber ced7d41b51 Formatter/ObjC: In dictionary literals, break after ':', not before it.
Before:
  @{ NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
     : regularFont, };

Now:
  @{ NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :
     regularFont, };

':'s in dictionary literals (and the corresponding {}s) are now marked as
TT_ObjCDictLiteral too, which makes further improvements to dict literal
layout possible.

llvm-svn: 182716
2013-05-26 05:39:26 +00:00
Galina Kistanova a035f3b2ce Fixed bug when tests in executable partially used absolute paths.
llvm-svn: 182715
2013-05-26 03:58:41 +00:00
Rui Ueyama 37645e5953 Remove unreachable statement.
llvm-svn: 182714
2013-05-26 01:25:39 +00:00
Chris Lattner 4093afda9b Disable the StringMapEntry copy constructor, to make sure we
reject things like: "for (auto Entry : SomeStringMap)".  Previously
this would copy the value but not the tail allocated string data
(the key).

llvm-svn: 182713
2013-05-25 22:28:22 +00:00
Cameron Zwarich 80cbcd2d11 Add support for DWARF line number table entries for values in the instruction
stream.

llvm-svn: 182712
2013-05-25 21:56:53 +00:00
Rafael Espindola 50df3a02be Fix linkage computation for derived types in inline functions.
John noticed that the fix for pr15930 (r181981) didn't handle indirect
uses of local types. For example, a pointer to local struct, or a
function that returns it.

One way to implement this would be to recursively look for local
types. This would look a lot like the linkage computation itself for
types.

To avoid code duplication and utilize the existing linkage cache, this
patch just makes the computation of "type with no linkage but
externally visible because it is from an inline function"  part of the
linkage computation itself.

llvm-svn: 182711
2013-05-25 17:16:20 +00:00
Eric Christopher 5bed56d2f5 Add some comments to the stringify function.
llvm-svn: 182710
2013-05-25 05:13:17 +00:00
Rui Ueyama f52a930cfb Fix indentation.
llvm-svn: 182709
2013-05-25 04:59:32 +00:00
Hal Finkel bc2ee4c4e6 PPC: Combine duplicate (offset) lvsl Altivec intrinsics
The lvsl permutation control instruction is a function only of the alignment of
the pointer operand (relative to the 16-byte natural alignment of Altivec
vectors). As a result, multiple lvsl intrinsics where the operands differ by a
multiple of 16 can be combined.

llvm-svn: 182708
2013-05-25 04:05:05 +00:00
Andrew Trick 8972aba193 Track IR ordering of SelectionDAG nodes 4/4.
Unit test cases for -pre-RA-sched=source.

llvm-svn: 182706
2013-05-25 03:26:51 +00:00
Andrew Trick e2431c64bc Track IR ordering of SelectionDAG nodes 3/4.
Remove the old IR ordering mechanism and switch to new one.  Fix unit
test failures.

llvm-svn: 182704
2013-05-25 03:08:10 +00:00
Andrew Trick ef9de2a739 Track IR ordering of SelectionDAG nodes 2/4.
Change SelectionDAG::getXXXNode() interfaces as well as call sites of
these functions to pass in SDLoc instead of DebugLoc.

llvm-svn: 182703
2013-05-25 02:42:55 +00:00
Duncan Sands f3dcb68d76 Fix comment type pointed out by Kim Gräsman.
llvm-svn: 182702
2013-05-25 02:22:10 +00:00
Andrew Trick 175143bf88 Track IR ordering of SelectionDAG nodes 1/4.
Use a field in the SelectionDAGNode object to track its IR ordering.
This adds fields and utility classes without changing existing
interfaces or functionality.

llvm-svn: 182701
2013-05-25 02:20:36 +00:00
Andrew Trick fc1c5fe927 Fix RecyclingAllocator::PrintStats to print the underlying allocator's stats.
llvm-svn: 182700
2013-05-25 01:47:42 +00:00
Argyrios Kyrtzidis 977026c5f5 [Preprocessor] Prevent expansion of y in x ## y when x is empty
When x is empty, x ## is suppressed, and when y gets expanded, the fact that it follows ## is not
available in the macro expansion result. The macro definition can be checked instead, the ## will
be available there regardless of what x expands to.

Fixes http://llvm.org/PR12767

Patch by Harald van Dijk!

llvm-svn: 182699
2013-05-25 01:35:18 +00:00
Argyrios Kyrtzidis d6111d3c6d Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID (V2).
llvm-svn: 182698
2013-05-25 01:03:03 +00:00
Michael J. Spencer e24b872188 Use new version of countLeadingZeros.
llvm-svn: 182697
2013-05-25 00:25:21 +00:00
Richard Smith 82f3fc06d3 Increase the portability of this script a bit: use /usr/bin/env to find bash,
rather than assuming it lives in the path. Patch by Eitan Adler!

llvm-svn: 182696
2013-05-24 23:54:21 +00:00
Argyrios Kyrtzidis 5fd822c283 Make isBeforeInTranslationUnit consistent in the face of failures to get a valid FileID.
Suggested by Jordan.

llvm-svn: 182695
2013-05-24 23:47:43 +00:00
Nico Weber 9eea764a1f Warn on va_start() when called with a reference parameter.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf 18.7p3
explicitly calls this (and some other things) out as undefined.

Also move 2 other existing warnings behind the new -Wvarargs flag.

llvm-svn: 182694
2013-05-24 23:31:57 +00:00
Eric Christopher ba63e07f3a Add to testsuite.
llvm-svn: 182693
2013-05-24 23:20:16 +00:00
Eric Christopher fcee6f0abc ArrayRef-ize MD5 and clean up a few variable names.
Add a stringize method to make dumping a bit easier, and add a testcase
exercising a few different paths.

llvm-svn: 182692
2013-05-24 23:08:17 +00:00
Hal Finkel cf2e908014 PPC: Initial support for permutation-based unaligned Altivec loads
Altivec only directly supports aligned loads, but the loads have a strange
property: If given an unaligned address, they truncate the address to the next
lower aligned address, and load from there.  This property, along with an extra
load and some special-purpose permutation-control instructions that generate
the appropriate permutations from the original unaligned address, allow
efficient lowering of aligned loads. This code uses the trick explained in the
Apple Velocity Engine optimization overview document to prevent the needed
extra load from possibly causing a page fault if the original address happens
to be aligned.

As noted in the FIXMEs, there are several additional optimizations that can be
performed to reduce the cost of these loads even more. These will be
implemented in future commits.

llvm-svn: 182691
2013-05-24 23:00:14 +00:00
Michael J. Spencer a8db3f6fa7 [Support] Remove Count{Leading,Trailing}Zeros_{32,64}.
llvm-svn: 182690
2013-05-24 22:58:37 +00:00
Jim Grosbach c161680c47 Tidy up. Whitespace.
llvm-svn: 182689
2013-05-24 22:53:06 +00:00
Quentin Colombet f482805c28 Follow up of the introduction of MCSymbolizer.
- Ressurect old MCDisassemble API to soften transition.
- Extend MCTargetDesc to set target specific symbolizer.

llvm-svn: 182688
2013-05-24 22:51:52 +00:00
Filipe Cabecinhas 251f496578 lldbPluginOSDarwinKernel doesn't exist.
llvm-svn: 182687
2013-05-24 22:46:06 +00:00
Michael Gottesman 410bd52561 clang formatted APFloat.h
llvm-svn: 182686
2013-05-24 22:40:37 +00:00
Michael Gottesman 356ead3f36 clang-formatted APInt.h
llvm-svn: 182685
2013-05-24 22:38:49 +00:00
Benjamin Kramer 2ce482e628 MathExtras: Return the result of find(First|Last)Set in the input type.
Otherwise ZB_Max returns a wrong result when sizeof(T) > sizeof(size_t).

llvm-svn: 182684
2013-05-24 22:25:20 +00:00
Filipe Cabecinhas f104a830d4 Update countTrailingZeros function usage to match llvm's r182667.
llvm-svn: 182683
2013-05-24 22:24:17 +00:00
Argyrios Kyrtzidis 2702101a07 [libclang] Add logging for clang_createTranslationUnit.
llvm-svn: 182682
2013-05-24 22:24:07 +00:00
Argyrios Kyrtzidis 5dca864366 Add some safety checks in a couple of SourceManager functions.
This is to address crash in rdar://13932308

llvm-svn: 182681
2013-05-24 22:24:04 +00:00
Michael J. Spencer df1ecbd734 Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
llvm-svn: 182680
2013-05-24 22:23:49 +00:00
Michael J. Spencer 795ecd2c43 [Support][MathExtras] Fix literal type issues.
llvm-svn: 182679
2013-05-24 22:19:05 +00:00