summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* clang-format: Improve nested block / lambda indentation when wrappingDaniel Jasper2015-05-132-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | before binary/ternary operators. Basically, it doesn't seem right to indent a nested block aligned to a binary or ternary operator. Before: int i = aaaaaa ? 1 // : [] { return 2; // }(); llvm::errs() << "number of twos is " << std::count_if(v.begin(), v.end(), [](int x) { return x == 2; // force break }); After: int i = aaaaaa ? 1 // : [] { return 2; // }(); llvm::errs() << "number of twos is " << std::count_if(v.begin(), v.end(), [](int x) { return x == 2; // force break }); llvm-svn: 237263
* clang-format: Fix incorrect */& classification.Daniel Jasper2015-05-132-0/+5
| | | | | | | | | | Before: void f() { f(new a(), c *d); } After: void f() { f(new a(), c * d); } llvm-svn: 237249
* clang-format: Fix semicolon less macro-detection.Daniel Jasper2015-05-132-5/+13
| | | | | | | | | | | | | | It was fooled by the comment. Before: SOME_UNRELATED_MACRO /*static*/ int i; After: SOME_UNRELATED_MACRO /*static*/ int i; llvm-svn: 237246
* clang-format: [ObjC] Further improve wrapping of methods calls without inputs.Daniel Jasper2015-05-132-1/+4
| | | | | | | | | | | | Before: [aaaaaaaaaaaaaaaaaaaaaaa .aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa] aaaaaaaaaaaaaaaaaaaaaa]; After: [aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa] aaaaaaaaaaaaaaaaaaaaaa]; llvm-svn: 237244
* [OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.Alexey Bataev2015-05-132-11/+51
| | | | | | In some rare cases shared copies of lastprivate/firstprivate variables were not updated after the loop directive. llvm-svn: 237243
* clang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functionsDaniel Jasper2015-05-132-2/+24
| | | | llvm-svn: 237241
* clang-format: Prefer formatting local lambdas like functions.Daniel Jasper2015-05-132-0/+6
| | | | | | | | | | | | | Before: auto my_lambda = [](const string &some_parameter) { return some_parameter.size(); }; After: auto my_lambda = [](const string &some_parameter) { return some_parameter.size(); }; llvm-svn: 237235
* clang-format: Support column layout with comment after {.Daniel Jasper2015-05-132-4/+12
| | | | | | | | | | | | | | | | Before: vector<int> iiiiiiiiiiiiiii = { // 1111111111, 2222222222, 33333333333, 4444444444, // 111111111, 222222222, 3333333333, 444444444, // 11111111, 22222222, 333333333, 44444444}; After: vector<int> iiiiiiiiiiiiiii = { // 1111111111, 2222222222, 33333333333, 4444444444, // 111111111, 222222222, 3333333333, 444444444, // 11111111, 22222222, 333333333, 44444444}; llvm-svn: 237233
* Have '__have_extension(cxx_variadic_templates)' return true for any C++ ↵Eric Fiselier2015-05-122-0/+6
| | | | | | standard. llvm-svn: 237202
* Add missing #includes, found by modules build.Richard Smith2015-05-122-0/+5
| | | | llvm-svn: 237194
* Add a new error for unexpected semi-colon before closing delimiter.Richard Trieu2015-05-124-4/+25
| | | | | | | | | Previously, if a semi-colon is unexpectedly added before a closing ')', ']' or '}', two errors and one note would emitted, and the parsing would get confused to which scope it was in. This change consumes the semi-colon, recovers parsing better, and emits only one error with a fix-it. llvm-svn: 237192
* InstrProf: Update name of compiler-rt routine for setting filenameJustin Bogner2015-05-121-2/+2
| | | | | | Patch by Teresa Johnson. llvm-svn: 237187
* clang-format AllocateTarget. NFCDouglas Katzman2015-05-121-16/+16
| | | | llvm-svn: 237183
* List Alexey Bataev as code owner for Clang's OpenMP support, as discussed ↵Richard Smith2015-05-121-0/+4
| | | | | | | | offline. Thanks for all your hard work getting us OpenMP feature-complete, Alexey! llvm-svn: 237171
* Fixed double-free in case of module loading error.Artem Belevich2015-05-122-2/+7
| | | | | | | | | | | | | GetOutputStream() owns the stream it returns pointer to and the pointer should never be freed by us. When we fail to load and exit early, unique_ptr still holds the pointer and frees it which leads to compiler crash when CompilerInstance attempts to free it again. Added regression test for failed bitcode linking. Differential Revision: http://reviews.llvm.org/D9625 llvm-svn: 237159
* Changed renaming of local symbols by inserting a dot vefore the numeric suffixSunil Srivastava2015-05-1235-82/+82
| | | | | | | details in http://reviews.llvm.org/D9483 goes with llvm checkin r237150 llvm-svn: 237151
* Fix clang-format build from the solution; the underlying path has changed to ↵Manuel Klimek2015-05-121-2/+2
| | | | | | include the VS directory structure. llvm-svn: 237136
* Remove superfluous SmallString cast.Yaron Keren2015-05-121-1/+1
| | | | llvm-svn: 237123
* Fix misleading parameter name for PPCallbacks::FileSkipped.Nikola Smiljanic2015-05-122-9/+10
| | | | | | Patch thanks to Vladimir Voskresensky. llvm-svn: 237115
* clang-format: Make member introduced in r237108 const.Daniel Jasper2015-05-121-2/+1
| | | | llvm-svn: 237114
* Change TargetParser enum names to avoid macro conflicts (clang)Renato Golin2015-05-121-14/+14
| | | | | | | | | sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1" using a cpp macro. The result is that this fails to compile. Fixes https://llvm.org/PR23482 llvm-svn: 237113
* clang-format: Fix */& detection for lambdas in macros.Daniel Jasper2015-05-122-5/+6
| | | | | | | | | | Before: #define MACRO() [](A * a) { return 1; } After: #define MACRO() [](A *a) { return 1; } llvm-svn: 237109
* clang-format: Fix hanging nested blocks in macros.Daniel Jasper2015-05-122-2/+16
| | | | | | | | | | | | | | | | | | | | Before: #define MACRO() \ Debug(aaa, /* force line break */ \ { \ int i; \ int j; \ }) After: #define MACRO() \ Debug(aaa, /* force line break */ \ { \ int i; \ int j; \ }) llvm-svn: 237108
* Refactor clang-format's formatter.Manuel Klimek2015-05-123-166/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: a) Pull out a class LevelIndentTracker whose responsibility is to keep track of the indent of levels across multiple annotated lines. b) Put all responsibility for merging lines into the LineJoiner; make the LineJoiner iterate over the lines so we never operate on a line that might be merged later; this makes the interface safer to use. c) Move formatting of the end-of-file whitespace into formatFirstToken. Fix bugs that became obvious after the refactoring: 1. We would not format lines with offsets correctly inside nested blocks if only the outer expression was affected: int x = s({ // clang-format only this line class X { public: // ^ this starts at the non-modified indnent level; previously we would // not fix this, now we correctly outdent it. void f(); }; }); 2. We would incorrectly align comments across lines that do not have comments for lines with nested blocks: int expression; // with comment int x = s({ int y; // comment int z; // we would incorrectly align this comment with the comment on // 'expression' }); llvm-svn: 237104
* [OPENMP] Allow using of threadprivate variables as loop-control variables in ↵Alexey Bataev2015-05-126-15/+10
| | | | | | lop based directives. llvm-svn: 237102
* [OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.Alexey Bataev2015-05-1210-30/+137
| | | | | | 'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region. llvm-svn: 237100
* Driver: Fix a -Wshadow issue from r237091Justin Bogner2015-05-123-3/+16
| | | | | | | | | | The MachO toolchain has an isTargetIOSBased method, but it isn't virtual so it isn't very meaningful to call it. After thinking about this, I guess that putting this logic in the MachO class is a bit of a layering violation anyway. Do this more like how we handle AddLinkRuntimeLibArgs instead. llvm-svn: 237095
* Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-124-14/+55
| | | | | | | | This time without a stray "true" in an argument list. This reverts r237077, restoring r237074. llvm-svn: 237091
* revert r237081 -- bad idea (-lcrypt may not be present)Kostya Serebryany2015-05-122-2/+0
| | | | llvm-svn: 237086
* add -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)Kostya Serebryany2015-05-122-1/+3
| | | | llvm-svn: 237081
* Remove the code that pulled soft float attributes out of the featureEric Christopher2015-05-123-15/+7
| | | | | | | strings and remove the setting of TargetOptions::UseSoftFloat to match the code change in llvm r237079. llvm-svn: 237080
* Revert "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-124-55/+14
| | | | | | This revert r237074. These tests are failing all over the place. llvm-svn: 237077
* Driver: Make profiling flags work with -nostdlib on DarwinJustin Bogner2015-05-124-14/+55
| | | | | | | | | | | | | Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib shouldn't prevent it from being linked. This makes Darwin behave like other toolchains, and link in the profile runtime irrespective of -nostdlib, since the resulting program can't be run unless you link this. I've also added a test to show that other toolchains already behave like this. llvm-svn: 237074
* Allow empty assembly string literal with -fno-gnu-inline-asmSteven Wu2015-05-123-8/+21
| | | | | | | | | Empty assembly string will not introduce assembly code in the output binary and it is often used as a trick in the header to disable optimizations. It doesn't conflict with the purpose of the option so it is allowed with -fno-gnu-inline-asm flag. llvm-svn: 237073
* Update initialization of a class variable and comment.Eric Christopher2015-05-121-2/+4
| | | | llvm-svn: 237071
* Typo fix: s/initialzier/initializer/ in a doc comment.James Dennett2015-05-111-1/+1
| | | | | | No functional change. llvm-svn: 237068
* PR20625: Instantiate static constexpr member function of a local struct in a ↵Richard Smith2015-05-113-1/+26
| | | | | | | | | | | | | | | function template earlier. This is necessary in order to allow the use of a constexpr member function, or a member function with deduced return type, of a local class within a surrounding instantiated function template specialization. Patch by Michael Park! This re-commits r236063, which was reverted in r236134, along with a fix for a delayed template parsing bug that was exposed by this change. llvm-svn: 237064
* Move sanitizer parser and group expander from Driver to Basic.Peter Collingbourne2015-05-114-38/+49
| | | | | | | | No functional change. Differential Revision: http://reviews.llvm.org/D9621 llvm-svn: 237056
* Unify sanitizer kind representation between the driver and the rest of the ↵Peter Collingbourne2015-05-117-158/+130
| | | | | | | | | | compiler. No functional change. Differential Revision: http://reviews.llvm.org/D9618 llvm-svn: 237055
* Allow AsmLabel with -fno-gnu-inline-asmSteven Wu2015-05-112-4/+9
| | | | | | | | | | | | | | | | | | | Summary: AsmLabel is heavily used in system level and firmware to redirect function and access platform specific labels. They are also extensively used in system headers which makes this option unusable for many users. Since AsmLabel doesn't introduce any assembly code into the output binary, it shouldn't be considered as inline-asm. Reviewers: bob.wilson, rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9679 llvm-svn: 237048
* [cuda] Fixed test case failure on s390xArtem Belevich2015-05-111-2/+2
| | | | llvm-svn: 237007
* Revert "Allow -target= and --target options"Richard Barton2015-05-112-8/+2
| | | | | | | | | After mailing list discussion on 11-13 March we would prefer to stick to a single spelling of the long option. This reverts commit 30035fe1a7c759c89ee62eb46efce6b3790fcc08. llvm-svn: 237003
* [Sparc] Add support for 'sparcel' to clang.Douglas Katzman2015-05-116-3/+86
| | | | | | Differential Revision: http://reviews.llvm.org/D8784 llvm-svn: 237001
* clang-format: Support aligning ObjC string literals.Daniel Jasper2015-05-114-18/+33
| | | | | | | | | | | | Before: NSString s = @"aaaa" @"bbbb"; After: NSString s = @"aaaa" @"bbbb"; llvm-svn: 237000
* Disable __has_cpp_attribute when not compiling in C++ mode. As this feature ↵Aaron Ballman2015-05-112-2/+9
| | | | | | | | test macro only supports C++ style attributes, it doesn't apply to code compiled as C code, and can lead to diagnostics when given a scoped attribute. This addresses PR23435. llvm-svn: 236996
* clang-format: Appease the buildbots by including climits.Daniel Jasper2015-05-111-0/+1
| | | | llvm-svn: 236995
* clang-format: Improve column layout.Daniel Jasper2015-05-112-14/+23
| | | | | | | | | | | | | | | | | | | | | | Specifically, calculate the deviation between the shortest and longest element (which is used to prevent excessive whitespace) per column, not overall. This automatically handles the corner cases of a single column and a single row so that the actualy implementation becomes simpler. Before: vector<int> x = {1, aaaaaaaaaaaaaaaaaaaaaa, 2, bbbbbbbbbbbbbbbbbbbbbb, 3, cccccccccccccccccccccc}; After: vector<int> x = {1, aaaaaaaaaaaaaaaaaaaaaa, 2, bbbbbbbbbbbbbbbbbbbbbb, 3, cccccccccccccccccccccc}; llvm-svn: 236992
* clang-format: Don't merge subsequent lines into _asm blocks.Daniel Jasper2015-05-112-0/+7
| | | | | | | | | | | | | Before: _asm { } int i; After: _asm { } int i; llvm-svn: 236985
* clang-format: [JS] Clean up export declaration parsing.Daniel Jasper2015-05-111-7/+4
| | | | | | NFC intended. llvm-svn: 236982
* AVX-512: Changed CC parameter in "cmp" intrinsicElena Demikhovsky2015-05-115-309/+309
| | | | | | from i8 to i32 according to the Intel Spec llvm-svn: 236980
OpenPOWER on IntegriCloud