Commit Graph

924 Commits

Author SHA1 Message Date
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
Chris Bieneman 6c33fc1ee0 [CMake] [Order-files] Use print_function as an attempt at being forward compatible.
Based on feedback from bogner.

llvm-svn: 257936
2016-01-15 21:30:06 +00:00
Chris Bieneman d8b5bde5d6 [CMake] Support generation of linker order files using dtrace
Summary:
This patch extends the lit-based perf-training tooling supplied for PGO data generation to also generate linker order files using dtrace.

This patch should work on any system that has dtrace. If CMake can find the dtrace tool it will generate a target 'generate-order-file' which will run the per-training tests wrapped by dtrace to capture function entries. There are several algorithms implemented for sorting the order files which can be experimented with for best performance. The dtrace wrapper also supports bot oneshot and pid probes.

The perf-helper.py changes to support order file construction are ported from internal changes by ddunbar; he gets all the credit for the hard work here, I just copy and pasted.

Note: I've tested these patches on FreeBSD and OS X 10.10.

Reviewers: ddunbar, bogner, silvas

Subscribers: llvm-commits, emaste

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

llvm-svn: 257934
2016-01-15 21:21:12 +00:00
Craig Topper d3dfa14ad3 [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects in the support library will be deleted.
llvm-svn: 256731
2016-01-04 04:51:46 +00:00