Skip to content

Commit 379afbd

Browse files
authored
Merge pull request #12491 from gottesmm/pr-b65b52572f0ab46374d54e693a93daaeec20fe77
2 parents 7d8c696 + cc39b5f commit 379afbd

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docs/DebuggingTheCompiler.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,28 @@ using regular expressions (i.e. ignoring language semantics), ViewCFG can:
145145
The script assumes that the relevant text is passed in via stdin and uses open
146146
to display the .dot file.
147147

148-
**NOTE** Since we use open, .dot files should be associated with the Graphviz app for this to work.
148+
Additional, both emacs and vim integration is provided. For vim integration add
149+
the following commands to your .vimrc::
150+
151+
com! -nargs=? Funccfg silent ?{$?,/^}/w !viewcfg <args>
152+
com! -range -nargs=? Viewcfg silent <line1>,<line2>w !viewcfg <args>
153+
154+
This will add::
155+
156+
:Funccfg displays the CFG of the current SIL/LLVM function.
157+
:<range>Viewcfg displays the sub-CFG of the selected range.
158+
159+
For emacs users, we provide in sil-mode (``./utils/sil-mode.el``) the function::
160+
161+
sil-mode-display-function-cfg
162+
163+
To use this feature, placed the point in the sil function that you want viewcfg
164+
to graph and then run ``sil-mode-display-function-cfg``. This will cause viewcfg
165+
to be invoked with the sil function body. Note,
166+
``sil-mode-display-function-cfg`` does not take any arguments.
167+
168+
**NOTE** viewcfg must be in the $PATH for viewcfg to work.
169+
**NOTE** Since we use open, .dot files should be associated with the Graphviz app for viewcfg to work.
149170

150171
Using Breakpoints
151172
`````````````````

0 commit comments

Comments
 (0)