]> granicus.if.org Git - clang/commit
Fix assume-filename handling in clang-format.el
authorPhilipp Stephani <phst@google.com>
Sat, 2 Dec 2017 21:18:14 +0000 (21:18 +0000)
committerPhilipp Stephani <phst@google.com>
Sat, 2 Dec 2017 21:18:14 +0000 (21:18 +0000)
commit5a0ab09ed86ed4bc944b76d1bd4f2f784a94464f
tree6ad099693d76f2ba1b509ad283387989bb95fe2c
parentbf691ab9cdc04546974fa94ec6dd5d7cf2bd0fa6
Fix assume-filename handling in clang-format.el

Summary:
When 'buffer-file-name' is nil 'call-process-region' returned a segmentation fault error.

This was a problem when using clang-format-buffer on an orgmode source code editing buffer.

I fixed this problem by excluding the '-assume-filename' argument when 'buffer-file-name' is nil.

To make it a bit more flexible I also added an optional argument, 'assume-file-name', to specify an assume-filename that overrides 'buffer-file-name'.

Reviewers: klimek, djasper, phst, phi

Reviewed By: phst, phi

Subscribers: phi, jholewinski, mgorny, javed.absar, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D37903

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319621 91177308-0d34-0410-b5e6-96231b3b80d8
tools/clang-format/clang-format.el