summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [SystemZ] Add support for IBM z14 processor (1/3)Ulrich Weigand2017-07-173-3/+110
| | | | | | | | | | | This patch series adds support for the IBM z14 processor. This part includes: - Basic support for the new processor and its features. - Support for low-level builtins mapped to new LLVM intrinsics. Support for the -fzvector extension to vector float and the new high-level vector intrinsics is provided by separate patches. llvm-svn: 308197
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-1710-72/+89
| | | | | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. I will also directly update some extra clang tooling that is broken by the change from Argument to Parameter. Hopefully the bots will stay appeased. Thanks! llvm-svn: 308190
* Fix dereference of pointers in throw statements.Manuel Klimek2017-07-171-1/+2
| | | | | | | | | | | | Before: throw * x; After: throw *x; Patch by Erik Uhlmann. llvm-svn: 308185
* [OPENMP] Codegen for reduction clauses in 'taskloop' directives.Alexey Bataev2017-07-174-20/+562
| | | | | | Adds codegen for taskloop-based directives. llvm-svn: 308174
* Revert changes from my previous refactoring - will need to fix dependencies ↵Faisal Vali2017-07-1710-89/+72
| | | | | | | | in clang's extra tooling (such as clang-tidy etc.). Sorry about that. llvm-svn: 308158
* [NFC] Refactor the Preprocessor function that handles Macro definitions and ↵Faisal Vali2017-07-1710-72/+89
| | | | | | | | | | | | | | rename Arguments to Parameters in Macro Definitions. - Extracted the reading of the tokens out into a separate function. - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation). This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible. Thanks! llvm-svn: 308157
* Enable TLS support on OpenBSD, but default to the emulatated TLS model.Brad Smith2017-07-172-5/+4
| | | | llvm-svn: 308155
* [Bash-autocompletion] Add support for -W<warning> and -Wno<warning>Yuka Takahashi2017-07-162-0/+19
| | | | | | | | | | Summary: `-W[tab]` will autocomplete warnings defined in this link: https://clang.llvm.org/docs/DiagnosticsReference.html#wweak-vtables Differential Revision: https://reviews.llvm.org/D35447 llvm-svn: 308139
* [c++2a] Add option -std=c++2a to enable support for potential/transitional ↵Faisal Vali2017-07-162-1/+5
| | | | | | | | | | C++2a features - as usual C++2a implies all the C++'s that came before it. Thank you Aaron for the feedback here: https://reviews.llvm.org/D35454 llvm-svn: 308118
* Use ARC parsing rules for ns_returns_retained in MRC so that code canJohn McCall2017-07-154-45/+84
| | | | | | | | be shared without warnings. Build AttributedTypes to leave breadcrumbs for tools like the static analyzer. Warn about attempting to use the attribute with incompatible return types. llvm-svn: 308092
* [ODRHash] Revert r307743 which reverted r307720Richard Trieu2017-07-152-28/+52
| | | | | | | Reapply r307720 to allow processing of constructors and destructors. Reuse the diagnostics for CXXMethodDecl for them. llvm-svn: 308077
* [clang] Fix handling of "%zd" format specifierAlexander Shaposhnikov2017-07-141-3/+2
| | | | | | | | | | | | | This diff addresses FIXME in lib/Analysis/PrintfFormatString.cpp and makes PrintfSpecifier::getArgType return the correct type. In particular, this change enables Clang to emit a warning on incorrect using of "%zd"/"%zn" format specifiers. Differential revision: https://reviews.llvm.org/D35427 Test plan: make check-all llvm-svn: 308067
* Prevent ClangTools from generating dependency files.Sterling Augustine2017-07-141-0/+1
| | | | | | | | | | | | | | | | | | | | D34304 created a way for ToolInvocations to conditionally generate dependency files, and updated call sites to preserve the old behavior of not generating them by default. CompilerInvocations... Summary: ...are yet another call-path that needs updating to preserve the old behavior. Reviewers: klimek, echristo Reviewed By: echristo Subscribers: echristo, cfe-commits Differential Revision: https://reviews.llvm.org/D35131 llvm-svn: 308043
* Unconditionally use .init_array instead of .ctors on Solaris.Aaron Ballman2017-07-143-3/+4
| | | | | | Patch by Fedor Sergeev llvm-svn: 308038
* [clang] Add getSignedSizeType methodAlexander Shaposhnikov2017-07-141-0/+6
| | | | | | | | | | | | | | | | | C11 standard refers to the signed counterpart of the type size_t in the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers (in printf format string). In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case (which is not handled correctly at the moment). This diff adds getSignedSizeType method to TargetInfo and exposes it in ASTContext similarly to how it is done for getSizeType. lib/Analysis/PrintfFormatString.cpp will be changed in a separate commit. Differential revision: https://reviews.llvm.org/D35378 Test plan: make check-all llvm-svn: 308037
* [index] Added a method indexTopLevelDecls to run indexing on a list of Decls.Ilya Biryukov2017-07-141-0/+12
| | | | | | | | | | | | | | | | Summary: We need it in clangd for refactoring that replaces ASTUnit with manual AST management. Reviewers: akyrtzi, benlangmuir, arphaman, klimek Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35405 llvm-svn: 308016
* [analyzer] Add annotation for functions taking user-facing stringsErik Verbruggen2017-07-141-10/+59
| | | | | | | | | | | | | | | | There was already a returns_localized_nsstring annotation to indicate that the return value could be passed to UIKit methods that would display them. However, those UIKit methods were hard-coded, and it was not possible to indicate that other classes/methods in a code-base would do the same. The takes_localized_nsstring annotation can be put on function parameters and selector parameters to indicate that those will also show the string to the user. Differential Revision: https://reviews.llvm.org/D35186 llvm-svn: 308012
* Keep the IdentifierInfo in the Token for alternative operator keywordOlivier Goffart2017-07-143-46/+35
| | | | | | | | | | | | | | | | | | | The goal of this commit is to fix clang-format so it does not merge tokens when using the alternative spelling keywords. (eg: "not foo" should not become "notfoo") The problem is that Preprocessor::HandleIdentifier used to drop the identifier info from the token for these keyword. This means the first condition of TokenAnnotator::spaceRequiredBefore is not met. We could add explicit check for the spelling in that condition, but I think it is better to keep the IdentifierInfo and handle the operator keyword explicitly when needed. That actually leads to simpler code, and probably slightly more efficient as well. Another side effect of this change is that __identifier(and) will now work as one would expect, removing a FIXME from the MicrosoftExtensions.cpp test Differential Revision: https://reviews.llvm.org/D35172 llvm-svn: 308008
* [X86] Add 'movbe' to btver2 CPU.Craig Topper2017-07-141-0/+1
| | | | | | This probably doesn't change anything because the frotend doesn't do anything with this feature and the backend will infer from the cpu string. So this is just for consistency with other cpus that support movbe. llvm-svn: 308002
* Change dyn_casts with unused variables to isa statements to avoid unused ↵Eric Christopher2017-07-142-3/+3
| | | | | | variables. llvm-svn: 307988
* [ODRHash] Avoid taking the types of FunctionDecl'sRichard Trieu2017-07-141-1/+5
| | | | | | | | FunctionDecl already hashes most of the information in the function's type. Add hashing of the return type, and skip hashing the function's type to avoid redundancy and extra work when computing the hash. llvm-svn: 307986
* [Driver] Respect -target when determining target platform on AppleAkira Hatanaka2017-07-141-19/+49
| | | | | | | | | | | | | | platforms. Set the target OS based on -target if it is present on the command line and -arch is not. With this commit, "-target x86_64-apple-ios8.0" does the same thing as "-arch x86_64 -mios-version-min=8.0". rdar://problem/21012522 llvm-svn: 307982
* [PS4] Disable LTO unit features under ThinLTO, like for Darwin.Paul Robinson2017-07-131-4/+5
| | | | llvm-svn: 307964
* Use getNameAsString instead of getName to get method names when dumpingLang Hames2017-07-131-6/+2
| | | | | | | | overrides: getName can fail if the decl's name isn't a simple identifier. This is a more general replacement for the fix in r305860. llvm-svn: 307959
* [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)Vedant Kumar2017-07-133-16/+33
| | | | | | | | | | | | | | | | | | | | | The pointer overflow check gives false negatives when dealing with expressions in which an unsigned value is subtracted from a pointer. This is summarized in PR33430 [1]: ubsan permits the result of the subtraction to be greater than "p", but it should not. To fix the issue, we should track whether or not the pointer expression is a subtraction. If it is, and the indices are unsigned, we know to expect "p - <unsigned> <= p". I've tested this by running check-{llvm,clang} with a stage2 ubsan-enabled build. I've also added some tests to compiler-rt, which are in D34122. [1] https://bugs.llvm.org/show_bug.cgi?id=33430 Differential Revision: https://reviews.llvm.org/D34121 llvm-svn: 307955
* [AArch64] Produce the right kind of va_arg for windowsMartin Storsjo2017-07-131-3/+18
| | | | | | | | On windows on arm64, the va_list is a plain pointer. Differential Revision: https://reviews.llvm.org/D35008 llvm-svn: 307933
* Fix spelling mistakes in comments. NFCI.Simon Pilgrim2017-07-131-14/+14
| | | | llvm-svn: 307932
* Fix -Wdocumentation warning. NFCISimon Pilgrim2017-07-131-1/+0
| | | | llvm-svn: 307931
* Extend -Wdeprecated-implementations to warn about unavailable methodsAlex Lorenz2017-07-131-1/+11
| | | | | | rdar://22867595 llvm-svn: 307924
* NFC, Cleanup the code for -Wdeprecated-implementationsAlex Lorenz2017-07-131-22/+28
| | | | | | | | and void capitalization of the warning message rdar://22867595 llvm-svn: 307923
* [AArch64] Add support for handling the +sve target feature.Amara Emerson2017-07-131-4/+11
| | | | | | | | This also adds the appropriate predefine for SVE if enabled. Differential Revision: https://reviews.llvm.org/D35118 llvm-svn: 307919
* [OPENMP] Generalization of codegen for reduction clauses.Alexey Bataev2017-07-133-387/+564
| | | | | | | Reworked codegen for reduction clauses for future support of reductions in task-based directives. llvm-svn: 307910
* [ObjC] Pick a 'readwrite' property when synthesizing ambiguousAlex Lorenz2017-07-132-37/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | property and check for incompatible attributes This commit changes the way ambiguous property synthesis (i.e. when synthesizing a property that's declared in multiple protocols) is performed. Previously, Clang synthesized the first property that was found. This lead to problems when the property was synthesized in a class that conformed to two protocols that declared that property and a second protocols had a 'readwrite' declaration - the setter was not synthesized so the class didn't really conform to the second protocol and user's code would crash at runtime when they would try to set the property. This commit ensures that a first readwrite property is selected. This is a semantic change that changes users code in this manner: ``` @protocol P @property(readonly) int p; @end @protocol P2 @property(readwrite) id p; @end @interface I <P2> @end @implementation I @syntesize p; // Users previously got a warning here, and Clang synthesized // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p.. @end ``` To ensure that this change is safe, the warning about incompatible types is promoted to an error when this kind of readonly/readwrite ambiguity is detected in the @implementation. This will ensure that previous code that had this subtle bug and ignored the warning now will fail to compile with an error, and users should not get suprises at runtime once they resolve the error. The commit also extends the ambiguity checker, and now it can detect conflicts among the different property attributes. An error diagnostic is used for conflicting attributes, to ensure that the user won't get "suprises" at runtime. ProtocolPropertyMap is removed in favour of a a set + vector because the map's order of iteration is non-deterministic, so it couldn't be used to select the readwrite property. rdar://31579994 Differential Revision: https://reviews.llvm.org/D35268 llvm-svn: 307903
* [index] Objective-C method declarations and message sends withAlex Lorenz2017-07-131-0/+4
| | | | | | | | an empty first selector piece should store the location of the first ':' rdar://33188656 llvm-svn: 307901
* [refactor][rename] Use a single base class for class that findsAlex Lorenz2017-07-132-197/+72
| | | | | | | | | | | | | | a declaration at location and for class that searches for all occurrences of a specific declaration This commit uses a single RecursiveSymbolVisitor class for both USRLocFindingASTVisitor and NamedDeclOccurrenceFindingVisitor to avoid duplicate traversal code. It also traverses nested name specifier locs in the new class and remove the separate matching step. Differential Revision: https://reviews.llvm.org/D34949 llvm-svn: 307898
* fix typos in comments; NFCHiroshi Inoue2017-07-131-1/+1
| | | | llvm-svn: 307886
* [Sema] Mark a virtual CXXMethodDecl as used if a call to it can beAkira Hatanaka2017-07-136-108/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devirtualized. The code to detect devirtualized calls is already in IRGen, so move the code to lib/AST and make it a shared utility between Sema and IRGen. This commit fixes a linkage error I was seeing when compiling the following code: $ cat test1.cpp struct Base { virtual void operator()() {} }; template<class T> struct Derived final : Base { void operator()() override {} }; Derived<int> *d; int main() { if (d) (*d)(); return 0; } rdar://problem/33195657 Differential Revision: https://reviews.llvm.org/D34301 llvm-svn: 307883
* Reland "[Driver] Update Fuchsia driver path handling"Petr Hosek2017-07-122-17/+82
| | | | | | | | | | | | | | | | | Several improvements to the Fuchsia driver: * Search for C++ library headers and libraries in directories that are part of the toolchain distribution rather than sysroot. * Use LLVM support utlities to construct paths to make sure the driver is also usable on Windows for cross-compiling. * Change the driver to inherit directly from ToolChain rather than Generic_GCC since we don't need any of the GCC related multilib logic. Differential Revision: https://reviews.llvm.org/D35328 llvm-svn: 307856
* [index] Don't add relation to a NamedDecl with no nameBen Langmuir2017-07-121-5/+9
| | | | | | | | | | | | Unless it's one of the special cases (tag, category) that we can handle. This syncs up the check between handling a decl and handling a relation. This would cause invalid nameless decls to end up in relations despite having no name or USR. rdar://problem/32474406 llvm-svn: 307855
* Revert "[analyzer] Support generating and reasoning over more symbolic ↵Dominic Chen2017-07-123-38/+22
| | | | | | | | | | constraint types" Assertion `Loc::isLocType(SSE->getLHS()->getType())' failed in Analysis/PR3991.m This reverts commit e469ff2759275e67f9072b3d67fac90f647c0fe6. llvm-svn: 307853
* [mips][mt][7/7] Add driver option for the MIPS MT ASE.Simon Dardis2017-07-121-0/+1
| | | | | | | | Reviewers: atanasyan, slthakur Differential Revision: https://reviews.llvm.org/D35254 llvm-svn: 307847
* Revert "[Driver] Update Fuchsia driver path handling"Petr Hosek2017-07-122-82/+17
| | | | | | | | The tests are failing on Windows. This reverts commit 429fe8229496f639df6b0b4734beedb1d4317aa5. llvm-svn: 307845
* [DOXYGEN] Corrected typos and incorrect parameters description.Ekaterina Romanova2017-07-122-2/+2
| | | | | | | | | | Corrected several typos and incorrect parameters description that Sony 's techinical writer found during review. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. llvm-svn: 307838
* [analyzer] Support generating and reasoning over more symbolic constraint typesDominic Chen2017-07-123-22/+38
| | | | | | | | | | | | Summary: Generate more IntSymExpr constraints, perform SVal simplification for IntSymExpr and SymbolCast constraints, and create fully symbolic SymExprs Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D28953 llvm-svn: 307833
* [Driver] Update Fuchsia driver path handlingPetr Hosek2017-07-122-17/+82
| | | | | | | | | | | | | | | | | Several improvements to the Fuchsia driver: * Search for C++ library headers and libraries in directories that are part of the toolchain distribution rather than sysroot. * Use LLVM support utlities to construct paths to make sure the driver is also usable on Windows for cross-compiling. * Change the driver to inherit directly from ToolChain rather than Generic_GCC since we don't need any of the GCC related multilib logic. Differential Revision: https://reviews.llvm.org/D32613 llvm-svn: 307830
* [OPENMP] Emit implicit taskgroup block around taskloop directives.Alexey Bataev2017-07-122-8/+24
| | | | | | | | | If taskloop directive has no associated nogroup clause, it must emitted inside implicit taskgroup block. Runtime supports it, but we need to generate implicit taskgroup block explicitly to support future reductions codegen. llvm-svn: 307822
* [clang] buildFixItInsertionLine should use Hints of the same FID and LineNoChih-Hung Hsieh2017-07-121-6/+5
| | | | | | | | Fix bug https://bugs.llvm.org/show_bug.cgi?id=33734 Differential Revision: https://reviews.llvm.org/D35230 llvm-svn: 307809
* [clang-format] Keep level of comment before an empty lineKrasimir Georgiev2017-07-121-4/+13
| | | | | | | | | | | | | | | | | Summary: This patch fixes bug https://bugs.llvm.org/show_bug.cgi?id=3313: a comment line was aligned with the next #ifdef even in the presence of an empty line between them. Reviewers: djasper, klimek Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D35296 llvm-svn: 307795
* Expose some type-conversion functions as part of the IRGen ABI.John McCall2017-07-121-0/+16
| | | | | | Patch by Benoit Vey! llvm-svn: 307760
* CFG: Add CFGElement for automatic variables that leave the scopeMatthias Gehre2017-07-126-46/+197
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This mimics the implementation for the implicit destructors. The generation of this scope leaving elements is hidden behind a flag to the CFGBuilder, thus it should not affect existing code. Currently, I'm missing a test (it's implicitly tested by the clang-tidy lifetime checker that I'm proposing). I though about a test using debug.DumpCFG, but then I would have to add an option to StaticAnalyzer/Core/AnalyzerOptions to enable the scope leaving CFGElement, which would only be useful to that particular test. Any other ideas how I could make a test for this feature? Reviewers: krememek, jordan_rose Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15031 llvm-svn: 307759
OpenPOWER on IntegriCloud