Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
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
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
020832fb
"README.md" did not exist on "b58ce85ecc1e676ec4c38157f2fae293766a0aad"
Commit
020832fb
authored
11 years ago
by
Pete Cooper
Browse files
Options
Downloads
Patches
Plain Diff
Add LLVM_HAS_INITIALIZER_LISTS for upcoming C++11 support. Use it in ArrayRef
llvm-svn: 194362
parent
ef276df2
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/include/llvm/ADT/ArrayRef.h
+7
-0
7 additions, 0 deletions
llvm/include/llvm/ADT/ArrayRef.h
llvm/include/llvm/Support/Compiler.h
+9
-0
9 additions, 0 deletions
llvm/include/llvm/Support/Compiler.h
with
16 additions
and
0 deletions
llvm/include/llvm/ADT/ArrayRef.h
+
7
−
0
View file @
020832fb
...
@@ -83,6 +83,13 @@ namespace llvm {
...
@@ -83,6 +83,13 @@ namespace llvm {
/*implicit*/
LLVM_CONSTEXPR
ArrayRef
(
const
T
(
&
Arr
)[
N
])
/*implicit*/
LLVM_CONSTEXPR
ArrayRef
(
const
T
(
&
Arr
)[
N
])
:
Data
(
Arr
),
Length
(
N
)
{}
:
Data
(
Arr
),
Length
(
N
)
{}
#if LLVM_HAS_INITIALIZER_LISTS
/// Construct an ArrayRef from a std::initializer_list.
/*implicit*/
ArrayRef
(
const
std
::
initializer_list
<
T
>
&
Vec
)
:
Data
(
Vec
.
begin
()
==
Vec
.
end
()
?
(
T
*
)
0
:
Vec
.
begin
()),
Length
(
Vec
.
size
())
{}
#endif
/// @}
/// @}
/// @name Simple Operations
/// @name Simple Operations
/// @{
/// @{
...
...
This diff is collapsed.
Click to expand it.
llvm/include/llvm/Support/Compiler.h
+
9
−
0
View file @
020832fb
...
@@ -403,4 +403,13 @@
...
@@ -403,4 +403,13 @@
# define LLVM_ENUM_INT_TYPE(intty)
# define LLVM_ENUM_INT_TYPE(intty)
#endif
#endif
/// \brief Does the compiler support generalized initializers (using braced
/// lists and std::initializer_list).
#if (__has_feature(cxx_generalized_initializers) \
|| defined(__GXX_EXPERIMENTAL_CXX0X__))
#define LLVM_HAS_INITIALIZER_LISTS 1
#else
#define LLVM_HAS_INITIALIZER_LISTS 0
#endif
#endif
#endif
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