From b7aebc1220bd328f507e6c7457915717fcbe5091 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 2 Aug 2021 00:47:59 -0700 Subject: [PATCH] scons: Further simplify the_gpu_isa.hh. Turn the "namespace" function into a simple variable. Also, since the only thing defined in the file is a macro, we can drop the compiler guards and use that macro as its own compiler guard. Change-Id: I1e8559fc7add61105b2990f76226714ba282581d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48967 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Bobby R. Bruce --- src/SConscript | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/SConscript b/src/SConscript index 40ce61132b..21df7cab19 100644 --- a/src/SConscript +++ b/src/SConscript @@ -744,19 +744,15 @@ env.Command('config/the_isa.hh', [], MakeAction(makeTheISA, Transform("CFG ISA", 0))) def makeTheGPUISA(source, target, env): - target_gpu_isa = env['TARGET_GPU_ISA'] + gpu_isa = env['TARGET_GPU_ISA'] - def namespace(isa): - return isa[0].upper() + isa[1:].lower() + 'ISA' + namespace = gpu_isa[0].upper() + gpu_isa[1:].lower() + 'ISA' code = code_formatter() code('''\ -#ifndef __CONFIG_THE_GPU_ISA_HH__ -#define __CONFIG_THE_GPU_ISA_HH__ - -#define TheGpuISA ${{namespace(target_gpu_isa)}} - -#endif // __CONFIG_THE_GPU_ISA_HH__''') +#ifndef TheGpuISA +#define TheGpuISA ${namespace} +#endif // TheGpuISA''') code.write(str(target[0]))