[PATCH] D27474: [llgo] Remove support for LLVM attributes

Meador Inge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 11:32:15 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL288843: [llgo] Remove support for LLVM attributes (authored by meadori).

Changed prior to commit:
  https://reviews.llvm.org/D27474?vs=80451&id=80454#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27474

Files:
  llgo/trunk/irgen/attribute.go


Index: llgo/trunk/irgen/attribute.go
===================================================================
--- llgo/trunk/irgen/attribute.go
+++ llgo/trunk/irgen/attribute.go
@@ -74,8 +74,6 @@
 		return parseLinkageAttribute(value)
 	case "name":
 		return nameAttribute(strings.TrimSpace(value))
-	case "attr":
-		return parseLLVMAttribute(strings.TrimSpace(value))
 	case "thread_local":
 		return tlsAttribute{}
 	default:
@@ -142,36 +140,6 @@
 	}
 }
 
-func parseLLVMAttribute(value string) llvmAttribute {
-	var result llvmAttribute
-	value = strings.Replace(value, ",", " ", -1)
-	for _, field := range strings.Fields(value) {
-		switch strings.ToLower(field) {
-		case "noreturn":
-		case "nounwind":
-		case "noinline":
-		case "alwaysinline":
-			kind := llvm.AttributeKindID(strings.ToLower(field))
-			result.AttrKinds = append(result.AttrKinds, kind)
-		}
-	}
-	return result
-}
-
-type llvmAttribute struct {
-	AttrKinds []uint
-}
-
-func (a llvmAttribute) Apply(v llvm.Value) {
-	ctx := v.GlobalParent().Context()
-	if !v.IsAFunction().IsNil() {
-		for _, kind := range a.AttrKinds {
-			attr := ctx.CreateEnumAttribute(kind, 0)
-			v.AddFunctionAttr(attr)
-		}
-	}
-}
-
 type tlsAttribute struct{}
 
 func (tlsAttribute) Apply(v llvm.Value) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27474.80454.patch
Type: text/x-patch
Size: 1256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161206/1df05067/attachment.bin>


More information about the llvm-commits mailing list