================
@@ -373,8 +439,160 @@ bool SPIRVEmitNonSemanticDI::emitGlobalDI(MachineFunction
&MF) {
return true;
}
+// Emits the SPIRV DebugFunction instruction for a given MachineFunction.
+bool SPIRVEmitNonSemanticDI::emitFunctionDI(MachineFunction &MF) {
+ const Function &F = MF.getFunction();
+
+ DISubprogram *SP = F.getSubprogram();
+ // DISubProgram is not available, don't translate
+ if (!SP) {
----------------
slinder1 wrote:
Nit: I'd drop the braces on these early returns (see
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements)
The function is already long, and these push things apart even more.
I might also vote for dropping some of the comments which describe something in
the same terms as it is implemented.
For example I would change:
```cpp
// Get the scope from DISubProgram
DIScope *Scope = SP->getScope();
if (!Scope) {
return false;
}
```
To:
```cpp
DIScope *Scope = SP->getScope();
if (!Scope)
return false;
```
https://github.com/llvm/llvm-project/pull/183122
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits