149764 Commits

Author SHA1 Message Date
Zachary Turner
ea64a9b812 [CodeView] Move CodeView YAML code to ObjectYAML.
This is the beginning of an effort to move the codeview yaml
reader / writer into ObjectYAML so that it can be shared.
Currently the only consumer / producer of CodeView YAML is
llvm-pdbdump, but CodeView can exist outside of PDB files, and
indeed is put into object files and passed to the linker to
produce PDB files.  Furthermore, there are subtle differences
in the types of records that show up in object file CodeView
vs PDB file CodeView, but they are otherwise 99% the same.

By having this code in ObjectYAML, we can have llvm-pdbdump
reuse this code, while teaching obj2yaml and yaml2obj to use
this syntax for dealing with object files that can contain
CodeView.

This patch only adds support for CodeView type information
to ObjectYAML.  Subsequent patches will add support for
CodeView symbol information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:53:05 +00:00
Matthias Braun
7d0dde023f TargetPassConfig: Keep a reference to an LLVMTargetMachine; NFC
TargetPassConfig is not useful for targets that do not use the CodeGen
library, so we may just as well store a pointer to an
LLVMTargetMachine instead of just to a TargetMachine.

While at it, also change the constructor to take a reference instead of a
pointer as the TM must not be nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:36:41 +00:00
Tim Northover
837e2e977f MIR: remove explicit "noVRegs" property.
We can infer this from the incoming MIR, so there's no reason to
represent it with a special flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:28:57 +00:00
Xinliang David Li
cbd4ff9310 [PartialInlining] Shrinkwrap allocas with live range contained in outline region.
Differential Revision: http://reviews.llvm.org/D33618


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304245 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 21:22:18 +00:00
Quentin Colombet
c832920d4b [Localizer] Don't trick to be smart for the insertion point
There is no guarantee that the first use of a constant that is traversed
is actually the first in the related basic block. Thus, if we use that
as the insertion point we may end up with definitions that don't
dominate there use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304244 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 20:53:06 +00:00
Ben Langmuir
a7be02e457 [llvm-config] Fix cflags test looking for "warning"
This will fail if you configure with e.g. -Wno-unknown-warning-option.
Change it to check for 'warning:' just like we did for 'error:' in
r289484.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304239 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 20:21:47 +00:00
Matthew Simpson
ed4243c350 [LV] Reapply r303763 with fix for PR33193
r303763 caused build failures in some out-of-tree tests due to an assertion in
TTI. The original patch updated cost estimates for induction variable update
instructions marked for scalarization. However, it didn't consider that the
incoming value of an induction variable phi node could be a cast instruction.
This caused queries for cast instruction costs with a mix of vector and scalar
types. This patch includes a fix for cast instructions and the test case from
PR33193.

The fix was suggested by Jonas Paulsson <paulsson@linux.vnet.ibm.com>.

Reference: https://bugs.llvm.org/show_bug.cgi?id=33193
Original Differential Revision: https://reviews.llvm.org/D33457

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304235 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:55:57 +00:00
Benjamin Kramer
35a9f9117d [Object] Remove unused field + constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304233 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:37:02 +00:00
Benjamin Kramer
85938b9f71 [Object] Fix pessimizing move.
Returning the Error by value triggers copy elision, the move is more
expensive. Clang rightfully warns about it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:36:58 +00:00
Vedant Kumar
26ba02bc31 Revert "This patch closes PR28513: an optimization of multiplication by different constants. It's implemented on DAG combiner level."
This reverts commit r304209.

I think this change is responsible for a tablgen failure in stage2 builds:

  http://green.lab.llvm.org/green/job/clang-stage2-configure-Rthinlto_build/2171/

I reproduced the failure locally (without ThinLTO), reverted the commit, rebuilt the stage1 clang, rebuilt the stage2 llvm-tblgen tool, and found that the crash disappears when the commit is reverted. Here is the stack trace:

FAILED: lib/Target/ARM/ARMGenRegisterBank.inc.tmp
cd /Volumes/Builds/pz-master-stage2-RA/lib/Target/ARM && /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes
/Builds/pz-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp
0  llvm-tblgen              0x0000000106fc9568 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  llvm-tblgen              0x0000000106fc9be6 SignalHandler(int) + 422
2  libsystem_platform.dylib 0x00000001076a7fba _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff58deb468 _sigtramp + 1366570184
4  llvm-tblgen              0x0000000106e89cc7 llvm::CodeGenRegBank::getCompositeSubRegIndex(llvm::CodeGenSubRegIndex*, llvm::CodeGenSubRegIndex*) + 615
5  llvm-tblgen              0x0000000106e88be6 llvm::CodeGenRegister::computeSubRegs(llvm::CodeGenRegBank&) + 2182
6  llvm-tblgen              0x0000000106e8e9f0 llvm::CodeGenRegBank::CodeGenRegBank(llvm::RecordKeeper&) + 2192
7  llvm-tblgen              0x0000000106f384a1 llvm::EmitRegisterBank(llvm::RecordKeeper&, llvm::raw_ostream&) + 65
8  llvm-tblgen              0x0000000106f72c64 (anonymous namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) + 1172
9  llvm-tblgen              0x0000000106fcb15f llvm::TableGenMain(char*, bool (*)(llvm::raw_ostream&, llvm::RecordKeeper&)) + 3599
10 llvm-tblgen              0x0000000106f727a6 main + 134
11 libdyld.dylib            0x000000010733c6a5 start + 1
Stack dump:
0.      Program arguments: /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes/Builds/pz-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp
/bin/sh: line 1: 41986 Segmentation fault: 11  /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes/Builds/pz
-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304231 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:25:22 +00:00
Galina Kistanova
34ca89b089 Added missing break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304230 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 19:02:49 +00:00
Keno Fischer
26b413581c Revert "[Cloning] Take another pass at properly cloning debug info"
At least one build bot is complaining. Will investigate after lunch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304228 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:56:26 +00:00
Matthias Braun
4ef46c3276 ARM: Add missing flags to TBB_[JH]T pseudo instructions
NFC except for calming down the machine verifier in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:52:33 +00:00
Keno Fischer
e34d6c6de7 [Cloning] Take another pass at properly cloning debug info
Summary:
In rL302576, DISubprograms gained the constraint that a !dbg attachments to functions must
have a 1:1 mapping to DISubprograms. As part of that change, the function cloning support
was adjusted to attempt to enforce this invariant during cloning. However, there
were several problems with the implementation. Part of these were fixed in rL304079.
However, there was a more fundamental problem with these changes, namely that it
bypasses the matadata value map, causing the cloned metadata to be a mix of metadata
pointing to the new suprogram (where manual code was added to fix those up) and the
old suprogram (where this was not the case). This mismatch could cause a number of
different assertion failures in the DWARF emitter. Some of these are given at
https://github.com/JuliaLang/julia/issues/22069, but some others have been observed
as well. Attempt to rectify this by partially reverting the manual DI metadata fixup,
and instead using the standard value map approach. To retain the desired semantics
of not duplicating the compilation unit and inlined subprograms, explicitly freeze
these in the value map.

Reviewers: dblaikie, aprantl, GorNishanov, echristo

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:28:30 +00:00
Eric Beckmann
1f0488cec7 Adding parsing ability for .res file.
Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33566

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304225 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 18:19:06 +00:00
Craig Topper
7aecbf8e99 [InstCombine] Add test cases to show missed opportunities to remove compare instructions after cttz/ctlz/ctpop where some bits of the input is known.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304224 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 17:47:59 +00:00
Krzysztof Parzyszek
79654737d7 [Hexagon] Improve code generation for 32x32-bit multiplication
For multiplications of 64-bit values (giving 64-bit result), detect
cases where the arguments are sign-extended 32-bit values, on a per-
operand basis. This will allow few patterns to match a wider variety
of combinations in which extensions can occur.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 17:47:51 +00:00
Zachary Turner
825457abaa [CodeView] Add more DebugSubsection implementations.
This adds implementations for Symbols and FrameData, and renames
the existing codeview::StringTable class to conform to the
DebugSectionStringTable convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 17:13:33 +00:00
Craig Topper
5e57487f27 [SelectionDAG] Remove special case for ISD::FPOWI from the strict FP intrinsic handling.
This code was compensating for FPOWI defaulting to Legal and many targets not changing it to Expand. This was fixed in r304215 to default to Expand so this special handling should no longer be necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304221 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 17:12:18 +00:00
Stanislav Mekhanoshin
f0c3d71794 [AMDGPU] Allow SDWA in instructions with immediates and SGPRs
An encoding does not allow to use SDWA in an instruction with
scalar operands, either literals or SGPRs. That is however possible
to copy these operands into a VGPR first.

Several copies of the value are produced if multiple SDWA conversions
were done. To cleanup MachineLICM (to hoist copies out of loops),
MachineCSE (to remove duplicate copies) and SIFoldOperands (to replace
SGPR to VGPR copy with immediate copy right to the VGPR) runs are added
after the SDWA pass.

Differential Revision: https://reviews.llvm.org/D33583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304219 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 16:49:24 +00:00
Zachary Turner
4b1845a38a [CodeView] Rename ModuleDebugFragment -> DebugSubsection.
This is more concise, and matches the terminology used in other
parts of the codebase more closely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 16:36:15 +00:00
Mark Searles
6781296ab7 [AMDGPU] Require waitcnt before barrier for all targets; adjust tests.
Differential Revision: https://reviews.llvm.org/D33576

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 16:22:43 +00:00
Craig Topper
384602a9e4 [SelectionDAG] Set ISD::FPOWI to Expand by default
Summary:
Currently FPOWI defaults to Legal and LegalizeDAG.cpp turns Legal into Expand for this opcode because Legal is a "lie".

This patch changes the default for this opcode to Expand and removes the hack from LegalizeDAG.cpp. It also removes all the code in the targets that set this opcode to Expand themselves since they can just rely on the default.

Reviewers: spatel, RKSimon, efriedma

Reviewed By: RKSimon

Subscribers: jfb, dschuff, sbc100, jgravelle-google, nemanjai, javed.absar, andrew.w.kaylor, llvm-commits

Differential Revision: https://reviews.llvm.org/D33530

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 15:27:55 +00:00
Andrew V. Tischenko
a31800bb04 This patch closes PR28513: an optimization of multiplication by different constants.
It's implemented on DAG combiner level.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 13:00:44 +00:00
Max Kazantsev
e840b9f244 [SCEV][NFC] Remove redundant params from isAvailableAtLoopEntry
Params DT and LI are redundant, because these values are contained in fields anyways.

Differential Revision: https://reviews.llvm.org/D33668


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 10:54:58 +00:00
Ulrich Weigand
ccbe107148 [SystemZ] Add decimal floating-point instructions
This adds assembler / disassembler support for the decimal
floating-point instructions.  Since LLVM does not yet have
support for decimal float types, these cannot be used for
codegen at this point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 10:15:16 +00:00
Ulrich Weigand
002ef9b847 [SystemZ] Add hexadecimal floating-point instructions
This adds assembler / disassembler support for the hexadecimal
floating-point instructions.  Since the Linux ABI does not use
any hex float data types, these are not useful for codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 10:13:23 +00:00
Ulrich Weigand
903a50124a [SystemZ] Add missing assembler/disassembler tests
A few instructions that are actually correctly supported in the
assembler and disassembler did not have any tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 10:11:13 +00:00
Oliver Stannard
94eec101b3 [MC] Fix constant pools with DenseMap sentinel values
The MC ConstantPool class uses a DenseMap to track generated constants, with
the int64_t value of the constant as the key. This fails when values of
0x7fffffffffffffff or 0x7ffffffffffffffe are inserted into the constant pool, as
these are sentinel values for DenseMap.

The fix is to use std::map instead, which doesn't use sentinel values.

Differential revision: https://reviews.llvm.org/D33667



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 09:37:11 +00:00
Zoran Jovanovic
db736ce4a1 [mips] Expansion of LI.S and LI.D
Author: smaksimovic
Reviewers: dsanders sdardis
Introduces LI.S and LI.D pseudo instructions with floating point operands.
Differential Revision: https://reviews.llvm.org/D14390


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 09:33:43 +00:00
Kristof Beyls
21ff45022b Fix PR33031: correct the estimate of maximum offset for instructions spilling/filling the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 06:58:41 +00:00
Daniel Berlin
0ef24304b8 NewGVN: Compute hash value of expression on demand and use it in inequality testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 06:58:18 +00:00
Daniel Berlin
328a635eb4 NewGVN: Fix PR33194, memory corruption by putting temporary instructions in tables sometimes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 06:42:29 +00:00
Galina Kistanova
38012725da Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 03:30:34 +00:00
Galina Kistanova
72f550d188 Added missing line continuation to HANDLE_DIEVALUE_SMALL and HANDLE_DIEVALUE_LARGE macros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304186 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 03:21:12 +00:00
Galina Kistanova
c927ec6baf Reverted r303602, as it will be fixed in gtest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 03:17:10 +00:00
Joerg Sonnenberger
ef8c4cd636 Revert r303763, results in asserts i.e. while building Ruby.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 22:52:17 +00:00
Craig Topper
04877f744d [TableGen] Use StringMap instead of DenseMap<StringRef> to unique CodeInit and StringInit objects. Override the allocator to keep using the BumpPtrAllocator. NFCI
StringMap is better suited to mapping strings than a DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304178 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 21:49:37 +00:00
Craig Topper
70ac7747fa [TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80 column violations in arg_begin/arg_end. Remove DagInit::args and use getArgs instead. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 21:49:34 +00:00
Benjamin Kramer
e005fa57be [ManagedStatic] Avoid putting function pointers in template args.
This is super awkward, but GCC doesn't let us have template visible when
an argument is an inline function and -fvisibility-inlines-hidden is
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 20:56:27 +00:00
Davide Italiano
dbdee033c3 [GlobalIsel] Fix a warning with GCC 7 -Wpedantic. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 20:13:22 +00:00
Zvi Rackover
f3bd691d3b [X86] Add tests for (ix bitcast (vxi1 and ...)). NFC.
To be improved by D33311.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 19:00:57 +00:00
Zvi Rackover
cebaae1718 [X86] Replace undef value in flaky test
D33311 exposes the flakiness in this test. Replacing the undef placed by
bugpoint, makes it more interesting and robust.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 18:27:00 +00:00
Benjamin Kramer
613a9c723b [ManagedStatic] Make object_creator/object_deleter visible again.
They're now exposed as template args, which creates complications when
ManagedStatics are used across .so boundaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 18:00:33 +00:00
Benjamin Kramer
bcabbd57dc Don't destroy ManagedStatics in a unit test.
Turns out this is very hostile towards other unit tests running in the
same process, it unregisters all flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 17:25:37 +00:00
Benjamin Kramer
0666890a33 [wasm] Fix test after r304117.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 16:32:52 +00:00
Benjamin Kramer
3259254476 [X86] Don't fold away the memory operand of an xchg.
xchg with a mem operand has different locking semantics. If we unfold it
into a xchg r,r we will loose the implicit lock. Likewise we never want
to fold a register xchg into a memory one as it would be a lot slower.

This triggers during LLVM selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 16:25:20 +00:00
Ayal Zaks
98be03e2e2 [Docs] Add VectorizationPlan to docs/Proposals.
Following the request made in https://reviews.llvm.org/D32871, the
general documentation of the Vectorization Plan is hereby placed
under docs/Proposals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304161 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 15:36:23 +00:00
Benjamin Kramer
107c8c925e Try to work around MSVC being buggy. Attempt #1.
error C2971: 'llvm::ManagedStatic': template parameter 'Creator': 'CreateDefaultTimerGroup': a variable with non-static storage duration cannot be used as a non-type argument

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 14:28:04 +00:00
Benjamin Kramer
6d432cf813 [Timer] Move DefaultTimerGroup into a ManagedStatic.
This used to be just leaked. r295370 made it use magic statics. This adds
a global destructor, which is something we'd like to avoid. It also creates
a weird situation where the mutex used by TimerGroup is re-created during
global shutdown and leaked.

Using a ManagedStatic here is also subtle as it relies on the mutex
inside of ManagedStatic to be recursive. I've added a test for that
in a previous change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 14:05:29 +00:00