Commit Graph

169212 Commits

Author SHA1 Message Date
Ted Kremenek c980afc578 [-Wunreachable-code] Tweak heuristic for configuration values to include arithmetic operations involving sizeof(), but not raw integers.
This case was motivated by a false positive with the
llvm::AlignOf<> specialization in LLVM.

llvm-svn: 203363
2014-03-08 23:20:11 +00:00
Aaron Ballman b97112e4bd [C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.

llvm-svn: 203362
2014-03-08 22:19:01 +00:00
Adam Nemet 4203039760 Update comment from r203315 based on review
llvm-svn: 203361
2014-03-08 21:51:55 +00:00
Argyrios Kyrtzidis 8ed7414e58 [Preprocessor] Only check for -Wunused-macros if the translation unit kind is TU_Complete.
llvm-svn: 203360
2014-03-08 21:18:26 +00:00
Saleem Abdulrasool 9174593d09 POSIX: fix possible API misuse
memcpy cannot be passed NULL.  Ensuring that the destination pointer is non-NULL
requires checking success.  Rather than performing the success check at that
point, increasing indentation an additional level, fold it into the previous
statement.

llvm-svn: 203359
2014-03-08 20:47:12 +00:00
Saleem Abdulrasool d41fca11af POSIX: fix possible invalid API usage
strcmp cannot be passed a NULL.  Add a short-circuiting check to avoid the
possible API misuse.

llvm-svn: 203358
2014-03-08 20:47:07 +00:00
Saleem Abdulrasool 03700ded1b POSIX: add missing curly braces
It seems that the original commit missed the curly braces for the scope, always
doing the string comparision.

llvm-svn: 203357
2014-03-08 20:47:03 +00:00
Aaron Ballman 7fad360fe3 Adding some includes to appease build bots. Amends r203354
llvm-svn: 203356
2014-03-08 20:15:31 +00:00
Aaron Ballman e8a8baef44 [C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman 1b91204e3d Adding range-based STL-like helper APIs. llvm::distance() is the range version of std::distance. llvm::copy is the range version of std::copy.
llvm-svn: 203354
2014-03-08 20:11:24 +00:00
Aaron Ballman 23a6dcb365 [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203353
2014-03-08 18:45:14 +00:00
Lang Hames 951b235be2 Make createObjectImage and createObjectImageFromFile static methods on the
relevant subclasses of RuntimeDyldImpl. This allows construction of
RuntimeDyldImpl instances to be deferred until after the target architecture is
known.

llvm-svn: 203352
2014-03-08 18:45:12 +00:00
Aaron Ballman 43027eb093 Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
llvm-svn: 203351
2014-03-08 18:30:40 +00:00
Virgile Bello 2756adf377 Implement ObjectFilePECOFF::SetLoadAddress().
llvm-svn: 203350
2014-03-08 17:17:20 +00:00
Virgile Bello ffeba25652 Remove %zx in printf (only GCC supports it, not MSVC).
llvm-svn: 203349
2014-03-08 17:15:35 +00:00
Virgile Bello da0fc76e7f Add inttypes.h to SBQueue.cpp (MSVC compilation error with PRIx32).
llvm-svn: 203348
2014-03-08 16:22:55 +00:00
Duncan P. N. Exon Smith 429d2608f9 Change else if => if after return, after r203265
llvm-svn: 203347
2014-03-08 15:15:42 +00:00
Ahmed Charles 007bf9a541 Fix 80 cols.
llvm-svn: 203346
2014-03-08 12:51:31 +00:00
Craig Topper e56917c0ca [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203345
2014-03-08 08:27:28 +00:00
Craig Topper b51ff603ea [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203344
2014-03-08 07:51:20 +00:00
Adam Nemet 5f9eb0af72 [bugpoint] Don't ignore arg in -compile-commad="tool arg"
Args is an output parameter of the function lexCommand but the reference
operator was missed.

llvm-svn: 203343
2014-03-08 07:48:19 +00:00
Craig Topper 59be68f05f [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203342
2014-03-08 07:14:16 +00:00
Craig Topper 12f0ca454b De-virtualize a method since it doesn't override anything (yay 'override' keyword) and its class is in an anonymous namespace.
llvm-svn: 203341
2014-03-08 07:07:08 +00:00
Craig Topper 34a61bc97a [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203340
2014-03-08 07:02:02 +00:00
Craig Topper 7b883b314c [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203339
2014-03-08 06:31:39 +00:00
Adrian Prantl cece9ccaf1 Revert "Experimentally enable --verify-debug-info on some testcases and see if"
Some of the buildbots need to be upgraded to a more recen version of
dwarfdump first.

Reverting for now.

llvm-svn: 203338
2014-03-08 02:46:36 +00:00
David Blaikie 078278fe3a DebugInfo: further improvements to test following up on r203329
llvm-svn: 203337
2014-03-08 02:45:53 +00:00
Ted Kremenek efea63450b [-Wunreachabe-code] Don't warn about unreachable destructors for temporaries.
This can possibly be refined later, but right now the experience
is so incomprehensible for a user to understand what is going on
this isn't a useful warning.

llvm-svn: 203336
2014-03-08 02:22:32 +00:00
Ted Kremenek fcc1417fad Fix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
llvm-svn: 203335
2014-03-08 02:22:29 +00:00
Ted Kremenek ff909f907c [CFG] Record would-be successor for noreturn destructor.
llvm-svn: 203334
2014-03-08 02:22:25 +00:00
Ted Kremenek 04bfbeea04 [-Wunreachable-code] Handle 'return' with no argument dominated by 'noreturn' function.
llvm-svn: 203333
2014-03-08 02:22:23 +00:00
Jason Molenda 53b8ea1c89 Need to use rm -rf on dSYM bundle directories.
llvm-svn: 203332
2014-03-08 01:53:27 +00:00
Rui Ueyama 0b87794f2b Remove extra space.
llvm-svn: 203331
2014-03-08 01:45:39 +00:00
Jason Molenda ac605f4a3a Add API logging to the SBQueue/SBQueueItem/SBThread calls.
llvm-svn: 203330
2014-03-08 01:34:55 +00:00
David Blaikie f528f054d0 DebugInfo: Fix test fallout from r203323
Will fix this harder in a moment.

llvm-svn: 203329
2014-03-08 01:32:51 +00:00
Rui Ueyama 2348be8b6d Add one more test for r203308.
llvm-svn: 203328
2014-03-08 01:27:22 +00:00
Adrian Prantl f3c43d14d9 Experimentally enable --verify-debug-info on some testcases and see if
the buildbots can take it.

llvm-svn: 203327
2014-03-08 01:23:49 +00:00
Adrian Prantl 8b466d5474 Add back the original version of the test, too. (as XFAILed on Darwin)
llvm-svn: 203326
2014-03-08 01:21:37 +00:00
Rafael Espindola 181d29782e Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

The name CLANG_IS_PRODUCTION is historical. We should probably change it, but
should change the configure build at the same time.

llvm-svn: 203325
2014-03-08 01:19:37 +00:00
Adrian Prantl 32347758b3 Work around a bug in LLDB (it finds the wrong "C", rdar://problem/14933867)
and enable this test on Darwin.

llvm-svn: 203324
2014-03-08 01:03:55 +00:00
David Blaikie 26ab6c6dd5 DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in DW_TAG_lexical_blocks
Suggested by Adrian Prantl in code review for r203187

llvm-svn: 203323
2014-03-08 00:58:20 +00:00
Rui Ueyama 7caea31189 Fix a bug that mergeCases table does not match the merge constants.
MergeCases table should not have an entry for MergeContents because atoms with
MergeContents attribute should never have name. This issue was not caught by a
test because getting a value of 6th element of an array of array actually gets
the first element's value of the next array, and that happened to be a valid
value. Added asserts to catch that error.

llvm-svn: 203322
2014-03-08 00:44:01 +00:00
Rafael Espindola bc28340573 Revert "Add an option to disable plugins in clang."
This reverts commit r203320.

There is some order dependency going on that I missed.

llvm-svn: 203321
2014-03-08 00:41:53 +00:00
Rafael Espindola 8c49cd1b06 Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

llvm-svn: 203320
2014-03-08 00:33:15 +00:00
Eric Christopher 4f17ee09f9 Add support for hashing location information for CU level hashes.
Add a testcase based on sret.cpp where we can now hash the entire
compile unit.

llvm-svn: 203319
2014-03-08 00:29:41 +00:00
Richard Smith 664b32b814 Revert accidentally-committed file.
llvm-svn: 203318
2014-03-08 00:04:19 +00:00
Richard Smith 9bca298f6d Module [extern_c] attribute: inherit to submodules, don't write 'extern "C"'
blocks when building in C mode, and serialize and deserialize the attribute.

llvm-svn: 203317
2014-03-08 00:03:56 +00:00
Adam Nemet 7f928f14f4 [DAGCombiner] Distribute TRUNC through AND in rotation amount
This is already done for shifts.  Allow it for rotations as well. E.g.:

   (rotl:i32 x, (trunc (and y, 31))) -> (rotl:i32 x, (and (trunc y), 31))

Use the newly factored-out distributeTruncateThroughAnd.

With this patch and some X86.td tweaks we should be able to remove redundant
masking of the rotation amount like in the example above.  HW implicitly
performs this masking.

The testcase will be added as part of the X86 patch.

llvm-svn: 203316
2014-03-07 23:56:30 +00:00
Adam Nemet 5117f5dffc [DAGCombiner] Recognize another rotation idiom
This is the new idiom:

  x<<(y&31) | x>>((0-y)&31)

which is recognized as:

  x ROTL (y&31)

The change refines matchRotateSub.  In
Neg & (OpSize - 1) == (OpSize - Pos) & (OpSize - 1), if Pos is
Pos' & (OpSize - 1) we can just use Pos' instead of Pos.

llvm-svn: 203315
2014-03-07 23:56:28 +00:00
Adam Nemet c6553a8354 [DAGCombiner] Slightly improve readability of matchRotateSub
Slightly change the wording in the function comment. Originally, it can be
misunderstood as we turned the input into two subsequent rotates.

Better connect the comment which talks about Mask and the code which used
LoBits.  Renamed variable to MaskLoBits.

llvm-svn: 203314
2014-03-07 23:56:24 +00:00