Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLVM bpEVL
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Albano
LLVM bpEVL
Commits
0687b044
Commit
0687b044
authored
18 years ago
by
Evan Cheng
Browse files
Options
Downloads
Patches
Plain Diff
Oops. Need to keep CP index.
llvm-svn: 28958
parent
7f88856d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/lib/Target/X86/X86AsmPrinter.cpp
+15
-16
15 additions, 16 deletions
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.h
+1
-1
1 addition, 1 deletion
llvm/lib/Target/X86/X86AsmPrinter.h
with
16 additions
and
17 deletions
llvm/lib/Target/X86/X86AsmPrinter.cpp
+
15
−
16
View file @
0687b044
...
...
@@ -231,21 +231,19 @@ void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
const
std
::
vector
<
MachineConstantPoolEntry
>
&
CP
=
MCP
->
getConstants
();
if
(
CP
.
empty
())
return
;
std
::
vector
<
MachineConstantPoolEntry
>
FloatCPs
;
std
::
vector
<
MachineConstantPoolEntry
>
DoubleCPs
;
std
::
vector
<
MachineConstantPoolEntry
>
OtherCPs
;
// const TargetData *TD = TM.getTargetData();
// unsigned Align = MCP->getConstantPoolAlignment();
std
::
vector
<
std
::
pair
<
MachineConstantPoolEntry
,
unsigned
>
>
FloatCPs
;
std
::
vector
<
std
::
pair
<
MachineConstantPoolEntry
,
unsigned
>
>
DoubleCPs
;
std
::
vector
<
std
::
pair
<
MachineConstantPoolEntry
,
unsigned
>
>
OtherCPs
;
for
(
unsigned
i
=
0
,
e
=
CP
.
size
();
i
!=
e
;
++
i
)
{
MachineConstantPoolEntry
CPE
=
CP
[
i
];
const
Constant
*
CV
=
CPE
.
Val
;
const
Type
*
Ty
=
CV
->
getType
();
if
(
Ty
->
getTypeID
()
==
Type
::
FloatTyID
)
FloatCPs
.
push_back
(
CPE
);
FloatCPs
.
push_back
(
std
::
make_pair
(
CPE
,
i
)
);
else
if
(
Ty
->
getTypeID
()
==
Type
::
DoubleTyID
)
DoubleCPs
.
push_back
(
CPE
);
DoubleCPs
.
push_back
(
std
::
make_pair
(
CPE
,
i
)
);
else
OtherCPs
.
push_back
(
CPE
);
OtherCPs
.
push_back
(
std
::
make_pair
(
CPE
,
i
)
);
}
EmitConstantPool
(
MCP
,
FloatCPs
,
"
\t
.literal4"
);
EmitConstantPool
(
MCP
,
DoubleCPs
,
"
\t
.literal8"
);
...
...
@@ -254,22 +252,23 @@ void X86SharedAsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
void
X86SharedAsmPrinter
::
EmitConstantPool
(
MachineConstantPool
*
MCP
,
std
::
vector
<
MachineConstantPoolEntry
>
&
CP
,
std
::
vector
<
std
::
pair
<
MachineConstantPoolEntry
,
unsigned
>
>
&
CP
,
const
char
*
Section
)
{
if
(
CP
.
empty
())
return
;
SwitchToDataSection
(
Section
,
0
);
EmitAlignment
(
MCP
->
getConstantPoolAlignment
());
for
(
unsigned
i
=
0
,
e
=
CP
.
size
();
i
!=
e
;
++
i
)
{
O
<<
PrivateGlobalPrefix
<<
"CPI"
<<
getFunctionNumber
()
<<
'_'
<<
i
<<
":
\t\t\t\t\t
"
<<
CommentString
<<
" "
;
WriteTypeSymbolic
(
O
,
CP
[
i
].
Val
->
getType
(),
0
)
<<
'\n'
;
EmitGlobalConstant
(
CP
[
i
].
Val
);
O
<<
PrivateGlobalPrefix
<<
"CPI"
<<
getFunctionNumber
()
<<
'_'
<<
CP
[
i
].
second
<<
":
\t\t\t\t\t
"
<<
CommentString
<<
" "
;
WriteTypeSymbolic
(
O
,
CP
[
i
].
first
.
Val
->
getType
(),
0
)
<<
'\n'
;
EmitGlobalConstant
(
CP
[
i
].
first
.
Val
);
if
(
i
!=
e
-
1
)
{
unsigned
EntSize
=
TM
.
getTargetData
()
->
getTypeSize
(
CP
[
i
].
Val
->
getType
());
unsigned
ValEnd
=
CP
[
i
].
Offset
+
EntSize
;
unsigned
EntSize
=
TM
.
getTargetData
()
->
getTypeSize
(
CP
[
i
].
first
.
Val
->
getType
());
unsigned
ValEnd
=
CP
[
i
].
first
.
Offset
+
EntSize
;
// Emit inter-object padding for alignment.
EmitZeros
(
CP
[
i
+
1
].
Offset
-
ValEnd
);
EmitZeros
(
CP
[
i
+
1
].
first
.
Offset
-
ValEnd
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
llvm/lib/Target/X86/X86AsmPrinter.h
+
1
−
1
View file @
0687b044
...
...
@@ -96,7 +96,7 @@ struct X86SharedAsmPrinter : public AsmPrinter {
virtual
void
EmitConstantPool
(
MachineConstantPool
*
MCP
);
void
EmitConstantPool
(
MachineConstantPool
*
MCP
,
std
::
vector
<
MachineConstantPoolEntry
>
&
CP
,
std
::
vector
<
std
::
pair
<
MachineConstantPoolEntry
,
unsigned
>
>
&
CP
,
const
char
*
Section
);
};
...
...
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