- Jun 02, 2017
-
-
Richard Smith authored
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304515 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jun 01, 2017
-
-
Vedant Kumar authored
Check pointer arithmetic for overflow. For some more background on this check, see: https://wdtz.org/catching-pointer-overflow-bugs.html https://reviews.llvm.org/D20322 Patch by Will Dietz and John Regehr! This version of the patch is different from the original in a few ways: - It introduces the EmitCheckedInBoundsGEP utility which inserts checks when the pointer overflow check is enabled. - It does some constant-folding to reduce instrumentation overhead. - It does not check some GEPs in CGExprCXX. I'm not sure that inserting checks here, or in CGClass, would catch many bugs. Possible future directions for this check: - Introduce CGF.EmitCheckedStructGEP, to detect overflows when accessing structures. Testing: Apart from the added lit test, I ran check-llvm and check-clang with a stage2, ubsan-instrumented clang. Will and John have also done extensive testing on numerous open source projects. Differential Revision: https://reviews.llvm.org/D33305 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304459 91177308-0d34-0410-b5e6-96231b3b80d8
-
Peter Collingbourne authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304385 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 31, 2017
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304253 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 28, 2017
-
-
Eric Fiselier authored
Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304107 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 27, 2017
-
-
Eric Fiselier authored
This reverts commit r304054. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304057 91177308-0d34-0410-b5e6-96231b3b80d8
-
Eric Fiselier authored
Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304054 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 09, 2017
-
-
Tom Stellard authored
Adapt to changes made in r302499. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302500 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 08, 2017
-
-
Daniel Jasper authored
DontAlign This converts the clang-format option AlignEscapedNewlinesLeft from a boolean to an enum, named AlignEscapedNewlines, with options Left (prev. true), Right (prev. false), and a new option DontAlign. When set to DontAlign, the backslashes are placed just after the last token in each line: #define EXAMPLE \ do { \ int x = aaaaa; \ int b; \ int dddddddddd; \ } while (0) Patch by jtbandes. Thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302428 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
Patch by Roman Lebedev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302419 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 07, 2017
-
-
Eric Fiselier authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302364 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 06, 2017
-
-
Kostya Serebryany authored
[sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. clang part. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302320 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 05, 2017
-
-
Jakub Kuderski authored
Summary: This adds a new ASTMatcher for CXXStdInitializerListExprs that matches C++ initializer list expressions. The primary motivation is to use it to fix [[ https://bugs.llvm.org/show_bug.cgi?id=32896 | PR32896 ]] (review here [[ https://reviews.llvm.org/D32767 | D32767 ]]). Reviewers: alexfh, Prazek, aaron.ballman Reviewed By: alexfh, aaron.ballman Subscribers: malcolm.parsons, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302287 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
Patch by Roman Lebedev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302275 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 02, 2017
-
-
Vedant Kumar authored
This reverts commit r300295. It's no longer true, print_stacktrace=1 is supported on Darwin/Windows as of r301839. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301960 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kostya Serebryany authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301888 91177308-0d34-0410-b5e6-96231b3b80d8
-
- May 01, 2017
-
-
Kostya Serebryany authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301824 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 24, 2017
-
-
Craig Topper authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301202 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 20, 2017
-
-
Vassil Vassilev authored
Currently we have #include <Sema.h> in the doxygen page documenting Sema. The patch changes it ot #include "clang/Sema/Sema.h" which is what we would spell if we need to include it in a real codebase. Patch by Yuka Takahashi (D32113)! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300825 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kostya Serebryany authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300776 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 19, 2017
-
-
Kostya Serebryany authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300738 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 18, 2017
-
-
Alex Lorenz authored
This is a recommit of r300539 that was reverted in r300543 due to test failures. The original commit message is displayed below: The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300556 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
Some tests fail on the Windows buildbots. I will have to investigate more. This commit reverts r300539, r300540 and r300542. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300543 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300539 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 14, 2017
-
-
Vedant Kumar authored
Printing out stack traces along with UBSan diagnostics is unsupported on Darwin. That's because it isn't possible to use the fast unwinder or the slow unwinder. Apparently, it's inappropriate to use the fast unwinder for UBSan issues. I'm not exactly sure why (see the comment in ubsan_diag.cc). Forcing use of the fast unwinder produces decent results, AFAICT. Darwin also does not appear to have a slow unwinder suitable for use with the sanitizers. Apparently that's because of PR20800 [1][2]. But that bug has been fixed. I'm not sure if there is anything preventing use of the slow unwinder now. Currently, passing UBSAN_OPTIONS=print_stacktrace=1 does nothing on Darwin. This isn't good, but it might be a while before we can fix the situation, so we should at least document it. [1] https://github.com/google/sanitizers/issues/137 "We can't use the slow unwinder on OSX now, because Clang produces incorrect unwind info for the ASan runtime functions on OSX (http://llvm.org/PR20800)." [2] https://bugs.llvm.org/show_bug.cgi?id=20800 Bug 20800 - Invalid compact unwind info generated for a function without frame pointers on OSX git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300295 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300271 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300270 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 13, 2017
-
-
Eric Fiselier authored
Summary: [LWG 2911](http://cplusplus.github.io/LWG/lwg-defects.html#2911) adds `std::is_aggregate` to the library, which requires a new builtin trait. This patch implements `__is_aggregate`. Reviewers: rsmith, majnemer, aaron.ballman Reviewed By: aaron.ballman Subscribers: STL_MSFT, cfe-commits Differential Revision: https://reviews.llvm.org/D31513 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300116 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 12, 2017
-
-
Bruno Cardoso Lopes authored
One way to currently test the reproducers is to setup "FORCE_CLANG_DIAGNOSTICS_CRASH=1" before invoking clang. This simulates a crash and produces the same contents needed by the reproducers. The reproducers are specially useful when triaging Modules issues, not only on crashes, but also for reproducing misleading warnings, errors, etc. Add a '-gen-reproducer' driver option to clang (or any similar name) and give users a flag option. Note that clang already has a -fno-crash-diagnostics, which disables the crash reproducers. I've decided not to propose "-fcrash-diagnostics" since it doesn't convey the ideia of reproduction despite a crash. rdar://problem/24114619 Differential Revision: https://reviews.llvm.org/D27604 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300109 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 11, 2017
-
-
Sylvestre Ledru authored
Reviewers: djasper Reviewed By: djasper Subscribers: Eugene.Zelenko, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D31408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299919 91177308-0d34-0410-b5e6-96231b3b80d8
-
Peter Collingbourne authored
docs: Use the term "whole-program devirtualization" instead of "virtual function call optimization". The former term is probably more familiar to users. Also add references to the command line flags used to enable the features described in the doc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299902 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 05, 2017
-
-
Nico Weber authored
clang-format <<END auto c1 = u8'a'; auto c2 = u'a'; END Before: auto c1 = u8 'a'; auto c2 = u'a'; Now: auto c1 = u8'a'; auto c2 = u'a'; Patch from Denis Gladkikh <llvm@denis.gladkikh.email>! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299574 91177308-0d34-0410-b5e6-96231b3b80d8
-
Adam Nemet authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299488 91177308-0d34-0410-b5e6-96231b3b80d8
-
Adam Nemet authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299481 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Apr 04, 2017
-
-
Adam Nemet authored
This adds the new pragma and the first variant, contract(on/off/fast). The pragma has the same block scope rules as STDC FP_CONTRACT, i.e. it can be placed at the beginning of a compound statement or at file scope. Similarly to STDC FP_CONTRACT there is no need to use attributes. First an annotate token is inserted with the parsed details of the pragma. Then the annotate token is parsed in the proper contexts and the Sema is updated with the corresponding FPOptions using the shared ActOn function with STDC FP_CONTRACT. After this the FPOptions from the Sema is propagated into the AST expression nodes. There is no change here. I was going to add a 'default' option besides 'on/off/fast' similar to STDC FP_CONTRACT but then decided against it. I think that we'd have to make option uppercase then to avoid using 'default' the keyword. Also because of the scoped activation of pragma I am not sure there is really a need a for this. Differential Revision: https://reviews.llvm.org/D31276 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299470 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 28, 2017
-
-
Eric Liu authored
Reviewers: hokein, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D28671 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298912 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 22, 2017
-
-
Stephan Bergmann authored
Reviewers: rsmith, rizsotto.mailinglist Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31133 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298490 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 21, 2017
-
-
Eric Christopher authored
The alias was only ever used on darwin and had some issues there, and isn't used in practice much. Also fixes a problem with -mno-altivec not turning off -maltivec. Also add a diagnostic for faltivec/fno-altivec that directs users to use maltivec options and include the altivec.h file explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298449 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 20, 2017
-
-
Vedant Kumar authored
PR32346 suggests that UBSan's docs about the -fsanitize, -fno-sanitize-recover, and -fsanitize-trap options are not explicit enough. Try to improve the wording. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298310 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kostya Serebryany authored
Summary: Proposal: Backward-edge CFI for return statements (RCFI) Reviewers: pcc, eugenis, krasin Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31112 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298303 91177308-0d34-0410-b5e6-96231b3b80d8
-