Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLVM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Erhardt
LLVM
Commits
dd8fc7bd
Commit
dd8fc7bd
authored
12 years ago
by
Fabian Scheler
Browse files
Options
Downloads
Patches
Plain Diff
added missing stuff
- TriCoreFrameLowering.cpp - missing namespace
parent
223875ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Target/TriCore/TriCoreFrameLowering.cpp
+74
-0
74 additions, 0 deletions
lib/Target/TriCore/TriCoreFrameLowering.cpp
lib/Target/TriCore/TriCoreMisc.cpp
+3
-1
3 additions, 1 deletion
lib/Target/TriCore/TriCoreMisc.cpp
with
77 additions
and
1 deletion
lib/Target/TriCore/TriCoreFrameLowering.cpp
0 → 100644
+
74
−
0
View file @
dd8fc7bd
//===-- TriCoreFrameLowering.cpp - Frame info for TriCore Target --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains TriCore frame information that doesn't fit anywhere else
// cleanly...
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "target_tricore"
#include
"TriCoreFrameLowering.h"
#include
"TriCoreInstrInfo.h"
#include
"TriCoreMisc.h"
#include
"TriCore.h"
#include
"llvm/Function.h"
#include
"llvm/CodeGen/MachineInstrBuilder.h"
#include
"llvm/CodeGen/RegisterScavenging.h"
#include
"llvm/Support/Debug.h"
#include
"llvm/Support/raw_ostream.h"
#include
"llvm/Target/TargetInstrInfo.h"
namespace
llvm
{
// Inserts prologue code into the function.
void
TriCoreFrameLowering
::
emitPrologue
(
MachineFunction
&
mf
)
const
{
DebugLoc
dl
;
MachineBasicBlock
&
mbb
=
mf
.
front
();
MachineBasicBlock
::
iterator
it
=
mbb
.
begin
();
uint64_t
stackSize
=
mf
.
getFrameInfo
()
->
getStackSize
();
const
TargetFrameLowering
*
tfi
=
mf
.
getTarget
().
getFrameLowering
();
const
TargetInstrInfo
*
tii
=
mf
.
getTarget
().
getInstrInfo
();
DEBUG
(
errs
()
<<
"TriCoreFrameLowering::emitPrologue(): mf = "
<<
mf
.
getFunction
()
->
getName
()
<<
"
\n
"
);
if
(
it
!=
mbb
.
end
())
dl
=
it
->
getDebugLoc
();
// Set frame pointer if one is used; adjust stack pointer
if
(
tfi
->
hasFP
(
mf
))
{
BuildMI
(
mbb
,
it
,
dl
,
tii
->
get
(
TriCore
::
MOV_AAsrr
),
FRAME_POINTER
)
.
addReg
(
STACK_POINTER
);
}
adjustStackPointer
(
mf
,
mbb
,
it
,
-
stackSize
);
}
// Inserts epilogue code into the function.
void
TriCoreFrameLowering
::
emitEpilogue
(
MachineFunction
&
mf
,
MachineBasicBlock
&
mbb
)
const
{
// Nothing to do - the ret instruction performs all cleanup automatically,
// including restoring stack pointer and frame pointer (being located in the
// upper context).
}
// This method is called immediately before PrologEpilogInserter scans the
// physical registers used to determine what callee saved registers should be
// spilled.
void
TriCoreFrameLowering
::
processFunctionBeforeCalleeSavedScan
(
MachineFunction
&
mf
,
RegScavenger
*
rs
)
const
{
// FIXME: This always leads to the generation of an emergency spill slot in
// the stack frame, whether we actually need one or not.
const
TargetRegisterClass
*
rc
=
TriCore
::
IRRegisterClass
;
int
fi
=
mf
.
getFrameInfo
()
->
CreateStackObject
(
rc
->
getSize
(),
rc
->
getAlignment
(),
false
);
rs
->
setScavengingFrameIndex
(
fi
);
}
}
This diff is collapsed.
Click to expand it.
lib/Target/TriCore/TriCoreMisc.cpp
+
3
−
1
View file @
dd8fc7bd
...
...
@@ -26,7 +26,7 @@
#include
"llvm/Target/TargetInstrInfo.h"
#include
"llvm/Target/TargetMachine.h"
using
namespace
llvm
;
namespace
llvm
{
// Increments or decrements the stack pointer by the given number of bytes.
void
adjustStackPointer
(
MachineFunction
&
mf
,
...
...
@@ -57,3 +57,5 @@ void adjustStackPointer(MachineFunction &mf,
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment