aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2017-07-09[analyzer] Make StmtDataCollector part of the CloneDetection APIRaphael Isemann
Summary: We probably want to use this useful templates in other pieces of code (e.g. the one from D34329), so we should make this public. Reviewers: NoQ Reviewed By: NoQ Subscribers: cfe-commits, xazax.hun, v.g.vassilev, johannes Differential Revision: https://reviews.llvm.org/D34880 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-08CodeGen: Fix address space of global variableYaxun Liu
Certain targets (e.g. amdgcn) require global variable to stay in global or constant address space. In C or C++ global variables are emitted in the default (generic) address space. This patch introduces virtual functions TargetCodeGenInfo::getGlobalVarAddressSpace and TargetInfo::getConstantAddressSpace to handle this in a general approach. It only affects IR generated for amdgcn target. Differential Revision: https://reviews.llvm.org/D33842 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-08[ODRHash] Support FriendDeclRichard Trieu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07[modules ts] Basic for module linkage.Richard Smith
In addition to the formal linkage rules, the Modules TS includes cases where internal-linkage symbols within a module interface unit can be referenced from outside the module via exported inline functions / templates. We give such declarations "module-internal linkage", which is formally internal linkage, but results in an externally-visible symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07[ObjC] Avoid the -Wunguarded-availability warnings for protocolAlex Lorenz
requirements in protocol/class/category declarations The unguarded availability warnings in the protocol requirements of a protocol /class/category declaration can be avoided. This matches the behaviour of Swift's diagnostics. The warnings for deprecated/unavailable protocols are preserved. rdar://33156429 Differential Revision: https://reviews.llvm.org/D35061 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307368 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06Reject attempts to build a module without -fmodules, rather than silently ↵Richard Smith
doing weird things. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06Allow CompilerInvocations to generate .d files.Sterling Augustine
Summary: Most clang tools should ignore the -M family of options because one wouldn't want them to generate a new dependency (.d) file. However, some tools may want this dependency file. This patch creates a mechanism for them to do this. This implementation just plumbs a boolean down several layers of calls. Each of the modified calls has several call sites, and so a single member variable or new API entry point won't work. An alternative would be to write a function to filter the -M family of arguments out of CC1Args, and have each caller call that function by hand before calling newInvocation, Invocation::run, or buildAstFromCodeWithArgs. This is a more complicated and error-prone solution. Why burden all the callers to remember to use this function? But I could rewrite this patch to use that method if that is deemed more appropriate. Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34304 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it showsSjoerd Meijer
problems in testing, see comments in D34161 for some more details. A fix is in progres in D35011, but a revert seems better now as the fix will probably take some more time to land. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06[OpenMP] Extend CLANG target options with device offloading kind.Gheorghe-Teodor Bercea
Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld Reviewed By: hfinkel Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits Differential Revision: https://reviews.llvm.org/D29647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06[clang-format] Add TextProto language name, NFCKrasimir Georgiev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307264 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05Customize the SFINAE diagnostics for enable_if to provide the failed condition.Douglas Gregor
When enable_if disables a particular overload resolution candidate, rummage through the enable_if condition to find the specific condition that caused the failure. For example, if we have something like: template< typename Iter, typename = std::enable_if_t<Random_access_iterator<Iter> && Comparable<Iterator_value_type<Iter>>>> void mysort(Iter first, Iter last) {} and we call "mysort" with "std::list<int>" iterators, we'll get a diagnostic saying that the "Random_access_iterator<Iter>" requirement failed. If we call "mysort" with "std::vector<something_not_comparable>", we'll get a diagnostic saying that the "Comparable<...>" requirement failed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05[Sema] Don't allow -Wunguarded-availability to be silenced with redeclsErik Pilkington
Differential revision: https://reviews.llvm.org/D33816 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05Address comments that escaped D33333Erich Keane
Patch By: Jen Yu Differential Revision:https://reviews.llvm.org/D34671 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05Add const to reference arguments of Diagnostic ctorAlexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05Fix invalid warnings for header guards in preamblesErik Verbruggen
Fixes https://bugs.llvm.org/show_bug.cgi?id=33574 Differential Revision: https://reviews.llvm.org/D34882 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307134 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05[modules ts] Improve merging of module-private declarations.Richard Smith
These cases occur frequently for declarations in the global module (above the module-declaration) in a Modules TS module interface. When we merge a definition from another module into such a module-private definition, ensure that we transitively make everything lexically within that definition visible to that translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05[modules ts] Declarations from a module interface unit are only visible outsideRichard Smith
the module if declared in an export block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-04[OpenCL] Rename err_opencl_enqueue_kernel_expected_typeJoey Gouly
Rename err_opencl_enqueue_kernel_expected_type so that other builtins can use the same diagnostic. https://reviews.llvm.org/D34948 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307067 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-03[clang-format] Support text proto messagesKrasimir Georgiev
Summary: This patch adds support for textual protocol buffer messages. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek, mgorny Differential Revision: https://reviews.llvm.org/D34441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-03Add a fixit for -Wobjc-protocol-property-synthesisAlex Lorenz
rdar://32132756 Differential Revision: https://reviews.llvm.org/D34886 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01Add an option group for deprecated warnings. Add the removedJoerg Sonnenberger
-fslp-vectorize-aggressive and -fno-slp-vectorize-aggressive flags back under this group and test for the warning. Document the future removal in the ReleaseNotes. Differential Revision: https://reviews.llvm.org/D34926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306965 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01Changed Opts.EABIVersion type string to llvm::EABI enum classYuka Takahashi
Summary: Changed EABIVersion type from string to llvm::EABI. It seems it was just a typo and this is intended implementation. Differential Revision: https://reviews.llvm.org/D34595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306953 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak
Summary: Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the documentation to fix an error -- I had used the wrong syntax for a link. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01Revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak
Summary: The commit caused a documentation breakage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01[Driver] Add -fdiagnostics-hotness-thresholdBrian Gesiak
Summary: Depends on https://reviews.llvm.org/D34867. Add a Clang frontend option to enable optimization remark hotness thresholds, which were added to LLVM in https://reviews.llvm.org/D34867. This prevents diagnostics that do not meet a minimum hotness threshold from being output. When generating optimization remarks for large codebases with a ton of cold code paths, this option can be used to limit the optimization remark output at a reasonable size. Discussion of this change can be read here: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html Reviewers: anemet, davidxl, hfinkel Reviewed By: anemet Subscribers: fhahn, cfe-commits Differential Revision: https://reviews.llvm.org/D34868 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01[Driver] Check that the iOS deployment target is iOS 10 or earlier ifAkira Hatanaka
the target is 32-bit. The following changes are made to the driver since 32-bit apps do not run on iOS 11 or later: - If the deployment target is set explicitly, either with a command-line option or an environment variable, the driver should report an error if the version is greater than iOS 10. - In the case where the deployment target is not set explicitly and the default is inferred from the target triple or SDK version, it should use a maximum default of iOS 10.99.99. rdar://problem/32230613 Differential Revision: https://reviews.llvm.org/D34529 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01[Modules] Implement ODR-like semantics for tag types in C/ObjCBruno Cardoso Lopes
Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01Change enumerator default linkage type for CBruno Cardoso Lopes
Redeclaration lookup should never find hidden enumerators in C, because they do not have linkage (C11 6.2.2/6) The linkage of an enumerator should be VisibleNoLinkage, and isHiddenDeclarationVisible should be checking hasExternalFormalLinkage. This is was reviewed as part of D31778, but splitted into a different commit for clarity. rdar://problem/31909368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30clang-format: add options to merge empty record bodyFrancois Ferrand
Summary: This patch introduces a few extra BraceWrapping options, similar to `SplitEmptyFunction`, to allow merging empty 'record' bodies (e.g. class, struct, union and namespace): * SplitEmptyClass * SplitEmptyStruct * SplitEmptyUnion * SplitEmptyNamespace The `SplitEmptyFunction` option name has also been simplified/ shortened (from `SplitEmptyFunctionBody`). These options are helpful when the correspond AfterXXX option is enabled, to allow merging the empty record: class Foo {}; In addition, this fixes an unexpected merging of short records, when the AfterXXXX options are used, which caused to be formatted like this: class Foo { void Foo(); }; This is now properly formatted as: class Foo { void Foo(); }; Reviewers: djasper, krasimir Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D34395 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306874 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[refactor] Move clang-rename into the clang repositoryAlex Lorenz
The core engine of clang-rename will be used for local and global renames in the new refactoring engine, as mentioned in http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html. The clang-rename tool is still supported but might get deprecated in the future. Differential Revision: https://reviews.llvm.org/D34696 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30Driver: fix option declarationSaleem Abdulrasool
The option is a "joined" argument. Fix silly copy-paste error. This allows the parsing to work at runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306830 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[OpenCL] Add function name to extension diagnosticJoey Gouly
Slightly improve the diagnostic by including the function name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[OPENMP] Initial support for taskloop reductions.Alexey Bataev
Add sema/parsupping ort for taskloop [simd] reductions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[Driver] Actually report errors during parsing instead of stopping when ↵Benjamin Kramer
there's an error somewhere. This is a more principled version of r303756. That change was both very brittle about the state of the Diags object going into the driver and also broke tooling in funny ways. In particular it prevented tools from capturing diagnostics properly and made the compilation database logic fail to provide arguments to the tool, falling back to scanning directories for JSON files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30Ambiguity might be also uninitialized. Use llvm::Optional.Vassil Vassilev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30fix trivial typos, NFCHiroshi Inoue
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306789 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30Remove Clang support for '-fvectorize-slp-aggressive' which used LLVM'sChandler Carruth
basic block vectorizer. This vectorizer has had no known users for many, many years and is completely surpassed by the normal '-fvectorize-slp'-controlled SLP vectorizer in LLVM. Hal proposed this back in 2014 to no objections: http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html While this patch completely removes the flag, Joerg is working on a patch that will add it back in a way that warns users and ignores the flag in a clear and well factored way (so that we can keep doing this going forward). Differential Revision: https://reviews.llvm.org/D34846 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306786 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30[WebAssembly] Add throw/rethrow builtins for exception handlingHeejin Ahn
Summary: Add new builtins for throw/rethrow instructions. This follows exception handling handling proposal in https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md Reviewers: sunfish, dschuff Reviewed By: dschuff Subscribers: jfb, dschuff, sbc100, jgravelle-google Differential Revision: https://reviews.llvm.org/D34783 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith
not the ASTContext state. We use this when running a preprocessor-only action on an AST file in order to avoid paying the runtime cost of loading the extra information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306760 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[clang-format] Switch to case-insensitive header matching and use it toChandler Carruth
improve support for LLVM-style include sorting. This really is a collection of improvements to the rules for LLVM include sorting: - We have gmock headers now, so it adds support for those to one of the categories. - LLVM does use 'FooTest.cpp' files to test 'Foo.h' so it adds that suffix for finding a main header. - At times the test file's case may not match the header file's case, so switch to case-insensitive regex matching of header names. With this set of changes, I can't spot any misbehaviors when re-sorting all of LLVM's unittest '#include' lines. Thanks to Eric and Daniel for help testing and refining the patch during review! Differential Revision: https://reviews.llvm.org/D33932 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.Tim Shen
Differential Revision: https://reviews.llvm.org/D34790 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306757 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29[Sema] Issue diagnostics if a new/delete expression generates a call toAkira Hatanaka
a c++17 aligned allocation/deallocation function that is unavailable in the standard library on Apple platforms. The aligned functions are implemented only in the following versions or later versions of the OSes, so clang issues diagnostics if the deployment target being targeted is older than these: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 The diagnostics are issued whenever the aligned functions are selected except when the selected function has a definition in the same file. If there is a user-defined function available somewhere else, option -Wno-aligned-allocation-unavailable can be used to silence the diagnostics. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34574 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Initialize variable and silence potentially uninitialized warning.Vassil Vassilev
Patch by Liza Sakellari! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Fix NSAPI constants to reflect the current state ofAlex Lorenz
NSStringMethodKind/NSDictionaryMethodKind enums Patch by Vladimir Voskresensky! Differential Revision: https://reviews.llvm.org/D34766 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Factor out a functionality from isBeforeInTranslationUnitGabor Horvath
The first user of this API will be the cross translation unit functionality of the Static Analyzer which will be committed in a follow-up patch. Differential Revision: https://reviews.llvm.org/D34506 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29Track the set of module maps read while building a .pcm file and reload ↵Richard Smith
those when preprocessing from that .pcm file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306628 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[ASTReader] Treat multiple defns of ObjC protocols the same as interfaces.Graydon Hoare
Summary: In change 2ba19793512, the ASTReader logic for ObjC interfaces was modified to preserve the first definition-data read, "merging" later definitions into it rather than overwriting it (though this "merging" is, in practice, a no-op that discards the later definition-data). Unfortunately this change was only made to ObjC interfaces, not protocols; this means that when (for example) loading a protocol that references an interface, if both the protocol and interface are multiply defined (as can easily happen if the same header is read from multiple contexts), an _inconsistent_ pair of definitions is loaded: first-read for the interface and last-read for the protocol. This in turn causes very subtle downstream bugs in the Swift ClangImporter, which filters the results of name lookups based on the owning module of a definition; inconsistency between a pair of related definitions causes name lookup failures at various stages of compilation. To fix these downstream issues, this change replicates the logic applied to interfaces in change 2ba19793512, but for ObjC protocols. rdar://30851899 Reviewers: doug.gregor, rsmith Reviewed By: doug.gregor Subscribers: jordan_rose, cfe-commits Differential Revision: https://reviews.llvm.org/D34741 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306583 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28Use vfs::FileSystem in ASTUnit when creating CompilerInvocation.Ilya Biryukov
Summary: It used to always call into the RealFileSystem before. Reviewers: bkramer, krasimir, klimek, bruno Reviewed By: klimek Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D34469 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28DiagnosticRenderer.h: Prune \param SM, corresponding to rL306384. ↵NAKAMURA Takumi
[-Wdocumentation] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306511 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27[libclang] Support for querying the exception specification type through ↵Jonathan Coe
libclang Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306483 91177308-0d34-0410-b5e6-96231b3b80d8