Commit Graph

1027 Commits

Author SHA1 Message Date
Reid Kleckner 6432d45f7b Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it
llvm-svn: 284667
2016-10-19 23:39:55 +00:00
Manuel Klimek a5cf51f2dc Delete clang-completion-mode.el.
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.

llvm-svn: 283864
2016-10-11 09:25:34 +00:00
Mehdi Amini 732afdd09a Turn cl::values() (for enum) from a vararg function to using C++ variadic 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

llvm-svn: 283671
2016-10-08 19:41:06 +00:00
Manuel Klimek e6d01e08c6 Fix warnings in clang-completion-mode.el.
- Use defvar to declare variables
- Don't use delete-backward-char, which is for interactive use only

Patch by Philipp Stephani

llvm-svn: 282573
2016-09-28 10:20:10 +00:00
Devin Coughlin 0dfc6f0809 [analyzer] SATestBuild.py: Treat '#' as comment in projectMap.csv
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

llvm-svn: 281880
2016-09-19 01:36:40 +00:00
Richard Smith 8cba29181b [docs] Order diagnostic cross-references alphabetically rather than based on
order in the .td file.

llvm-svn: 281434
2016-09-14 01:55:42 +00:00
Richard Smith ce9d586fdb Update DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics and groups in a deterministic order.
llvm-svn: 281433
2016-09-14 01:51:10 +00:00
Reid Kleckner 003bb09e78 Fix a FIXME about MSVC 2013 in the diagnostic doc generation code
Ultimately it boiled down to adding a move constructor.

llvm-svn: 281408
2016-09-13 22:22:56 +00:00
Richard Smith 85edca95c6 Work around MSVC 2013's inability to default move special members.
llvm-svn: 281382
2016-09-13 20:00:02 +00:00
Richard Smith ffa0241a03 Work around a GCC 4.7-specific issue: due to implementing older rules for
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).

llvm-svn: 281363
2016-09-13 18:35:34 +00:00
Richard Smith 67462ffce9 Add virtual destructor (necessary due to the switch to shared_ptr).
llvm-svn: 281198
2016-09-12 06:51:11 +00:00
Richard Smith 94a2fe5c8d Attempt #3 to placate MSVC.
llvm-svn: 281197
2016-09-12 06:38:31 +00:00
Richard Smith c14994f290 Attempt #2 to placate MSVC
llvm-svn: 281195
2016-09-12 06:23:26 +00:00
Richard Smith cd608d1a20 Attempt to placate MSVC.
llvm-svn: 281194
2016-09-12 06:13:44 +00:00
Richard Smith b6a3b4ba61 Add a mode to clang-tblgen to generate reference documentation for warning and
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
2016-09-12 05:58:29 +00:00
Akira Hatanaka 3d17313734 [tablegen] Check that an optional IdentifierArgument of an attribute is
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
2016-09-10 03:29:43 +00:00
Nico Weber 20e08048ec Add plumbing for new attribute type "Microsoft".
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
2016-09-03 02:55:10 +00:00
Eric Fiselier 341e825eae Implement __attribute__((require_constant_initialization)) for safe static 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
2016-09-02 18:53:31 +00:00
Eric Fiselier bcdcbd11ba Revert r280516 since it contained accidental changes.
llvm-svn: 280521
2016-09-02 18:43:25 +00:00
Eric Fiselier 92f8935e63 Implement __attribute__((require_constant_initialization)) for safe static 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
2016-09-02 18:25:29 +00:00
Chris Bieneman 7f5884a489 [Order Files] On Darwin use DTrace's oneshot probe
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
2016-08-24 22:09:46 +00:00
Vedant Kumar 957d7a00bc [clang-tblgen] Remove unused #include (NFC)
llvm-svn: 277885
2016-08-05 22:48:53 +00:00
Chris Bieneman 54e044736f Revert "[Order Files] Remove dtrace predicate"
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
2016-08-02 18:23:56 +00:00
Chris Bieneman f7a024b886 [Order Files] Remove dtrace predicate
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
2016-08-02 17:50:53 +00:00
Chris Bieneman 973781bbb4 [Order Files] Fixing an error in the perf-helper script
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
2016-08-01 22:54:00 +00:00
Chris Bieneman 7256f51b18 [Perf-Helper] Add logging for dtrace commands
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
2016-07-29 22:48:17 +00:00
Mehdi Amini 9670f847b8 [NFC] Header cleanup
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
2016-07-18 19:02:11 +00:00
Saleem Abdulrasool 511f2e5a89 Sema: support __declspec(dll*) on ObjC interfaces
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
2016-07-15 20:41:10 +00:00
Richard Smith 6e2a64f289 Add simple, stupid, pattern-based fuzzer / reducer for modules bugs. I've
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
2016-06-27 19:43:46 +00:00
David Majnemer f7e3609f77 Use ranges to concisely express iteration
No functional change is intended, this should just clean things up a
little.

llvm-svn: 273522
2016-06-23 00:15:04 +00:00
Vedant Kumar 3dd0fb3e70 [perf-training] Ignore 'Profile Note' warnings from the runtime
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
2016-06-14 19:06:48 +00:00
Vedant Kumar d6d4b3717e Remove stray semi-colon in *.py file, NFC
llvm-svn: 272610
2016-06-14 01:14:50 +00:00
Mike Spertus 27c72d2fdb Improved Visual Studio visualization of OpaquePtr
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
2016-06-13 04:02:35 +00:00
Mike Spertus ce334cf156 Visual Studio Visualizer for PackExpansionType
llvm-svn: 272522
2016-06-12 22:54:46 +00:00
Mike Spertus 47f4890bc1 Visual Studio native visualizer for ParsedTemplateArgument
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
2016-06-12 22:21:56 +00:00
Mike Spertus 5bf7fd8185 Rudimentary support for Visual Studio Stmt visualizer
Better than nothing...

llvm-svn: 272518
2016-06-12 18:42:04 +00:00
Mike Spertus 897711f018 Visual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfo
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
2016-06-11 20:15:19 +00:00
Mike Spertus 334aa07915 Visual Studio visualizers associated with LookupResults
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
2016-06-11 03:02:33 +00:00
Mike Spertus 3f19966441 Added missing close brace to OpaquePtr Visual Studio visualizer
This syntax error resulted in garbage being appended to OpaquePtr visualizations

llvm-svn: 272441
2016-06-10 22:25:43 +00:00
Richard Smith dfed58a527 Update to match LLVM r272232.
llvm-svn: 272233
2016-06-09 00:53:41 +00:00
Mike Spertus 8a0a1d7385 Improve Visual Studio visualization of DeclaratorDecl
With this change, you can now expand its name and type.

llvm-svn: 271966
2016-06-07 00:27:37 +00:00
Mike Spertus 1f56e99933 Improved Visual Studio visualizations for template argument lists
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
2016-06-06 21:41:20 +00:00
Mike Spertus 3d1ab08e8a Fix typo in last submission to visualize proper template argument
llvm-svn: 271911
2016-06-06 17:23:37 +00:00
Mike Spertus 603bbfca10 Better Visual Studio visualization of TemplateArgument and TemplateArgumentList
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
2016-06-06 17:08:32 +00:00
Mike Spertus ef8c308d69 Slightly improve Visual Studio visualization of clang::Expr
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
2016-06-06 03:37:18 +00:00
Reid Kleckner ebeb0ca80d Work around MinGW's macro definition of 'interface' to 'struct'
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
2016-05-31 17:42:56 +00:00
Benjamin Kramer cfeacf56f0 Apply clang-tidy's misc-move-constructor-init throughout Clang.
No functionality change intended, maybe a tiny performance improvement.

llvm-svn: 270996
2016-05-27 14:27:13 +00:00
Benjamin Kramer 2e018efa9b Turn copies into references as suggested by clang-tidy's performance-unnecessary-copy-initialization.
llvm-svn: 270994
2016-05-27 13:36:58 +00:00
Mike Spertus 819fb787ce Visualize ellipses in TemplateTypeParm and TemplateTypeParmDecl
Now a TemplateTypeParm will be visualized as typename ...T if it is a pack

llvm-svn: 270521
2016-05-24 01:47:41 +00:00
Mike Spertus 64aa76d9ca Visualizer for Pack template arguments
llvm-svn: 270505
2016-05-23 22:27:44 +00:00
Richard Smith 1997856936 Fix use-after-free ASan failures for modules / PCH files that deserialize abi_tag or no_sanitize attributes.
llvm-svn: 269869
2016-05-18 00:16:51 +00:00
Mike Spertus b27ebb8824 Simple visualization of expressions
While more could be done, showing the type is a lot better than what is there now.

llvm-svn: 269623
2016-05-16 01:36:09 +00:00
Eugene Zelenko a9f3e908bf Fix Clang-tidy modernize-use-bool-literals in generated code.
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
2016-05-12 22:27:08 +00:00
Peter Collingbourne 7dab685e55 Revert unnecessary tblgen change.
llvm-svn: 267788
2016-04-27 20:49:44 +00:00
Peter Collingbourne a8b2f7c0d7 Rework interface for bitset-using features to use a notion of LTO visibility.
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
2016-04-27 20:39:53 +00:00
Alex Denisov d82f494aa4 Replace hardcoded comment at 'lit.site.cfg.in'
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
2016-04-16 06:54:46 +00:00
Chris Bieneman f5a7ec7a5c [OrderFiles] Don't allow lit to run dtrace multithreaded
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
2016-04-13 17:12:56 +00:00
Chris Bieneman 834a40b463 [Perf-Training] Reworked workflow improvements for order-file generation
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
2016-04-08 22:48:18 +00:00
Richard Smith 290d801916 Re-commit r265518 ("[modules] Continue factoring encoding of AST records out of
ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug
(thanks, MSan!).

llvm-svn: 265564
2016-04-06 17:06:00 +00:00
Dmitry Polukhin 790b540099 Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."
This reverts commit r265518.

llvm-svn: 265526
2016-04-06 10:01:46 +00:00
Richard Smith 5811c40bb3 [modules] Continue factoring encoding of AST records out of ASTWriter.
llvm-svn: 265518
2016-04-06 06:26:08 +00:00
Mike Spertus 8874ef7cf1 Fix redundant "typename typename T" in Visual Studio Native Visualizer
Also, a little minor cleanup

llvm-svn: 265338
2016-04-04 19:36:48 +00:00
Mike Spertus 63e428f5de Visual Studio native visualizers for clang::TemplateSpecializationType
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
2016-04-01 03:31:43 +00:00
Mike Spertus 61c3f39401 Visual Studio native visualization for clang::TemplateDecl
With this change, TemplateDecls display in the Locals Window something like

  template<typename T, typename U> struct A;

llvm-svn: 264997
2016-03-31 06:09:56 +00:00
Mike Spertus 1796c2e37b Visual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl
With this change, a TemplateParameterList will suggestively display in the locals window something like:
  <typename T, int i>

llvm-svn: 264714
2016-03-29 10:57:24 +00:00
Mike Spertus a9ab71c65a Visual Studio native visualizer for InjectedClassNameType
Also fixes some omissions for TemplateSpecializationType

llvm-svn: 264710
2016-03-29 09:24:45 +00:00
Mike Spertus 1904598fff This file was accidentally committed with bad line endings. Fixed...
llvm-svn: 264621
2016-03-28 19:08:27 +00:00
Mike Spertus 6601a4420b Use VS2015 Project Support for Natvis to eliminate the need to manually install clang native visualizer
This is the clang equivalent to llvm commit 264601. When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013).

llvm-svn: 264603
2016-03-28 18:03:37 +00:00
Mike Spertus 8758c9ddad Display const/volatile/restrict qualifiers in Visual Studio visualizations
llvm-svn: 264229
2016-03-24 00:38:54 +00:00
Mike Spertus 85a8abee8b Visualize fields of records as they were declared in Visual Studio debugger
llvm-svn: 264169
2016-03-23 17:29:42 +00:00
Chris Bieneman 09804e275f [Perf-training] Using os.devnull instead of a temp file
This is based on post-commit feedback from Vedant. Totally didn't know that existed and worked on Windows.

Thanks Vedant!

llvm-svn: 264064
2016-03-22 16:33:23 +00:00
Chris Bieneman d4f094bb2b [Perf-training] Cleanup based on feedback from Sean Silvas
Sean provided feedback based on r257934 on cfe-commits. This change addresses that feedback.

llvm-svn: 264063
2016-03-22 16:27:35 +00:00
Chris Bieneman b6f7efa71f [Perf-training] Fixing an issue with multi-threading PGO generation
When LIT parallelizes the profraw file generation we need to generate unique temp filenames then clean them up after the driver executes.

llvm-svn: 264021
2016-03-22 02:55:40 +00:00
Mike Spertus 32e9a32225 Visual Studio Native Visualizations for constructors and methods
With this change, the class

  struct A {
    A(int _i);
    ~A();
    int foo(double d);
    double bar(A *a) { return 1.3; }
  };

appears in the VS2015 Locals Window as

D              0x02dbb378 struct A
|- DeclKind    CXXRecord
|- Members
 |- [0]        implicit struct A
 |- [1]        Constructor {A(int _i)}
 |- [2]        Destructor {~A()}
 |- [3]        Method {int foo(double d)}
 |- [4]        Method {double bar(struct A *)}
|- [Raw View]  /* Other stuff */

Note that these changes only benefit VS2015 as
VS2013 does not have views and only displays the
struct name "A", but the change does no apparent
harm in VS2013, so is still a win.

llvm-svn: 264020
2016-03-22 02:29:22 +00:00
Chris Bieneman 12fd02db6b [Perf-training] Adding support for tests to skip the clang driver
This patch adds a new set of substitutions to the lit run lines for order files and PGO generation which run the clang driver to get the cc1 command, then execute the cc1 command directly. This allows the scripts to bypass profiling the clang driver over and over again.

The approach in this patch was discussed via IRC with Sean Silvas.

Special thanks to Daniel Dunbar whose out-of-tree code I liberally plagiarized.

llvm-svn: 263997
2016-03-21 22:37:14 +00:00
Mike Spertus 6fa3e599ea Visual Studio Visualizers for clang::FunctionDecl
Readably displays a FunctionDecl in the Visual Studio Locals Window something like:
  void g(int, double d, struct A && arr)

llvm-svn: 263915
2016-03-20 20:15:23 +00:00
Mike Spertus 1d051ee78a Better visualization of clang::BuiltinType in VisualStudio
Whenever possible, use C++ names for visualizing builtin types. E.g., "long double" instead of "LongDouble"

llvm-svn: 263891
2016-03-20 00:32:30 +00:00
Mike Spertus 7f2de8e46a Visual Studio Visualizer for clang::FunctionProtoType
Displays return type and parameters for the Function Protoype object in the Locals window.

llvm-svn: 263890
2016-03-20 00:20:43 +00:00
Mike Spertus a814d3d288 Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers
This change shows members of DeclContext objects in the Visual Studio debugger. It will also cast a TagType like a class or a struct to a DeclContext, so its methods and fields are visualized. 

llvm-svn: 263794
2016-03-18 16:38:34 +00:00
Manman Ren c7890fed01 Add an optional string argument to DeprecatedAttr for Fix-It.
We only add this to __attribute__((deprecated)).

Differential Revision: http://reviews.llvm.org/D17865

llvm-svn: 263652
2016-03-16 18:50:49 +00:00
Mike Spertus 01b14bf761 Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
Created visualizer for PointerType, LValueReferenceType, RValueReferenceType, and TemplateParmType.
In addition, cleaned up the display of existing types to be more C++-like. For example, instead of

  SubstTemplateTypeParmType: {Identifier (("T"))} => Record (25), {Identifier (("A"))}

it now displays more readably as 

  SubstTemplateTypeParmType: {typename T <= struct A}

The <expand> sections still can be used for all the gory details if necessary.

llvm-svn: 263638
2016-03-16 14:27:50 +00:00
Manman Ren 42e09eb022 Print strict in Availability attribute when it is on.
llvm-svn: 263172
2016-03-10 23:54:12 +00:00
Mike Spertus 288daa5bc6 Add Visual Studio native visualizers for several Clang types
This is one of a series of changes to improve the MSVC visualization of Clang types.
This one focuses on Record and SubstTemplateTypeParmType meaning that, for example,
a TemplateArgumentLoc no longer displays incomprehensibly in the locals window as

  {Argument={DeclArg={Kind=1 QT=0x033acb00 D=0xcccccccc {DeclType=???}}...

but instead much more usefully as

  Type template parameter: SubstTemplateTypeParm: {Identifier (("T"))} => Record, {Identifier (("A"))}

Additional types and improvements will be made in subsequent commits

llvm-svn: 262933
2016-03-08 16:14:23 +00:00
Richard Smith 4f902c7ecc P0188R1: add support for standard [[fallthrough]] attribute. This is almost
exactly the same as clang's existing [[clang::fallthrough]] attribute, which
has been updated to have the same semantics. The one significant difference
is that [[fallthrough]] is ill-formed if it's not used immediately before a
switch label (even when -Wimplicit-fallthrough is disabled). To support that,
we now build a CFG of any function that uses a '[[fallthrough]];' statement
to check.

In passing, fix some bugs with our support for statement attributes -- in
particular, diagnose their use on declarations, rather than asserting.

llvm-svn: 262881
2016-03-08 00:32:55 +00:00
John McCall 477f2bb0d5 Semantic analysis for the swiftcall calling convention.
I've tried to keep the infrastructure behind parameter ABI
treatments fairly general.

llvm-svn: 262587
2016-03-03 06:39:32 +00:00
John McCall 5d7cf778e4 Add an llvm_unreachable back to the autogeneration of this covered switch.
llvm-svn: 262288
2016-03-01 02:09:20 +00:00
John McCall 2225c8b2e4 Infrastructure improvements to Clang attribute TableGen.
This should make it easier to add new Attr subclasses.

llvm-svn: 262275
2016-03-01 00:18:05 +00:00
Chandler Carruth ce55f56fbc [cmake] Revert r260742 (and r260744) to improve order file support.
This appears to be passing '-Wl,-order_file' to Linux link commands,
which then causes the linker to silently, behind the scenes, write the
output to 'rder_file' instead of somewhere else. Will work with Chris to
figure out the proper support for this, but so far there are numerous
people who can't get Clang to update when they build because of this.

llvm-svn: 261054
2016-02-17 02:13:35 +00:00
Benjamin Kramer 1b5820133f Fix a leak in the generated code for attributes with strings.
Storing std::strings in attributes simply doesn't work, we never call
the destructor. Use an array of StringRefs instead of std::strings and
copy the data into memory taken from the ASTContext.

llvm-svn: 260831
2016-02-13 18:11:49 +00:00
Chris Bieneman 3878bc4a33 [CMake] Improve the clang order-file generation workflow
Summary:
This commit re-lands r259862. The underlying cause of the build breakage was an incorrectly written capabilities test. In tools/Driver/CMakeLists.txt I was attempting to check if a linker flag worked, the test was passing it to the compiler, not the linker. CMake doesn't have a linker test, so we have a hand-rolled one.

Original Patch Review: http://reviews.llvm.org/D16896

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.

Reviewers: bogner

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16999

llvm-svn: 260742
2016-02-12 21:36:55 +00:00
Chris Bieneman dc76e70b2a Revert "[CMake] Improve the clang order-file generation workflow"
This reverts commit r259862, and attempts to fix builder CMakeCaches.

Will try this again some other time...

Conflicts:

	CMakeLists.txt
	tools/driver/CMakeLists.txt

llvm-svn: 259872
2016-02-05 03:40:37 +00:00
Chris Bieneman 1681091991 [CMake] Improve the clang order-file generation workflow
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.

Reviewers: bogner

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D16896

llvm-svn: 259862
2016-02-05 01:22:03 +00:00
Chris Bieneman 2e4c67299e Add back the ABITest makefiles
These files are standalone and not integrated with CMake, so we probably want them.

llvm-svn: 259667
2016-02-03 17:16:01 +00:00
Craig Topper 054b391cf4 No need to use utostr when putting integers into a raw_ostream. NFC
llvm-svn: 259310
2016-01-31 00:20:26 +00:00
Chris Bieneman 2bf68c6c1c Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

    "This is the way [autoconf] ends
    Not with a bang but a whimper."
    -T.S. Eliot

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D16472

llvm-svn: 258862
2016-01-26 21:30:40 +00:00
Devin Coughlin 9ea8033d1b [analyzer] SATestBuild.py: Remove html and log when producing reference results.
The html reports are huge -- every issue in a given file results in a separate
copy of the source code, in HTML form, for the file. This gets very large
quickly and it doesn't make sense to check this into a reference repository.
Also remove the log when generating reference results because it can leak
absolute path names. We still keep both the html and the log around when
producing non-reference results.

llvm-svn: 258594
2016-01-23 01:09:07 +00:00
Devin Coughlin 86f61a9a62 [analyzer] SATestBuild.py: Handle spaces in path passed to --use-analyzer.
I missed this one in r258493.

llvm-svn: 258517
2016-01-22 18:45:22 +00:00
Devin Coughlin ab95cd2794 [analyzer] Update SATestBuild.py to handle spaces in paths.
The Jenkins workspace on the new Green Dragon builder for the static analyzer has spaces
in its path.

llvm-svn: 258493
2016-01-22 07:08:06 +00:00
Craig Topper 2576124eb5 [TableGen] Merge the SuperClass Record and SMRange vector a single vector. This removes the state needed to manage the extract vector. NFC
llvm-svn: 258066
2016-01-18 19:52:54 +00:00
Chris Bieneman 3f746e67df [CMake] Fix bots broken by including order file generation in check-all
llvm-svn: 257948
2016-01-15 22:44:18 +00:00