aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/clang_wrapper.py
diff options
context:
space:
mode:
authorworkfork <workfork@yandex-team.ru>2022-02-10 16:46:43 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:43 +0300
commitc3745173272d1cf5b0642debb40d019e7ae71094 (patch)
treedaee509c9d920ccdc727dbf1254b2183bf5f64aa /build/scripts/clang_wrapper.py
parent656921707c02b816d730f31c1fdc1d615adbfe00 (diff)
downloadydb-c3745173272d1cf5b0642debb40d019e7ae71094.tar.gz
Restoring authorship annotation for <workfork@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/clang_wrapper.py')
-rw-r--r--build/scripts/clang_wrapper.py78
1 files changed, 39 insertions, 39 deletions
diff --git a/build/scripts/clang_wrapper.py b/build/scripts/clang_wrapper.py
index af3869f789..844ae856d6 100644
--- a/build/scripts/clang_wrapper.py
+++ b/build/scripts/clang_wrapper.py
@@ -1,4 +1,4 @@
-import subprocess
+import subprocess
import sys
@@ -6,48 +6,48 @@ def fix(s):
# disable dbg DEVTOOLS-2744
if s == '-g':
return None
- if s == '/Z7' or s == '/Od' or s == '/Ob0' or s == '/D_DEBUG':
- return None
-
- # disable sanitizers for generated code
- if s.startswith('-fsanitize') or s == '-Dmemory_sanitizer_enabled' or s.startswith('-fsanitize-blacklist'):
- return None
-
- # strip gcc toolchain flags (appear when crosscompiling)
- if s.startswith('-fabi-version'):
- return None
-
+ if s == '/Z7' or s == '/Od' or s == '/Ob0' or s == '/D_DEBUG':
+ return None
+
+ # disable sanitizers for generated code
+ if s.startswith('-fsanitize') or s == '-Dmemory_sanitizer_enabled' or s.startswith('-fsanitize-blacklist'):
+ return None
+
+ # strip gcc toolchain flags (appear when crosscompiling)
+ if s.startswith('-fabi-version'):
+ return None
+
# remove arguments unknown to clang-cl
if s == '-fcase-insensitive-paths': # or s == '-fno-lto': # DEVTOOLSSUPPORT-3966
return None
- # Paths under .ya/tools/v3/.../msvc/include are divided with '\'
- return s.replace('\\', '/')
-
-
-def fix_path(p):
- try:
- i = p.rfind('/bin/clang')
- p = p[:i] + '/bin/clang-cl'
- except ValueError:
- pass
- return p
+ # Paths under .ya/tools/v3/.../msvc/include are divided with '\'
+ return s.replace('\\', '/')
+def fix_path(p):
+ try:
+ i = p.rfind('/bin/clang')
+ p = p[:i] + '/bin/clang-cl'
+ except ValueError:
+ pass
+ return p
+
+
if __name__ == '__main__':
- is_on_win = sys.argv[1] == 'yes'
- path = sys.argv[2]
- args = filter(None, [fix(s) for s in sys.argv[3:]])
- if is_on_win:
- path = fix_path(path)
- try:
- i = args.index('-emit-llvm')
- args[i:i+1] = ['-Xclang', '-emit-llvm']
- except ValueError:
- pass
- args.append('-fms-compatibility-version=19')
-
- cmd = [path] + args
-
- rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=sys.stdout)
- sys.exit(rc)
+ is_on_win = sys.argv[1] == 'yes'
+ path = sys.argv[2]
+ args = filter(None, [fix(s) for s in sys.argv[3:]])
+ if is_on_win:
+ path = fix_path(path)
+ try:
+ i = args.index('-emit-llvm')
+ args[i:i+1] = ['-Xclang', '-emit-llvm']
+ except ValueError:
+ pass
+ args.append('-fms-compatibility-version=19')
+
+ cmd = [path] + args
+
+ rc = subprocess.call(cmd, shell=False, stderr=sys.stderr, stdout=sys.stdout)
+ sys.exit(rc)