summaryrefslogtreecommitdiffstats
path: root/clang/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* 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. llvm-svn: 281192
* [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 llvm-svn: 281132
* 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 llvm-svn: 280575
* 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 llvm-svn: 280525
* Revert r280516 since it contained accidental changes.Eric Fiselier2016-09-021-3/+1
| | | | llvm-svn: 280521
* 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 llvm-svn: 280516
* [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. llvm-svn: 279673
* [clang-tblgen] Remove unused #include (NFC)Vedant Kumar2016-08-051-1/+0
| | | | llvm-svn: 277885
* 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. llvm-svn: 277492
* [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. llvm-svn: 277487
* [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. llvm-svn: 277401
* [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. llvm-svn: 277234
* [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 llvm-svn: 275882
* 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. llvm-svn: 275610
* 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. llvm-svn: 273913
* Use ranges to concisely express iterationDavid Majnemer2016-06-231-2/+2
| | | | | | | No functional change is intended, this should just clean things up a little. llvm-svn: 273522
* [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. llvm-svn: 272695
* Remove stray semi-colon in *.py file, NFCVedant Kumar2016-06-141-1/+1
| | | | llvm-svn: 272610
* 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 llvm-svn: 272531
* Visual Studio Visualizer for PackExpansionTypeMike Spertus2016-06-121-0/+10
| | | | llvm-svn: 272522
* 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. llvm-svn: 272521
* Rudimentary support for Visual Studio Stmt visualizerMike Spertus2016-06-121-0/+6
| | | | | | Better than nothing... llvm-svn: 272518
* 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 llvm-svn: 272487
* 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} llvm-svn: 272448
* 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 llvm-svn: 272441
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | llvm-svn: 272233
* Improve Visual Studio visualization of DeclaratorDeclMike Spertus2016-06-071-0/+4
| | | | | | With this change, you can now expand its name and type. llvm-svn: 271966
* 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 *>. llvm-svn: 271944
* Fix typo in last submission to visualize proper template argumentMike Spertus2016-06-061-1/+1
| | | | llvm-svn: 271911
* Better Visual Studio visualization of TemplateArgument and TemplateArgumentListMike Spertus2016-06-061-2/+32
| | | | | | | For pack TemplateArguments, visualize all of the items in the pack Visualize a TemplateArgumentList as a template argument list. E.g., <int, double> llvm-svn: 271910
* Slightly improve Visual Studio visualization of clang::ExprMike Spertus2016-06-061-1/+1
| | | | | | | | | Now it gives the StmtClass of the Expr as well as the type. It's still a long way from full visualization of expressions, but I have found that having the class really helps when debugging, so definitely worth submitting. llvm-svn: 271866
* Work around MinGW's macro definition of 'interface' to 'struct'Reid Kleckner2016-05-311-0/+5
| | | | | | | | | | | Previous attempts to rename the IBOutletCollection argument to something other than "Interface" were undone (r127127 and r139620). Instead of renaming it, work around this in tablegen, so the public facing getter can have the usual name of 'getInterface'. Fixes PR26682 llvm-svn: 271305
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-272-8/+10
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Turn copies into references as suggested by clang-tidy's ↵Benjamin Kramer2016-05-271-6/+7
| | | | | | performance-unnecessary-copy-initialization. llvm-svn: 270994
* Visualize ellipses in TemplateTypeParm and TemplateTypeParmDeclMike Spertus2016-05-241-2/+5
| | | | | | Now a TemplateTypeParm will be visualized as typename ...T if it is a pack llvm-svn: 270521
* Visualizer for Pack template argumentsMike Spertus2016-05-231-1/+6
| | | | llvm-svn: 270505
* Fix use-after-free ASan failures for modules / PCH files that deserialize ↵Richard Smith2016-05-181-7/+33
| | | | | | abi_tag or no_sanitize attributes. llvm-svn: 269869
* Simple visualization of expressionsMike Spertus2016-05-161-0/+3
| | | | | | While more could be done, showing the type is a lot better than what is there now. llvm-svn: 269623
* Fix Clang-tidy modernize-use-bool-literals in generated code.Eugene Zelenko2016-05-121-16/+118
| | | | | | | | | | Reduce space in empty constructors and between data members and first public section. Fix some Include What You Use warnings. Differential revision: http://reviews.llvm.org/D20213 llvm-svn: 269371
* Revert unnecessary tblgen change.Peter Collingbourne2016-04-271-1/+0
| | | | llvm-svn: 267788
* Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne2016-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bitsets, and the compiler features they rely on (vtable opt, CFI), only have visibility within the LTO'd part of the linkage unit. Therefore, only enable these features for classes with hidden LTO visibility. This notion is based on object file visibility or (on Windows) dllimport/dllexport attributes. We provide the [[clang::lto_visibility_public]] attribute to override the compiler's LTO visibility inference in cases where the class is defined in the non-LTO'd part of the linkage unit, or where the ABI supports calling classes derived from abstract base classes with hidden visibility in other linkage units (e.g. COM on Windows). If the cross-DSO CFI mode is enabled, bitset checks are emitted even for classes with public LTO visibility, as that mode uses a separate mechanism to cause bitsets to be exported. This mechanism replaces the whole-program-vtables blacklist, so remove the -fwhole-program-vtables-blacklist flag. Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the support for the special attr:uuid blacklist entry is removed. Differential Revision: http://reviews.llvm.org/D18635 llvm-svn: 267784
* Replace hardcoded comment at 'lit.site.cfg.in'Alex Denisov2016-04-162-4/+4
| | | | | | | | | | | | At the moment almost every lit.site.cfg.in contains two lines comment: ## Autogenerated by LLVM/Clang configuration. # Do not edit! The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from configure_lit_site_cfg with the note and some useful information. llvm-svn: 266516
* [OrderFiles] Don't allow lit to run dtrace multithreadedChris Bieneman2016-04-131-0/+1
| | | | | | Dtrace is implemented to try and minimize performance impact on the process being traced. This results in dtrace dropping samples if it is taking too many CPU resources. Multi-threading dtrace increases the sample drop rate dramatically. llvm-svn: 266213
* [Perf-Training] Reworked workflow improvements for order-file generationChris Bieneman2016-04-081-2/+1
| | | | | | | | | | | | | | | | | | | This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64. Original Summary: With this change generating clang order files using dtrace uses the following workflow: cmake <whatever options you want> ninja generate-order-file ninja clang This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one. CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file. llvm-svn: 265864
* Re-commit r265518 ("[modules] Continue factoring encoding of AST records out ofRichard Smith2016-04-061-14/+11
| | | | | | | ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug (thanks, MSan!). llvm-svn: 265564
* Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."Dmitry Polukhin2016-04-061-11/+14
| | | | | | This reverts commit r265518. llvm-svn: 265526
* [modules] Continue factoring encoding of AST records out of ASTWriter.Richard Smith2016-04-061-14/+11
| | | | llvm-svn: 265518
* Fix redundant "typename typename T" in Visual Studio Native VisualizerMike Spertus2016-04-041-2/+3
| | | | | | Also, a little minor cleanup llvm-svn: 265338
* Visual Studio native visualizers for clang::TemplateSpecializationTypeMike Spertus2016-04-011-2/+17
| | | | | | | | Displays a template specialization as, say, A<int, double>. Does not yet handle UncommonTemplateNameStorage, QualifiedTemplateName, or DependentTemplateName, but still more than worthwhile llvm-svn: 265104
* Visual Studio native visualization for clang::TemplateDeclMike Spertus2016-03-311-0/+3
| | | | | | | | With this change, TemplateDecls display in the Locals Window something like template<typename T, typename U> struct A; llvm-svn: 264997
OpenPOWER on IntegriCloud