It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/vim/README b/utils/vim/README
new file mode 100644
index 0000000..466de4f
--- /dev/null
+++ b/utils/vim/README
@@ -0,0 +1,43 @@
+-*- llvm/utils/vim/README -*-
+
+These are syntax highlighting files for the VIM editor. Included are:
+
+* llvm.vim
+
+ Syntax highlighting mode for LLVM assembly files. To use, COPY `llvm.vim' to
+ ~/.vim/syntax and add this code to your ~/.vimrc :
+
+ augroup filetype
+ au! BufRead,BufNewFile *.ll set filetype=llvm
+ au! BufRead,BufNewFile *.llx set filetype=llvm
+ augroup END
+
+* tablegen.vim
+
+ Syntax highlighting mode for TableGen description files. To use, COPY
+ `tablegen.vim' to ~/.vim/syntax and add this code to your ~/.vimrc :
+
+ augroup filetype
+ au! BufRead,BufNewFile *.td set filetype=tablegen
+ augroup END
+
+
+IMPORTANT: Making symlinks from ~/.vim/syntax/... to the syntax files in your
+LLVM source tree does not work, you DO need to copy the files directly.
+
+However, if you do not already have a ~/.vim/syntax/ directory, simply
+symlinking it to llvm/utils/vim will do the trick nicely, and you can stay
+up-to-date with CVS.
+
+Note: If you notice missing or incorrect syntax highlighting, please contact
+<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
+functionality, it will be most appreciated. Thank you.
+
+If you find yourself working with LLVM Makefiles often, but you don't get syntax
+highlighting (because the files have names such as Makefile.rules or
+TEST.nightly.Makefile), add the following to your ~/.vimrc:
+
+ " LLVM Makefile highlighting mode
+ augroup filetype
+ au! BufRead,BufNewFile *Makefile* set filetype=make
+ augroup END
diff --git a/utils/vim/llvm.vim b/utils/vim/llvm.vim
new file mode 100644
index 0000000..712a9a5
--- /dev/null
+++ b/utils/vim/llvm.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language: llvm
+" Maintainer: The LLVM team, http://llvm.org/
+" Updated: 2003-06-02
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+syn keyword llvmType void bool sbyte ubyte
+syn keyword llvmType short ushort int uint
+syn keyword llvmType long ulong float double
+syn keyword llvmType type label opaque
+
+syn keyword llvmStatement add sub mul div rem
+syn keyword llvmStatement and or xor
+syn keyword llvmStatement setne seteq setlt setgt setle setge
+
+syn keyword llvmStatement phi tail call cast to select shl shr vaarg vanext
+syn keyword llvmStatement ret br switch invoke unwind unreachable
+syn keyword llvmStatement malloc alloca free load store getelementptr
+
+syn keyword llvmStatement begin end true false zeroinitializer
+syn keyword llvmStatement declare global constant const
+syn keyword llvmStatement internal uninitialized external implementation
+syn keyword llvmStatement linkonce weak appending
+syn keyword llvmStatement undef null to except target endian pointersize deplibs
+syn keyword llvmStatement big little volatile fastcc coldcc cc
+
+"syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/
+syn match llvmNumber /\<\d\+\>/
+syn match llvmNumber /\<\d\+\.\d*\>/
+
+syn match llvmComment /;.*$/
+syn region llvmString start=/"/ skip=/\\"/ end=/"/
+syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
+
+
+if version >= 508 || !exists("did_c_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink llvmType Type
+ HiLink llvmStatement Statement
+ HiLink llvmNumber Number
+ HiLink llvmComment Comment
+ HiLink llvmString String
+ HiLink llvmLabel Label
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "llvm"
diff --git a/utils/vim/tablegen.vim b/utils/vim/tablegen.vim
new file mode 100644
index 0000000..1514e2e
--- /dev/null
+++ b/utils/vim/tablegen.vim
@@ -0,0 +1,41 @@
+" Vim syntax file
+" Language: TableGen
+" Maintainer: The LLVM team, http://llvm.org/
+" Updated: 2003-08-11
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+
+syn keyword tgKeyword def let in code dag field include
+syn keyword tgType class int string list bit bits
+" FIXME: this does not handle hex (0x...) or binary (0b...) constants
+syn match tgNumber /\<\d\+\>/
+syn match tgNumber /\<\d\+\.\d*\>/
+syn match tgComment /\/\/.*$/
+" FIXME: this does not capture multi-line C-style comments
+syn match tgComment /\/\*.*\*\//
+syn region tgString start=/"/ skip=/\\"/ end=/"/
+
+if version >= 508 || !exists("did_c_syn_inits")
+ if version < 508
+ let did_c_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink tgKeyword Statement
+ HiLink tgType Type
+ HiLink tgNumber Number
+ HiLink tgComment Comment
+ HiLink tgString String
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "tablegen"
diff --git a/utils/vim/vimrc b/utils/vim/vimrc
new file mode 100644
index 0000000..3c872d9
--- /dev/null
+++ b/utils/vim/vimrc
@@ -0,0 +1,40 @@
+" LLVM coding guidelines conformance for VIM
+" Maintainer: LLVM Team, http://llvm.cs.uiuc.edu
+" Updated: 2005-04-24
+" WARNING: Read before you source in all these commands and macros! Some
+" of them may change VIM behavior that you depend on.
+
+" Wrap text at 80 cols
+set textwidth=80
+
+" A tab produces a 2-space indentation
+set tabstop=2
+set shiftwidth=2
+set expandtab
+
+" Optional
+" C/C++ programming helpers
+set autoindent
+set smartindent
+" Add and delete spaces in increments of `shiftwidth' for tabs
+set smarttab
+
+" Enable filetype detection
+filetype on
+
+" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
+" so it's important to categorize them as such.
+augroup filetype
+ au! BufRead,BufNewFile *Makefile* set filetype=make
+augroup END
+
+" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
+autocmd FileType make set noexpandtab
+
+" Useful macros for cleaning up code to conform to LLVM coding guidelines
+
+" Delete trailing whitespace and tabs at the end of each line
+map :dtws :%s/[\ \t]\+$//
+
+" Convert all tab characters to two spaces
+map :untab :%s/\t/ /g