Skip to content

Instantly share code, notes, and snippets.

@jvillard
Created August 31, 2016 01:21
Show Gist options
  • Save jvillard/5fd9b9dc32a402aa5347edc5d327f45b to your computer and use it in GitHub Desktop.
Save jvillard/5fd9b9dc32a402aa5347edc5d327f45b to your computer and use it in GitHub Desktop.
tentative fix for facebook/infer#446 and facebook/infer#450
diff --git a/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh b/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh
index c94ebc5..9c3eaaf 100755
--- a/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh
+++ b/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh
@@ -26,8 +26,11 @@ APPLE_CLANG="$FCP_APPLE_CLANG"
# Main
if [ "${0%++}" != "$0" ]; then XX="++"; fi
+# Skip -cc1as commands
+if [ "$1" = "-cc1as" ]; then
+ STATUS=0
# Normalize clang command if not -cc1 already. -cc1 is always the first argument if present.
-if [ "$1" = "-cc1" ]; then
+elif [ "$1" = "-cc1" ]; then
"$CLANG_CC1_CAPTURE" "$@"
STATUS=$?
else
@@ -50,6 +53,8 @@ else
grep -e '^\([[:space:]]\"\|clang: error:\)' | \
# replace -cc1 commands with our clang wrapper
sed -e "s#^[[:space:]]\"\([^\"]*\)\" \"-cc1\" \(.*\)\$# \"$CLANG_CC1_CAPTURE\" \"-cc1\" \2#g" | \
+ # do not run -cc1as commands
+ grep -v '"-cc1as"' | \
# replace error messages by failures
sed -e 's#^\(^clang: error:.*$\)#echo "\1"; exit 1#g' | \
# add trailing ; to each line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment