mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-30 13:02:06 +00:00
More compiledb fixes. (#25355)
This commit is contained in:
parent
7ecdb57414
commit
7f9ceef3dd
35
.clangd
35
.clangd
@ -1,4 +1,33 @@
|
|||||||
CompileFlags:
|
CompileFlags:
|
||||||
Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option]
|
Add:
|
||||||
Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues, -D__has_include*]
|
[
|
||||||
Compiler: clang
|
-Wno-unknown-attributes,
|
||||||
|
-Wno-maybe-uninitialized,
|
||||||
|
-Wno-unknown-warning-option,
|
||||||
|
-Wno-pointer-to-int-cast,
|
||||||
|
-Wno-int-to-void-pointer-cast,
|
||||||
|
-DPROGMEM=,
|
||||||
|
]
|
||||||
|
Remove:
|
||||||
|
[
|
||||||
|
-W*,
|
||||||
|
-mmcu=*,
|
||||||
|
-mcpu=*,
|
||||||
|
-mfpu=*,
|
||||||
|
-mfloat-abi=*,
|
||||||
|
-mno-unaligned-access,
|
||||||
|
-mno-thumb-interwork,
|
||||||
|
-mcall-prologues,
|
||||||
|
-D__has_include*,
|
||||||
|
-mlra,
|
||||||
|
]
|
||||||
|
Compiler: clang
|
||||||
|
Diagnostics:
|
||||||
|
UnusedIncludes: None
|
||||||
|
Suppress:
|
||||||
|
[
|
||||||
|
asm_invalid_output_constraint,
|
||||||
|
asm_invalid_input_constraint,
|
||||||
|
invalid_asm_value_for_constraint,
|
||||||
|
anyx86_interrupt_attribute,
|
||||||
|
]
|
||||||
|
@ -44,8 +44,7 @@ def cpu_defines(binary: str, compiler_args: str) -> List[str]:
|
|||||||
invocation.extend(['-x', 'c', '-std=gnu11'])
|
invocation.extend(['-x', 'c', '-std=gnu11'])
|
||||||
elif binary.endswith("g++"):
|
elif binary.endswith("g++"):
|
||||||
invocation.extend(['-x', 'c++', '-std=gnu++14'])
|
invocation.extend(['-x', 'c++', '-std=gnu++14'])
|
||||||
compiler_args = shlex.split(compiler_args)
|
invocation.extend(shlex.split(compiler_args))
|
||||||
invocation.extend(compiler_args)
|
|
||||||
invocation.append('-')
|
invocation.append('-')
|
||||||
result = cli.run(invocation, capture_output=True, check=True, stdin=None, input='\n')
|
result = cli.run(invocation, capture_output=True, check=True, stdin=None, input='\n')
|
||||||
define_args = []
|
define_args = []
|
||||||
@ -55,7 +54,11 @@ def cpu_defines(binary: str, compiler_args: str) -> List[str]:
|
|||||||
define_args.append(f'-D{line_args[1]}={line_args[2]}')
|
define_args.append(f'-D{line_args[1]}={line_args[2]}')
|
||||||
elif len(line_args) == 2 and line_args[0] == '#define':
|
elif len(line_args) == 2 and line_args[0] == '#define':
|
||||||
define_args.append(f'-D{line_args[1]}')
|
define_args.append(f'-D{line_args[1]}')
|
||||||
return list(sorted(set(define_args)))
|
|
||||||
|
type_filter = re.compile(
|
||||||
|
r'^-D__(SIZE|INT|UINT|WINT|WCHAR|BYTE|SHRT|SIG|FLOAT|LONG|CHAR|SCHAR|DBL|FLT|LDBL|PTRDIFF|QQ|DQ|DA|HA|HQ|SA|SQ|TA|TQ|UDA|UDQ|UHA|UHQ|USQ|USA|UTQ|UTA|UQQ|UQA|ACCUM|FRACT|UACCUM|UFRACT|LACCUM|LFRACT|ULACCUM|ULFRACT|LLACCUM|LLFRACT|ULLACCUM|ULLFRACT|SACCUM|SFRACT|USACCUM|USFRACT)'
|
||||||
|
)
|
||||||
|
return list(sorted(set(filter(lambda x: not type_filter.match(x), define_args))))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@ -92,8 +95,8 @@ def parse_make_n(f: Iterator[str]) -> List[Dict[str, str]]:
|
|||||||
for s in system_libs(binary):
|
for s in system_libs(binary):
|
||||||
args += ['-isystem', '%s' % s]
|
args += ['-isystem', '%s' % s]
|
||||||
args.extend(cpu_defines(binary, ' '.join(shlex.quote(s) for s in compiler_args)))
|
args.extend(cpu_defines(binary, ' '.join(shlex.quote(s) for s in compiler_args)))
|
||||||
new_cmd = ' '.join(shlex.quote(s) for s in args)
|
args[0] = binary
|
||||||
records.append({"directory": str(QMK_FIRMWARE.resolve()), "command": new_cmd, "file": this_file})
|
records.append({"arguments": args, "directory": str(QMK_FIRMWARE.resolve()), "file": this_file})
|
||||||
state = 'start'
|
state = 'start'
|
||||||
|
|
||||||
return records
|
return records
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
|
extern void __builtin_avr_delay_cycles(uint32_t);
|
||||||
|
|
||||||
// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf
|
// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf
|
||||||
// page 22: Table 4-2. Arithmetic and Logic Instructions
|
// page 22: Table 4-2. Arithmetic and Logic Instructions
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user