summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-022-2/+96
| | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
* clang-format: precedence-based indentation when breaking before operators.Daniel Jasper2014-12-021-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; After: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; Not particularly pretty, but can probably help to uncover bugs. And if this bugs somebody, parentheses can help. llvm-svn: 223111
* Try to fix the MSVC build.Hans Wennborg2014-12-022-11/+10
| | | | llvm-svn: 223105
* Remove special case for aarch64 static vs. PIC code in iOS kernel code.Bob Wilson2014-12-022-4/+2
| | | | | | | | | | I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 llvm-svn: 223097
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-029-112/+184
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* Perform correct lookup when '__super' is used in class with dependent base.Nikola Smiljanic2014-12-013-6/+27
| | | | llvm-svn: 223090
* Make -fuse-ld=lld work properly on Windows.Zachary Turner2014-12-012-4/+23
| | | | | | | | | | | | Using lld on Windows requires calling link-lld.exe instead of lld.exe. This patch puts this knowledge into clang so that when using the GCC style clang driver, it can properly delegate to lld. Differential Revision: http://reviews.llvm.org/D6428 Reviewed by: Reid Kleckner, Rui Ueyama llvm-svn: 223086
* Use nullptr to silence -Wsentinel when self-hosting on WindowsReid Kleckner2014-12-0110-52/+52
| | | | | | | | | | | Richard rejected my Sema change to interpret an integer literal zero in a varargs context as a null pointer, so -Wsentinel sees an integer literal zero and fires off a warning. Only CodeGen currently knows that it promotes integer literal zeroes in this context to pointer size on Windows. I didn't want to teach -Wsentinel about that compatibility hack. Therefore, I'm migrating to C++11 nullptr. llvm-svn: 223079
* Add missing 'break's, found by inspection. No functionality change; theRichard Smith2014-12-011-0/+2
| | | | | | fallthrough happened to do the right thing in both cases. llvm-svn: 223064
* Update R600 address space map to include genericMatt Arsenault2014-12-011-2/+1
| | | | llvm-svn: 223046
* Make the function pointer a template argument instead of a runtime value.Samuel Benzaquen2014-12-011-22/+37
| | | | | | | | | | | | | | | | | Summary: Speed up the variadic matchers by removing one indirect call. Making the function pointer a template arguments allows the compiler to inline the call instead of doing an runtime call by pointer. Also, optimize the allOf() case to avoid redundant kind checks. This speeds up our clang-tidy benchmark by ~2% Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6424 llvm-svn: 223029
* [OPENMP] Formating and code improvement for codegen of 'omp critical' directive.Alexey Bataev2014-12-013-47/+28
| | | | | | No functional changes, only code improvements. llvm-svn: 223010
* Revert "Remove threshold for lifetime marker insertion of named temporaries"Arnaud A. de Grandmaison2014-12-012-29/+26
| | | | | | Revert r222993 while I investigate some MemorySanitizer failures. llvm-svn: 222995
* Remove threshold for lifetime marker insertion of named temporariesArnaud A. de Grandmaison2014-12-012-26/+29
| | | | | | | | | Now that TailRecursionElimination has been fixed with r222354, the threshold on size for lifetime marker insertion can be removed. This only affects named temporary though, as the patch for unnamed temporaries is still in progress. llvm-svn: 222993
* Fix typo.Nico Weber2014-11-291-1/+1
| | | | llvm-svn: 222964
* AST: Consider pseudo-struct builtin types as substitutableDavid Majnemer2014-11-281-1/+14
| | | | | | | | We didn't consider types like ObjCSel as a substitution candidate. This fixes PR21688. llvm-svn: 222941
* Add additional arguments for -mfpu optionsRichard Barton2014-11-281-0/+3
| | | | | | | | | Add neon-vfpv3 to allow specifying both at the same time. This is not an option that GCC supports, but follows the same track and should be non-controversial. Change-Id: Id9ec157c835937d7d11ad0f49dbe5171fac17658 llvm-svn: 222933
* Add -mfpu=neon-vfpv4Richard Barton2014-11-281-0/+3
| | | | | | | This enables user to architecturally specify ARMv7A + VFPv4 + NEON. Change-Id: I779b01fef5c47e5e4ac702ae24ed2f76a0e4c63f llvm-svn: 222932
* [OPENMP] Additional processing of 'omp atomic write' directive.Alexey Bataev2014-11-281-12/+61
| | | | | | According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic write' is allowed to be used only for expression statements of form 'x = expr;', where x is a lvalue expression and expr is an expression with scalar type. Patch adds checks for it. llvm-svn: 222913
* Create a new 'flag_enum' attribute.Alexis Hunt2014-11-283-77/+159
| | | | | | | | | | | This attribute serves as a hint to improve warnings about the ranges of enumerators used as flag types. It currently has no working C++ implementation due to different semantics for enums in C++. For more explanation, see the docs and testcases. Reviewed by Aaron Ballman. llvm-svn: 222906
* AArch64: simplify PCS mapping.Tim Northover2014-11-271-122/+30
| | | | | | | | | | | | Now that LLVM can count the registers needed to implement AAPCS rules, we don't need to duplicate that logic here. This means we can drop the explicit padding and also use more natural types in many cases (e.g. "struct { float arr[3]; }" used to end up as "[2 x double]" to avoid holes on the stack. The one wrinkle is that AAPCS va_arg was also using the register counting machinery. But the local replacement isn't too bad. llvm-svn: 222904
* clang-format: [JS] Contract fewer functions to a single line.Daniel Jasper2014-11-271-2/+3
| | | | | | | | | | | | | Before: var someVariable = function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }; After: var someVariable = function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); }; llvm-svn: 222893
* clang-format: [JS] Try not to break in container literals.Daniel Jasper2014-11-271-0/+2
| | | | | | | | | | | | | | | | | Before: var obj = { fooooooooo: function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); } }; After: var obj = { fooooooooo: function(x) { return x.zIsTooLongForOneLineWithTheDeclarationLine(); } }; llvm-svn: 222892
* clang-format: [JS] new and delete are valid function names.Daniel Jasper2014-11-271-3/+2
| | | | | | | | | | | | Before: someObject.new (); someObject.delete (); After: someObject.new(); someObject.delete(); llvm-svn: 222890
* clang-format: [JS] Make Closure module detection more narrow.Daniel Jasper2014-11-271-1/+2
| | | | | | | | | | | Before: var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName'); After: var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName'); llvm-svn: 222888
* clang-format: Don't use column layout with AlignAfterOpenBrackets.Daniel Jasper2014-11-271-0/+4
| | | | | | This fixes llvm.org/PR21676. llvm-svn: 222886
* [c++1z] Remove terse range-based for loops; they've been removed fromRichard Smith2014-11-271-3/+1
| | | | | | consideration for C++17 for now. Update C++ status page to match. llvm-svn: 222865
* When checking for uninitialized values, do not confuse "std::move" with everyRichard Trieu2014-11-273-3/+6
| | | | | | other function named "move". llvm-svn: 222863
* clang-format: [Java] Don't line-wrap package declarations.Daniel Jasper2014-11-262-2/+6
| | | | | | This fixes llvm.org/PR21677. llvm-svn: 222843
* clang-format: Tweak -style=Chromium for Java files.Nico Weber2014-11-261-6/+11
| | | | | | | | | | | For Java, don't do any of the deviations from Google Style that Chromium style does for C++. Chromium's Java follows Android Java style [1], which is roughly Google Java style with an indent of 4 and a continuation indent of 8. 1: https://source.android.com/source/code-style.html llvm-svn: 222839
* [OpenCL] Implemented restrictions for pointer conversions specified in ↵Anastasia Stulova2014-11-264-6/+29
| | | | | | | | | | | | OpenCL v2.0. OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces: - the named address spaces (__global, __local, and __private) => __generic - implicitly converted; - __generic => named - with an explicit cast; - named <=> named - disallowed; - __constant <=> any other - disallowed. llvm-svn: 222834
* [OpenCL] Generic address space has been added in OpenCL v2.0.Anastasia Stulova2014-11-266-5/+44
| | | | | | | | | | To support it in the frontend, the following has been added: - generic address space type attribute; - documentation for the OpenCL address space attributes; - parsing of __generic(generic) keyword; - test code for the parser and diagnostics. llvm-svn: 222831
* clang-format: [Java] Improve formatting of throws declarations.Daniel Jasper2014-11-261-2/+3
| | | | | | | | | | | | Before: public void doSoooooooooo() throws LoooooooooongException, LooooooooooongException {} After: public void doSoooooooooo() throws LoooooooooongException, LooooooooooongException {} llvm-svn: 222829
* clang-format: [Java] Improve cast detection.Daniel Jasper2014-11-261-3/+7
| | | | | | | | | | Before: a[b >> 1] = (byte)(c() << 4); After: a[b >> 1] = (byte) (c() << 4); llvm-svn: 222827
* clang-format: [Java] Fix breaking after annotations.Daniel Jasper2014-11-261-1/+2
| | | | | | | | | | | | | Before: @Annotation1 // comment @Annotation2 class C {} After: @Annotation1 // comment @Annotation2 class C {} llvm-svn: 222825
* clang-format: Add SFS_Empty to only empty functions on a single line.Daniel Jasper2014-11-261-2/+6
| | | | | | | | Activated for and tested by Google's Java style. This fixes llvm.org/PR21667. llvm-svn: 222819
* clang-format: [Java] Support Foo.class;Daniel Jasper2014-11-261-0/+7
| | | | | | | | | | | | | Before: SomeClass. class.getName(); After: SomeClass.class.getName(); This fixes llvm.org/PR21665. llvm-svn: 222813
* [c++1z] Most of N4268 (allow constant evaluation for non-type template ↵Richard Smith2014-11-263-67/+219
| | | | | | | | | arguments). We don't yet support pointer-to-member template arguments that have undergone pointer-to-member conversions, mostly because we don't have a mangling for them yet. llvm-svn: 222807
* CodeGen: Fix emission of __atomic_compare_exchangeDavid Majnemer2014-11-251-22/+22
| | | | | | We (wrongly) discarded the return value of the call. llvm-svn: 222798
* Ensure that any TypoExprs in the arguments to bultins with custom typeKaelyn Takata2014-11-251-2/+6
| | | | | | | | checking are handled before the custom type checking is performed. Fixes PR21669. llvm-svn: 222797
* Re-apply r222646 (was reverted in r222667). Adding 4 ASTMatchers: ↵Manuel Klimek2014-11-252-3/+15
| | | | | | | | | | | | | | | | | | | | | | | typedefDecl, isInMainFile, isInSystemFile, isInFileMatchingName Change to original: ifndef out tests in Windows due to /-separated paths. Summary: Often one is only interested in matches within the main-file or matches that are not within a system-header, for which this patch adds isInMainFile and isInSystemFile. They take no arguments and narrow down the matches. The isInFileMatchingName is mainly thought for interactive clang-query-sessions, to make a matcher more specific without restarting the session with the files you are interested in for that moment. It takes a string that will be used as regular-expression to match the filename of where the matched node is expanded. Patch by Hendrik von Prince. llvm-svn: 222765
* clang-format: Refactoring.Daniel Jasper2014-11-255-404/+375
| | | | | | Re-apply r222638 and r222641 without variadic templates. llvm-svn: 222747
* Add flag -f(no-)modules-implicit-maps.Daniel Jasper2014-11-252-44/+60
| | | | | | | This suppresses the implicit search for files called 'module.modulemap' and similar. llvm-svn: 222745
* Add a missing override, caught by clang's inconsistent override warning.Chandler Carruth2014-11-251-1/+1
| | | | llvm-svn: 222742
* [ARM] Define __ARM_FEATURE_DSP macro for CPUs that have DSP instructionsSergey Dmitrouk2014-11-251-0/+7
| | | | | | | | | | | | | | | | | Summary: This resolves [[ http://llvm.org/bugs/show_bug.cgi?id=17391 | PR17391 ]]. GCC's sources were used as a guide (couldn't find much information in ARM documentation). Reviewers: doug.gregor, asl Reviewed By: asl Subscribers: asl, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D6339 llvm-svn: 222741
* MS ABI: Add CodeGen support for rethrowing MS C++ exceptionsDavid Majnemer2014-11-254-16/+51
| | | | | | | | | | Rethrowing exceptions in the MS model is very simple: just call _CxxThrowException with nullptr for both arguments. N.B. They chose stdcall as the calling convention for x86 but cdecl for all other platforms. llvm-svn: 222733
* CodeGen: further simplify assertionSaleem Abdulrasool2014-11-251-4/+2
| | | | | | Use more of algorithm to simplify the assertion. Pointed out by David Blakie! llvm-svn: 222721
* Remove unnecessary environment switchReid Kleckner2014-11-241-11/+1
| | | | | | | | All supported environments on x86 Windows return structs in EAX:EDX. This removes code added in r204978 that had to get updated in r222680. We should now have the same behavior we had before r204978. llvm-svn: 222697
* Force the correction of delayed typos in casts in non-C++ code.Kaelyn Takata2014-11-241-0/+6
| | | | | | | Fixes PR21656, which is fallout from r222551 caused by an untested/missed code path. llvm-svn: 222694
* Filter the toplevel matchers by kind.Samuel Benzaquen2014-11-242-10/+86
| | | | | | | | | | | | | | | | | | Summary: Filter the toplevel matchers by kind. Decl and Stmt matchers are tied to a specific node kind and trying to match incompatible nodes is a waste. Precalculate a filtered list of matchers that have a chance of matching the node and ignore the rest. Speeds up our clang-tidy benchmark by ~10% Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6361 llvm-svn: 222688
OpenPOWER on IntegriCloud