summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Improve clang-format.el.Manuel Klimek2015-01-081-48/+117
| | | | | | | | | | | | - includes header/footer as required by MELPA - correctly handles buffers that are not associated with a file - displays stderr and exit code of clang-format process - customizable via the emacs customization interface and file-/directory- local variables Patch by Johann Klähn. llvm-svn: 225447
* clang-format: Force line break between "endl" and "<<".Daniel Jasper2015-01-082-28/+30
| | | | | | | | | | | | | | | | This makes piped output easier to read in many instances. Before: llvm::errs() << aaaa << std::endl << bbbb << std::endl; After: llvm::errs() << aaaa << std::endl << bbbb << std::endl; Also fix a few instance of "don't use else after return" as per the coding standards. llvm-svn: 225444
* Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.Logan Chien2015-01-082-9/+48
| | | | | | | | | | | | | | | | | | | | If there are some non-ascii character in the input source code, the column index might be smallar than the byte index. This will result in two possible assertion failures. This CL fixes the computation of the column index and byte index. 1. The assertion in startOfNextColumn() and startOfPreviousColumn() should not be raised when the byte index is greater than the column index since the non-ascii characters may use more than one bytes to store a character in a column. 2. The length of the caret line should be equal to the number of columns of source line, instead of the length of the source line. Otherwise, the assertion in selectInterestingSourceRegion will be raised because the removed columns plus the kept columns are not greater than the max column, which means that we should not remove any column at all. llvm-svn: 225442
* clang-format: Improve template parameter detection.Daniel Jasper2015-01-082-2/+6
| | | | | | | | | | Before: struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>; After: struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>; llvm-svn: 225435
* Attempt to fix test from r225423 to get build bots green.Richard Trieu2015-01-081-7/+7
| | | | llvm-svn: 225426
* When the diagnostic text is simply "%0", sanitize the string for anyRichard Trieu2015-01-082-0/+26
| | | | | | unprintable characters. Fixes PR22048. llvm-svn: 225423
* Wrap to 80 columns. No behavior change.Nico Weber2015-01-071-29/+20
| | | | llvm-svn: 225414
* Add help text for mmacosx-version-min=, mios-version-min=.Nico Weber2015-01-071-2/+4
| | | | | | | | | I keep forgetting the exact spelling of -macosx-version-min=, and now I can run `bin/clang --help | grep version -A 2` to remind myself. While here, also document -mios-version-min=. Don't document -mios-simulator-version-min= as it's just an alias for -mios-version-min= these days. llvm-svn: 225409
* Handle OpaqueValueExprs more intelligently in the TransformTypos treeKaelyn Takata2015-01-074-1/+17
| | | | | | | | | | | | transform. Also diagnose typos in the initializer of an invalid C++ declaration. Both issues were hit using the same line of test code, depending on whether the code was treated as C or C++. Fixes PR22092. llvm-svn: 225389
* Slightly simplify the test from r225361.Nico Weber2015-01-071-22/+7
| | | | | | | | Shorter and doesn't need -O2 -- but still suboptimal as it's still doing -emit-obj. dblaikie says he'll improve this when he'll reland his change with a fix. llvm-svn: 225364
* clang-format: Let Chromium use the Google default for AlignTrailingComments.Nico Weber2015-01-071-1/+0
| | | | | | | | | | | r225141 changed the defaults of AllowShortIfStatementsOnASingleLine and AlignTrailingComments for Google style and added explicit overrides for Chromium style to undo these changes. For AllowShortIfStatementsOnASingleLine that's good as the Android style guide (which Chromium uses for Java) explicitly permits single-line ifs. But it's silent on trailing comments, to it makes sense for Chromium style to just follow Google style. llvm-svn: 225363
* Revert r225085, it caused PR22096.Nico Weber2015-01-073-0/+37
| | | | | | | | PR22096 has several test cases that assert that look fairly different. I'm adding one of those as an automated test, but when relanding the other cases should probably be checked as well. llvm-svn: 225361
* Debug info: pass in the correct size for a pointer to a member function.Adrian Prantl2015-01-072-2/+12
| | | | | | This corrects a bug I introduced in r224781. llvm-svn: 225359
* clang-format: Understand single-line comments at the end of blocks.Daniel Jasper2015-01-072-4/+14
| | | | | | | | | | | This prevents clang-format from moving/aligning the comment in the snippet: void f() { int i; // some comment // some unrelated comment } llvm-svn: 225352
* clang-format: Fix unary operator detection.Daniel Jasper2015-01-072-4/+5
| | | | | | | | | | Before: ** outparam = 1; After: **outparam = 1; llvm-svn: 225349
* Fix comment typo.Nico Weber2015-01-071-1/+1
| | | | llvm-svn: 225340
* Fix grammar-o in comment.Nico Weber2015-01-061-1/+1
| | | | llvm-svn: 225324
* Suppress clang warnings in a codegen test.Rafael Espindola2015-01-061-8/+8
| | | | | | | This makes the output of FileCheck way easier to read since this test hits many warnings. llvm-svn: 225322
* Add __builtin_amdgpu_classMatt Arsenault2015-01-063-0/+19
| | | | llvm-svn: 225314
* [PowerPC] Add support for -mcmpbHal Finkel2015-01-062-0/+8
| | | | | | | In r225106, support for the CMPB instruction was added to the PowerPC backend. This adds the associated GCC-compatible feature flag. llvm-svn: 225312
* Update for .ll syntax change.Rafael Espindola2015-01-066-19/+19
| | | | llvm-svn: 225303
* R600: Handle amdgcn tripleTom Stellard2015-01-069-12/+19
| | | | | | For now there is no difference between amdgcn and r600. llvm-svn: 225294
* Basic: fix compilation with MSVCSaleem Abdulrasool2015-01-061-2/+4
| | | | | | | | | | | | | | MSVC doesn't like the instantiation of the structure in the initializer list. Initialize it in the constructor body to repair the build. TargetInfo.h(545) : error C2143: syntax error : missing ')' before '{' TargetInfo.h(545) : error C2143: syntax error : missing ';' before '}' TargetInfo.h(545) : error C2059: syntax error : ')' TargetInfo.h(545) : error C2059: syntax error : ',' TargetInfo.h(547) : error C2143: syntax error : missing ';' before '{' TargetInfo.h(547) : error C2447: '{' : missing function header (old-style formal list?) llvm-svn: 225247
* Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool2015-01-066-4/+198
| | | | | | | | | | Add additional constraint checking for target specific behaviour for inline assembly constraints. We would previously silently let all arguments through for these constraints. In cases where the constraints were violated, we could end up failing to select instructions and triggering assertions or worse, silently ignoring instructions. llvm-svn: 225244
* Set the default ISA for OpenBSD/mips64 to MIPS III.Brad Smith2015-01-062-0/+12
| | | | llvm-svn: 225241
* Allow -fsanitize-coverage=N with ubsan, clang partKostya Serebryany2015-01-062-2/+9
| | | | | | | | | | | | | | | | | | | | Summary: Allow -fsanitize-coverage=N with ubsan, clang part. This simply allows the flag combination. The LLVM will work out of the box, the compile-rt part will follow as a separate patch. Test Plan: check-clang Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6849 llvm-svn: 225229
* Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"Duncan P. N. Exon Smith2015-01-054-7/+31
| | | | | | | | | This reverts commit r225212. It's failing on multiple buildbots [1][2]. [1]: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22032 [2]: http://lab.llvm.org:8080/green/view/Clang/job/clang-stage1-cmake-RA-incremental_check/2357/ llvm-svn: 225221
* Use the integrated assembler by default on 32-bit PowerPC and SPARCBrad Smith2015-01-054-31/+7
| | | | llvm-svn: 225212
* Fix lit for builds under /optFrancisco Lopes da Silva2015-01-051-2/+2
| | | | llvm-svn: 225196
* Make this test a bit stricter.Rafael Espindola2015-01-051-7/+7
| | | | | | | The first function is named __cxx_global_var_init, which is a substring of the following functions @__cxx_global_var_init(1,2,3,etc). llvm-svn: 225191
* Disable warnings in this test.Rafael Espindola2015-01-051-4/+4
| | | | | | This makes it a lot easier to read the output from FileCheck when it fails. llvm-svn: 225190
* Fix clash of gcc toolchains in driver regression tests.Samuel Antao2015-01-057-1/+156
| | | | | | For some regression tests the path to the right toolchain is specified using the -sysroot switch. However, if clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by sysroot. This causes several regression tests to fail as they will be using an unexpected path. This patch fixes this issue by adding --gcc-toolchain='' to all tests that rely on that. The empty string causes the driver to pick the path from sysroot instead. llvm-svn: 225182
* Fix dangling pointer in isDerivedFrom.Samuel Benzaquen2015-01-051-3/+3
| | | | | | | | | | | | | | | | Summary: Replace usage of StringRef with std::string in AST_MATCHER* generated matchers to make sure they keep their own copy of the string. The value could be a temporary and it causes the pointer to be dangling by the time the matcher is executed. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6843 llvm-svn: 225180
* clang/CMakeLists.txt: Introduce LLVM_SHLIB_OUTPUT_INTDIR also here, or ↵NAKAMURA Takumi2015-01-051-0/+6
| | | | | | plugins tests might fail. llvm-svn: 225170
* Fix formatting. NFC.Rafael Espindola2015-01-051-6/+3
| | | | llvm-svn: 225168
* clang-format: [Java] Fix incorrect detection of cast.Daniel Jasper2015-01-052-0/+6
| | | | | | | | | | | | | | After: return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaa) : aaaaaaaaaaaaaaaaaaaaaaa; After: return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa) : aaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 225161
* clang-format: [Java] Fix incorrect recognition of annonymous classes.Daniel Jasper2015-01-042-2/+8
| | | | | | | | | | | | | | | | Before: someFunction(new Runnable() { public void run() { System.out.println(42); } }); After: someFunction(new Runnable() { public void run() { System.out.println(42); } }); llvm-svn: 225142
* clang-format: [Java] Change a few flags for Google's Java style.Daniel Jasper2015-01-041-0/+4
| | | | | | No tests added as all of these are already tested separately. llvm-svn: 225141
* Remove an assert that's not true on invalid code.Nico Weber2015-01-043-2/+31
| | | | | | | | | | r185773 added an assert that checked that a CXXUnresolvedConstructExpr either has a valid rparen, or exactly one argument. This doesn't have to be true for invalid inputs. Convert the assert to an if, and add a test for this case. Found by SLi's afl bot. llvm-svn: 225140
* Fix default image name to 'a.exe' on Windows, instead 'a.out'.Yaron Keren2015-01-043-2/+4
| | | | | | This applies to mingw as clang-cl already has its own logic for the filename. llvm-svn: 225134
* clang-format: Re-enable comment re-indentation for Java/JS.Daniel Jasper2015-01-042-6/+19
| | | | | | This was broken by r224120. llvm-svn: 225130
* Fix indentation. No behavior change.Nico Weber2015-01-041-1/+1
| | | | llvm-svn: 225129
* Wrap to 80 columns, no behavior change.Nico Weber2015-01-041-4/+7
| | | | llvm-svn: 225128
* Document that GetTypeForDeclarator() cannot return a null type.Nico Weber2015-01-043-18/+13
| | | | | | | | | | | | | Also add a few asserts for this. The existing code assumes this in a bunch of places already (see e.g. the assert at the top of ParseTypedefDecl(), and there are many unchecked calls on the result of GetTypeForDeclarator()), and from looking through the code this should always be true from what I can tell. This allows removing ASTContext::getNullTypeSourceInfo() too as that's now unused. No behavior change intended. llvm-svn: 225125
* Crash less enthusiasticially on _Atomic or __restrict__ on invalid types.Nico Weber2015-01-042-4/+14
| | | | | | | | | | Many places in Sema cannot handle isNull() types. This is fine, because in most places the type building code recovers by falling back to IntTy. In GetFullTypeForDeclarator(), this is done at the end of the getNumTypeObjects() loop body. This function calls BuildQualifiedType() before this fallback is done though, so it explicitly needs to check for isNull() types. llvm-svn: 225124
* Wrap to 80 columns, no behavior change.Nico Weber2015-01-041-4/+5
| | | | llvm-svn: 225122
* AST: Remove overzealous assertion from IsModifiableDavid Majnemer2015-01-042-6/+4
| | | | | | It's reasonable to ask if an l-value with class type is modifiable. llvm-svn: 225121
* Parse: __attribute__((keyword)) shouldn't errorDavid Majnemer2015-01-033-5/+6
| | | | | | | Weird constructs like __attribute__((inline)) or __attibute__((typename)) should result in warnings, not errors. llvm-svn: 225118
* Volatile reads are side-effecting operations, but in the general case of ↵Aaron Ballman2015-01-032-3/+11
| | | | | | | | | | | access through a volatile-qualified type, we're not certain of the underlying object's side-effects on access. Treat volatile accesses as "maybe" instead of "definite" side effects for the purposes of warning on evaluations in an unevaluated context. No longer diagnose on idiomatic code like: int * volatile v; (void)sizeof(*v); llvm-svn: 225116
* Remove -Werror from test.Rafael Espindola2015-01-031-2/+2
| | | | | | | It is not needed since we FileCheck for the warning and -Werror itself can end up unused. llvm-svn: 225102
OpenPOWER on IntegriCloud