summaryrefslogtreecommitdiffstats
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* [TableGen] Only normalize the spelling of GNU-style attributes.Justin Lebar2017-01-051-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang] Update lit config in utils/perf-trainingAlexander Shaposhnikov2017-01-042-4/+3
| | | | | | | | | | | | | 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
* [clang] Fix clean build of generate-order-fileAlexander Shaposhnikov2016-12-311-1/+5
| | | | | | | | | | | | | | 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
* Adapt to llvm/TableGen DagInit changes.Matthias Braun2016-12-051-15/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288645 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: Adapt to llvm r288612Matthias Braun2016-12-042-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288614 91177308-0d34-0410-b5e6-96231b3b80d8
* [TableGen] Ignore fake args for parsing-related arg counts.George Burgess IV2016-12-011-0/+4
| | | | | | | | | | | | | | | | | | | 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
* [TableGen] Minor clean-ups. NFC.George Burgess IV2016-12-011-52/+42
| | | | | | | | | | 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
* Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).Eugene Zelenko2016-11-291-19/+44
| | | | | | | 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
* Use noexcept instead of LLVM_NOEXCEPT now that all compilers support itReid Kleckner2016-10-191-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284667 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete clang-completion-mode.el.Manuel Klimek2016-10-111-248/+0
| | | | | | | | | | | | It has been unmaintained for a while (last change was more than four years ago), and it appears not widely used. By now there are multiple well-maintained alternatives (emacs-ycmd, atuo-complete-clang), and if users try to make this work they'll likely have a bad user experience. Reasoning and problems pointed out by Philipp Stephani. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283864 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-2/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warnings in clang-completion-mode.el.Manuel Klimek2016-09-281-7/+6
| | | | | | | | | - Use defvar to declare variables - Don't use delete-backward-char, which is for interactive use only Patch by Philipp Stephani git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282573 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csvDevin Coughlin2016-09-191-0/+8
| | | | | | | | | | Treat lines in projectMap.csv that start with '#' as comments. This enables a workflow where projects can be temporarily disabled with a comment describing when they should be turned back on. Differential Revision: https://reviews.llvm.org/D24709 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281880 91177308-0d34-0410-b5e6-96231b3b80d8
* [docs] Order diagnostic cross-references alphabetically rather than based onRichard Smith2016-09-141-0/+1
| | | | | | | order in the .td file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281434 91177308-0d34-0410-b5e6-96231b3b80d8
* Update DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics ↵Richard Smith2016-09-141-3/+12
| | | | | | and groups in a deterministic order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281433 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME about MSVC 2013 in the diagnostic doc generation codeReid Kleckner2016-09-131-5/+7
| | | | | | Ultimately it boiled down to adding a move constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281408 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around MSVC 2013's inability to default move special members.Richard Smith2016-09-131-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281382 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around a GCC 4.7-specific issue: due to implementing older rules forRichard Smith2016-09-131-0/+5
| | | | | | | | | | | | implicit declarations of move operations, GCC 4.7 would find that SelectPiece has neither a move constructor nor a copy constructor. The copy constructor was (correctly) deleted because the class has a member of move-only type, and the move constructor was (incorrectly, per current C++ rules) not provided because the class has a copy-only base class (in turn because it explicitly declares a destructor). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281363 91177308-0d34-0410-b5e6-96231b3b80d8
* Add virtual destructor (necessary due to the switch to shared_ptr).Richard Smith2016-09-121-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281198 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt #3 to placate MSVC.Richard Smith2016-09-121-4/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281197 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt #2 to placate MSVCRichard Smith2016-09-121-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281195 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to placate MSVC.Richard Smith2016-09-121-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281194 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a mode to clang-tblgen to generate reference documentation for warning andRichard Smith2016-09-123-1/+432
| | | | | | | | | remark flags. For now I'm checking in a copy of the built documentation, but we can replace this with a placeholder (as we do for the attributes reference documentation) once we enable building this server-side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281192 91177308-0d34-0410-b5e6-96231b3b80d8
* [tablegen] Check that an optional IdentifierArgument of an attribute isAkira Hatanaka2016-09-101-1/+7
| | | | | | | | | | | | | provided before trying to print it. This fixes a segfault that occurs when function printPretty generated by tablegen tries to print an optional argument of attribute objc_bridge_related. rdar://problem/28155469 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281132 91177308-0d34-0410-b5e6-96231b3b80d8
* Add plumbing for new attribute type "Microsoft".Nico Weber2016-09-031-6/+22
| | | | | | | | | This is for attributes in []-delimited lists preceding a class, like e.g. `[uuid("...")] class Foo {};` Not used by anything yet, so no behavior change. Part of https://reviews.llvm.org/D23895 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280575 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __attribute__((require_constant_initialization)) for safe static ↵Eric Fiselier2016-09-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: This attribute specifies expectations about the initialization of static and thread local variables. Specifically that the variable has a [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization) according to the rules of [basic.start.static]. Failure to meet this expectation will result in an error. Static objects with constant initializers avoid hard-to-find bugs caused by the indeterminate order of dynamic initialization. They can also be safely used by other static constructors across translation units. This attribute acts as a compile time assertion that the requirements for constant initialization have been met. Since these requirements change between dialects and have subtle pitfalls it's important to fail fast instead of silently falling back on dynamic initialization. ```c++ // -std=c++14 #define SAFE_STATIC __attribute__((require_constant_initialization)) static struct T { constexpr T(int) {} ~T(); }; SAFE_STATIC T x = {42}; // OK. SAFE_STATIC T y = 42; // error: variable does not have a constant initializer // copy initialization is not a constant expression on a non-literal type. ``` This attribute can only be applied to objects with static or thread-local storage duration. Reviewers: majnemer, rsmith, aaron.ballman Subscribers: jroelofs, cfe-commits Differential Revision: https://reviews.llvm.org/D23385 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280525 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r280516 since it contained accidental changes.Eric Fiselier2016-09-021-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280521 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __attribute__((require_constant_initialization)) for safe static ↵Eric Fiselier2016-09-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: This attribute specifies expectations about the initialization of static and thread local variables. Specifically that the variable has a [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization) according to the rules of [basic.start.static]. Failure to meet this expectation will result in an error. Static objects with constant initializers avoid hard-to-find bugs caused by the indeterminate order of dynamic initialization. They can also be safely used by other static constructors across translation units. This attribute acts as a compile time assertion that the requirements for constant initialization have been met. Since these requirements change between dialects and have subtle pitfalls it's important to fail fast instead of silently falling back on dynamic initialization. ```c++ // -std=c++14 #define SAFE_STATIC __attribute__((require_constant_initialization)) static struct T { constexpr T(int) {} ~T(); }; SAFE_STATIC T x = {42}; // OK. SAFE_STATIC T y = 42; // error: variable does not have a constant initializer // copy initialization is not a constant expression on a non-literal type. ``` This attribute can only be applied to objects with static or thread-local storage duration. Reviewers: majnemer, rsmith, aaron.ballman Subscribers: jroelofs, cfe-commits Differential Revision: https://reviews.llvm.org/D23385 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280516 91177308-0d34-0410-b5e6-96231b3b80d8
* [Order Files] On Darwin use DTrace's oneshot probeChris Bieneman2016-08-241-0/+5
| | | | | | The oneshot probe only gets executed the first time the probe is hit in the process. For order file generation this is really all we care about. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279673 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tblgen] Remove unused #include (NFC)Vedant Kumar2016-08-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277885 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Order Files] Remove dtrace predicate"Chris Bieneman2016-08-021-1/+2
| | | | | | | | This reverts commit r277487. Removing the probe predicate was a red herring. It results in more symbols being placed in the final order file, but they are symbols from outside the clang image. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277492 91177308-0d34-0410-b5e6-96231b3b80d8
* [Order Files] Remove dtrace predicateChris Bieneman2016-08-021-2/+1
| | | | | | Having the dtrace predicate setup to only show probes in clang filters out static initializers executed by dyld, which we do want included in the order files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277487 91177308-0d34-0410-b5e6-96231b3b80d8
* [Order Files] Fixing an error in the perf-helper scriptChris Bieneman2016-08-011-1/+1
| | | | | | Dtrace probemod needs to be based on the first argument of the command, not the first argument of the args. This error was introduced a while back when I added support for skipping the driver and invoking cc1 directly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277401 91177308-0d34-0410-b5e6-96231b3b80d8
* [Perf-Helper] Add logging for dtrace commandsChris Bieneman2016-07-291-0/+1
| | | | | | Logging the dtrace command into the top of the dtrace log is useful when debugging why the order file generation is flaky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277234 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-182-6/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: support __declspec(dll*) on ObjC interfacesSaleem Abdulrasool2016-07-151-0/+9
| | | | | | | | | | | Extend the __declspec(dll*) attribute to cover ObjC interfaces. This was requested by Microsoft for their ObjC support. Cover both import and export. This only adds the semantic analysis portion of the support, code-generation still remains outstanding. Add some basic initial documentation on the attributes that were previously empty. Tweak the previous tests to use the relative expected-warnings to make the tests easier to read. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275610 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple, stupid, pattern-based fuzzer / reducer for modules bugs. I'veRichard Smith2016-06-271-0/+166
| | | | | | | | already used this to find and reduce quite a few bugs, and it works pretty well if you can find the right patterns. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273913 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ranges to concisely express iterationDavid Majnemer2016-06-231-2/+2
| | | | | | | No functional change is intended, this should just clean things up a little. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273522 91177308-0d34-0410-b5e6-96231b3b80d8
* [perf-training] Ignore 'Profile Note' warnings from the runtimeVedant Kumar2016-06-141-0/+1
| | | | | | | | | | | | | | | After r272599, -DLLVM_BUILD_INSTRUMENTED passes a default argument to -fprofile-instr-generate. This confuses the perf-helper script because the runtime emits a note stating that the default is overridden by the LLVM_PROFILE_FILE environment variable. Change the perf-helper script s.t it does not treat these notes as failures. This isn't a strictly NFC change, but I don't see a simple way to add a test for it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272695 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove stray semi-colon in *.py file, NFCVedant Kumar2016-06-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272610 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved Visual Studio visualization of OpaquePtrMike Spertus2016-06-131-0/+18
| | | | | | | | | | | Create a special visualizer for OpaquePtr<QualType> because the standard visualizer doesn't work with OpaquePtr<QualType> due to QualType being heavily dependent on traits to be pointer-like. Also, created an identical visualizer for UnionOpaquePtr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272531 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual Studio Visualizer for PackExpansionTypeMike Spertus2016-06-121-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272522 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual Studio native visualizer for ParsedTemplateArgumentMike Spertus2016-06-121-0/+11
| | | | | | | | | | | Does a good job with type and non-type template arguments and lays the groundwork for template template arguments to visualize well once there is a TemplateName visualizer. Also fixed what looks like an incorrect comment in the header for ParsedTemplate.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272521 91177308-0d34-0410-b5e6-96231b3b80d8
* Rudimentary support for Visual Studio Stmt visualizerMike Spertus2016-06-121-0/+6
| | | | | | | Better than nothing... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272518 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfoMike Spertus2016-06-111-0/+39
| | | | | | | | | | | | Created a visualizer for ActionResult that displayed the validity and the pointer, but many of them initially displayed poorly. It turns out that the primary culprit is that LocInfoType is often passed in an action result, but it is not the same as other types. For example, LocInfoType is not in TypeNodes.def and clang::Type::TypeClass does not have a LocInfoType enum. After adding a special visualizer for LocInfoType, the display was more useful git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272487 91177308-0d34-0410-b5e6-96231b3b80d8
* Visual Studio visualizers associated with LookupResultsMike Spertus2016-06-111-0/+18
| | | | | | | | | | | | Visualizers for DeclAccessPair, UnresolvedSet, and LookupResult. For example, when combined with LLVM diff D21256 (currently in review), a Lookup set will show much more naturally in the Locals window something like Found: {public typename ...Ts} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272448 91177308-0d34-0410-b5e6-96231b3b80d8
* Added missing close brace to OpaquePtr Visual Studio visualizerMike Spertus2016-06-101-1/+1
| | | | | | | This syntax error resulted in garbage being appended to OpaquePtr visualizations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272441 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272233 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve Visual Studio visualization of DeclaratorDeclMike Spertus2016-06-071-0/+4
| | | | | | | With this change, you can now expand its name and type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271966 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved Visual Studio visualizations for template argument listsMike Spertus2016-06-061-1/+22
| | | | | | | | | | | Improved the visualizer for TemplateArgumentList to show type arguments in the DisplayString. E.g., <double, long>. Added a visualizer for MultiLevelTemplateArgumentList. I decided to display them by how they would appear in a template with the (non-existent) template-id's omitted, so the DisplayString naturally presents as something like <double, long>::<char *>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271944 91177308-0d34-0410-b5e6-96231b3b80d8