[cfe-commits] r57133 - /cfe/trunk/utils/CheckBuiltinMacros.sh
Daniel Dunbar
daniel at zuster.org
Sun Oct 5 13:39:31 PDT 2008
Author: ddunbar
Date: Sun Oct 5 15:39:30 2008
New Revision: 57133
URL: http://llvm.org/viewvc/llvm-project?rev=57133&view=rev
Log:
Add script for checking builtin macros verse another compiler ($CC or
gcc).
Added:
cfe/trunk/utils/CheckBuiltinMacros.sh (with props)
Added: cfe/trunk/utils/CheckBuiltinMacros.sh
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/CheckBuiltinMacros.sh?rev=57133&view=auto
==============================================================================
--- cfe/trunk/utils/CheckBuiltinMacros.sh (added)
+++ cfe/trunk/utils/CheckBuiltinMacros.sh Sun Oct 5 15:39:30 2008
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -ex
+
+if [ -z "$CC" ]; then
+ CC="gcc"
+fi
+
+SRCLANG=c
+MACROLIST=macro-list.txt
+CCDEFS=cc-definitions.txt
+CLANGDEFS=clang-definitions.txt
+
+# Gather list of macros as "NAME" = NAME.
+$CC -dM -E -x $SRCLANG /dev/null -o - | \
+grep "#define" | sort -f | sed -e "s/#define \([^ ]*\) .*/\"\1\" = \1/" > $MACROLIST
+
+$CC -E -x $SRCLANG $MACROLIST > $CCDEFS
+
+clang -E -x $SRCLANG $MACROLIST > $CLANGDEFS
+
+diff $CCDEFS $CLANGDEFS
+
+
Propchange: cfe/trunk/utils/CheckBuiltinMacros.sh
------------------------------------------------------------------------------
svn:executable = *
More information about the cfe-commits
mailing list