From patchwork Tue Jun 12 12:20:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 928292 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479537-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="w2l+KMut"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 414pql6HT6z9s0w for ; Tue, 12 Jun 2018 22:20:19 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=wAaNCjX/6QieOm6C3lFUsS1uGk2VmUgMVi7YqqU2toyTGGjjha gu3wqIMnkTzLAQFMz8mKUANTaKl67QTAVjii65kWSJveK8pHqR/XHTPuR7kYal/v 8ZnLpiS9Ql5HWgpVGCMqOjS93n7NR/Ig+IF7xsNSGzC/J3ngJp4Nik2vg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=7XdKfvqVeTKEOLSTHufyeTZm45w=; b=w2l+KMutO5vYenCvjSJR Zt9VIozgJyaXL+cVw1EqaQMjwUqoXm4O0KvC3+dPZR2G+qr16WG5+FRoGhqt6m95 CB48kyvECFPZaR6l8/FG2yCEXcu/EwpN1zDov72uTO2D5MQylmLeKRpoj7jjcdmZ TYImrzgDCt60j1QyWlLLmf4= Received: (qmail 65136 invoked by alias); 12 Jun 2018 12:20:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 65101 invoked by uid 89); 12 Jun 2018 12:20:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Jun 2018 12:20:09 +0000 Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 72A6AADD5; Tue, 12 Jun 2018 12:20:07 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Add initial version of rtl.vim syntax file. To: gcc-patches@gcc.gnu.org Cc: Mikhail Maltsev , Marek Polacek Message-ID: <79dbc4bf-8e12-7604-bae9-dcb6f18e78b6@suse.cz> Date: Tue, 12 Jun 2018 14:20:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. This is equivalent of gimple.vim file. I'm aware of not full coverage of RTL instructions, but hope it's a good start point. Screenshots: https://drive.google.com/open?id=14y-Hca2hf1gyWDfHaht6Wjv-Btf3Bdvl https://drive.google.com/open?id=1LiqsJq2ng-aeKsvw3PhUnDjLWh54Y1Vc Ready for trunk? Thanks, Martin contrib/ChangeLog: 2018-06-12 Martin Liska * rtl.vim: New file. --- contrib/rtl.vim | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 contrib/rtl.vim diff --git a/contrib/rtl.vim b/contrib/rtl.vim new file mode 100644 index 00000000000..c584b56e3f3 --- /dev/null +++ b/contrib/rtl.vim @@ -0,0 +1,55 @@ +" Syntax highlighting rules for RTL dump files (for Vim). +" +" Copyright (C) 2018 Free Software Foundation, Inc. +" +" This script is free software; you can redistribute it and/or modify +" it under the terms of the GNU General Public License as published by +" the Free Software Foundation; either version 3, or (at your option) +" any later version +" +" For more instructions please see gimple.vim file in the same folder. + + +" Do not continue, if syntax is already enabled in current buffer. +if exists("b:current_syntax") + finish +endif + +" General-purpose comments. +syn match rtlComment ";;.*$" + +syn keyword rtlInstruction insn parallel_insn set mem simple_return plus + \ clobber parallel compare minus xor subreg + \ ashift ashiftrt lshiftrt symbol_reg + \ zero_extend symbol_ref label_ref call + \ vec_merge vec_duplicate vec_concat +syn keyword rtlConditional jump_insn if_then_else call_insn eq +syn keyword rtlNote note barrier code_label +syn keyword rtlVariableLoation var_location +syn keyword rtlExpressionList expr_list +syn keyword rtlPcRegister pc + +" String literals +syn region rtlString start=/\v"/ skip=/\v\\./ end=/\v"/ + +syn match rtlNoteInsn "NOTE_INSN_[A-Z_]*" +syn match rtlIntegerConstant "\vconst_int -?\d+" +syn match rtlFloatConstant "\vconst_double:[A-Z]+ -?\d*\.\d+(e\+\d+)?" +syn match rtlRegister "\vreg(\/[a-z])?:[A-Z0-9]+ \d+ [a-z0-9]+" +syn match rtlLocation /\v"[^"]*":\d+/ + +hi def link rtlInstruction Statement +hi def link rtlConditional Conditional +hi def link rtlNote Debug +hi def link rtlNoteInsn Debug +hi def link rtlIntegerConstant Number +hi def link rtlFloatConstant Number +hi def link rtlRegister Type +hi def link rtlPcRegister Type +hi def link rtlVariableLoation Debug +hi def link rtlExpressionList Debug +hi def link rtlComment Comment +hi def link rtlLocation Debug +hi def link rtlString String + +let b:current_syntax = "rtl"