summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Adds a clang-tidy test for a failing assertion in the misc-misplaced-const ↵Aaron Ballman2018-03-021-0/+15
| | | | | | | | check. The test case previously triggered an assertion in the AST matchers because the QualType being matched is invalid. That is no longer the case after r326604. llvm-svn: 326605
* [clang-tidy] Another batch of checks to rename from misc- to bugprone-.Alexander Kornienko2018-02-289-22/+22
| | | | | | | | | | | | | | | | Summary: clang-tidy/rename_check.py {misc,bugprone}-suspicious-semicolon clang-tidy/rename_check.py {misc,bugprone}-suspicious-string-compare clang-tidy/rename_check.py {misc,bugprone}-swapped-arguments clang-tidy/rename_check.py {misc,bugprone}-undelegated-constructor --check_class_name UndelegatedConstructor Reviewers: hokein, sammccall, aaron.ballman Subscribers: klimek, mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D43870 llvm-svn: 326386
* Rename more checks from misc- to bugprone-.Alexander Kornienko2018-02-285-10/+10
| | | | | | | | | | | | | | | | Summary: clang-tidy/rename_check.py {misc,bugprone}-string-integer-assignment clang-tidy/rename_check.py {misc,bugprone}-string-literal-with-embedded-nul clang-tidy/rename_check.py {misc,bugprone}-suspicious-enum-usage clang-tidy/rename_check.py {misc,bugprone}-suspicious-missing-comma Reviewers: hokein, sammccall, aaron.ballman Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D43868 llvm-svn: 326384
* [clangd] Try to fix failures on clang-x64-ninja-win7 build bot.Eric Liu2018-02-285-9/+9
| | | | llvm-svn: 326365
* Rename a few checks from misc- to bugprone-.Alexander Kornienko2018-02-285-14/+14
| | | | | | | | | | | | | | | | | | Summary: rename_check.py {misc,bugprone}-forwarding-reference-overload rename_check.py {misc,bugprone}-macro-repeated-side-effects rename_check.py {misc,bugprone}-lambda-function-name rename_check.py {misc,bugprone}-misplaced-widening-cast Reviewers: hokein, sammccall, aaron.ballman Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D43867 llvm-svn: 326327
* [clang-tidy] Add a test for readability-implicit-bool-conversion with bitfields.Alexander Kornienko2018-02-281-0/+6
| | | | llvm-svn: 326314
* [clangd] don't insert new includes if either original header or canonical ↵Eric Liu2018-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | header is already included. Summary: Changes: o Store both the original header and the canonical header in LSP command. o Also check that both original and canonical headers are not already included by comparing both resolved header path and written literal includes. This addresses the use case where private IWYU pragma is defined in a private header while it would still be preferrable to include the private header, in the internal implementation file. If we have seen that the priviate header is already included, we don't try to insert the canonical include. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43510 llvm-svn: 326070
* [clang-tidy/google] Improve the Objective-C global variable declaration ↵Yan Zhang2018-02-251-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check 🔧 Summary: The current Objective-C global variable declaration check restricts naming that is permitted by the Google Objective-C style guide. The Objective-C style guide states the following: "Global and file scope constants should have an appropriate prefix. [...] Constants may use a lowercase k prefix when appropriate" http://google.github.io/styleguide/objcguide#constants This change fixes the check to allow two or more capital letters as an appropriate prefix. This change intentionally avoids making a decision regarding whether to flag constants that use a two letter prefix (two letter prefixes are reserved by Apple¹ but many projects seem to violate this guideline). This change eliminates an important category of false positives (constants prefixed with '[A-Z]{2,}') at the cost of introducing a less important category of false negatives (constants prefixed with only '[A-Z]'). The false positives are observed in standard recommended code while the false negatives occur in non-standard unrecommended code. The number of eliminated false positives is expected to be significantly larger than the number of exposed false negatives. ❧ (1) "Two-letter prefixes like these are reserved by Apple for use in framework classes." https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html Reviewers: aaron.ballman, Wizard, hokein, benhamilton Reviewed By: aaron.ballman, Wizard Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D43581 llvm-svn: 326046
* [clang-tidy] Replace the usage of std::uncaught_exception with ↵Gabor Horvath2018-02-201-0/+79
| | | | | | | | | | std::uncaught_exceptions Patch by: Daniel Kolozsvari! Differential Revision: https://reviews.llvm.org/D40787 llvm-svn: 325572
* [clangd] Implement textDocument/hoverMarc-Andre Laperle2018-02-163-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Implemention of textDocument/hover as described in LSP definition. This patch adds a basic Hover implementation. When hovering a variable, function, method or namespace, clangd will return a text containing the declaration's scope, as well as the declaration of the hovered entity. For example, for a variable: Declared in class Foo::Bar int hello = 2 For macros, the macro definition is returned. This patch doesn't include: - markdown support (the client I use doesn't support it yet) - range support (optional in the Hover response) - comments associated to variables/functions/classes They are kept as future work to keep this patch simpler. I added tests in XRefsTests.cpp. hover.test contains one simple smoketest to make sure the feature works from a black box perspective. Reviewers: malaperle, krasimir, bkramer, ilya-biryukov Subscribers: sammccall, mgrang, klimek, rwols, ilya-biryukov, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D35894 Signed-off-by: Simon Marchi <simon.marchi@ericsson.com> Signed-off-by: William Enright <william.enright@polymtl.ca> llvm-svn: 325395
* [clangd] collect symbol #include & insert #include in global code completion.Eric Liu2018-02-164-5/+41
| | | | | | | | | | | | | | | | | | Summary: o Collect suitable #include paths for index symbols. This also does smart mapping for STL symbols and IWYU pragma (code borrowed from include-fixer). o For global code completion, add a command for inserting new #include in each code completion item. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, jkorous-apple, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42640 llvm-svn: 325343
* [clang-tidy] Add `readability-simd-intrinsics` check.Fangrui Song2018-02-152-0/+38
| | | | | | | | | | | | | | | | | | | | | Summary: Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX, ARM NEON). It is common that SIMD code implementing the same algorithm, is written in multiple target-dispatching pieces to optimize for different architectures or micro-architectures. The C++ standard proposal P0214 and its extensions cover many common SIMD operations. By migrating from target-dependent intrinsics to P0214 operations, the SIMD code can be simplified and pieces for different targets can be unified. Refer to http://wg21.link/p0214 for introduction and motivation for the data-parallel standard library. Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42983 llvm-svn: 325272
* [clangd] Use explicit env in test to make lit+windows happy. NFCSam McCall2018-02-151-1/+1
| | | | llvm-svn: 325257
* [clangd] Enable snippet completion based on client capabilities.Ilya Biryukov2018-02-151-0/+43
| | | | | | | | | | | | | | Summary: And remove -enable-snippets flag. Reviewers: hokein, ioeric, sammccall Reviewed By: ioeric Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43229 llvm-svn: 325242
* [clang-tidy] Make a test pass on platforms where exceptions disabled by default.Gabor Horvath2018-02-151-1/+1
| | | | llvm-svn: 325225
* [clang-tidy] New checker for exceptions that are created but not thrownGabor Horvath2018-02-151-0/+167
| | | | | | | | Patch by: Kristof Umann Differential Revision: https://reviews.llvm.org/D43120 llvm-svn: 325222
* [clangd] Fix tracing now that spans lifetimes can overlap on a thread.Sam McCall2018-02-151-13/+17
| | | | | | | | | | | | | | | | | | | | | | | Summary: The chrome trace viewer requires events within a thread to strictly nest. So we need to record the lifetime of the Span objects, not the contexts. But we still want to show the relationship between spans where a context crosses threads, so do this with flow events (i.e. arrows). Before: https://photos.app.goo.gl/q4Dd9u9xtelaXk1v1 After: https://photos.app.goo.gl/5RNLmAMLZR3unvY83 (This could stand some further improvement, in particular I think we want a container span whenever we schedule work on a thread. But that's another patch) Reviewers: ioeric Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43272 llvm-svn: 325220
* [clangd] Configure clangd tracing with CLANGD_TRACE env instead of -trace flagSam McCall2018-02-141-1/+1
| | | | llvm-svn: 325097
* [clang-tidy] Update fuchsia-multiple-inheritance to not failJulie Hockett2018-02-131-0/+3
| | | | | | | | | | | | Updating the fuchsia-multiple-inheritance to gracefully handle unknown record types (e.g. templatized classes) by simply continuing, rather than asserting and failing. Fixes PR36052. Differential Revision: https://reviews.llvm.org/D43223 llvm-svn: 325015
* test: use target triple for the testSaleem Abdulrasool2018-02-071-1/+1
| | | | | | | | Now that `pragma comment` is also used on ELF-ish targets with a restricted set of options, we need to specify the full target here for the test. llvm-svn: 324441
* [clang-tidy] Update fuchsia-multiple-inheritance to check for templatesJulie Hockett2018-02-071-0/+2
| | | | | | | | | | | Updating fuchsia-multiple-inheritance to not crash when a record inherits a template. Fixes PR36052. Differential Revision: https://reviews.llvm.org/D42918 llvm-svn: 324432
* Support special acronyms inside property names and allow plural formsYan Zhang2018-02-061-0/+3
| | | | | | | | | | | | Reviewers: benhamilton, hokein Reviewed By: benhamilton, hokein Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42947 llvm-svn: 324407
* [clangd] Attempt to unbreak windows buildbots.Ilya Biryukov2018-02-061-1/+1
| | | | | | | Some buildbots are breaking on trace.test due to using Linux's path separators. This commit should unbreak them. llvm-svn: 324382
* [clangd] Cut input-mirror.test down to size. NFCSam McCall2018-02-061-143/+0
| | | | llvm-svn: 324334
* [clangd] Support simpler JSON-RPC stream parsing for lit tests.Sam McCall2018-02-0618-1170/+990
| | | | | | | | | | | | | | Summary: Instead of content-length, we delimit messages with ---. This also removes the need for (most) dos-formatted test files. Reviewers: ioeric Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D42919 llvm-svn: 324333
* [clang-tidy] ObjC ARC objects should not trigger ↵Ben Hamilton2018-02-022-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance-unnecessary-value-param Summary: The following Objective-C code currently incorrectly triggers clang-tidy's performance-unnecessary-value-param check: ``` % cat /tmp/performance-unnecessary-value-param-arc.m void foo(id object) { } clang-tidy /tmp/performance-unnecessary-value-param-arc.m -checks=-\*,performance-unnecessary-value-param -- -xobjective-c -fobjc-abi-version=2 -fobjc-arc 1 warning generated. /src/llvm/tools/clang/tools/extra/test/clang-tidy/performance-unnecessary-value-param-arc.m:10:13: warning: the parameter 'object' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param] void foo(id object) { } ~~ ^ const & ``` This is wrong for a few reasons: 1) Objective-C doesn't have references, so `const &` is not going to help 2) ARC heavily optimizes the "expensive" copy which triggers the warning This fixes the issue by disabling the warning for non-C++, as well as disabling it for objects under ARC memory management for Objective-C++. Fixes https://bugs.llvm.org/show_bug.cgi?id=32075 Test Plan: New tests added. Ran tests with `make -j12 check-clang-tools`. Reviewers: alexfh, hokein Reviewed By: hokein Subscribers: stephanemoore, klimek, xazax.hun, cfe-commits, Wizard Differential Revision: https://reviews.llvm.org/D42812 llvm-svn: 324097
* [clang-tidy] misc-redundant-expression: fix a crash under ubsanAlexander Kornienko2018-02-011-2/+7
| | | | llvm-svn: 323980
* [clangd] Add a test URI scheme for lit tests to unbreak platform-specific ↵Eric Liu2018-01-3116-145/+129
| | | | | | | | | | | | | | | | URI failures. Summary: This should also fix the current windows buildbot breakage (http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/9838/steps/ninja%20check%201/logs/stdio) Reviewers: sammccall Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D42735 llvm-svn: 323885
* clang-tidy/rename_check.py misc-incorrect-roundings bugprone-incorrect-roundingsAlexander Kornienko2018-01-301-2/+2
| | | | | | | | More specifically, clang-tidy/rename_check.py misc-incorrect-roundings \ bugprone-incorrect-roundings --check_class_name IncorrectRoundings llvm-svn: 323768
* clang-tidy/rename_check.py misc-string-compare readability-string-compareAlexander Kornienko2018-01-301-3/+3
| | | | llvm-svn: 323766
* add prefix with '_' support for property name. Corresponding apple dev doc: ↵Yan Zhang2018-01-303-7/+27
| | | | | | | | | | | | | | https://developer.apple.com/library/content/qa/qa1908/_index.html Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42464 llvm-svn: 323722
* [clangd] Add ClangdUnit diagnostics tests using annotated code.Sam McCall2018-01-251-22/+0
| | | | | | | | | | | | | | | | | | | Summary: This adds checks that our diagnostics emit correct ranges in a bunch of cases, as promised in D41118. The diagnostics-preamble test is also converted and extended to be a little more precise. diagnostics.test stays around as the smoke test for this feature. Reviewers: ilya-biryukov Subscribers: klimek, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41454 llvm-svn: 323448
* [clang-tidy] Handle bitfields in cppcoreguidelines-pro-type-member-init if ↵Malcolm Parsons2018-01-232-0/+20
| | | | | | | | | | | | | | | | | | using C++2a Summary: C++2a allows bitfields to have default member initializers. Add support for this to clang-tidy's cppcoreguidelines-pro-type-member-init check. Reviewers: aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: klimek, nemanjai, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D42426 llvm-svn: 323227
* [clang-tidy] Handle bitfields in modernize-use-default-member-init if using ↵Malcolm Parsons2018-01-231-0/+10
| | | | | | | | | | | | | | | | | | C++2a Summary: C++2a allows bitfields to have default member initializers. Add support for this to clang-tidy's modernize-use-default-member-init check. Reviewers: aaron.ballman, alexfh Reviewed By: aaron.ballman Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D42413 llvm-svn: 323208
* [clang-tidy] Add -vfsoverlay flagIlya Biryukov2018-01-233-0/+21
| | | | | | | | | | | | | | | | | | | | | Summary: It allows to remap and override files and directories on disk when running clang-tidy. The intended use case for the flag is running standalone clang-tidy binary for IDE and editor integration. Patch by Vladimir Plyashkun. Reviewers: alexfh, benlangmuir, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D41535 llvm-svn: 323196
* [clang-tidy] Don't generate fixes for invalid new expr location in ↵Haojian Wu2018-01-231-0/+9
| | | | | | | | | | | | | | modernize-make-unique. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D42363 llvm-svn: 323191
* [clang-tidy objc-property-declaration] New option IncludeDefaultAcronymsBen Hamilton2018-01-222-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The existing option objc-property-declaration.Acronyms replaces the built-in set of acronyms. While this behavior is OK for clients that don't want the default behavior, many clients may just want to add their own custom acronyms to the default list. This revision introduces a new option, objc-property-declaration.IncludeDefaultAcronyms, which controls whether the acronyms in objc-property-declaration.Acronyms are appended to the default list (the default behavior) or whether they replace. I also updated the documentation. Test Plan: make -j12 check-clang-tools Reviewers: Wizard, hokein, klimek Reviewed By: hokein Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: https://reviews.llvm.org/D42261 llvm-svn: 323130
* Assume the shared library path variable is LD_LIBRARY_PATH on systemsDimitry Andric2018-01-201-4/+3
| | | | | | | | except Darwin and Windows. This prevents inserting an environment variable with an empty name (which is illegal and leads to a Python exception) on any of the BSDs. llvm-svn: 323040
* [clang-tidy] Adding Fuchsia checker for multiple inheritanceJulie Hockett2018-01-191-0/+131
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn when a class inherits from multiple classes that are not pure virtual. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D40580 llvm-svn: 323011
* [clang-tidy objc-property-declaration] Expand list of ObjC acronymsBen Hamilton2018-01-181-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: We were missing some pretty common acronyms in the camelCase property name check objc-property-declaration. This expands the list and sorts it lexicographically, so we can avoid duplicates. Test Plan: make -j12 check-clang-tools Reviewers: Wizard, hokein, klimek Reviewed By: Wizard Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42253 llvm-svn: 322886
* [clang-tidy] Don't generate fix for argument constructed from ↵Haojian Wu2018-01-182-0/+14
| | | | | | | | | | | | | | | | | | | | | | std::initializer_list. Summary: A follow-up fix of rL311652. The previous `vector` in our test is different with `std::vector`, so The check still generates fixes for std::vector (`auto p = std::unique_ptr<Foo>(new Foo({1,2,3}))`) in real world, the patch makes the vector behavior in test align with std::vector (both AST nodes are the same now). Reviewers: ilya-biryukov, alexfh Reviewed By: ilya-biryukov Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41852 llvm-svn: 322822
* [clang-tidy] Adding Fuchsia checker for trailing returnsJulie Hockett2018-01-171-0/+23
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if a function has a trailing return. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D42116 llvm-svn: 322759
* [clang-tidy] Fixing Fuchsia overloaded operator warning messageJulie Hockett2018-01-171-5/+5
| | | | | | | | Updating Fuchsia overloaded operator warning message for clarity. Differential Revision: https://reviews.llvm.org/D42120 llvm-svn: 322692
* [clangd] Don't crash on LSP calls for non-added filesIlya Biryukov2018-01-171-0/+45
| | | | | | | | | | | | | | | | | | | | | Summary: We will return errors for non-added files for now. Another alternative for clangd would be to read non-added files from disk and provide useful features anyway. There are still some cases that fail with assertion (e.g., code complete). We should address those too, but they require more subtle changes to the code and therefore out of scope of this patch. Reviewers: sammccall, ioeric, hokein Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42164 llvm-svn: 322637
* [clang-tidy] implement check for gotoJonas Toth2018-01-171-0/+139
| | | | | | | | | | | | | | | | | | | | The usage of `goto` is discourage in C++ since forever. This check implements a warning for every `goto`. Even though there are (rare) valid use cases for `goto`, better high level constructs should be used. `goto` is used sometimes in C programs to free resources at the end of functions in the case of errors. This pattern is better implemented with RAII in C++. Reviewers: aaron.ballman, alexfh, hokein Reviewed By: aaron.ballman Subscribers: lebedev.ri, jbcoe, Eugene.Zelenko, klimek, nemanjai, mgorny, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D41815 llvm-svn: 322626
* add ID as a special acronym to objc property declaration check for property ↵Yan Zhang2018-01-171-0/+1
| | | | | | | | | | | | | | names like bundleID.allow using acronyms as suffix. Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42143 llvm-svn: 322602
* [clang-tidy] Expand readability-redundant-smartptr-get to understand ↵Samuel Benzaquen2018-01-151-4/+22
| | | | | | | | | | | | | | implicit converions to bool in more contexts. Summary: Expand readability-redundant-smartptr-get to understand implicit converions to bool in more contexts. Reviewers: hokein Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41998 llvm-svn: 322497
* [clang-tidy] Adding Fuchsia checker for statically constructed objectsJulie Hockett2018-01-111-0/+91
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if statically-stored objects are created, unless constructed with `constexpr`. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D41546 llvm-svn: 322310
* [clang-tidy] Fix google-readability-namespace-comments handling of C++17 ↵Alexander Kornienko2018-01-111-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | nested namespaces Summary: Fixes bug 34701 When we encounter a namespace find the location of the left bracket. Then if the text between the name and the left bracket contains a ':' then it's a C++17 nested namespace. Reviewers: #clang-tools-extra, alexfh, aaron.ballman Reviewed By: aaron.ballman Subscribers: curdeius, cfe-commits, krasimir, JonasToth, JDevlieghere, xazax.hun Tags: #clang-tools-extra Patch by Alexandru Octavian Buțiu! Differential Revision: https://reviews.llvm.org/D38284 llvm-svn: 322274
* [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation ↵Samuel Benzaquen2018-01-081-1/+5
| | | | | | | | | | | | | | | | between basic_string and basic_string_view. Summary: Fix DanglingHandleCheck to handle the final implementation of std::string and std::string_view. These use a conversion operator instead of a conversion constructor. Reviewers: hokein Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41779 llvm-svn: 322002
OpenPOWER on IntegriCloud