Skip to content

Commit e6c29d6

Browse files
committed
[llgo] Remove support for LLVM attributes
llgo supports the application of LLVM attributes to global objects and functions. This "feature" is undocumented and untested. As discusses in D27442, it should be removed. Differential Revision: https://reviews.llvm.org/D27474 llvm-svn: 288843
1 parent dd6ca63 commit e6c29d6

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

llgo/irgen/attribute.go

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ func parseAttribute(line string) Attribute {
7474
return parseLinkageAttribute(value)
7575
case "name":
7676
return nameAttribute(strings.TrimSpace(value))
77-
case "attr":
78-
return parseLLVMAttribute(strings.TrimSpace(value))
7977
case "thread_local":
8078
return tlsAttribute{}
8179
default:
@@ -142,36 +140,6 @@ func (a nameAttribute) Apply(v llvm.Value) {
142140
}
143141
}
144142

145-
func parseLLVMAttribute(value string) llvmAttribute {
146-
var result llvmAttribute
147-
value = strings.Replace(value, ",", " ", -1)
148-
for _, field := range strings.Fields(value) {
149-
switch strings.ToLower(field) {
150-
case "noreturn":
151-
case "nounwind":
152-
case "noinline":
153-
case "alwaysinline":
154-
kind := llvm.AttributeKindID(strings.ToLower(field))
155-
result.AttrKinds = append(result.AttrKinds, kind)
156-
}
157-
}
158-
return result
159-
}
160-
161-
type llvmAttribute struct {
162-
AttrKinds []uint
163-
}
164-
165-
func (a llvmAttribute) Apply(v llvm.Value) {
166-
ctx := v.GlobalParent().Context()
167-
if !v.IsAFunction().IsNil() {
168-
for _, kind := range a.AttrKinds {
169-
attr := ctx.CreateEnumAttribute(kind, 0)
170-
v.AddFunctionAttr(attr)
171-
}
172-
}
173-
}
174-
175143
type tlsAttribute struct{}
176144

177145
func (tlsAttribute) Apply(v llvm.Value) {

0 commit comments

Comments
 (0)