0

[vim/ycm] Fix parsing error for -march flag

liblcang 6.0 chokes on -march=armv7-a with a message
"ClangParseError: Failed to parse the translation unit."
In this CL flag '-march' is filtered off for all arm architectures.

Change-Id: I6d7074c7b337b0a07633d728d0779ec3559652fa
Reviewed-on: https://chromium-review.googlesource.com/c/1278633
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600375}
This commit is contained in:
Vitaliy Kharin
2018-10-17 13:51:29 +00:00
committed by Commit Bot
parent 34dffa3bad
commit 3f33f8189f
2 changed files with 5 additions and 0 deletions

@ -890,6 +890,7 @@ Vinay Anantharaman <vinaya@adobe.com>
Vipul Bhasin <vipul.bhasin@gmail.com>
Visa Putkinen <v.putkinen@partner.samsung.com>
Vishal Bhatnagar <vishal.b@samsung.com>
Vitaliy Kharin <kvserr@gmail.com>
Vivek Galatage <vivek.vg@samsung.com>
Volker Sorge <volker.sorge@gmail.com>
Waihung Fu <fufranci@amazon.com>

@ -248,6 +248,10 @@ def GetClangOptionsFromCommandLine(clang_commandline, out_dir,
clang_flags.append(include_match.group(1) + path)
elif flag.startswith('-std') or flag == '-nostdinc++':
clang_flags.append(flag)
elif flag.startswith('-march=arm'):
# Value armv7-a of this flag causes a parsing error with a message
# "ClangParseError: Failed to parse the translation unit."
continue
elif flag.startswith('-') and flag[1] in 'DWFfmO':
if flag == '-Wno-deprecated-register' or flag == '-Wno-header-guard':
# These flags causes libclang (3.3) to crash. Remove it until things