Commit Graph

1127 Commits

Author SHA1 Message Date
George Karpenkov 4c51d85a89 [analyzer] [tests] Write to logfile instead of stdout while updating
reference results

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326295 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28 01:55:23 +00:00
Aaron Ballman bee15dcc32 Improve the way attribute argument printing happens for omitted optional arguments when pretty printing.
Patch by Joel Denny.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326266 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 23:49:28 +00:00
Jonas Hahnfeld abe788081e [docs] Fix duplicate arguments for JoinedAndSeparate
We can't see how many arguments are in the meta var name, so just
assume that it is the right number.

Differential Revision: https://reviews.llvm.org/D42840

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325805 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-22 17:06:27 +00:00
Alexey Bataev 62d1174367 [OpenMP] Fix trailing space when printing pragmas, by Joel. E. Denny
Summary:
-ast-print prints omp pragmas with a trailing space.  While this
behavior is likely of little concern to most users, surely it's
unintentional, and it's annoying for some source-level work I'm
pursuing.  This patch focuses on omp pragmas, but it also fixes
init_seg and loop hint pragmas because they share implementation.

The testing strategy here is to add usually just one '{{$}}' per
relevant -ast-print test file.  This seems to achieve good code
coverage.  However, this strategy is probably easy to forget as the
tests evolve.  That's probably fine as this fix is far from critical.
The main goal of the testing is to aid the initial review.

This patch also adds a fixme for "#pragma unroll", which prints as
"#pragma unroll (enable)", which is invalid syntax.

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

Differential Revision: https://reviews.llvm.org/D43204

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325145 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 17:38:47 +00:00
George Karpenkov a701b12944 [analyzer] [tests] Update CmpRuns to write to stdout correctly in multithreaded environment
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-13 23:36:01 +00:00
George Karpenkov 6187d33bf2 [analyzer] [tests] Fix a typo in analyzer testing script.
Incorrect option instance construction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-12 22:13:01 +00:00
George Karpenkov 9f84a49dbd [analyzer] [tests] Fixing an error after non-atomic cherry-pick
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324762 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-09 18:48:31 +00:00
George Karpenkov 3cc1cf93fc [analyzer] [tests] [NFC] Remove a fragile tightly-coupled component emulating parser output
...when we can just use the real parser instead.

Differential Revision: https://reviews.llvm.org/D43098

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324759 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-09 18:39:47 +00:00
George Karpenkov 880486c0ff [analyzer] [tests] Test different projects concurrently
Differential Revision: https://reviews.llvm.org/D43031

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324652 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 21:22:42 +00:00
George Karpenkov c58ab38fd0 [analyzer] [tests] Show function name in CmpRuns output
Combined with enabled flag for stable filenames, this greatly simplifies
finding the offending report.

Differential Revision: https://reviews.llvm.org/D42831

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324362 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 17:22:09 +00:00
George Karpenkov 7a1006f6f3 [analyzer] [tests] Fix crash in SATestBuild.py
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324114 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-02 18:27:14 +00:00
George Karpenkov de212366a3 [analyzer] [tests] [NFC] Remove dead code from CmpRuns
Indeed, "CHANGE" is not a thing yet, and we should probably not carry
around dead code which does not do anything apart from confusing the
reader.

Differential Revision: https://reviews.llvm.org/D42819

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324027 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 22:40:01 +00:00
George Karpenkov ef79198e68 [analyzer] [tests] Add an option to show the histogram of path differences between the analyzer runs
Differential Revision: https://reviews.llvm.org/D42778

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324021 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 22:25:18 +00:00
Adrian Prantl 604238e317 Mark fallthrough with LLVM_FALLTHROUGH
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323986 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 18:10:20 +00:00
George Karpenkov ea016449cc [analyzer] [tests] Show the number of removed/added bug reports
Differential Revision: https://reviews.llvm.org/D42718

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323941 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 02:38:42 +00:00
George Karpenkov 44c0f4cce2 [analyzer] Use stable filenames in analyzer testing infrastructure
Makes finding the right file in test results easier.

Differential Revision: https://reviews.llvm.org/D42445

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323697 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 21:45:07 +00:00
Benjamin Kramer 244006d31e Unused diagnostics can occur in tblgen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323435 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 15:57:22 +00:00
Hiroshi Inoue ee91cd8cc8 [NFC] fix trivial typos in comments
"the the" -> "the"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323078 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-22 07:44:38 +00:00
Abderrazek Zaafrani 5d89c44ccd [AArch64] Add ARMv8.2-A FP16 scalar intrinsics
https://reviews.llvm.org/D41792

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323006 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 23:11:18 +00:00
Richard Smith 38b23a4558 Make attribute instantiation instantiate all attributes, not just the first of
each kind.

Attribute instantiation would previously default to instantiating each kind of
attribute only once. This was overridden by a flag whose intended purpose was
to permit attributes from a prior declaration to be inherited onto a new
declaration even if that new declaration had its own copy of the attribute.
This is the wrong behavior: when instantiating attributes from a template, we
should always instantiate all the attributes that were written on that
template.

This patch renames the flag in the Attr class (and TableGen sources) to more
clearly identify what it's actually for, and removes the usage of the flag from
template instantiation. I also removed the flag from AlignedAttr, which was
only added to work around the incorrect suppression of duplicate attribute
instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321834 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 23:42:29 +00:00
Aaron Ballman f09294c09f Introduce some infrastructure for adding C attributes with [[]] syntax.
This patch adds support to the attribute tablegen for specifying a [[]] attribute is allowed in C mode. This patch also adds the annotate attribute to the list of double square bracket attributes we support in C mode.

Eventually, I anticipate that this logic will be reversed (you have to opt out of allowing an attribute in C rather than opting in), but I want to see how the design plays out as more attributes are considered.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 22:22:48 +00:00
Benjamin Kramer 3edb08be72 Avoid int to string conversion in Twine or raw_ostream contexts.
Some output changes from uppercase hex to lowercase hex, no other functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28 16:58:54 +00:00
Abderrazek Zaafrani 749de2d465 [AARch64] Add ARMv8.2-A FP16 vector intrinsics
Putting back the code that was reverted few weeks ago.

Differential Revision: https://reviews.llvm.org/D34161

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321294 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21 19:20:01 +00:00
Erich Keane 6bb630e324 Add support for ObjectFormat to TargetSpecificAttr
Looking through the code, I saw a FIXME on IFunc to switch it
to a target specific attribute. In looking through it, i saw that
the no-longer-appropriately-named TargetArch didn't support ObjectFormat
checking.

This patch changes the name of TargetArch to TargetSpecific
(since it checks much more than just Arch), makes "Arch" optional, adds
support for ObjectFormat, better documents the TargetSpecific type, and
changes IFunc over to a TargetSpecificAttr.

Differential Revision: https://reviews.llvm.org/D41303


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20 18:51:08 +00:00
Adrian Prantl 550c574546 Silence a bunch of implicit fallthrough warnings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19 22:06:11 +00:00
Aaron Ballman f3dc130210 Determine the attribute subject for diagnostics based on declarative information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing.
This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc).

Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319002 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-26 20:01:12 +00:00
Aaron Ballman 79c395c08e Move the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-04 20:06:22 +00:00
George Karpenkov 13cb2b7774 [analyzer] [tests] Remove empty folders in reference results, do not store diffs.txt
Storing diffs.txt is now redundant, as we simply dump the CmpRuns output
to stdout (it is saved in CI and tends to be small).
Not generating those files enables us to remove empty folders, which
confuse git, as it would not add them with reference results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30 19:40:33 +00:00
George Karpenkov b26cd8eec6 [Analyzer] [Tests] Fixing typo from the previous commit.
Can not open a non-existent file with r+.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316808 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-27 22:52:36 +00:00
George Karpenkov 0d8450b358 [Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316806 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-27 22:39:54 +00:00
Don Hinton 67b501a525 New lldb python module for managing diagnostic breakpoints
Summary:
Can be used to set breakpoints for either the diagnostics actually
emitted for the current compilation, a particular DiagID, or all
DiagIDs for a particular warning.

Differential Revision: https://reviews.llvm.org/D36347

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-27 17:02:33 +00:00
George Karpenkov bce8668f19 [Analyzer] [Tests] Write analyzers crashes to stdout, and not to a separate file
With this change it would be sufficient to look at CI console to see the
failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316687 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26 19:00:22 +00:00
Aaron Ballman d090ddde40 Add a new attribute definition spelling, Clang<"attr">, that expands to two attribute spellings: GNU<"attr"> and CXX11<"clang", "attr">. This is similar to how the GCC spelling works and is intended to be used for attributes introduced for Clang.
Changes all existing attributes that currently use GNU<"attr"> and CXX11<"clang", "attr> spellings to instead use the Clang<"attr"> spelling.

No additional tests are necessary because the existing tests already use both spellings for the attributes converted to the new spelling. No functional changes are expected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316658 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26 12:19:02 +00:00
George Karpenkov 9107ad9e5f [Analyzer] [Tests] Consistently use exit codes. Use code=42 to signify different results
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26 01:13:22 +00:00
George Karpenkov d67bfb9c5a [Analyzer] [Tests] Do not discard output from CmpRuns.py when running integration tests
Contrary to the deleted comment, in most cases CmpRuns.py produces a
fairly small amount of output, which is useful to see straight away to
see what has changed when executing the integration tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25 21:49:46 +00:00
George Karpenkov d8eca0ac08 [Analyzer] [Tests] Minor refactor of testing infrastructure:
Move utilities functions into a separate file to make comprehension
easier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 23:52:48 +00:00
George Karpenkov 7ffb1b28fb [Analyzer] [Tests] Remove temporary fields from generated reference results.
Pointer to HTML diagnostics is removed (as it is not stored) as well as
the version (as it would be available from the commit message).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 23:52:46 +00:00
George Karpenkov 15627d6263 [Analyzer] Fix bug in testing scripts, which always marked result as failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 22:24:13 +00:00
Aaron Ballman 1b97bbcc56 Silence -Wimplicit-fallthrough warnings with the generated code; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 12:11:58 +00:00
Erich Keane 551dc900ed Fix usage in TableGen of getValueAsString
Record::getValueAsString returns a stringref to an interned
string (apparently had been changed since most of tablegen was
written). In this patch, I audited the usage of getValueAsString
to find places where we can trivially stop storing 'std::string' and instead
keep the stringref.

There was one instance where an unnecessary 'stringstream' was being used,
so that has been removed as well to unblock the stringref replacing string fix.

Differential Revision: https://reviews.llvm.org/D38979


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-16 23:25:24 +00:00
Erich Keane d9cf6d4934 Replace usage of std::stringstream with raw_string_ostream
Typically we don't use the stringstream, so instead use
raw_string_stream.  Additionally, the dependent function
changed to use raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-16 22:47:26 +00:00
Erich Keane 40df0cb905 Sort Attributes by "HeaderName"
Attributes in the docs were previously sorted (apparently)
by the attribute name, so AnyX86Interrupt ended up being the
first one, rather than in a meaningful place. This resulted in the
4 'interrupt' titled sections being all in different places.

This replaces it with a naive alphabetical sort (case sensitive, underscore
and special characters first, etc).

Differential Revision: https://reviews.llvm.org/D38969


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315931 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-16 20:31:05 +00:00
Aaron Ballman 0b63209b05 Add -f[no-]double-square-bracket-attributes as new driver options to control use of [[]] attributes in all language modes. This is the initial implementation of WG14 N2165, which is a proposal to add [[]] attributes to C2x, but also allows you to enable these attributes in C++98, or disable them in C++11 or later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-15 15:01:42 +00:00
Alexander Shaposhnikov 290556e7d3 [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA
At the moment if LLVM_BUILD_INSTRUMENTED is set to True 
one has to set LLVM_PROFTDATA even if it's not really used 
(because of message(FATAL_ERROR ...)). 
Building the instrumented version of Clang can be useful even if 
one doesn't plan to build the target generate-profdata
(currently that target would only compile utils/perf-training/cxx/hello_world.cpp).
For example, one can run the instrumented version of Clang 
via a separate build system against a different codebase, 
collect/analyze the profiles and merge them by llvm-profdata later.

Differential revision: https://reviews.llvm.org/D38859


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-13 03:21:39 +00:00
George Karpenkov 9197bbb6e9 [Analyzer] Remove dead code from testing scripts
Differential Revision: https://reviews.llvm.org/D38488

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11 18:42:39 +00:00
George Karpenkov 9f31f2539f [Analyzer Tests] Run static analyzer integration tests until the end,
Do not stop at the first failure.

Differential Revision: https://reviews.llvm.org/D38589

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05 17:32:06 +00:00
George Karpenkov 812f8f999c [Analyzer Tests] Fix misc bugs in analyzer reference results updater.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314960 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-05 01:02:20 +00:00
George Karpenkov 86395f102e [Analyzer] Make testing scripts flake8 compliant
Differential Review: https://reviews.llvm.org/D38213

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-02 17:59:12 +00:00
George Karpenkov 1d37cb4e87 [Analyzer] Add nullability to the list of tested checkers in SATestBuild
Differential Revision: https://reviews.llvm.org/D38162

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314572 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-30 00:05:24 +00:00
George Karpenkov 56635e1e5f [Analyzer] Fix minor errors in python scripts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22 22:58:46 +00:00
George Karpenkov 392a9db851 [Analyzer] Static analyzer script for updating reference results
The script updates reference results from the previous run, and stages them.

Differential Revision: https://reviews.llvm.org/D38157

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22 01:43:12 +00:00
George Karpenkov d578df7f78 [Analyzer] Refactor analyzer testing scripts.
- Exporting needed function for future reuse.
 - Idiomatic python: using with `file as f` instead of `try/finally`.
 - Fixing some indentation issues.
 - No need to reinvent python `multiprocessing.getCPUCount()`
 - Removing a function parameter which is always the same under all invocations.
 - Adding some docstrings.

Differential Revision: https://reviews.llvm.org/D38156

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22 01:41:16 +00:00
George Karpenkov 551a3cb90e [Analyzer] Use CC environment variable to select analyzer path in SATestBuild.
This change is required to easily test the given checkout of the analyzer,
rather than the one bundled with a system compiler.

Differential Revision: https://reviews.llvm.org/D38155

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 22:12:49 +00:00
George Karpenkov 2f6a914998 [Analyzer] Add simple help to SATestAdd.py
Differential Revision: https://reviews.llvm.org/D38003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 21:47:33 +00:00
George Karpenkov b937f758ff [Analyzer] Remove dead code from CmpRuns.py.
Differential Revision: https://reviews.llvm.org/D38003

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-21 21:47:13 +00:00
Konstantin Zhuravlyov a7577861db Add '\n' in ClangDataCollectorsEmitter
Differential Revision: https://reviews.llvm.org/D37599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312795 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-08 16:17:16 +00:00
Johannes Altmanninger 451a8da2ab [AST] Add TableGen for StmtDataCollectors
Summary:
This adds an option "-gen-clang-data-collectors" to the Clang TableGen
that is used to generate StmtDataCollectors.inc.

Reviewers: arphaman, teemperor!

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D37383

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-06 13:20:51 +00:00
Richard Smith 33face3d0a Do not look through pack expansions when looking for unexpanded parameter packs.
Fixes a selection of rejects-valids when pack-expanding a lambda that itself
contains a pack expansion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-15 22:58:45 +00:00
Yuka Takahashi 1a3ea7bcf3 [Bash-autocompletion] Show HelpText with possible flags
Summary:
`clang --autocomplete=-std` will show
```
-std:   Language standard to compile for
-std=   Language standard to compile for
-stdlib=        C++ standard library to use
```
after this change.

However, showing HelpText with completion in bash seems super tricky, so
this feature will be used in other shells (fish, zsh...).

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D35759

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309113 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 13:36:58 +00:00
Yuka Takahashi 50fc19e473 [Bash-completion] Fixed a bug that file doesn't autocompleted after =
Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

Differential Revision: https://reviews.llvm.org/D35763

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 13:30:36 +00:00
Yuka Takahashi db54025161 [Bash-autocompletion] Fixed a bug on bash
Summary: Maybe I mismerged when merging previous commits by hand.

Differential Revision: https://reviews.llvm.org/D35448

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308091 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-15 09:09:51 +00:00
Yuka Takahashi 609e559729 [Bash-autocompletion] Auto complete cc1 options if -cc1 is specified
Summary:
We don't want to autocomplete flags whose Flags class has `NoDriverOption` when argv[1] is not `-cc1`.

Another idea for this implementation is to make --autocomplete a cc1
option and handle it in clang Frontend, by porting --autocomplete
handler from Driver to Frontend, so that we can handle Driver options
and CC1 options in unified manner.

Differential Revision: https://reviews.llvm.org/D34770

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-08 17:48:59 +00:00
Yuka Takahashi ed22ecfce6 [Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly
Summary: Fixed a bug that -foo=bar wasn't handled properly on old version of bash.

Differential Revision: https://reviews.llvm.org/D34927

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-08 17:34:02 +00:00
Sjoerd Meijer 5bf57dfedf This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
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 16:37:31 +00:00
Michael Zolotukhin a1cfa91c1c Fix one more reference to lit.util.capture()
The capture method was removed in r306643.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 21:06:11 +00:00
Yuka Takahashi d958391d29 [Bash-autocompletion] Add support for older bash version.
Summary:
OS X seems to use older bash version which doesn't suport
_init_completion and compopt, so add support for this.

Reviewers: ruiu, v.g.vassilev, teemperor

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D34924

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306962 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 18:32:55 +00:00
Yuka Takahashi ce9e71cd08 [Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME
Summary: `~/build/bin/clang -f[tab]` was executed without ~ expanded to $HOME, so changed this by expanding ~ to path using eval.

Differential Revision: https://reviews.llvm.org/D34925

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306957 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-01 16:30:02 +00:00
Yuka Takahashi af42c8bd38 [Bash-autocompletion] Invoke clang where user called
Summary:
When user build clang and used completion Eg. `build/bin/clang -fno[tab]`, we want to invoke `build/bin/clang --autocomplete=-fno`, rather than `clang --autocomplete=-fno`.

Differential Revision: https://reviews.llvm.org/D34761

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306559 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 16:29:26 +00:00
Yuka Takahashi ddb61cae6a [Bash-autocompletion] Check clang version in Bash
Summary:
Add check if user's clang version supports --autocomplete or not.
If not, we just autocomplete files.

Reviewers: ruiu, v.g.vassilev, teemperor

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D34607

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306555 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 15:59:55 +00:00
Yuka Takahashi 908e5ec11c [bash-autocompletion] Delete space after flags which has '=' prefix
Summary:
This is patch for bash completion for clang project.
We don't need space when completing options like "-stdlib=".

Differential Revision: https://reviews.llvm.org/D34594

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 00:35:36 +00:00
Abderrazek Zaafrani 6e3f80de39 [AArch64] ADD ARMv.2-A FP16 vector intrinsics
Differential Revision: https://reviews.llvm.org/D34161

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305820 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 18:54:57 +00:00
Yuka Takahashi f5f37badaf [GSoC] Flag value completion for clang
This is patch for GSoC project, bash-completion for clang.

To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.

In this patch, Options.td was mainly changed in order to add value class
in Options.inc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305805 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-20 16:31:31 +00:00
Vedant Kumar d4d74154eb Revert "[AArch64] Add ARMv8.2-A FP16 vefctor intrinsics"
This reverts commit r304493. It breaks all the Darwin bots:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/37168

Failure:
Failing Tests (2):
    Clang :: CodeGen/aarch64-v8.2a-neon-intrinsics.c
    Clang :: CodeGen/arm_neon_intrinsics.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 01:22:14 +00:00
Abderrazek Zaafrani d751aefbc7 [AArch64] Add ARMv8.2-A FP16 vefctor intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:22:29 +00:00
Craig Topper 7530780af3 [TableGen] Clang changes to support Record::getValueAsString and getValueAsListOfStrings returning StringRef instead of std::string
This is the clang version of D33710.

Differential Revision: https://reviews.llvm.org/D33711

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304326 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 19:01:22 +00:00
Argyrios Kyrtzidis b4d1da0e78 Enhance the 'diagnose_if' attribute so that we can apply it for ObjC methods and properties as well
This is an initial commit to allow using it with constant expressions, a follow-up commit will enable full support for it in ObjC methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24 00:46:27 +00:00
Yuka Takahashi 67b9708e37 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 18:52:27 +00:00
Yuka Takahashi d7b775c00f [GSoC] Shell autocompletion for clang
Summary:
This is a first patch for GSoC project, bash-completion for clang.
To use this on bash, please run `source clang/utils/bash-autocomplete.sh`.
bash-autocomplete.sh is code for bash-completion.

Simple flag completion and path completion is available in this patch.

Reviewers: teemperor, v.g.vassilev, ruiu, Bigcheese, efriedma

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33237

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303670 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 18:39:08 +00:00
Saleem Abdulrasool 088659bc77 utils: Silence -Wpedantic warning
llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp:1673:67: warning: default argument specified for lambda parameter [-Wpedantic]
                    const Record *Constraint = nullptr) {
                                               ^~~~~~~

Found by gcc 5.4.0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301783 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-01 00:26:59 +00:00
Alex Lorenz 9192aede9d Add #pragma clang attribute support to the external_source_symbol attribute
Prior to this commit the external_source_symbol attribute wasn't supported by
#pragma clang attribute for the following two reasons:

- The Named attribute subject hasn't been supported by TableGen.
- There was no way to specify a subject match rule for #pragma clang attribute
 that could operate on a set of attribute subjects (e.g. the ones that derive
 from NamedDecl).

This commit fixes the two issues and thus adds external_source_symbol support to
#pragma clang attribute.

rdar://31169028

Differential Revision: https://reviews.llvm.org/D32176


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 15:52:11 +00:00
Alex Lorenz 4bbde6cf2a Add #pragma clang attribute
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
2017-04-18 14:33:39 +00:00
Alex Lorenz 7844d0af18 Revert r300539 - Add #pragma clang attribute
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
2017-04-18 10:46:41 +00:00
Alex Lorenz df381a38cf Fix one more 'not all control paths return a value' MSVC warning
The warning was caused by r300539.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 10:17:41 +00:00
Alex Lorenz 4163ed68e2 [TableGen] Fix MSVC warning that occurs in TableGen generated function
This should fix the Windows buildbot failure that happened after r300539.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 09:59:27 +00:00
Alex Lorenz c79938aaca Add #pragma clang attribute
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
2017-04-18 09:41:47 +00:00
Faisal Vali 919ac41f65 [NFC, Scoped Enum] Convert Sema::ExpressionEvaluationContext into a scoped Enum
- also replace direct equality checks against the ConstantEvaluated enumerator  with isConstantEvaluted(), in anticipation of adding finer granularity to the various ConstantEvaluated contexts and reinstating certain restrictions on where lambda expressions can occur in C++17.

- update the clang tablegen backend that uses these Enumerators, and add the relevant scope where needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-01 21:30:49 +00:00
Erich Keane 4a1e0b13e7 Correct class-template deprecation behavior-REDUX
Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Previous DiffRev: https://reviews.llvm.org/D27486, was reverted.
This patch fixes the issues brought up here by the reverter: https://reviews.llvm.org/rL298410

Differential Revision: https://reviews.llvm.org/D31245


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 18:51:54 +00:00
Martin Bohme d29393efed Revert "Correct class-template deprecation behavior"
This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 13:34:37 +00:00
Erich Keane c1312361da Correct class-template deprecation behavior
Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Differential Revision: https://reviews.llvm.org/D27486


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 17:49:17 +00:00
Richard Smith 029306869e Improve workaround for Sphinx's lack of support for command line options containing '+', '.' etc. to be more stable as the set of options changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 01:54:42 +00:00
Richard Smith 9d48ebf07b [docs] Add TableGen-based generator for command line argument documentation,
and generate documentation for all (non-hidden) options supported by the
'clang' driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 19:39:46 +00:00
David L. Jones e147e84fec Switch TableGen to emit calls to ASTRecordReader for AttrPCHRead.
Summary:
This patch changes TableGen-generated code in AttrPCHRead to call functions on
ASTRecordReader, instead of passing separate parameters to ASTReader. This is a
follow-up to r290217.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28007

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 01:04:30 +00:00
Justin Lebar 15128fbc1c [TableGen] Only normalize the spelling of GNU-style attributes.
Summary:
When Sema looks up an attribute name, it strips off leading and trailing
"__" if the attribute is GNU-style.  That is, __attribute__((foo)) and
__attribute__((__foo__)) are equivalent.

This is only true for GNU-style attributes.  In particular,
__declspec(__foo__) is not equivalent to __declspec(foo), and Sema
respects this difference.

This patch fixes TableGen to match Sema's behavior.  The spelling
'GNU<"__foo__">' should be normalized to 'GNU<"foo">', but
'Declspec<"__foo__">' should not be changed.

This is necessary to make CUDA compilation work on Windows, because e.g.
the __device__ attribute is spelled __declspec(__device__).

Attr.td does not contain any Declspec spellings that start or end with
"__", so this change should not affect any other attributes.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D28318

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291129 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 16:51:54 +00:00
Alexander Shaposhnikov a8ae85fe8f [clang] Update lit config in utils/perf-training
This diff replaces --driver-mode=cpp in
utils/perf-training/order-files.lit.cfg and
utils/perf-training/lit.cfg with --driver-mode=g++.
clang --driver-mode=cpp will call the preprocessor and will not
trigger compilation.

Differential revision: https://reviews.llvm.org/D28269


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290936 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 04:33:28 +00:00
Alexander Shaposhnikov 021fcf99fa [clang] Fix clean build of generate-order-file
This diff fixes the clean build of the target generate-order-file.
In llvm/tools/clang/CMakeLists.txt 
add_subdirectory(utils/perf-training) should go after the block where 
the value of the variable CLANG_ORDER_FILE is set - otherwise 
(tested with cmake's version 3.6.2) the arguments of perf-helper.py gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).

Differential revision: https://reviews.llvm.org/D28153


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-31 05:25:52 +00:00
Matthias Braun 7bf57ebec1 Adapt to llvm/TableGen DagInit changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-05 06:00:51 +00:00
Matthias Braun cdc1a6e2aa TableGen: Adapt to llvm r288612
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-04 05:55:09 +00:00
George Burgess IV 2f42451024 [TableGen] Ignore fake args for parsing-related arg counts.
We should complain about the following:

```
void foo() __attribute__((unavailable("a", "b")));
```

Instead, we currently just ignore "b". (...We also end up ignoring "a",
because we assume elsewhere that this attribute can only have 1 or 0
args.)

This happens because `unavailable` has a fake enum arg, and
`AttributeList::{getMinArgs,getMaxArgs}` include fake args in their
counts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 17:52:39 +00:00
George Burgess IV ee1551204c [TableGen] Minor clean-ups. NFC.
Primarily: try to use DenseSet<StringRef> instead of
std::set<std::string>, and use pretty range algos where we can.

Small sizes were arbitrarily chosen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 00:13:18 +00:00
Eugene Zelenko 65a595e5a4 Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
This preparation to remove SetVector.h dependency on SmallSet.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:44:24 +00:00