[lldb] Replace deprecated `std::unique_ptr::unique()` to silence a warning with MS...
[llvm-project.git] / flang / docs / flang-c-style.el
blob949702a420df044d91194a42b2252c52cb8d7f61
1 ;;===-- docs/flang-c-style.el ------------------------------------===;;
2 ;;
3 ;; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 ;; See https://llvm.org/LICENSE.txt for license information.
5 ;; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 ;;
7 ;;===----------------------------------------------------------------------===;;
9 ;; Define a cc-mode style for editing C++ codes in Flang.
11 ;; Inspired from LLVM style in
12 ;; https://github.com/llvm/llvm-project/blob/main/llvm/utils/emacs/emacs.el
15 (c-add-style "flang"
16 '("gnu"
17 (fill-column . 80)
18 (c++-indent-level . 2)
19 (c-basic-offset . 2)
20 (indent-tabs-mode . nil)
21 (c-offsets-alist .
22 ((arglist-intro . ++)
23 (innamespace . 0)
24 (member-init-intro . ++)
30 ;; Use the following to make it the default.
33 (defun flang-c-mode-hook ()
34 (c-set-style "flang")
37 (add-hook 'c-mode-hook 'flang-c-mode-hook)
38 (add-hook 'c++-mode-hook 'flang-c-mode-hook)