Explorer: Add heading and sub-heading methods to trace (#3088)

Instead of manually putting symbols before and after heading, this
introduces two methods `Heading` and `SubHeading` inside `TraceStream`.

Both methods take `llvm::StringRef` as parameter, formats the given text
as follows and adds it into the output stream.

**Heading**
```
* * * * * * * * * *  heading  * * * * * * * * * *
-------------------------------------------------
```
**Sub heading**
```
- - - - -  sub heading  - - - - -
---------------------------------
```

Note: both methods assert that tracing should be enabled.
This commit is contained in:
Prabhat Sachdeva
2023-08-10 22:40:21 +00:00
committed by GitHub
parent 7b22173cba
commit 2a74c807d8
15 changed files with 99 additions and 48 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ fn Main() -> i32 {
// ARGS: --trace_file=- --trace_phase=source_program %s
// AUTOUPDATE
// CHECK:STDOUT: ********** source program **********
// CHECK:STDOUT: * * * * * * * * * * source program * * * * * * * * * *
// CHECK:STDOUT: --------------------------------------------------------
// CHECK:STDOUT: interface TestInterface {
// CHECK:STDOUT: }
// CHECK:STDOUT: fn Main ()-> i32 {