projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3be4346
)
Fix automatic description for AnyTypeOf
author
Geoffrey Martin-Noble
<gcmn@google.com>
Mon, 20 May 2019 17:32:55 +0000
(10:32 -0700)
committer
Mehdi Amini
<joker.eph@gmail.com>
Mon, 20 May 2019 20:49:53 +0000
(13:49 -0700)
Unfortunately, this now gives a segfault if you pass it an empty list, similar to stringify. Given how fiddly this is, we should probably have a string join helper. I'll fix both of these using better tablegen helpers in a follow-up.
--
PiperOrigin-RevId:
249076849
mlir/include/mlir/IR/OpBase.td
patch
|
blob
|
history
diff --git
a/mlir/include/mlir/IR/OpBase.td
b/mlir/include/mlir/IR/OpBase.td
index
5d17280
..
48c35e5
100644
(file)
--- a/
mlir/include/mlir/IR/OpBase.td
+++ b/
mlir/include/mlir/IR/OpBase.td
@@
-271,7
+271,7
@@
class AnyTypeOf<list<Type> allowedTypes, string description = ""> : Type<
!if(!eq(description, ""),
// Join all allowed types' descriptions with " or " as the description
// if not provided during template specialization
- !foldl(
/*init*/"", /*list*/allowedTypes
, prev, cur,
+ !foldl(
!head(allowedTypes).description, !tail(allowedTypes)
, prev, cur,
prev # " or " # cur.description),
// Otherwise use the provided one
description)>;