summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2013-02-05 22:59:42 +0000
committerBob Wilson <bob.wilson@apple.com>2013-02-05 22:59:42 +0000
commit5dba16c58133eebe8c25832b3d9889f670170da1 (patch)
treed7ddad54a38c0a46198666fa2c30e262498223da /llvm/utils
parent36860df355c95358b82a37ad1cba68601d0cf5da (diff)
downloadbcm5719-llvm-5dba16c58133eebe8c25832b3d9889f670170da1.tar.gz
bcm5719-llvm-5dba16c58133eebe8c25832b3d9889f670170da1.zip
Preprocess Apple llvmCore headers to reflect NDEBUG setting. <rdar://12568983>
If an Apple llvmCore build is done without assertions, and a client uses the llvmCore headers with assertions enabled, or vice versa, then things will break because some of the structure sizes in the API are different. Use the unifdef tool to make the headers unconditionally match the way the llvmCore libraries were built. llvm-svn: 174460
Diffstat (limited to 'llvm/utils')
-rwxr-xr-xllvm/utils/buildit/build_llvm10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/utils/buildit/build_llvm b/llvm/utils/buildit/build_llvm
index 896ede3e466..c056b9742b9 100755
--- a/llvm/utils/buildit/build_llvm
+++ b/llvm/utils/buildit/build_llvm
@@ -234,6 +234,16 @@ RC_ProjectSourceSubversion=`printf "%d" $LLVM_MINOR_VERSION`
echo "#define LLVM_VERSION ${RC_ProjectSourceVersion}" > $DEST_DIR$DEST_ROOT/include/llvm/Version.h
echo "#define LLVM_MINOR_VERSION ${RC_ProjectSourceSubversion}" >> $DEST_DIR$DEST_ROOT/include/llvm/Version.h
+# Run unifdef to preprocess the installed headers to reflect whether this
+# was a debug or release build.
+for file in `find $DEST_DIR$DEST_ROOT/include -type f -print`; do
+ if [ "$LLVM_ASSERTIONS" = yes ]; then
+ unifdef -UNDEBUG -D_DEBUG -o $file $file
+ else
+ unifdef -DNDEBUG -U_DEBUG -ULLVM_ENABLE_DUMP -o $file $file
+ fi
+done
+
# Find the right version of strip to use.
STRIP=strip
if [ -n "$SDKROOT" ]; then
OpenPOWER on IntegriCloud