platform/upstream/llvm.git
11 years agoDetect when we end up trying to load conflicting module files.
Douglas Gregor [Wed, 6 Feb 2013 22:40:31 +0000 (22:40 +0000)]
Detect when we end up trying to load conflicting module files.

This can happen when one abuses precompiled headers by passing more -D
options when using a precompiled hedaer than when it was built. This
is intentionally permitted by precompiled headers (and is exploited by
some build environments), but causes problems for modules.

First part of <rdar://problem/13165109>, detecting when something when
horribly wrong.

llvm-svn: 174554

11 years agoFix typo
Eli Bendersky [Wed, 6 Feb 2013 22:34:46 +0000 (22:34 +0000)]
Fix typo

llvm-svn: 174553

11 years ago[Support][ErrorOr] Add support for convertable types.
Michael J. Spencer [Wed, 6 Feb 2013 22:28:53 +0000 (22:28 +0000)]
[Support][ErrorOr] Add support for convertable types.

Thanks to Andrew, David, and Aaron for helping fix this.

llvm-svn: 174552

11 years agoAdd a comment to the test that points to the source from which the input object
Eli Bendersky [Wed, 6 Feb 2013 22:17:40 +0000 (22:17 +0000)]
Add a comment to the test that points to the source from which the input object
file was generated.

llvm-svn: 174551

11 years agoCode Custodian (trivial whitespace cleanup)
Joe Abbey [Wed, 6 Feb 2013 22:14:06 +0000 (22:14 +0000)]
Code Custodian (trivial whitespace cleanup)

llvm-svn: 174550

11 years agoFix bug in the alignment of comments.
Daniel Jasper [Wed, 6 Feb 2013 22:04:05 +0000 (22:04 +0000)]
Fix bug in the alignment of comments.

Before:
const char *test[] = {
  // A
  "aaaa",
               // B
  "aaaaa",
};

After:
const char *test[] = {
  // A
  "aaaa",
  // B
  "aaaaa",
};

llvm-svn: 174549

11 years agoClean up multiple skeleton compile units if we have multiple compile
Eric Christopher [Wed, 6 Feb 2013 21:53:56 +0000 (21:53 +0000)]
Clean up multiple skeleton compile units if we have multiple compile
units coming in.

llvm-svn: 174548

11 years agoRemove some dead code.
Eric Christopher [Wed, 6 Feb 2013 21:53:53 +0000 (21:53 +0000)]
Remove some dead code.

llvm-svn: 174547

11 years ago[mips] Make NOP a pseudo instruction and expand it to "sll $zero, $zero, 0".
Akira Hatanaka [Wed, 6 Feb 2013 21:50:15 +0000 (21:50 +0000)]
[mips] Make NOP a pseudo instruction and expand it to "sll $zero, $zero, 0".

llvm-svn: 174546

11 years agoBecome a little smarter with formatting long chains of pipes.
Daniel Jasper [Wed, 6 Feb 2013 21:04:05 +0000 (21:04 +0000)]
Become a little smarter with formatting long chains of pipes.

Assign a high penalty to breaking before "<<" if the previous token is a
string literal ending in ":" or "=".

Before:
llvm::outs()
    << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa << "bbbbbbbbbbbbbbbbb = "
    << bbbbbbbbbbbbbbbbb << "ccccccccccccccccc = " << ccccccccccccccccc
    << "ddddddddddddddddd = " << ddddddddddddddddd << "eeeeeeeeeeeeeeeee = "
    << eeeeeeeeeeeeeeeee;

After:
llvm::outs() << "aaaaaaaaaaaaaaaaa = " << aaaaaaaaaaaaaaaaa
             << "bbbbbbbbbbbbbbbbb = " << bbbbbbbbbbbbbbbbb
             << "ccccccccccccccccc = " << ccccccccccccccccc
             << "ddddddddddddddddd = " << ddddddddddddddddd
             << "eeeeeeeeeeeeeeeee = " << eeeeeeeeeeeeeeeee;

llvm-svn: 174545

11 years agoMarcin Zalewski: Change the name of a template parameter in __copy_backward from...
Howard Hinnant [Wed, 6 Feb 2013 21:03:39 +0000 (21:03 +0000)]
Marcin Zalewski:  Change the name of a template parameter in __copy_backward from _InputIterator to _BidirectionalIterator to better document the intent of the algorithm.

llvm-svn: 174544

11 years agoAdd a test for checking the current .debug_frame dumping capability.
Eli Bendersky [Wed, 6 Feb 2013 20:55:06 +0000 (20:55 +0000)]
Add a test for checking the current .debug_frame dumping capability.

The test is a binary placed in test/DebugInfo/Inputs, with a source C
file used for reference/reproducing. The source's first line is a clang
build command for reproducing the binary.

llvm-svn: 174543

11 years agoThis is a follow-up on r174446, now taking Atom processors into
Eli Bendersky [Wed, 6 Feb 2013 20:43:57 +0000 (20:43 +0000)]
This is a follow-up on r174446, now taking Atom processors into
account. Atoms use LEA for updating SP in prologs/epilogs, and the
exact LEA opcode depends on the data model.

Also reapplying the test case which was added and then reverted
(because of Atom failures), this time specifying explicitly the CPU in
addition to the triple. The test case now checks all variations (data
mode, cpu Atom vs. Core).

llvm-svn: 174542

11 years agoCanonicalize line endings to Linux style also when the --strict-whitespace flag is...
Guy Benyei [Wed, 6 Feb 2013 20:40:38 +0000 (20:40 +0000)]
Canonicalize line endings to Linux style also when the --strict-whitespace flag is in use. This flag is supposed to affect horizontal whitespaces only.

llvm-svn: 174541

11 years agoCleanup of ASTMatcher macros and adding support for overloaded matchers.
Manuel Klimek [Wed, 6 Feb 2013 20:36:22 +0000 (20:36 +0000)]
Cleanup of ASTMatcher macros and adding support for overloaded matchers.

This is in preparation for adding other overloaded matchers. This change
alone is a net win in LOC.
I went through all matchers and looked whether we could now encode them
as macro, or simplify them with the matcher atoms that were not
available before.

llvm-svn: 174540

11 years agoGive a lot more timing latitude to some of the timing tests. Busy buildbots are hitti...
Howard Hinnant [Wed, 6 Feb 2013 20:25:56 +0000 (20:25 +0000)]
Give a lot more timing latitude to some of the timing tests. Busy buildbots are hitting the timing limits too often.

llvm-svn: 174539

11 years ago[tests] Infer the cxx_under_test (as clang++).
Daniel Dunbar [Wed, 6 Feb 2013 20:24:23 +0000 (20:24 +0000)]
[tests] Infer the cxx_under_test (as clang++).

 - This is a reasonable default, and makes testing just work with no required
   parameters.

 - Add notes on all of the inferred or default values.

llvm-svn: 174538

11 years agoAlign trailing block comments like trailing line comments.
Daniel Jasper [Wed, 6 Feb 2013 20:07:35 +0000 (20:07 +0000)]
Align trailing block comments like trailing line comments.

llvm-svn: 174537

11 years agoImprove comment.
Bill Wendling [Wed, 6 Feb 2013 20:05:44 +0000 (20:05 +0000)]
Improve comment.

llvm-svn: 174536

11 years agoPartially revert r152770. That commit moved the default handlers to their own file...
Howard Hinnant [Wed, 6 Feb 2013 19:29:55 +0000 (19:29 +0000)]
Partially revert r152770.  That commit moved the default handlers to their own file.  But it also did some refactoring.  It is the latter that is being reverted.  The refactoring had accidentally removed the required effect that the default unexpected_handler calls std::terminate(), which is a visible effect.

llvm-svn: 174532

11 years agoRemove unneeded test. We have plenty of subgroup relations between warnings,
Ted Kremenek [Wed, 6 Feb 2013 19:24:28 +0000 (19:24 +0000)]
Remove unneeded test.  We have plenty of subgroup relations between warnings,
and for those we care about we should have a general way of testing them.

llvm-svn: 174531

11 years agoAccept and ignore the -fextended-identifiers option.
Jordan Rose [Wed, 6 Feb 2013 18:15:40 +0000 (18:15 +0000)]
Accept and ignore the -fextended-identifiers option.

This was GCC's option to turn on UCN support, which we always have on now
in C99 and C++ modes.

Additionally, mark the -fno-extended-identifiers option as unsupported,
since we don't support disabling UCNs in C99 and C++ modes.

PR11538

llvm-svn: 174530

11 years agoEliminate a race condition with the global module index.
Douglas Gregor [Wed, 6 Feb 2013 18:08:37 +0000 (18:08 +0000)]
Eliminate a race condition with the global module index.

Essentially, a module file on disk could change size between the time
we stat() it and the time we open it, and we need to be robust against
such a problem.

llvm-svn: 174529

11 years ago[tests] Change test default to run against locally built library.
Daniel Dunbar [Wed, 6 Feb 2013 17:47:08 +0000 (17:47 +0000)]
[tests] Change test default to run against locally built library.

llvm-svn: 174528

11 years ago[tests] Enable use_system_lib support on Linux.
Daniel Dunbar [Wed, 6 Feb 2013 17:45:53 +0000 (17:45 +0000)]
[tests] Enable use_system_lib support on Linux.
 - Patch by Michael van der Westhuizen.

llvm-svn: 174527

11 years agoPPC calling convention cleanup.
Bill Schmidt [Wed, 6 Feb 2013 17:33:58 +0000 (17:33 +0000)]
PPC calling convention cleanup.

Most of PPCCallingConv.td is used only by the 32-bit SVR4 ABI.  Rename
things to clarify this.  Also delete some code that's been commented out
for a long time.

llvm-svn: 174526

11 years agoR600: Support for indirect addressing v4
Tom Stellard [Wed, 6 Feb 2013 17:32:29 +0000 (17:32 +0000)]
R600: Support for indirect addressing v4

Only implemented for R600 so far.  SI is missing implementations of a
few callbacks used by the Indirect Addressing pass and needs code to
handle frame indices.

At the moment R600 only supports array sizes of 16 dwords or less.
Register packing of vector types is currently disabled, which means that a
vec4 is stored in T0_X, T1_X, T2_X, T3_X, rather than T0_XYZW. In order
to correctly pack registers in all cases, we will need to implement an
analysis pass for R600 that determines the correct vector width for each
array.

v2:
  - Add support for i8 zext load from stack.
  - Coding style fixes

v3:
  - Don't reserve registers for indirect addressing when it isn't
    being used.
  - Fix bug caused by LLVM limiting the number of SubRegIndex
    declarations.

v4:
  - Fix 64-bit defines

llvm-svn: 174525

11 years ago<rdar://problem/13159777>
Greg Clayton [Wed, 6 Feb 2013 17:22:03 +0000 (17:22 +0000)]
<rdar://problem/13159777>

lldb was mmap'ing archive files once per .o file it loads, now it correctly shares the archive between modules.

LLDB was also always mapping entire contents of universal mach-o files, now it maps just the slice that is required.

Added a new logging channel for "lldb" called "mmap" to help track future regressions.

Modified the ObjectFile and ObjectContainer plugin interfaces to take a data offset along with the file offset and size so we can implement the correct caching and efficient reading of parts of files without mmap'ing the entire file like we used to.

The current implementation still keeps entire .a files mmaped (once) and entire slices from universal files mmaped to ensure that if a client builds their binaries during a debug session we don't lose our data and get corrupt object file info and debug info.

llvm-svn: 174524

11 years agoFix bug in test harness to allow running dotest.py without "--executable" flag on...
Daniel Malea [Wed, 6 Feb 2013 16:55:07 +0000 (16:55 +0000)]
Fix bug in test harness to allow running dotest.py without "--executable" flag on Linux
- resolves errors in cases that run the lldb CLI utility

llvm-svn: 174522

11 years agoFormatter: Correctly detect ObjC message expressions preceded by a comment.
Nico Weber [Wed, 6 Feb 2013 16:54:35 +0000 (16:54 +0000)]
Formatter: Correctly detect ObjC message expressions preceded by a comment.

llvm-svn: 174521

11 years agoFix to build tests with GCC: update makefiles in two watchpoint testcases
Daniel Malea [Wed, 6 Feb 2013 16:51:24 +0000 (16:51 +0000)]
Fix to build tests with GCC: update makefiles in two watchpoint testcases

llvm-svn: 174520

11 years agoFix GCC 4.6 build by avoiding delegating ctors
Daniel Malea [Wed, 6 Feb 2013 16:46:40 +0000 (16:46 +0000)]
Fix GCC 4.6 build by avoiding delegating ctors

Patch by Abid Hafiz!

llvm-svn: 174519

11 years agoImplement external weak (ELF) symbols on AArch64
Tim Northover [Wed, 6 Feb 2013 16:43:33 +0000 (16:43 +0000)]
Implement external weak (ELF) symbols on AArch64

Weakly defined symbols should evaluate to 0 if they're undefined at
link-time. This is impossible to do with the usual address generation
patterns, so we should use a literal pool entry to materlialise the
address.

llvm-svn: 174518

11 years agoFix handling of comments in macros.
Manuel Klimek [Wed, 6 Feb 2013 16:40:56 +0000 (16:40 +0000)]
Fix handling of comments in macros.

We now correctly format:
 // Written as a macro, it is reformatted from:
 #define foo(a)                                                                \
   do {                                                                        \
     /* Initialize num to zero. */                                             \
     int num = 10;                                                             \
     /* This line ensures a is never zero. */                                  \
     int i = a == 0 ? 1 : a;                                                   \
     i = num / i; /* This division is OK. */                                   \
     return i;                                                                 \
   } while (false)

llvm-svn: 174517

11 years ago[TSan] skip multiple internal frames, if necessary
Alexey Samsonov [Wed, 6 Feb 2013 16:28:05 +0000 (16:28 +0000)]
[TSan] skip multiple internal frames, if necessary

llvm-svn: 174516

11 years agoAdd some comments to new frame entries
Eli Bendersky [Wed, 6 Feb 2013 16:20:31 +0000 (16:20 +0000)]
Add some comments to new frame entries

llvm-svn: 174515

11 years agoMuch semicolon after namespaces.
Manuel Klimek [Wed, 6 Feb 2013 16:08:09 +0000 (16:08 +0000)]
Much semicolon after namespaces.

We now leave the semicolon in the line of the closing brace in:
namespace {
...
};

llvm-svn: 174514

11 years agoFix formatting of ObjC method calls.
Daniel Jasper [Wed, 6 Feb 2013 16:00:26 +0000 (16:00 +0000)]
Fix formatting of ObjC method calls.

This fixes llvm.org/PR15165.

We now correctly align:
  [image_rep drawInRect:drawRect
               fromRect:NSZeroRect
              operation:NSCompositeCopy
               fraction:1.0
             ssssssssdd:NO
                  hints:nil];

llvm-svn: 174513

11 years agoParse record declarations with token pasted identifiers.
Manuel Klimek [Wed, 6 Feb 2013 15:57:54 +0000 (15:57 +0000)]
Parse record declarations with token pasted identifiers.

This is pretty common in macros:
 #define A(X, Y) class X##Y {};

llvm-svn: 174512

11 years ago[ASan] fix the interceptor for siglongjmp. As we're using dylib interposition, we...
Alexander Potapenko [Wed, 6 Feb 2013 15:45:43 +0000 (15:45 +0000)]
[ASan] fix the interceptor for siglongjmp. As we're using dylib interposition, we must intercept both siglongjmp and longjmp on Darwin.

llvm-svn: 174510

11 years agoFix a formatting bug caused by comments in expressions.
Daniel Jasper [Wed, 6 Feb 2013 15:23:09 +0000 (15:23 +0000)]
Fix a formatting bug caused by comments in expressions.

This fixes llvm.org/PR15162.

Before:
    bool aaaaaaaaaaaaa =  // comment
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
                          aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
                          aaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
    bool aaaaaaaaaaaaa =  // comment
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || aaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

llvm-svn: 174508

11 years agoUse 64-bit inodes in file operations. ASan is now built with -mmacosx-version-min...
Alexander Potapenko [Wed, 6 Feb 2013 14:41:15 +0000 (14:41 +0000)]
Use 64-bit inodes in file operations. ASan is now built with -mmacosx-version-min=10.5, thus the default inode
size is 32 bits. However the supported client code is going to target 10.6 and higher, where 64-bit inodes will be used.

llvm-svn: 174507

11 years ago[tsan] improve FrameIsInternal
Kostya Serebryany [Wed, 6 Feb 2013 14:32:16 +0000 (14:32 +0000)]
[tsan] improve FrameIsInternal

llvm-svn: 174506

11 years ago[tsan] print error summary line
Kostya Serebryany [Wed, 6 Feb 2013 14:24:00 +0000 (14:24 +0000)]
[tsan] print error summary line

llvm-svn: 174505

11 years agoOptionally derive formatting information from the input file.
Daniel Jasper [Wed, 6 Feb 2013 14:22:40 +0000 (14:22 +0000)]
Optionally derive formatting information from the input file.

With this patch, clang-format can analyze the input file for two
properties:
1. Is "int *a" or "int* a" more common.
2. Are non-C++03 constructs used, e.g. A<A<A>>.

With Google-style, clang-format will now use the more common style for
(1) and format C++03 compatible, unless it finds C++11 constructs in the
input.

llvm-svn: 174504

11 years agoRemove superseeded option.
Daniel Jasper [Wed, 6 Feb 2013 14:22:17 +0000 (14:22 +0000)]
Remove superseeded option.

The -invert-pointer-binding option will be superseeded by my next
cfe-commit. Instead of explicitly overwriting this flag, clang-format
can then be configured to auto-detect certain style-options based on the
input file.

llvm-svn: 174503

11 years agoAdd xml:space='preserve' in order to correctly preserve whitespace.
Manuel Klimek [Wed, 6 Feb 2013 12:40:01 +0000 (12:40 +0000)]
Add xml:space='preserve' in order to correctly preserve whitespace.

llvm-svn: 174502

11 years ago[asan] print a short one-line report summary after the full report. Currently, works...
Kostya Serebryany [Wed, 6 Feb 2013 12:36:49 +0000 (12:36 +0000)]
[asan] print a short one-line report summary after the full report. Currently, works only if symbolization happens in-process.

llvm-svn: 174501

11 years agoFix an issue with the formatting of stars in default values.
Daniel Jasper [Wed, 6 Feb 2013 10:57:42 +0000 (10:57 +0000)]
Fix an issue with the formatting of stars in default values.

Before: void f(int *a = d *e, int b = 0);
After:  void f(int *a = d * e, int b = 0);
llvm-svn: 174500

11 years agoAdds a convenience function selectFirst to simplify matching.
Manuel Klimek [Wed, 6 Feb 2013 10:33:21 +0000 (10:33 +0000)]
Adds a convenience function selectFirst to simplify matching.

A very common use case is to search for the first occurrence of
a certain node that is a descendant of another node. In that
case, selectFirst significantly simplifies the code at the client side.

llvm-svn: 174499

11 years agoHandle nested ObjC calls.
Daniel Jasper [Wed, 6 Feb 2013 10:05:46 +0000 (10:05 +0000)]
Handle nested ObjC calls.

Properly handle annotation contexts while calculating extra information
for each token. This enable nested ObjC calls and thus solves (most of)
llvm.org/PR15164. E.g., we can now format:

[contentsContainer replaceSubview:[subviews objectAtIndex:0]
                             with:contentsNativeView];

Also fix a problem with the formatting of types in casts as this was
trivial now.

llvm-svn: 174498

11 years agoKick JSON output for XML output.
Manuel Klimek [Wed, 6 Feb 2013 09:42:05 +0000 (09:42 +0000)]
Kick JSON output for XML output.

Apparently the owners of the tools we want to integrate with (eclipse in
this case) don't have JSON parsers.

The output now is:
<replacements>
<replacement offset='2' length='3'>  </replacement>
...
</replacements>

Kicking JSON for now - it's easy enough to get back in when we need it.

FIXME: once we find this useful enough, we might want to add it as
free-standing functions to tooling.

llvm-svn: 174497

11 years agoAdd AArch64 CRC32 instructions
Tim Northover [Wed, 6 Feb 2013 09:13:13 +0000 (09:13 +0000)]
Add AArch64 CRC32 instructions

These instructions are a late addition to the architecture, and may
yet end up behind an optional attribute, but for now they're available
at all times.

llvm-svn: 174496

11 years agoAdd icache prefetch operations to AArch64
Tim Northover [Wed, 6 Feb 2013 09:04:56 +0000 (09:04 +0000)]
Add icache prefetch operations to AArch64

This adds hints to the various "prfm" instructions so that they can
affect the instruction cache as well as the data cache.

llvm-svn: 174495

11 years agoInitial submission for the attribute group feature.
Bill Wendling [Wed, 6 Feb 2013 06:52:58 +0000 (06:52 +0000)]
Initial submission for the attribute group feature.

Attribute groups are of the form:

  #0 = attributes { noinline "no-sse" "cpu"="cortex-a8" alignstack=4 }

Target-dependent attributes are represented as strings. Attributes can have
optional values associated with them. E.g., the "cpu" attribute has the value
"cortex-a8".

Target-independent attributes are listed as enums inside the attribute classes.

Multiple attribute groups can be referenced by the same object. In that case,
the attributes are merged together.

llvm-svn: 174493

11 years agoRemove extra blank line between closing curly brace and 'else'
Craig Topper [Wed, 6 Feb 2013 06:50:38 +0000 (06:50 +0000)]
Remove extra blank line between closing curly brace and 'else'

llvm-svn: 174492

11 years agoRemove unused private field to suppress a build warning.
Craig Topper [Wed, 6 Feb 2013 06:48:10 +0000 (06:48 +0000)]
Remove unused private field to suppress a build warning.

llvm-svn: 174491

11 years agoAlphabetize the function attributes.
Bill Wendling [Wed, 6 Feb 2013 06:22:58 +0000 (06:22 +0000)]
Alphabetize the function attributes.

llvm-svn: 174490

11 years agoFormatter: No space after & and * in front of ObjC message expressions.
Nico Weber [Wed, 6 Feb 2013 06:20:11 +0000 (06:20 +0000)]
Formatter: No space after & and * in front of ObjC message expressions.

1. let determineStarAmp() check of unary operators before checking for
   "is next '['". That check was added in r173150, and the test from that
   revision passes either way.

2. change determineStarAmp() to categorize '*' and '&' after '=' as unary
   operator.

3. don't let parseSquare() overwrite the type of a '*' or '&' before the start
   of an objc message expression if has the role of unary operator.

llvm-svn: 174489

11 years agoARM: Use MCTargetAsmParser::validateTargetOperandClass().
Jim Grosbach [Wed, 6 Feb 2013 06:00:11 +0000 (06:00 +0000)]
ARM: Use MCTargetAsmParser::validateTargetOperandClass().

Use the validateTargetOperandClass() hook to match literal '#0' operands in
InstAlias definitions. Previously this required per-instruction C++ munging of the
operand list, but not is handled as a natural part of the matcher. Much better.

No additional tests are required, as the pre-existing tests for these instructions
exercise the new behaviour as being functionally equivalent to the old.

llvm-svn: 174488

11 years agoAllow targets to add custom asm operand matching logic.
Jim Grosbach [Wed, 6 Feb 2013 06:00:06 +0000 (06:00 +0000)]
Allow targets to add custom asm operand matching logic.

For example, ARM has several instructions with a literal '#0' immediate in the syntax
that's not represented as an actual operand. The asm matcher is expected a token
operand, but the parser will have created an immediate operand. This is currently
handled by dedicated per-instruction C++ munging of the ParsedAsmOperand list, but
will be better handled by this hook.

llvm-svn: 174487

11 years agoDon't check whether a friend declaration is correctly formed when instantiating,
Nick Lewycky [Wed, 6 Feb 2013 05:59:33 +0000 (05:59 +0000)]
Don't check whether a friend declaration is correctly formed when instantiating,
we already checked it when parsing.

llvm-svn: 174486

11 years agoFailing builds because a private class member is not being used after
Eli Bendersky [Wed, 6 Feb 2013 05:37:46 +0000 (05:37 +0000)]
Failing builds because a private class member is not being used after
initialization is one of the reasons I consider -werror to be shoddy.

llvm-svn: 174485

11 years agoRemove this test in the meantime, since it won't pass on Atom. Atom uses lea
Eli Bendersky [Wed, 6 Feb 2013 03:15:00 +0000 (03:15 +0000)]
Remove this test in the meantime, since it won't pass on Atom. Atom uses lea
to move the stack pointer in prologs/epilogs. I will fix the test and add it
back later.

llvm-svn: 174484

11 years agoAdd virtual desctructor to FrameEntry to avoid error on delete-non-virtual-dtor
Eli Bendersky [Wed, 6 Feb 2013 03:08:02 +0000 (03:08 +0000)]
Add virtual desctructor to FrameEntry to avoid error on delete-non-virtual-dtor

llvm-svn: 174483

11 years agoTweak check to avoid integer overflow (for insanely large alignments)
Evan Cheng [Wed, 6 Feb 2013 02:06:33 +0000 (02:06 +0000)]
Tweak check to avoid integer overflow (for insanely large alignments)

llvm-svn: 174482

11 years agoAdd a 'StringRef' version of hasAttribute.
Bill Wendling [Wed, 6 Feb 2013 01:33:42 +0000 (01:33 +0000)]
Add a 'StringRef' version of hasAttribute.

Fix the 'operator==' and 'hasAttributes' queries to take into account
target-dependent attributes.

llvm-svn: 174481

11 years agoAdd methods to merge an AttrBuilder into another builder.
Bill Wendling [Wed, 6 Feb 2013 01:16:00 +0000 (01:16 +0000)]
Add methods to merge an AttrBuilder into another builder.

This is useful when parsing an object that references multiple attribute groups.

N.B. If both builders have alignments specified, then they should match!

llvm-svn: 174480

11 years agoAttempt to recover gdb bot after r174445.
Manman Ren [Wed, 6 Feb 2013 00:59:41 +0000 (00:59 +0000)]
Attempt to recover gdb bot after r174445.

Failure: undefined symbol 'Lline_table_start0'.
Root-cause: we use a symbol subtraction to calculate at_stmt_list, but
the line table entries are not dumped in the assembly.
Fix: use zero instead of a symbol subtraction for Compile Unit 0.

llvm-svn: 174479

11 years ago[tests] One last batch of XFAILs, for tests using new symbols added to libc++.
Daniel Dunbar [Wed, 6 Feb 2013 00:59:06 +0000 (00:59 +0000)]
[tests] One last batch of XFAILs, for tests using new symbols added to libc++.

 - As of this commit, the test suite should now fully pass on both darwin11 and
   darwin12 when testing against either a locally built libc++ or the system libc++.

llvm-svn: 174478

11 years agoUse a dyn_cast to avoid a crash when the TypeLoc is not a ConstantArrayTypeLoc.
Chad Rosier [Wed, 6 Feb 2013 00:58:34 +0000 (00:58 +0000)]
Use a dyn_cast to avoid a crash when the TypeLoc is not a ConstantArrayTypeLoc.
rdar://13153516

llvm-svn: 174477

11 years ago<rdar://problem/11109570>
Greg Clayton [Wed, 6 Feb 2013 00:38:25 +0000 (00:38 +0000)]
<rdar://problem/11109570>

The first part of the fix for having LLDB handle LTO debugging when the DWARF is in the .o files. This part separates the object file's modules into a separate cache map that maps unique C strings for the N_OSO path to the ModuleSP since one object file might be mentioned more than once in LTO binaries.

llvm-svn: 174476

11 years ago[Headers] Use standard builtin defines instead of typeof trickery.
Daniel Dunbar [Wed, 6 Feb 2013 00:38:13 +0000 (00:38 +0000)]
[Headers] Use standard builtin defines instead of typeof trickery.

 - The trickery can confuse more basic source processors, in particular the
   Unix conformance tool that wants to scan headers.

llvm-svn: 174475

11 years agoFixed the TestSourceManager.py test case to not fail. It was using the "list" alias...
Greg Clayton [Wed, 6 Feb 2013 00:35:33 +0000 (00:35 +0000)]
Fixed the TestSourceManager.py test case to not fail. It was using the "list" alias which has now been turned into a regex command that mimics the GDB equivalent. Changed "list" to "source list" to get around this problem.

llvm-svn: 174474

11 years agoFix some formatting & add comments, following Eric's review
Eli Bendersky [Wed, 6 Feb 2013 00:20:38 +0000 (00:20 +0000)]
Fix some formatting & add comments, following Eric's review

llvm-svn: 174473

11 years agoAdded test for r174461 that checks that the desired behavior also occurs in ObjC...
Michael Gottesman [Wed, 6 Feb 2013 00:14:48 +0000 (00:14 +0000)]
Added test for r174461 that checks that the desired behavior also occurs in ObjC++ alongside ObjC.

\end paranoia.

llvm-svn: 174471

11 years ago[build] Create the link for the final library install name in the lib dir.
Daniel Dunbar [Wed, 6 Feb 2013 00:04:54 +0000 (00:04 +0000)]
[build] Create the link for the final library install name in the lib dir.

 - Otherwise, we never were actually linking against the right library when
   building the test applications.

llvm-svn: 174470

11 years ago[tests] Accept XFAIL arguments that match any part of a feature.
Daniel Dunbar [Wed, 6 Feb 2013 00:04:52 +0000 (00:04 +0000)]
[tests] Accept XFAIL arguments that match any part of a feature.

llvm-svn: 174469

11 years ago[analyzer]Revert part of r161511; suppresses leak false positives in C++
Anna Zaks [Wed, 6 Feb 2013 00:01:14 +0000 (00:01 +0000)]
[analyzer]Revert part of r161511; suppresses leak false positives in C++

This is a "quick fix".

The underlining issue is that when a const pointer to a struct is passed
into a function, we do not invalidate the pointer fields. This results
in false positives that are common in C++ (since copy constructors are
prevalent). (Silences two llvm false positives.)

llvm-svn: 174468

11 years agoAdd the target-dependent (string) attributes from the AttrBuilder to the AttributeSet.
Bill Wendling [Tue, 5 Feb 2013 23:48:36 +0000 (23:48 +0000)]
Add the target-dependent (string) attributes from the AttrBuilder to the AttributeSet.

llvm-svn: 174467

11 years agoAdding armv7l default to cortex-a8
Renato Golin [Tue, 5 Feb 2013 23:42:01 +0000 (23:42 +0000)]
Adding armv7l default to cortex-a8

llvm-svn: 174466

11 years agoAdd missing file to CMake list
Eli Bendersky [Tue, 5 Feb 2013 23:37:18 +0000 (23:37 +0000)]
Add missing file to CMake list

llvm-svn: 174465

11 years agoTest for r174446
Eli Bendersky [Tue, 5 Feb 2013 23:31:48 +0000 (23:31 +0000)]
Test for r174446

llvm-svn: 174464

11 years agoInitial support for DWARF CFI parsing and dumping in LLVM
Eli Bendersky [Tue, 5 Feb 2013 23:30:58 +0000 (23:30 +0000)]
Initial support for DWARF CFI parsing and dumping in LLVM

llvm-svn: 174463

11 years agoBe consistent about the field name - AddressSize, not PointerSize. Add
Eli Bendersky [Tue, 5 Feb 2013 23:26:02 +0000 (23:26 +0000)]
Be consistent about the field name - AddressSize, not PointerSize. Add
a setter and fix some comments.

llvm-svn: 174462

11 years agoChanged CGObjCMac.cpp to add the marker externally_initialized to SELECTOR_REFERENCES...
Michael Gottesman [Tue, 5 Feb 2013 23:08:45 +0000 (23:08 +0000)]
Changed CGObjCMac.cpp to add the marker externally_initialized to SELECTOR_REFERENCES in both the fragile and non-fragile API.

This is to ensure that GlobalOpt in LLVM does not attempt to look through a
selector reference to a method var name at compile time.

I also added a test/updated old tests that need to recognize the new keyword.

rdar://12580965.

llvm-svn: 174461

11 years agoPreprocess Apple llvmCore headers to reflect NDEBUG setting. <rdar://12568983>
Bob Wilson [Tue, 5 Feb 2013 22:59:42 +0000 (22:59 +0000)]
Preprocess Apple llvmCore headers to reflect NDEBUG setting. <rdar://12568983>

If an Apple llvmCore build is done without assertions, and a client uses
the llvmCore headers with assertions enabled, or vice versa, then things will
break because some of the structure sizes in the API are different.  Use the
unifdef tool to make the headers unconditionally match the way the llvmCore
libraries were built.

llvm-svn: 174460

11 years ago[tests] XFAIL some locale tests that don't seem to work on any Darwin.
Daniel Dunbar [Tue, 5 Feb 2013 22:51:20 +0000 (22:51 +0000)]
[tests] XFAIL some locale tests that don't seem to work on any Darwin.

llvm-svn: 174459

11 years agoRevert "[Support][ErrorOr] Add support for convertable types."
Andrew Trick [Tue, 5 Feb 2013 22:50:20 +0000 (22:50 +0000)]
Revert "[Support][ErrorOr] Add support for convertable types."

This reverts commit a33e1fafac7fedb1b080ef07ddf9ad6ddff3a830.

This unit test crashes on Darwon. It needs to be temporarily reverted
to unblock the test infrastructure.

llvm-svn: 174458

11 years agoConvert to storing the attribute's internals as enums, integers, and strings.
Bill Wendling [Tue, 5 Feb 2013 22:37:24 +0000 (22:37 +0000)]
Convert to storing the attribute's internals as enums, integers, and strings.

The stuff we're handing are all enums (Attribute::AttrKind), integers and
strings. Don't convert them to Constants, which is an unnecessary step here. The
rest of the changes are mostly mechanical.

llvm-svn: 174456

11 years agoChange ObjectFileMachO::ParseSymtab to read the external
Jason Molenda [Tue, 5 Feb 2013 22:31:24 +0000 (22:31 +0000)]
Change ObjectFileMachO::ParseSymtab to read the external
function stub routine addresses from an in-memory-only
MachO object file.  This was the only remaining part of
ParseSymtab() that was assuming a file exists.
<rdar://problem/13139585>

llvm-svn: 174455

11 years ago[tests] If no explicit target triple is given, try to infer it.
Daniel Dunbar [Tue, 5 Feb 2013 22:28:03 +0000 (22:28 +0000)]
[tests] If no explicit target triple is given, try to infer it.

llvm-svn: 174454

11 years ago[tests] Mark another stream input expected failure (with system libc++).
Daniel Dunbar [Tue, 5 Feb 2013 22:21:52 +0000 (22:21 +0000)]
[tests] Mark another stream input expected failure (with system libc++).

llvm-svn: 174453

11 years ago[tests] Mark another stream input expected failure (with system libc++).
Daniel Dunbar [Tue, 5 Feb 2013 22:10:28 +0000 (22:10 +0000)]
[tests] Mark another stream input expected failure (with system libc++).

llvm-svn: 174452

11 years ago[tests] Mark some string.conversions expected failures (with system libc++).
Daniel Dunbar [Tue, 5 Feb 2013 22:10:27 +0000 (22:10 +0000)]
[tests] Mark some string.conversions expected failures (with system libc++).

llvm-svn: 174451

11 years ago[tests] XFAIL a few things that require libc (?) support missing on Darwin.
Daniel Dunbar [Tue, 5 Feb 2013 22:10:25 +0000 (22:10 +0000)]
[tests] XFAIL a few things that require libc (?) support missing on Darwin.

llvm-svn: 174450

11 years agoAdd note why we used a switch.
Ted Kremenek [Tue, 5 Feb 2013 22:03:14 +0000 (22:03 +0000)]
Add note why we used a switch.

llvm-svn: 174449

11 years agoMinor tweak to install docs
Douglas Gregor [Tue, 5 Feb 2013 22:01:16 +0000 (22:01 +0000)]
Minor tweak to install docs

llvm-svn: 174448

11 years agoChange subexpressions to be visited in the CFG from left-to-right.
Ted Kremenek [Tue, 5 Feb 2013 22:00:19 +0000 (22:00 +0000)]
Change subexpressions to be visited in the CFG from left-to-right.

This is a more natural order of evaluation, and it is very important
for visualization in the static analyzer.  Within Xcode, the arrows
will not jump from right to left, which looks very visually jarring.
It also provides a more natural location for dataflow-based diagnostics.

Along the way, we found a case in the analyzer diagnostics where we
needed to indicate that a variable was "captured" by a block.

-fsyntax-only timings on sqlite3.c show no visible performance change,
although this is just one test case.

Fixes <rdar://problem/13016513>

llvm-svn: 174447

11 years agoMake sure the correct opcodes are used to SUB and ADD the stack
Eli Bendersky [Tue, 5 Feb 2013 21:53:29 +0000 (21:53 +0000)]
Make sure the correct opcodes are used to SUB and ADD the stack
pointer in function prologs/epilogs. The opcodes should depend on the
data model (LP64 vs. ILP32) rather than the architecture bit-ness.

llvm-svn: 174446