diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-29 19:21:20 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-29 19:21:20 +0000 |
commit | 3ad660a5155108208fbd3483e37f199b52c1eb27 (patch) | |
tree | 9e21badca4d2e321533212eac3f7433072359e8f /llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h | |
parent | a332978b2ab53306acdef10858c7e954e605ab37 (diff) | |
download | bcm5719-llvm-3ad660a5155108208fbd3483e37f199b52c1eb27.tar.gz bcm5719-llvm-3ad660a5155108208fbd3483e37f199b52c1eb27.zip |
Detemplatize LOHDirective.
The ARM64 backend uses it only as a container to keep an MCLOHType and
Arguments around so give it its own little copy. The other functionality
isn't used and we had a crazy method specialization hack in place to
keep it working. Unfortunately that was incompatible with MSVC.
Also range-ify a couple of loops while at it.
llvm-svn: 205114
Diffstat (limited to 'llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h')
-rw-r--r-- | llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h b/llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h index 59538ea40e9..02bf7cf6fd0 100644 --- a/llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h +++ b/llvm/lib/Target/ARM64/ARM64MachineFunctionInfo.h @@ -100,20 +100,33 @@ public: const SetOfInstructions &getLOHRelated() const { return LOHRelated; } // Shortcuts for LOH related types. - typedef LOHDirective<const MachineInstr> MILOHDirective; - typedef MILOHDirective::LOHArgs MILOHArgs; + class MILOHDirective { + MCLOHType Kind; + + /// Arguments of this directive. Order matters. + SmallVector<const MachineInstr *, 3> Args; + + public: + typedef SmallVectorImpl<const MachineInstr *> LOHArgs; - typedef LOHContainer<const MachineInstr> MILOHContainer; - typedef MILOHContainer::LOHDirectives MILOHDirectives; + MILOHDirective(MCLOHType Kind, const LOHArgs &Args) + : Kind(Kind), Args(Args.begin(), Args.end()) { + assert(isValidMCLOHType(Kind) && "Invalid LOH directive type!"); + } + + MCLOHType getKind() const { return Kind; } + const LOHArgs &getArgs() const { return Args; } + }; + + typedef MILOHDirective::LOHArgs MILOHArgs; + typedef SmallVector<MILOHDirective, 32> MILOHContainer; const MILOHContainer &getLOHContainer() const { return LOHContainerSet; } /// Add a LOH directive of this @p Kind and this @p Args. void addLOHDirective(MCLOHType Kind, const MILOHArgs &Args) { - LOHContainerSet.addDirective(Kind, Args); - for (MILOHArgs::const_iterator It = Args.begin(), EndIt = Args.end(); - It != EndIt; ++It) - LOHRelated.insert(*It); + LOHContainerSet.push_back(MILOHDirective(Kind, Args)); + LOHRelated.insert(Args.begin(), Args.end()); } private: |