Commit Graph

150283 Commits

Author SHA1 Message Date
Daniel Malea fddddbeab0 Re-implement DebugIR in a way that does not subclass AssemblyWriter:
- move AsmWriter.h from public headers into lib
- marked all AssemblyWriter functions as non-virtual; no need to override them
- DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper
- exposed flags to control hiding of a) debug metadata b) debug intrinsic calls

C/R: Paul Redmond

llvm-svn: 182617
2013-05-23 22:34:33 +00:00
Ulrich Weigand 41789de165 [PowerPC] Clean up generation of ha16() / lo16() markers
When targeting the Darwin assembler, we need to generate markers ha16() and
lo16() to designate the high and low parts of a (symbolic) immediate.  This
is necessary not just for plain symbols, but also for certain symbolic
expression, typically along the lines of ha16(A - B).  The latter doesn't
work when simply using VariantKind flags on the symbol reference.
This is why the current back-end uses hacks (explicitly called out as such
via multiple FIXMEs) in the symbolLo/symbolHi print methods.

This patch uses target-defined MCExpr codes to represent the Darwin
ha16/lo16 constructs, following along the lines of the equivalent solution
used by the ARM back end to handle their :upper16: / :lower16: markers.
This allows us to get rid of special handling both in the symbolLo/symbolHi
print method and in the common code MCExpr::print routine.  Instead, the
ha16 / lo16 markers are printed simply in a custom print routine for the
target MCExpr types.  (As a result, the symbolLo/symbolHi print methods
can now replaced by a single printS16ImmOperand routine that also handles
symbolic operands.)

The patch also provides a EvaluateAsRelocatableImpl routine to handle
ha16/lo16 constructs.  This is not actually used at the moment by any
in-tree code, but is provided as it makes merging into David Fang's
out-of-tree Mach-O object writer simpler.

Since there is no longer any need to treat VK_PPC_GAS_HA16 and
VK_PPC_DARWIN_HA16 differently, they are merged into a single
VK_PPC_ADDR16_HA (and likewise for the _LO16 types).

llvm-svn: 182616
2013-05-23 22:26:41 +00:00
Richard Smith be93c00ab3 Fix assert on temporary std::initializer_list.
llvm-svn: 182615
2013-05-23 21:54:14 +00:00
Daniel Jasper f632f69284 More tests and a fix for braced init lists.
Before: f(new vector<int> { 1, 2, 3 });
After:  f(new vector<int>{ 1, 2, 3 });
llvm-svn: 182614
2013-05-23 21:35:49 +00:00
Daniel Malea 96a6f90d84 Improve vim-lldb expression commands for objective-c and implement evaluate-under-cursor:
1. Added new :Lpo command
2. :Lpo and :Lprint can be invoked without parameters. In that case
cursor word will be used
3. Added :LpO command in that case instead of <cword> will be used
stripped <cWORD>. This command is useful for printing objective-c
properties (for ex.: self.tableView). 

Patch by Arthur Evstifeev!!

llvm-svn: 182613
2013-05-23 21:34:26 +00:00
Ted Kremenek abfcca30d8 [analyzer; alternate edges] Add a new test case file to regression test the new arrows algorithm.
This essentially combines the tests in plist-output.m and plist-alternate-output.m.

llvm-svn: 182612
2013-05-23 21:33:12 +00:00
Bill Wendling f44b2a2e2d The command line options need to be processed before we create the TargetMachine.
Move the processing of the command line options to right before we create the
TargetMachine instead of after.
<rdar://problem/13468287>

llvm-svn: 182611
2013-05-23 21:21:50 +00:00
Michael Sartain c836ae7d36 ObjectFileELF::GetModuleSpecifications on Linux should work now.
Which means "platform process list" should work and list the architecture.
We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next).

llvm-svn: 182610
2013-05-23 20:57:03 +00:00
Michael Sartain c3ce7f2740 Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors command line options.
settings set use-color [false|true]
settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} "
also "--no-use-colors" on the command prompt

llvm-svn: 182609
2013-05-23 20:47:45 +00:00
Manuel Klimek 75ef31f607 Fix aligning of comments.
Previously we started sequences to align for single line comments when
the previous line had a trailing comment, but the sequence was broken
for other reasons.

Now we re-format:
// a
 // b
f(); // c
to:
// a
// b
f(); // c

llvm-svn: 182608
2013-05-23 20:46:07 +00:00
Greg Clayton cc24775b42 <rdar://problem/13966084>
Make sure to not call "regexec" from <regex.h> with a NULL C string, otherwise we can crash.

llvm-svn: 182607
2013-05-23 20:27:15 +00:00
Daniel Malea f18cff4767 Adding .arcconfig file to LLDB to allow using Phabricator for reviews
llvm-svn: 182606
2013-05-23 20:21:28 +00:00
Manuel Klimek b27375fcd7 Fix aligning of comments that are at the start of the line.
Now correctly leaves:
f(); // comment
// comment
g(); // comment
... alone if the middle comment was aligned with g() before formatting.

llvm-svn: 182605
2013-05-23 19:54:43 +00:00
Tim Northover bfe2e5f778 Add caveat to __builtin_readcyclecounter documentation.
The ARM cycle-counter can be restricted by the operating system; it's
worth warning potential users of this issue.

llvm-svn: 182604
2013-05-23 19:14:12 +00:00
Tim Northover bc93308489 ARM: implement @llvm.readcyclecounter intrinsic
This implements the @llvm.readcyclecounter intrinsic as the specific
MRC instruction specified in the ARM manuals for CPUs with the Power
Management extensions.

Older CPUs had slightly different methods which may also have to be
implemented eventually, but this should cover all v7 cases.

rdar://problem/13939186

llvm-svn: 182603
2013-05-23 19:11:20 +00:00
Tim Northover cedd48183f ARM: Add Performance Monitor Extensions feature
Performance monitors, including a basic cycle counter, are an official
extension in the ARMv7 specification. This adds support for enabling and
disabling them, orthogonally from CPU selection.

rdar://problem/13939186

llvm-svn: 182602
2013-05-23 19:11:14 +00:00
Daniel Jasper d443239493 Increase test coverage for braced init lists.
Also fix a minor bug for constructor initializers with braced init lists.

llvm-svn: 182601
2013-05-23 18:29:16 +00:00
Tom Stellard 1b086cbcb8 R600: Fix R600ControlFlowFinalizer not considering VTX_READ 128 bit dst reg
Patch by: Vincent Lejeune

https://bugs.freedesktop.org/show_bug.cgi?id=64877

NOTE: This is a candidate for the 3.3 branch.
llvm-svn: 182600
2013-05-23 18:26:42 +00:00
Bill Wendling b7e7a38929 Don't override 'mode' and cleanup some variable names.
llvm-svn: 182599
2013-05-23 18:18:31 +00:00
Bill Wendling a600457cde Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing this out.
llvm-svn: 182598
2013-05-23 18:08:22 +00:00
Daniel Jasper 5bd0b9e53b Improve formatting of braced lists.
Before: vector<int> v{ -1};
After:  vector<int> v{-1};
llvm-svn: 182597
2013-05-23 18:05:18 +00:00
Daniel Jasper e7a500160e clang-format integration for git.
Put this somewhere on your path and use:

git clang-format

Awesome work by Mark Lodato. Many thanks!

llvm-svn: 182596
2013-05-23 17:53:42 +00:00
Rui Ueyama 25c208c020 [lld][LayoutPass] Add comment on _followOn{Nexts,Roots}.
Reviewers: shankarke

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D847

llvm-svn: 182595
2013-05-23 17:43:39 +00:00
Benjamin Kramer d78bb468bd Move passes from namespace llvm into anonymous namespaces. Sort includes while there.
llvm-svn: 182594
2013-05-23 17:10:37 +00:00
Jakob Stoklund Olesen 43711c51ec Fix PR16110: Handle DBG_VALUE in ConnectedVNInfoEqClasses::Distribute().
Now that the LiveDebugVariables pass is running *after* register
coalescing, the ConnectedVNInfoEqClasses class needs to deal with
DBG_VALUE instructions.

This only comes up when rematerialization during coalescing causes the
remaining live range of a virtual register to separate into two
connected components.

llvm-svn: 182592
2013-05-23 17:02:23 +00:00
Benjamin Kramer ad5c24f161 More symbols that should be static.
llvm-svn: 182590
2013-05-23 16:09:15 +00:00
Benjamin Kramer bf8d2540a3 Make helper functions static.
llvm-svn: 182589
2013-05-23 15:53:44 +00:00
Benjamin Kramer e79beacb32 Hexagon: Make helper functions static.
llvm-svn: 182588
2013-05-23 15:43:11 +00:00
Benjamin Kramer 635e368e33 R600: Hide symbols of implementation details.
Also removes an unused function.

llvm-svn: 182587
2013-05-23 15:43:05 +00:00
Benjamin Kramer bc6666bedf InlineSpiller: Store bucket pointers instead of iterators.
Lets us use a SetVector instead of an explicit set + vector combination.

llvm-svn: 182586
2013-05-23 15:42:57 +00:00
Aaron Ballman 15f193a1a3 Setting the default value (fixes CRT assertions about uninitialized variable use when doing debug MSVC builds), and fixing coding style.
llvm-svn: 182585
2013-05-23 14:55:00 +00:00
Rafael Espindola 00345fa97b Fix 32 bit build in c++11 mode.
The error was:
error: non-constant-expression cannot be narrowed from type 'long long' to 'long' in initializer list [-Wc++11-narrowing]
        MI.getOperand(6).getImm() & 0x1F,

llvm-svn: 182584
2013-05-23 13:22:30 +00:00
Sergey Matveev a4a01975d5 [lsan] Add lit test support.
"check-lsan" now runs both the tests from lib/lsan/tests and any lit
tests found under lib/lsan/lit_tests.

llvm-svn: 182583
2013-05-23 12:58:56 +00:00
Alexander Potapenko 22e92fa954 [TSan] Try to fix the Go-TSan build.
llvm-svn: 182582
2013-05-23 12:54:35 +00:00
Evgeniy Stepanov bfbd37e6e7 [tsan] Remove -Wgnu from Makefile.old.
llvm-svn: 182580
2013-05-23 11:57:47 +00:00
Alexander Potapenko 6535f510a3 [ASan] Introduce SymbolizerPrepareForSandboxing(), which is a no-op on every platform except Linux (because we don't support sandboxing anywhere else yet)
On Linux we pre-cache the value of readlink("/proc/self/exe"), so that it can be later used when the sandbox has been turned on.

llvm-svn: 182579
2013-05-23 11:53:36 +00:00
Evgeniy Stepanov a343d1d881 [msan] Fix line >80 chars.
llvm-svn: 182578
2013-05-23 11:51:47 +00:00
Manuel Klimek c573080d45 Stop aligning trailing comments which are aligned with the next line.
Previously we would align:
f(); // comment
     // other comment
g();

Even if // other comment was at the start of the line. Now we do not
align trailing comments if they have been already aligned correctly
with the next line.

Thus,
f(); // comment
// other comment
g();
will not be changed, while:
f(); // comment
  // other commment
g();
will lead to the two trailing comments being aligned.

llvm-svn: 182577
2013-05-23 11:42:52 +00:00
Evgeniy Stepanov 5415c9c352 [sanitizer] Fix Windows build.
llvm-svn: 182576
2013-05-23 11:41:58 +00:00
Timur Iskhodzhanov e05f9ba956 [ASan] Rename a atomic_compare_exchange_strong parameter to avoid a compiler warning
llvm-svn: 182575
2013-05-23 11:40:51 +00:00
Evgeniy Stepanov b978627cb8 [sanitizer] Intercept getsockopt.
llvm-svn: 182574
2013-05-23 11:38:08 +00:00
Evgeniy Stepanov ab25369d04 [sanitizer] Interceptors for gethostbyname and friends.
llvm-svn: 182573
2013-05-23 11:10:23 +00:00
Manuel Klimek 5c24cca0f0 Use a SourceRange for the whitespace location in FormatToken.
Replaces the use of WhitespaceStart + WhitspaceLength.
This made a bug in the formatter obvous where we would incorrectly
calculate the next column.

FIXME: There's a similar bug left regarding TokenLength. We should
probably also move to have a TokenRange instead.

llvm-svn: 182572
2013-05-23 10:56:37 +00:00
Sergey Matveev bb12f840b5 [lsan] Ensure lsan is initialized when interceptors are called.
Also remove unnecessary ifdefs.

llvm-svn: 182571
2013-05-23 10:24:44 +00:00
Daniel Jasper e5777d25d6 Improve formatting of braced lists.
Before:
vector<int> x { 1, 2, 3 };
After:
vector<int> x{ 1, 2, 3 };

Also add a style option to remove the spaces inside braced lists,
so that the above becomes:
std::vector<int> v{1, 2, 3};

llvm-svn: 182570
2013-05-23 10:15:45 +00:00
Manuel Klimek 6734592c12 Fix no-assert compiles.
llvm-svn: 182569
2013-05-23 10:02:51 +00:00
Manuel Klimek ab41991c07 Expand parsing of braced init lists.
Allows formatting of C++11 braced init list constructs, like:
vector<int> v { 1, 2, 3 };
f({ 1, 2 });

This involves some changes of how tokens are handled in the
UnwrappedLineFormatter. Note that we have a plan to evolve the
design of the token flow into one where we create all tokens
up-front and then annotate them in the various layers (as we
currently already have to create all tokens at once anyway, the
current abstraction does not help). Thus, this introduces
FIXMEs towards that goal.

llvm-svn: 182568
2013-05-23 09:41:43 +00:00
Alexander Potapenko fd7d9f45dd [ASan] Rename __asan_preinit to __local_asan_preinit to avoid warnings from the linker which is trying to export all the __asan_* symbols
llvm-svn: 182567
2013-05-23 09:15:20 +00:00
Nick Lewycky 7b431030ac Add missing test from r175092.
llvm-svn: 182564
2013-05-23 07:46:13 +00:00
Bill Wendling 353fbd3516 Performance improvement.
Using fwrite and fread was very *very* slow. The resulting code was multiple
times slower than GCC's implementation of gcov. Replace the fwrite/fread system
with an mmap() version.

If the `.gcda' file doesn't exist, we (re)allocate a buffer that we write
into. That gets written to the `.gcda' file in one chunk. If the `.gcda' file
already exists, we simply mmap() the file, modify the mapped data, and use
msync() to write the contents out to disk. It's much easier than implementing
our own buffering scheme, and we don't have to use fwrite's and fread's
buffering.

For those who are numbers-oriented, here are some timings:

GCC Verison
-----------

`.gcda' files don't exist:  23s
`.gcda' files do exist:     14s

LLVM Version (before this change)
---------------------------------

`.gcda' files don't exist:  28s
`.gcda' files do exist:     28s

LLVM Version (with this change)
-------------------------------

`.gcda' files don't exist:  18s
`.gcda' files do exist:      4s

It's a win-win-win-win-lose-win-win scenario!

<rdar://problem/13466086>

llvm-svn: 182563
2013-05-23 07:18:59 +00:00