Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
544a6336
Commit
544a6336
authored
18 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
add alternate version of constant ctors that don't take a vector. For now
this offers no performance advantage. llvm-svn: 34415
parent
8d033d11
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/include/llvm/Constants.h
+19
-3
19 additions, 3 deletions
llvm/include/llvm/Constants.h
with
19 additions
and
3 deletions
llvm/include/llvm/Constants.h
+
19
−
3
View file @
544a6336
...
@@ -248,6 +248,11 @@ protected:
...
@@ -248,6 +248,11 @@ protected:
public:
public:
/// get() - Static factory methods - Return objects of the specified value
/// get() - Static factory methods - Return objects of the specified value
static
Constant
*
get
(
const
ArrayType
*
T
,
const
std
::
vector
<
Constant
*>
&
);
static
Constant
*
get
(
const
ArrayType
*
T
,
const
std
::
vector
<
Constant
*>
&
);
static
Constant
*
get
(
const
ArrayType
*
T
,
Constant
*
const
*
Vals
,
unsigned
NumVals
)
{
// FIXME: make this the primary ctor method.
return
get
(
T
,
std
::
vector
<
Constant
*>
(
Vals
,
Vals
+
NumVals
));
}
/// This method constructs a ConstantArray and initializes it with a text
/// This method constructs a ConstantArray and initializes it with a text
/// string. The default behavior (AddNull==true) causes a null terminator to
/// string. The default behavior (AddNull==true) causes a null terminator to
...
@@ -308,8 +313,13 @@ public:
...
@@ -308,8 +313,13 @@ public:
/// get() - Static factory methods - Return objects of the specified value
/// get() - Static factory methods - Return objects of the specified value
///
///
static
Constant
*
get
(
const
StructType
*
T
,
const
std
::
vector
<
Constant
*>
&
V
);
static
Constant
*
get
(
const
StructType
*
T
,
const
std
::
vector
<
Constant
*>
&
V
);
static
Constant
*
get
(
const
std
::
vector
<
Constant
*>
&
V
,
bool
packed
=
false
);
static
Constant
*
get
(
const
std
::
vector
<
Constant
*>
&
V
,
bool
Packed
=
false
);
static
Constant
*
get
(
Constant
*
const
*
Vals
,
unsigned
NumVals
,
bool
Packed
=
false
)
{
// FIXME: make this the primary ctor method.
return
get
(
std
::
vector
<
Constant
*>
(
Vals
,
Vals
+
NumVals
),
Packed
);
}
/// getType() specialization - Reduce amount of casting...
/// getType() specialization - Reduce amount of casting...
///
///
inline
const
StructType
*
getType
()
const
{
inline
const
StructType
*
getType
()
const
{
...
@@ -347,7 +357,11 @@ public:
...
@@ -347,7 +357,11 @@ public:
/// get() - Static factory methods - Return objects of the specified value
/// get() - Static factory methods - Return objects of the specified value
static
Constant
*
get
(
const
VectorType
*
T
,
const
std
::
vector
<
Constant
*>
&
);
static
Constant
*
get
(
const
VectorType
*
T
,
const
std
::
vector
<
Constant
*>
&
);
static
Constant
*
get
(
const
std
::
vector
<
Constant
*>
&
V
);
static
Constant
*
get
(
const
std
::
vector
<
Constant
*>
&
V
);
static
Constant
*
get
(
Constant
*
const
*
Vals
,
unsigned
NumVals
)
{
// FIXME: make this the primary ctor method.
return
get
(
std
::
vector
<
Constant
*>
(
Vals
,
Vals
+
NumVals
));
}
/// getType - Specialize the getType() method to always return an VectorType,
/// getType - Specialize the getType() method to always return an VectorType,
/// which reduces the amount of casting needed in parts of the compiler.
/// which reduces the amount of casting needed in parts of the compiler.
///
///
...
@@ -578,6 +592,8 @@ public:
...
@@ -578,6 +592,8 @@ public:
Constant
*
const
*
IdxList
,
unsigned
NumIdx
);
Constant
*
const
*
IdxList
,
unsigned
NumIdx
);
static
Constant
*
getGetElementPtr
(
Constant
*
C
,
static
Constant
*
getGetElementPtr
(
Constant
*
C
,
Value
*
const
*
IdxList
,
unsigned
NumIdx
);
Value
*
const
*
IdxList
,
unsigned
NumIdx
);
// FIXME: Remove these.
static
Constant
*
getGetElementPtr
(
Constant
*
C
,
static
Constant
*
getGetElementPtr
(
Constant
*
C
,
const
std
::
vector
<
Constant
*>
&
IdxList
)
{
const
std
::
vector
<
Constant
*>
&
IdxList
)
{
return
getGetElementPtr
(
C
,
&
IdxList
[
0
],
IdxList
.
size
());
return
getGetElementPtr
(
C
,
&
IdxList
[
0
],
IdxList
.
size
());
...
...
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