summaryrefslogtreecommitdiffstats
path: root/clang/utils
Commit message (Collapse)AuthorAgeFilesLines
* Revert r326602, it caused PR36620.Nico Weber2018-03-071-136/+3
| | | | llvm-svn: 326862
* TableGen: Give up on exact fixits for diagnostic groupsNicolai Haehnle2018-03-061-32/+6
| | | | | | | | | | | With recent changes in the TableGen frontend, we no longer have usable location information for anonymous defs. Fixes test breakage caused by r326788. The normal, non-error TableGen output is not affected by this change. llvm-svn: 326822
* [Bash-autocompletion] Pass all flags in shell command-line to ClangYuka Takahashi2018-03-051-30/+11
| | | | | | | | | | | | | | | | | | | | Previously, we passed "#" to --autocomplete to indicate to enable cc1 flags. For example, when -cc1 or -Xclang was passed to bash, bash executed `clang --autocomplete=#-<flag they want to complete>`. However, this was not a good implementation because it depends -Xclang and -cc1 parsing to shell. So I changed this to pass all flags shell has, so that Clang can handle them internally. I had to change many testcases because API spec changed quite a lot. Reviewers: teemperor, v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39342 llvm-svn: 326684
* [Attr] Fix parameter indexing for several attributesJoel E. Denny2018-03-021-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch fixes a number of bugs related to parameter indexing in attributes: * Parameter indices in some attributes (argument_with_type_tag, pointer_with_type_tag, nonnull, ownership_takes, ownership_holds, and ownership_returns) are specified in source as one-origin including any C++ implicit this parameter, were stored as zero-origin excluding any this parameter, and were erroneously printing (-ast-print) and confusingly dumping (-ast-dump) as the stored values. * For alloc_size, the C++ implicit this parameter was not subtracted correctly in Sema, leading to assert failures or to silent failures of __builtin_object_size to compute a value. * For argument_with_type_tag, pointer_with_type_tag, and ownership_returns, the C++ implicit this parameter was not added back to parameter indices in some diagnostics. This patch fixes the above bugs and aims to prevent similar bugs in the future by introducing careful mechanisms for handling parameter indices in attributes. ParamIdx stores a parameter index and is designed to hide the stored encoding while providing accessors that require each use (such as printing) to make explicit the encoding that is needed. Attribute declarations declare parameter index arguments as [Variadic]ParamIdxArgument, which are exposed as ParamIdx[*]. This patch rewrites all attribute arguments that are processed by checkFunctionOrMethodParameterIndex in SemaDeclAttr.cpp to be declared as [Variadic]ParamIdxArgument. The only exception is xray_log_args's argument, which is encoded as a count not an index. Differential Revision: https://reviews.llvm.org/D43248 llvm-svn: 326602
* [analyzer] [tests] Create a directory for the log fileGeorge Karpenkov2018-03-011-0/+2
| | | | llvm-svn: 326408
* Test commit access: apply clang-format suggestionJoel E. Denny2018-02-281-2/+2
| | | | llvm-svn: 326332
* [analyzer] [tests] Write to logfile instead of stdout while updatingGeorge Karpenkov2018-02-281-17/+18
| | | | | | reference results llvm-svn: 326295
* Improve the way attribute argument printing happens for omitted optional ↵Aaron Ballman2018-02-271-37/+97
| | | | | | | | arguments when pretty printing. Patch by Joel Denny. llvm-svn: 326266
* [docs] Fix duplicate arguments for JoinedAndSeparateJonas Hahnfeld2018-02-221-7/+15
| | | | | | | | | 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 llvm-svn: 325805
* [OpenMP] Fix trailing space when printing pragmas, by Joel. E. DennyAlexey Bataev2018-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 325145
* [analyzer] [tests] Update CmpRuns to write to stdout correctly in ↵George Karpenkov2018-02-132-14/+18
| | | | | | multithreaded environment llvm-svn: 325070
* [analyzer] [tests] Fix a typo in analyzer testing script.George Karpenkov2018-02-121-1/+1
| | | | | | Incorrect option instance construction. llvm-svn: 324946
* [analyzer] [tests] Fixing an error after non-atomic cherry-pickGeorge Karpenkov2018-02-091-0/+1
| | | | llvm-svn: 324762
* [analyzer] [tests] [NFC] Remove a fragile tightly-coupled component ↵George Karpenkov2018-02-092-22/+12
| | | | | | | | | | emulating parser output ...when we can just use the real parser instead. Differential Revision: https://reviews.llvm.org/D43098 llvm-svn: 324759
* [analyzer] [tests] Test different projects concurrentlyGeorge Karpenkov2018-02-082-81/+180
| | | | | | Differential Revision: https://reviews.llvm.org/D43031 llvm-svn: 324652
* [analyzer] [tests] Show function name in CmpRuns outputGeorge Karpenkov2018-02-061-3/+9
| | | | | | | | | Combined with enabled flag for stable filenames, this greatly simplifies finding the offending report. Differential Revision: https://reviews.llvm.org/D42831 llvm-svn: 324362
* [analyzer] [tests] Fix crash in SATestBuild.pyGeorge Karpenkov2018-02-021-0/+7
| | | | llvm-svn: 324114
* [analyzer] [tests] [NFC] Remove dead code from CmpRunsGeorge Karpenkov2018-02-011-21/+6
| | | | | | | | | | 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 llvm-svn: 324027
* [analyzer] [tests] Add an option to show the histogram of path differences ↵George Karpenkov2018-02-011-2/+42
| | | | | | | | between the analyzer runs Differential Revision: https://reviews.llvm.org/D42778 llvm-svn: 324021
* Mark fallthrough with LLVM_FALLTHROUGHAdrian Prantl2018-02-011-1/+1
| | | | llvm-svn: 323986
* [analyzer] [tests] Show the number of removed/added bug reportsGeorge Karpenkov2018-02-011-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D42718 llvm-svn: 323941
* [analyzer] Use stable filenames in analyzer testing infrastructureGeorge Karpenkov2018-01-291-0/+1
| | | | | | | | Makes finding the right file in test results easier. Differential Revision: https://reviews.llvm.org/D42445 llvm-svn: 323697
* Unused diagnostics can occur in tblgen.Benjamin Kramer2018-01-251-1/+1
| | | | llvm-svn: 323435
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-01-221-2/+2
| | | | | | "the the" -> "the" llvm-svn: 323078
* [AArch64] Add ARMv8.2-A FP16 scalar intrinsicsAbderrazek Zaafrani2018-01-193-1/+153
| | | | | | https://reviews.llvm.org/D41792 llvm-svn: 323006
* Make attribute instantiation instantiate all attributes, not just the first ofRichard Smith2018-01-041-2/+10
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 321834
* Introduce some infrastructure for adding C attributes with [[]] syntax.Aaron Ballman2018-01-031-0/+2
| | | | | | | | 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. llvm-svn: 321763
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-3/+3
| | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. llvm-svn: 321526
* [AARch64] Add ARMv8.2-A FP16 vector intrinsicsAbderrazek Zaafrani2017-12-211-1/+5
| | | | | | | | Putting back the code that was reverted few weeks ago. Differential Revision: https://reviews.llvm.org/D34161 llvm-svn: 321294
* Add support for ObjectFormat to TargetSpecificAttrErich Keane2017-12-201-40/+42
| | | | | | | | | | | | | | | | 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 llvm-svn: 321201
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-191-3/+3
| | | | llvm-svn: 321115
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-261-121/+57
| | | | | | | | | | 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). llvm-svn: 319002
* Move the clang-tblgen project into the Clang tablegenning folder on IDEs ↵Aaron Ballman2017-11-041-0/+1
| | | | | | like Visual Studio rather than leave it in the root directory. NFC. llvm-svn: 317418
* [analyzer] [tests] Remove empty folders in reference results, do not store ↵George Karpenkov2017-10-302-17/+12
| | | | | | | | | | | 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. llvm-svn: 316948
* [Analyzer] [Tests] Fixing typo from the previous commit.George Karpenkov2017-10-271-1/+1
| | | | | | Can not open a non-existent file with r+. llvm-svn: 316808
* [Analyzer] [Tests] Dump the output of scan-build to stdout on failure.George Karpenkov2017-10-271-5/+6
| | | | | | Eliminates extra lookup step during debugging. llvm-svn: 316806
* New lldb python module for managing diagnostic breakpointsDon Hinton2017-10-271-0/+192
| | | | | | | | | | | 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 llvm-svn: 316773
* [Analyzer] [Tests] Write analyzers crashes to stdout, and not to a separate fileGeorge Karpenkov2017-10-261-20/+12
| | | | | | | With this change it would be sufficient to look at CI console to see the failure. llvm-svn: 316687
* Add a new attribute definition spelling, Clang<"attr">, that expands to two ↵Aaron Ballman2017-10-261-6/+10
| | | | | | | | | | 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. llvm-svn: 316658
* [Analyzer] [Tests] Consistently use exit codes. Use code=42 to signify ↵George Karpenkov2017-10-262-10/+13
| | | | | | different results llvm-svn: 316632
* [Analyzer] [Tests] Do not discard output from CmpRuns.py when running ↵George Karpenkov2017-10-252-15/+1
| | | | | | | | | | 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. llvm-svn: 316618
* [Analyzer] [Tests] Minor refactor of testing infrastructure:George Karpenkov2017-10-242-115/+122
| | | | | | | Move utilities functions into a separate file to make comprehension easier. llvm-svn: 316535
* [Analyzer] [Tests] Remove temporary fields from generated reference results.George Karpenkov2017-10-241-0/+8
| | | | | | | 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). llvm-svn: 316534
* [Analyzer] Fix bug in testing scripts, which always marked result as failure.George Karpenkov2017-10-241-0/+1
| | | | llvm-svn: 316522
* Silence -Wimplicit-fallthrough warnings with the generated code; NFC.Aaron Ballman2017-10-181-1/+1
| | | | llvm-svn: 316075
* Fix usage in TableGen of getValueAsStringErich Keane2017-10-161-28/+27
| | | | | | | | | | | | | | | 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 llvm-svn: 315956
* Replace usage of std::stringstream with raw_string_ostreamErich Keane2017-10-161-2/+3
| | | | | | | | Typically we don't use the stringstream, so instead use raw_string_stream. Additionally, the dependent function changed to use raw_ostream. llvm-svn: 315950
* Sort Attributes by "HeaderName" Erich Keane2017-10-161-20/+36
| | | | | | | | | | | | | | 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 llvm-svn: 315931
* Add -f[no-]double-square-bracket-attributes as new driver options to control ↵Aaron Ballman2017-10-151-28/+50
| | | | | | 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. llvm-svn: 315856
* [clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting ↵Alexander Shaposhnikov2017-10-131-6/+6
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 315665
OpenPOWER on IntegriCloud