[PATCH] D38959: AMDGPU: Don't use TargetStreamer if it has not been initialized
Javed Absar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 16 09:44:10 PDT 2017
javed.absar added inline comments.
================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:1232
+void AMDGPUAsmPrinter::useTargetStreamer(
+ function_ref<void(AMDGPUTargetStreamer *TargetStreamer)> Func) {
----------------
Instead of the numerous lambda functions making the code reading complicated, Could one make it neater like this ?
234: if (AMDGPUTargetStreamer *S =getTargetStreamer() )
235: Streamer->EmitGPUSymbolType(...)
236
AMDGPUTargetStreamer *getAMDGPUTargetStreamer( ) {
if (!OutStreamer)
return nullptr;
....
}
https://reviews.llvm.org/D38959
More information about the llvm-commits
mailing list