summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* [Objective-C] Fix non-determinism in clangMandeep Singh Grang2017-07-061-4/+5
| | | | | | | | | | | | | | Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet). Reviewers: dblaikie, davide, rsmith Reviewed By: dblaikie Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D34860 llvm-svn: 307296
* fix trivial typos in comments; NFCHiroshi Inoue2017-07-032-2/+2
| | | | llvm-svn: 307007
* fix trivial typos; NFCHiroshi Inoue2017-07-011-1/+1
| | | | llvm-svn: 306954
* Changed Opts.EABIVersion type string to llvm::EABI enum classYuka Takahashi2017-07-011-1/+1
| | | | | | | | | | 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 llvm-svn: 306953
* Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak2017-07-011-6/+12
| | | | | | | | 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. llvm-svn: 306948
* Revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak2017-07-011-12/+6
| | | | | | | Summary: The commit caused a documentation breakage. llvm-svn: 306946
* [Driver] Add -fdiagnostics-hotness-thresholdBrian Gesiak2017-07-011-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 306945
* Remove Clang support for '-fvectorize-slp-aggressive' which used LLVM'sChandler Carruth2017-06-301-1/+0
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 306786
* Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith2017-06-296-29/+37
| | | | | | | | | 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. llvm-svn: 306760
* [NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.Tim Shen2017-06-291-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D34790 llvm-svn: 306757
* [Sema] Issue diagnostics if a new/delete expression generates a call toAkira Hatanaka2017-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 306722
* [OpenMP] Add support for auxiliary triple specificationGheorghe-Teodor Bercea2017-06-293-3/+8
| | | | | | | | | | | | | | Summary: Device offloading requires the specification of an additional flag containing the triple of the //other// architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa. Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29339 llvm-svn: 306689
* Track the set of module maps read while building a .pcm file and reload ↵Richard Smith2017-06-293-22/+33
| | | | | | those when preprocessing from that .pcm file. llvm-svn: 306628
* Use vfs::FileSystem in ASTUnit when creating CompilerInvocation.Ilya Biryukov2017-06-282-4/+4
| | | | | | | | | | | | | | 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 llvm-svn: 306549
* Revert "Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc""Christof Douma2017-06-274-227/+167
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r305688 meaning it reintroduces r305684. To repeat: [NFC] Refactor DiagnosticRenderer to use FullSourceLoc Move the DiagnosticRenderer and its dependents to using FullSourceLocs instead of a SourceLocation and SourceManager pointer. The changeset is rather large but entirely mechanical. This is step one to allow DiagnosticRenderer to take either llvm::SMLocs or clang::SourceLocations. This breaks clang-tidy and clng-query which will be fixed in a commit soon after. Patch by Sanne Wouda Differential Revision: https://reviews.llvm.org/D31709 llvm-svn: 306384
* Remove some redundant setup when preprocessing .pcm files.Richard Smith2017-06-261-1/+0
| | | | | | Both of these steps are immediately overwritten by the FrontendAction setup. llvm-svn: 306325
* When preprocessing with -frewrite-imports and -fmodule-file=, do not pass allRichard Smith2017-06-261-0/+2
| | | | | | | | | | | modules to preprocessing of nested .pcm files. Making those module files available results in loading more .pcm files than necessary, and potentially in misbehavior if a module makes itself visible during its own compilation (as parts of that module that have not yet been processed would then become visible). llvm-svn: 306320
* Revert "Revert r305164/5/7."Saleem Abdulrasool2017-06-231-3/+16
| | | | | | | | | | | | | | | | | | | | | | | Restore the `-gz` option to the driver with some minor tweaks to handle the additional case for `-Wa,--compress-debug-sections`. This intends to make the compression of the debug information controllable from the driver. The following is the behaviour: -gz enable compression (ambiguous for format, will default to zlib-gnu) -gz=none disable compression -gz=zlib-gnu enable compression (deprecated GNU style zlib compression) -gz=zlib enable compression (zlib based compression) Although -Wa,-compress-debug-sections works, it should be discouraged when using the driver to invoke the assembler. However, we permit the assembler to accept the GNU as style argument --compress-debug-sections to maintain compatibility. Note, -gz/-gz= does *NOT* imply -g. That is, you need to additionally specific -g for debug information to be generated. llvm-svn: 306115
* [Frontend] 'Show hotness' can be used with a sampling profileBrian Gesiak2017-06-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Prior to this change, using `-fdiagnostics-show-hotness` with a sampling profile specified via `-fprofile-sample-use=` would result in the Clang frontend emitting a warning: "argument '-fdiagnostics-show-hotness' requires profile-guided optimization information". Of course, a sampling profile *is* profile-guided optimization information, so the warning is misleading. Furthermore, despite the warning, hotness was displayed based on the data in the sampling profile. Prevent the warning from being emitted when a sampling profile is used, and add a test that verifies this. Reviewers: anemet, davidxl Reviewed By: davidxl Subscribers: danielcdh, cfe-commits Differential Revision: https://reviews.llvm.org/D34082 llvm-svn: 306079
* Fixed compiler warnings after r305890.Ilya Biryukov2017-06-211-10/+4
| | | | | | Should fix buildbots that pass -Werror. llvm-svn: 305902
* Fix unused-variable compilation error.Haojian Wu2017-06-211-0/+2
| | | | llvm-svn: 305898
* Moved code hanlding precompiled preamble out of the ASTUnit.Ilya Biryukov2017-06-213-589/+779
| | | | | | | | | | | | Reviewers: bkramer, krasimir, arphaman, akyrtzi, klimek Reviewed By: klimek Subscribers: mgorny, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34287 llvm-svn: 305890
* Turn off "disable free" mode when preprocessing imported module files inRichard Smith2017-06-201-0/+1
| | | | | | | | | -frewrite-imports mode. This could end up accumulating a very large amount of intermediate state. Clear it out after each module file is processed. llvm-svn: 305764
* Support non-identifier module names when preprocessing modules.Richard Smith2017-06-194-11/+27
| | | | llvm-svn: 305758
* Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc"Christof Douma2017-06-194-167/+227
| | | | | | | This reverts commit 305684. This patch breaks extra/tools/clang-tidy llvm-svn: 305688
* [NFC] Refactor DiagnosticRenderer to use FullSourceLocChristof Douma2017-06-194-227/+167
| | | | | | | | | | | | | | | | Move the DiagnosticRenderer and its dependents to using FullSourceLocs instead of a SourceLocation and SourceManager pointer. The changeset is rather large but entirely mechanical. This is step one to allow DiagnosticRenderer to take either llvm::SMLocs or clang::SourceLocations. Patch by Sanne Wouda Review: https://reviews.llvm.org/D31709 Change-Id: If351a112cdf6718e2d3ef6721b8da9c6376b32dd llvm-svn: 305684
* Killing a tab and some other spurious whitespace; NFC.Aaron Ballman2017-06-161-1/+1
| | | | llvm-svn: 305586
* [PR33394] Avoid lexing editor placeholders when Clang is used onlyAlex Lorenz2017-06-161-40/+54
| | | | | | | | | | | | | | | | for preprocessing r300667 added support for editor placeholder to Clang. That commit didn’t take into account that users who use Clang for preprocessing only (-E) will get the "editor placeholder in source file" error when preprocessing their source (PR33394). This commit ensures that Clang doesn't lex editor placeholders when running a preprocessor only action. rdar://32718000 Differential Revision: https://reviews.llvm.org/D34256 llvm-svn: 305576
* Handle -ast-dump-all when passed as the only option.Aaron Ballman2017-06-151-1/+1
| | | | | | Patch by Don Hinton llvm-svn: 305432
* Be more strict when checking the -flto option valueYuka Takahashi2017-06-141-2/+8
| | | | | | | | | | | | | | Summary: It seems -flto must be either "thin" or "full". I think the use of containValue is just a typo. Reviewers: ruiu, tejohnson Subscribers: mehdi_amini, inglorion Differential Revision: https://reviews.llvm.org/D34055 llvm-svn: 305392
* Revert r305164/5/7.Daniel Jasper2017-06-121-16/+3
| | | | | | | | | | | | | | cc1as does not currently access the "--" version of this flag. At the very least this needs to be fixed and proper test cases need to be added. Simple reproducer: clang -Wa,--compress-debug-sections /tmp/test.cc Result: error: unknown argument: '--compress-debug-sections' llvm-svn: 305182
* Driver: add support for `-gz` and `-gz=`Saleem Abdulrasool2017-06-111-3/+16
| | | | | | | | | | | | | | | | | These options control the behaviour of the compression of debug info sections on ELF targets. Our behaviour slightly diverges from the behaviour of GCC. `-gz` maps to the `-compress-debug-sections` rather than `-compress-debug-sections=zlib` or `-compress-debug-sections=zlib-gnu`. This small divergence allows us to be compatible across versions of binutils (=zlib support was introduced in 2.26, while earlier versions only support =zlib-gnu). This also allows users to not have to worry about the version of the assembler they may be using if they are not using the IAS. Previously, users would have had to go through the internal option `-compress-debug-sectionss` and pass that through to the assembler, which is no longer needed. llvm-svn: 305165
* Attempt to fix shared library build: RewriteFrontend depends on ↵Richard Smith2017-06-091-0/+1
| | | | | | Serialization after r305116. llvm-svn: 305121
* Add -frewrite-imports flag.Richard Smith2017-06-093-18/+111
| | | | | | | | If specified, when preprocessing, the contents of imported .pcm files will be included in preprocessed output. The resulting preprocessed file can then be compiled standalone without the module sources or .pcm files. llvm-svn: 305116
* Add #pragma clang module build/endbuild pragmas for performing a module buildRichard Smith2017-06-092-70/+166
| | | | | | | | | | | | | | | as part of a compilation. This is intended for two purposes: 1) Writing self-contained test cases for modules: we can now write a single source file test that builds some number of module files on the side and imports them. 2) Debugging / test case reduction. A single-source testcase is much more amenable to reduction, compared to a VFS tarball or .pcm files. llvm-svn: 305101
* Speed up preamble loadingErik Verbruggen2017-06-091-7/+12
| | | | | | | | | | | | Cache filename - SourceLocation pairs to speed up preamble loading and global completion. This is especially relevant for windows, where preamble loading takes a while. Patch by Ivan Donchevskii! Differential Revision: http://reviews.llvm.org/D33493 llvm-svn: 305061
* Remove 'Filename' parameter from BeginSourceFileAction.Richard Smith2017-06-094-21/+12
| | | | | | | | | No-one was using this, and it's not meaningful in general -- FrontendActions can be run on inputs that don't have a corresponding source file. The current frontend input can be obtained by asking the FrontendAction if any future action actually needs it. llvm-svn: 305045
* [libclang] Introduce a new parsing option ↵Argyrios Kyrtzidis2017-06-091-1/+2
| | | | | | | | 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only. This is useful for parsing a single file, as a fast/inaccurate 'mode' that can still provide declarations from the file, like the classes and their methods. llvm-svn: 305044
* Represent debug information compression type fullySaleem Abdulrasool2017-06-091-1/+3
| | | | | | | | | | | This is tied with the LLVM side of the change to expose the debug information compression types to clang. We now track the compression type as an enumeration rather than a boolean. We still use the same value (GNU) that we did previously. This is in preparation to support passing down the compression type and switch it based on the command line. llvm-svn: 305039
* [sanitizer-coverage] one more flavor of coverage: ↵Kostya Serebryany2017-06-081-0/+2
| | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. Reapplying revisions 304630, 304631, 304632, 304673, see PR33308 llvm-svn: 305026
* Retain header search and preprocessing options from AST file when emittingRichard Smith2017-06-062-9/+30
| | | | | | preprocessed text for an AST file. llvm-svn: 304756
* Factor out and unify emission of "module is unavailable" diagnostics.Richard Smith2017-06-052-28/+6
| | | | | | Inspired by post-commit review of r304190. llvm-svn: 304728
* Rather than rejecting attempts to run preprocessor-only actions on AST files,Richard Smith2017-06-052-20/+94
| | | | | | | | | | replay the steps taken to create the AST file with the preprocessor-only action installed to produce preprocessed output. This can be used to produce the preprocessed text for an existing .pch or .pcm file. llvm-svn: 304726
* Revert "[sanitizer-coverage] one more flavor of coverage: ↵Renato Golin2017-06-051-2/+0
| | | | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. (clang part)" This reverts commit r304631, as it broke ARM/AArch64 bots for 2 days. llvm-svn: 304697
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-033-0/+4
| | | | llvm-svn: 304645
* [sanitizer-coverage] one more flavor of coverage: ↵Kostya Serebryany2017-06-031-0/+2
| | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. (clang part) llvm-svn: 304631
* Support lazy stat'ing of files referenced by module maps.Richard Smith2017-06-021-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 llvm-svn: 304515
* PR32848: There isn't necessarily a FileChanged or FileSkipped for every ↵Richard Smith2017-06-021-4/+3
| | | | | | | | | InclusionDirective callback. In particular, you don't get one if the inclusion directive encountered an error. Don't assert in that case. llvm-svn: 304506
* Escape filenames in module map line marker directives, to unbreak Windows ↵Richard Smith2017-06-012-4/+10
| | | | | | build bots. llvm-svn: 304464
* [Modules] Handle sanitizer feature mismatches when importing modulesVedant Kumar2017-06-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it an error to have a mismatch between the enabled sanitizers in a CU, and in any module being imported into the CU. Only mismatches between non-modular sanitizers are treated as errors. This patch also includes non-modular sanitizers in module hashes, in order to ensure module rebuilds occur when -fsanitize=X is toggled on and off for non-modular sanitizers, and to cut down on module rebuilds when the option is toggled for modular sanitizers. This fixes a longstanding issue with implicit modules and sanitizers, which Duncan originally diagnosed. When building with implicit modules it's possible to hit a scenario where modules are built without -fsanitize=address, and are subsequently imported into CUs with -fsanitize=address enabled. This causes strange failures at runtime. The case Duncan found affects libcxx, since its vector implementation behaves differently when ASan is enabled. Implicit module builds should "just work" when -fsanitize=X is toggled on and off across multiple compiler invocations, which is what this patch does. Differential Revision: https://reviews.llvm.org/D32724 llvm-svn: 304463
OpenPOWER on IntegriCloud