Commit Graph

144614 Commits

Author SHA1 Message Date
Dmitri Gribenko f38da0dc75 Add doxygen support for the tools in clang-tools-extra
Patch by Ariel Bernal.

llvm-svn: 176267
2013-02-28 16:46:40 +00:00
Edwin Vane 266b625ca9 Introducing Use-Auto transform for cpp11-migrate
The new Use-Auto transform replaces the type specifier for variable
declarations with the special C++11 'auto' type specifier. For now, the
replacement is done only for variables that are iterators of any of the
std containers and only if the type used is one of those explicitly
allowed by the standard (i.e. not an implementation-specific type).

Reviewers: gribozavr, silvas, klimek
llvm-svn: 176266
2013-02-28 16:29:24 +00:00
Evgeniy Stepanov 3305b177e6 [asan] Lower memory usage in LargeMallocTest on Android.
llvm-svn: 176264
2013-02-28 15:54:58 +00:00
Daniel Jasper a400cab43a Reduce penalty for splitting after "{" in static initializers.
This fixes llvm.org/PR15379.

Before:
const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00,
                                            0x00,                  // comment
                                            0x00, 0x00, 0x00, 0x00, 0x00,
                                            0x00,                  // comment
                                            0x00, 0x00, 0x00, 0x00 // comment
};

After:
const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment
  0x00, 0x00, 0x00, 0x00              // comment
};

llvm-svn: 176262
2013-02-28 15:04:12 +00:00
Tim Northover ce17020c97 AArch64: remove post-encoder method from FCMP (immediate) instructions.
The work done by the post-encoder (setting architecturally unused bits to 0 as
required) can be done by the existing operand that covers the "#0.0". This
removes at least one use of the discouraged PostEncoderMethod uses.

llvm-svn: 176261
2013-02-28 14:46:14 +00:00
Daniel Jasper 9a23be7451 Dont break between (( in __attribute__((.
Before:
void aaaaaaaaaaaaaaaaaa() __attribute__(
    (aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa,
     aaaaaaaaaaaaaaaaaaaaaaaaa));

After:
void aaaaaaaaaaaaaaaaaa()
    __attribute__((aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa,
                   aaaaaaaaaaaaaaaaaaaaaaaaa));

llvm-svn: 176260
2013-02-28 14:44:25 +00:00
Tim Northover c3c5c0971d AArch64: be more careful resorting to inefficient addressing for weak vars.
If an otherwise weak var is actually defined in this unit, it can't be
undefined at runtime so we can use normal global variable sequences (ADRP/ADD)
to access it.

llvm-svn: 176259
2013-02-28 14:36:31 +00:00
Tim Northover b9d4fd210b AArch64: don't drop GlobalAddress offset when handling extern_weak decls.
llvm-svn: 176258
2013-02-28 14:36:24 +00:00
Bill Wendling c7e0a04433 Add the -disable-opt option to LTO. This adds:
- Consistency with opt (which supports the same option with the same meaning and
  description).
- Debugging gold plugin-based linking without optimizations getting in the way.
- Debugging programs linked with the gold plugin while preserving the original
  debug info.
- Fine-grained control over LTO passes using the gold plugin in combination with
  opt (or clang/dragonegg).

Patch by Cristiano Giuffrida!

llvm-svn: 176257
2013-02-28 14:11:10 +00:00
Alexander Potapenko f1c48eb509 [ASan] Add the memcmp_strict flag (1 by default) that controls the behavior of accessibility checks in memcmp.
1: memcmp(p1, p2, n) always checks n bytes
0: memcmp checks up to n bytes depending on whether the memory contents differ.

llvm-svn: 176256
2013-02-28 14:09:30 +00:00
Evgeniy Stepanov 1cb95a17b8 [asan] Enable allocator2 on Android.
llvm-svn: 176255
2013-02-28 14:07:01 +00:00
David Chisnall beb8013095 Improve property metadata generation with the GNUstep runtime.
llvm-svn: 176254
2013-02-28 13:59:29 +00:00
Tim Northover 9fafdf6d5a AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.
llvm-svn: 176253
2013-02-28 13:52:07 +00:00
Daniel Jasper ff6c3a9525 No spaces around pointers to members.
Before: (a ->* f)()
After:  (a->*f)()
llvm-svn: 176252
2013-02-28 13:40:17 +00:00
Manuel Klimek d4be4084b4 First step towards adding a parent map to the ASTContext.
This does not yet implement the LimitNode approach discussed.

The impact of this is an O(n) in the number of nodes in the AST
reduction of complexity for certain kinds of matchers (as otherwise the
parent map gets recreated for every new MatchFinder).

See FIXMEs in the comments for the direction of future work.

llvm-svn: 176251
2013-02-28 13:21:39 +00:00
Kostya Serebryany abebb57272 [asan] bump kMidMemEnd to 0x4fffffffffULL since in rare cases prelink uses addresses higher than 0x3fffffffff
llvm-svn: 176250
2013-02-28 12:28:37 +00:00
Alexey Samsonov 4a3234bec5 [Sanitizer] Relax ThreadLister tests to allow possible pre-existing threads. Do proper mutex destruction. Patch by Sergey Matveev
llvm-svn: 176249
2013-02-28 11:33:51 +00:00
Evgeniy Stepanov 218c582cb5 [msan] Lit tests for __attribute__((no_sanitize_memory)).
llvm-svn: 176248
2013-02-28 11:25:54 +00:00
Evgeniy Stepanov 00062b4498 [msan] Implement sanitize_memory attribute.
Shadow checks are disabled and memory loads always produce fully initialized
values in functions that don't have a sanitize_memory attribute. Value and
argument shadow is propagated as usual.

This change also updates blacklist behaviour to match the above.

llvm-svn: 176247
2013-02-28 11:25:14 +00:00
Daniel Jasper c22f5b4abb Improve formatting of #defines.
Two improvements:
1) Always leave at least one space before "\". Otherwise is can look bad
   and there is a risk of unwillingly joining to characters to a different
   token.
2) Use the full column limit for single-line #defines.
   Fixes llvm.org/PR15148

llvm-svn: 176245
2013-02-28 11:05:57 +00:00
Daniel Jasper 57d4a5821d Fix bug when formatting "A<A<A>>".
Before:
A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                     int aaaaaaaaaaaaaaaaaaaaaaa);
Before:
A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                   int aaaaaaaaaaaaaaaaaaaaaaa);

llvm-svn: 176244
2013-02-28 10:06:05 +00:00
Renato Golin 0d89178ba3 Corrections for XFAIL armv5 tests
Most of the tests that behave differently on llvm-arm-linux buildbot
did so becase the triple wasn't set correctly to armv5, so we can
revert most of the special behaviour added previously. Some tests
still need the special treatment, though.

llvm-svn: 176243
2013-02-28 10:05:10 +00:00
Daniel Jasper ead41b6b8f Fix incorrect recognition of bin-packing.
Before (in Google style):
Constructor()
    : aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(
          aaaaaa) {}

After:
Constructor()
    : aaaaa(aaaaaa),
      aaaaa(aaaaaa),
      aaaaa(aaaaaa),
      aaaaa(aaaaaa),
      aaaaa(aaaaaa) {}

llvm-svn: 176242
2013-02-28 09:39:12 +00:00
Daniel Jasper d8ffcfa9b8 Fix spacing after binary operator as macro parameter.
Before: COMPARE(a, == , b);
After:  COMPARE(a, ==, b);
llvm-svn: 176241
2013-02-28 09:21:10 +00:00
Evgeniy Stepanov 4c9300e630 Remove unused leftover declarations.
llvm-svn: 176240
2013-02-28 08:42:11 +00:00
Evgeniy Stepanov 00eef441ff Fix global overflow in types::lookupTypeForTypeSpecifier.
memcpy() is allowed to read entire contents of both memory areas.

Found with AddressSanitizer.

llvm-svn: 176237
2013-02-28 07:53:32 +00:00
Nick Lewycky 1052c99f46 Holy macaroons, somebody made a copy of llvm/runtime/profile/GCDAProfiling.c,
didn't delete the original, and now they've diverged. I have no idea what's
going on. Apply my patch in r176173 to this one too, this one looks newer?

llvm-svn: 176236
2013-02-28 07:00:13 +00:00
Bill Wendling 0615dbe44c Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

llvm-svn: 176235
2013-02-28 06:43:24 +00:00
Jason Molenda d676074d8f Add the libdebugserver.cpp for creating a library that does debugserver
work.  There isn't any target in the xcode project file which will build
this yet.

llvm-svn: 176234
2013-02-28 04:25:38 +00:00
Sean Callanan 933ca2e2ea Fixed some problems with type deportation:
- made sure we tell Clang not to try to
    complete the type since it can't be
    completed from its origin any more; and

  - fixed a silly bug where we tried to
    forget about the original decl's origins
    rather than the deported decl's origin.

These produced some crashes in ptr_refs,
especially under libgmalloc.

<rdar://problem/13256150>

llvm-svn: 176233
2013-02-28 03:12:58 +00:00
Enrico Granata 1ddbd8a68b Fixing the log line for SBValue::MightHaveChildren() to report the correct function name
llvm-svn: 176232
2013-02-28 02:26:12 +00:00
Enrico Granata 0a2df227fc the log entry for SBThread::GetProcess() would not include the pointer to the process because we were using the value of the (otherwise unused) process_sp - instead of fetching the SP from sb_process
llvm-svn: 176231
2013-02-28 02:18:49 +00:00
Jordan Rose a22cd706a2 [analyzer] RegionStore: collectSubRegionKeys -> collectSubRegionBindings
By returning the (key, value) binding pairs, we save lookups afterwards.
This also enables further work later on.

No functionality change.

llvm-svn: 176230
2013-02-28 01:53:08 +00:00
Jordan Rose 4879e49c8e [analyzer] Mark the root SVal class as isPodLike.
Pure optimization, no functionality change. Probably does not make much
of a difference, but it's free.

llvm-svn: 176229
2013-02-28 01:53:03 +00:00
Michael J. Spencer 12e3dfc58e [Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
Argyrios Kyrtzidis 397ef40f6b Add a test case, to make sure there is no crash on IRGen when using PCH
Related to rdar://13114142

llvm-svn: 176227
2013-02-28 01:13:53 +00:00
Argyrios Kyrtzidis eed2dc5769 [PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite loop by constantly trying
to create the parent path.

This can happen if the path is a relative filename and the current directory was removed.
Thanks to Daniel D. for the hint in fixing it.

llvm-svn: 176226
2013-02-28 00:38:19 +00:00
Shuxin Yang 1e55d8c663 Fix a problem in alias analysis. It is about the misinterpretation of "Object".
This problem is exposed by r171325 which is already reverted. It is rather
hard to fabricate a testing case without it.

r171325 should *NOT* be resurrected as it has a potential problem although 
this problem dosen't directly contribute to PR14988.

The bug is tracked by:
  - rdar://13063553, and
  - http://llvm.org/bugs/show_bug.cgi?id=14988

Thank Arnold for coming up a better solution to this problem. After
comparing this solution and my original proposal, I decided to ditch mine.

llvm-svn: 176225
2013-02-28 00:24:45 +00:00
Eric Christopher 5958b46053 Remove unnecessary check against isGlobalVariable. We check it
a few lines above.

llvm-svn: 176224
2013-02-27 23:49:50 +00:00
Eric Christopher 3f79b8c374 Rework comment slightly and fix a few typos.
llvm-svn: 176223
2013-02-27 23:49:47 +00:00
Eric Christopher 10d35e9065 Remove unnecessary cast to void.
llvm-svn: 176222
2013-02-27 23:49:45 +00:00
Renato Golin 05bbce70dd Avoiding flamewars
llvm-svn: 176221
2013-02-27 23:21:44 +00:00
Manman Ren 584e4c0eda Debug Info: for static member variables, always put AT_MIPS_linkage_name to the
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when
DarwinGDBCompat is true.

Darwin GDB needs AT_MIPS_linkage_name at both places to work.

Follow-up patch to r176143.
rdar://problem/13291234

llvm-svn: 176220
2013-02-27 23:21:02 +00:00
Nadav Rotem c29095fb50 Silence the unused variable warning.
llvm-svn: 176218
2013-02-27 22:52:54 +00:00
Greg Clayton 8571963a7c Fixed a case where the result of std::string's c_str() method was being called on a local variable and returned as a const char * incorrectly. We used to cache the thread names for threads in the current host process, but we shoudn't be caching that as the names can change over time, so now a std::string is returned from Host::GetThreadName().
llvm-svn: 176217
2013-02-27 22:51:58 +00:00
David Blaikie dc601e3a09 PR15360: nullptr as a non-type template argument to a function type non-type template parameter
llvm-svn: 176216
2013-02-27 22:10:40 +00:00
David Blaikie a985542ae0 Add test coverage for array to pointer decay in non-type template parameters.
Functionality committed in r172585 but tested the function case without the
array case.

llvm-svn: 176215
2013-02-27 22:10:37 +00:00
Nadav Rotem 00b75dd3c4 The FastISEL should be fast. But when we record statistics we use atomic operations to increment the counters.
This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%.

llvm-svn: 176214
2013-02-27 21:59:43 +00:00
David Blaikie 9aa8e0b30a Copy missing member in DataLayout copy ctor.
Test case is missing due to it not being reachable through the current tools
but out of tree code such as the sample at
http://llvm.org/docs/tutorial/LangImpl4.html

Patch by Peng Cheng <gm4cheng@gmail.com>

llvm-svn: 176213
2013-02-27 21:44:59 +00:00
Jim Grosbach 5f21587648 ARM: FMA is legal only if VFP4 is available.
rdar://13306723

llvm-svn: 176212
2013-02-27 21:31:12 +00:00