Commit 459fdad8 authored by brooks's avatar brooks
Browse files

Add ports of clang and LLVM 3.3.rc3. Unlike previous ports these

install primarily in ${PREFIX}/llvm33 with wrapper scripts in
${PREFIX}/bin named clang33, llc33, etc.

In an additional change, the clang static analyzer's python wrapper and
web bits are not installed.
parent 7ef18f47
......@@ -1152,6 +1152,7 @@
SUBDIR += llvm
SUBDIR += llvm-devel
SUBDIR += llvm31
SUBDIR += llvm33
SUBDIR += lmdbg
SUBDIR += lndir
SUBDIR += lockfree-malloc
......
# $FreeBSD$
PORTNAME= llvm
DISTVERSION= 3.3rc3
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/pre-releases/3.3/rc3/
DISTNAME= llvm-source-${DISTVERSION}
MAINTAINER= brooks@FreeBSD.org
COMMENT= Low Level Virtual Machine
LIB_DEPENDS= execinfo:${PORTSDIR}/devel/libexecinfo
.if defined(PACKAGE_BUILDING)
BUILD_DEPENDS+= bash:${PORTSDIR}/shells/bash
.endif
.if defined(MAINTAINER_MODE)
BUILD_DEPENDS+= f2c:${PORTSDIR}/lang/f2c
.endif
LLVM_SUFFIX= 33
LLVM_PREFIX= ${PREFIX}/llvm${LLVM_SUFFIX}
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${LLVM_SUFFIX}
GNU_CONFIGURE= yes
GNU_CONFIGURE_PREFIX= ${LLVM_PREFIX}
USE_GMAKE= yes
USE_LDCONFIG= ${LLVM_PREFIX}/lib
USE_PERL5= yes
USE_PYTHON_BUILD= yes
MAKE_JOBS_SAFE= yes
WRKSRC= ${WRKDIR}/llvm.src
SUB_FILES= llvm-wrapper.sh
SUB_LIST= LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
# Suggested tweaks from http://llvm.org/docs/Packaging.html
CONFIGURE_ARGS+= --enable-shared
MAKE_ARGS+= REQUIRES_RTTI=1
LIBNAME= libLLVM-${DISTVERSION:C/\rc[0-9]//}.so
CONFIGURE_ARGS+= --enable-bindings=none
CONFIGURE_ARGS+= --enable-optimized
OPTIONS_DEFINE= ASSERTS DOCS LTOPLUGIN MANPAGES
ASSERTS_DESC= Enable assertions (thread unsafe)
LTOPLUGIN_DESC= Build LTO plugin (requires gold)
OPTIONS_DEFAULT= MANPAGES
PLIST_SUB+= PORTVERSION=${PORTVERSION}
COMMANDS= bugpoint \
llc \
lli \
llvm-ar \
llvm-as \
llvm-bcanalyzer \
llvm-config \
llvm-cov \
llvm-diff \
llvm-dis \
llvm-dwarfdump \
llvm-extract \
llvm-link \
llvm-mc \
llvm-mcmarkup \
llvm-nm \
llvm-objdump \
llvm-prof \
llvm-ranlib \
llvm-readobj \
llvm-rtdyld \
llvm-size \
llvm-stress \
llvm-symbolizer \
llvm-tblgen \
macho-dump \
opt
FIRST_COMMAND= ${COMMANDS:C/^/XXXX/1:MXXXX*:C/^XXXX//}
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MASSERTS}
CONFIGURE_ARGS+= --enable-assertions
.else
CONFIGURE_ARGS+= --disable-assertions
.endif
.if ${PORT_OPTIONS:MDOCS} || ${PORT_OPTIONS:MMANPAGES}
BUILD_DEPENDS+= sphinx-build:${PORTSDIR}/textproc/py-sphinx
.endif
.if ${PORT_OPTIONS:MDOCS}
CONFIGURE_ARGS+= --enable-docs
.else
CONFIGURE_ARGS+= --disable-docs
.endif
.if ${PORT_OPTIONS:MLTOPLUGIN}
BUILD_DEPENDS+= ld.gold:${PORTSDIR}/devel/binutils
RUN_DEPENDS+= ld.gold:${PORTSDIR}/devel/binutils
CONFIGURE_ARGS+= --with-binutils-include=${LOCALBASE}/include
PLIST_FILES+= lib/LLVMgold.so
.endif
.if ${PORT_OPTIONS:MMANPAGES}
MAN1SRCS= bugpoint.1 lit.1 llc.1 lli.1 llvm-ar.1 llvm-as.1 \
llvm-bcanalyzer.1 llvm-config.1 llvm-cov.1 llvm-diff.1 \
llvm-dis.1 llvm-extract.1 llvm-link.1 llvm-nm.1 \
llvm-prof.1 llvm-ranlib.1 llvm-stress.1 opt.1 tblgen.1
MAN1= ${MAN1SRCS:S/.1/${LLVM_SUFFIX}.1/}
.endif
.include <bsd.port.pre.mk>
.if ${ARCH} == "arm"
BROKEN= Does not compile on arm
.elif ${ARCH} == "sparc64"
BROKEN= does not compile on sparc64
.endif
.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
CONFIGURE_ARGS+= --enable-pic --with-pic
.endif
.if ${ARCH} == "i386"
CONFIGURE_ARGS+= --with-optimize-option=-O2
.endif
post-patch:
${REINPLACE_CMD} -e 's|${PORTVERSION}svn|${PORTVERSION}|g' \
${WRKSRC}/configure
${REINPLACE_CMD} -e 's|\(PROJ_docsdir.*:=\).*$$|\1${DOCSDIR}|g' \
${WRKSRC}/Makefile.config.in
${REINPLACE_CMD} -e 's|\(PROJ_mandir.*:=\).*$$|\1${MANPREFIX}/man|g' \
${WRKSRC}/Makefile.config.in
post-build:
.if ${PORT_OPTIONS:MMANPAGES}
@cd ${WRKSRC}/docs && ${GMAKE} -f Makefile.sphinx man
.endif
.if ${PORT_OPTIONS:MDOCS}
@cd ${WRKSRC}/docs && ${GMAKE} -f Makefile.sphinx html
.endif
post-install:
${MV} ${PREFIX}/llvm33/lib/${LIBNAME} ${LLVM_PREFIX}/lib/${LIBNAME}.0
${LN} -sf ${LIBNAME}.0 ${LLVM_PREFIX}/lib/${LIBNAME}
${INSTALL_SCRIPT} ${WRKDIR}/llvm-wrapper.sh \
${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX}
.for command in ${COMMANDS:C/^/XXXX/1:NXXXX*}
${LN} -f ${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX} \
${PREFIX}/bin/${command}${LLVM_SUFFIX}
.endfor
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${DOCSDIR}/html
${FIND} ${WRKSRC}/docs/_build/html -type f | \
${XARGS} -I _DOC_ ${INSTALL_DATA} _DOC_ ${DOCSDIR}/html/
.endif
.if ${PORT_OPTIONS:MMANPAGES}
for man in ${MAN1SRCS}; do \
${INSTALL_MAN} ${WRKSRC}/docs/_build/man/$${man} \
${MANPREFIX}/man/man1/$${man%.1}${LLVM_SUFFIX}.1 ; \
done
.endif
TEST_CMD= '(cd ${WRKSRC}/test; ${SETENV} ${MAKE_ENV} LD_LIBRARY_PATH=${WRKSRC}/Release/lib ${GMAKE} check-local-lit)'
regression-test: ${BUILD_COOKIE}
if [ `${ID} -u` = 0 ]; then \
${CHOWN} -R nobody ${WRKSRC}/test; \
su -m nobody -c ${TEST_CMD}; \
else \
${SH} -c ${TEST_CMD}; \
fi
build-plist:
${RM} -f ${PLIST}
.for command in ${COMMANDS}
${ECHO_CMD} bin/${command}${LLVM_SUFFIX} >> ${PLIST}
.endfor
${FIND} ${LLVM_PREFIX} -type f -o -type l | \
${GREP} -v man/man1 | ${SED} -e 's|${PREFIX}/||' \
-e 's|${PORTVERSION}|%%PORTVERSION%%|' | \
${SORT} >> ${PLIST}
${FIND} ${DOCSDIR} -type f | \
${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
${SORT} >> ${PLIST}
${FIND} ${LLVM_PREFIX} -type d | \
${SED} -e 's|${PREFIX}/||' | \
${SORT} -r | ${SED} -e 's|^|@dirrm |' >> ${PLIST}
${FIND} ${DOCSDIR} -type d | \
${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' | \
${SORT} -r >> ${PLIST}
.if make(svn-patch)
.if !defined(PATCH_REV)
.error svn-patch requires that PATCH_REV be set
.endif
_PATCH_FILE=${FILESDIR}/patch-svn-${PATCH_REV}
_LLVM_BASE=http://llvm.org/svn/llvm-project/llvm/trunk
svn-patch:
${PRINTF} "$$%s$$\n" FreeBSD > ${_PATCH_FILE}
svn log -c ${PATCH_REV} ${_LLVM_BASE} >> ${_PATCH_FILE}
svn diff -c ${PATCH_REV} ${_LLVM_BASE} >> ${_PATCH_FILE}
.endif
.include <bsd.port.post.mk>
SHA256 (llvm-source-3.3rc3.tar.gz) = 22202303fc2ff667bd2ed1777f46985aed87a266efcc5d438451c25ec50e743b
SIZE (llvm-source-3.3rc3.tar.gz) = 13644242
$FreeBSD$
--- utils/llvm-build/llvmbuild/main.py.orig
+++ utils/llvm-build/llvmbuild/main.py
@@ -633,7 +633,13 @@
# We handle a few special cases of target names here for historical
# reasons, as these are the names configure currently comes up with.
- native_target_name = { 'x86' : 'X86',
+ native_target_name = { 'amd64' : 'X86',
+ 'arm' : 'ARM',
+ 'i386' : 'X86',
+ 'mips' : 'Mips',
+ 'powerpc' : 'PowerPC',
+ 'sparc64' : 'Sparc',
+ 'x86' : 'X86',
'x86_64' : 'X86',
'Unknown' : None }.get(opts.native_target,
opts.native_target)
Low Level Virtual Machine (LLVM) is:
- A compilation strategy designed to enable effective program
optimization across the entire lifetime of a program.
- A virtual instruction set.
- A compiler infrastructure.
- LLVM does not imply things that you would expect from a high-level
virtual machine. It does not require garbage collection or run-time
code generation.
WWW: http://llvm.org/
This diff is collapsed.
......@@ -32,6 +32,7 @@
SUBDIR += clang
SUBDIR += clang-devel
SUBDIR += clang31
SUBDIR += clang33
SUBDIR += clay
SUBDIR += clisp
SUBDIR += clojure
......
# $FreeBSD$
PORTNAME= clang
DISTVERSION= 3.3rc3
CATEGORIES= lang devel
MASTER_SITES= http://llvm.org/pre-releases/3.3/rc3/
DISTNAME= cfe-source-${DISTVERSION}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
${LLVM_SOURCE}
MAINTAINER= brooks@FreeBSD.org
COMMENT= C, Objective-C, and C++ compiler
CLANG_NAME= cfe.src
CLANG_SOURCE= ${DISTNAME}${EXTRACT_SUFX}
LLVM_NAME= llvm.src
LLVM_SOURCE= llvm-source-${DISTVERSION}${EXTRACT_SUFX}
WRKSRC= ${WRKDIR}/${LLVM_NAME}
BUILD_WRKSRC= ${WRKSRC}/tools/clang
INSTALL_WRKSRC= ${WRKSRC}/tools/clang
BUILD_DEPENDS+= llvm>=${PORTVERSION}:${PORTSDIR}/devel/llvm
RUN_DEPENDS+= llvm>=${PORTVERSION}:${PORTSDIR}/devel/llvm
.if defined(PACKAGE_BUILDING)
BUILD_DEPENDS+= runtest:${PORTSDIR}/misc/dejagnu
.endif
LLVM_SUFFIX= 33
LLVM_PREFIX= ${PREFIX}/llvm${LLVM_SUFFIX}
DATADIR= ${PREFIX}/share/${PORTNAME}${LLVM_SUFFIX}
DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${LLVM_SUFFIX}
UNIQUENAME= ${PORTNAME}${LLVM_SUFFIX}
GNU_CONFIGURE= yes
GNU_CONFIGURE_PREFIX= ${LLVM_PREFIX}
USE_GMAKE= yes
USE_LDCONFIG= yes
USE_PERL5= yes
MAKE_JOBS_SAFE= yes
MAKE_ARGS= CLANG_TBLGEN=${WRKSRC}/${RELTYPE}/bin/clang-tblgen \
LLVMIncDir=${LLVM_PREFIX}/include \
LLVMToolDir=${LLVM_PREFIX}/bin \
LLVMLibDir=${LLVM_PREFIX}/lib
SUB_FILES= llvm-wrapper.sh
SUB_LIST= LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
OPTIONS_DEFINE= ASSERTS DOCS
ASSERTS_DESC= Enable assertions (thread unsafe)
CONFIGURE_ARGS+= --enable-optimized
MAN1= clang${LLVM_SUFFIX}.1
PLIST_SUB+= PORTVERSION=${PORTVERSION}
COMMANDS= c-index-test \
clang \
clang++ \
clang-check \
clang-cpp \
clang-tblgen
FIRST_COMMAND= ${COMMANDS:C/^/XXXX/1:MXXXX*:C/^XXXX//}
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MASSERTS}
CONFIGURE_ARGS+= --enable-assertions
RELTYPE= Release+Asserts
.else
CONFIGURE_ARGS+= --disable-assertions
RELTYPE= Release
.endif
.if ${PORT_OPTIONS:MDOCS}
CONFIGURE_ARGS+= --enable-docs
.else
CONFIGURE_ARGS+= --disable-docs
.endif
.include <bsd.port.pre.mk>
.if ${ARCH} == "sparc64"
BROKEN= Does not compile on sparc64
.endif
post-extract:
${RM} -f ${BUILD_WRKSRC}
${MV} ${WRKDIR}/${CLANG_NAME} ${BUILD_WRKSRC}
post-patch:
${REINPLACE_CMD} -e 's|${PORTVERSION}svn|${PORTVERSION}|g' \
${WRKSRC}/configure
${REINPLACE_CMD} -e 's|\(PROJ_docsdir.*:=\).*$$|\1${DOCSDIR}|g' \
${WRKSRC}/Makefile.config.in
${REINPLACE_CMD} -e 's|\(PROJ_mandir.*:=\).*$$|\1${MANPREFIX}/man|g' \
${WRKSRC}/Makefile.config.in
pre-build:
${LN} -sf ${LLVM_PREFIX}/include/llvm/IR/Intrinsics.gen \
${WRKSRC}/include/llvm/IR/
${MKDIR} ${WRKSRC}/${RELTYPE}/lib
${LN} -sf ${LLVM_PREFIX}/lib/libLLVM-3.3.so ${WRKSRC}/${RELTYPE}/lib/
${LN} -sf ${LLVM_PREFIX}/lib/libLLVMTableGen.a ${WRKSRC}/${RELTYPE}/lib/
${LN} -sf ${LLVM_PREFIX}/lib/libLLVMSupport.a ${WRKSRC}/${RELTYPE}/lib/
cd ${WRKSRC}/utils/unittest && ${GMAKE}
post-build:
@cd ${WRKSRC}/tools/clang/docs/tools && ${GMAKE} clang.1
post-install:
${LN} -sf ${LLVM_PREFIX}/bin/clang ${LLVM_PREFIX}/bin/clang-cpp
${INSTALL_SCRIPT} ${WRKDIR}/llvm-wrapper.sh \
${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX}
.for command in ${COMMANDS:C/^/XXXX/1:NXXXX*}
${LN} -f ${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX} \
${PREFIX}/bin/${command}${LLVM_SUFFIX}
.endfor
${INSTALL_MAN} ${WRKSRC}/tools/clang/docs/tools/clang.1 \
${MANPREFIX}/man/man1/clang${LLVM_SUFFIX}.1
TEST_CMD= '(cd ${WRKSRC}/test; ${SETENV} ${MAKE_ENV} ${GMAKE} check)'
regression-test: ${BUILD_COOKIE}
if [ `${ID} -u` = 0 ]; then \
${CHOWN} -R nobody ${WRKSRC}/test; \
su -m nobody -c ${TEST_CMD}; \
else \
${SH} -c ${TEST_CMD}; \
fi
PLIST_FILE_LIST= ${COMMANDS:S|^|bin/|} \
lib/libclang*
PLIST_DIR_LIST= include/clang \
include/clang-c \
lib/clang
build-plist:
${RM} -f ${PLIST}
.for command in ${COMMANDS}
${ECHO_CMD} bin/${command}${LLVM_SUFFIX} >> ${PLIST}
.endfor
(ls ${PLIST_FILE_LIST:S|^|${LLVM_PREFIX}/|}; \
${FIND} ${PLIST_DIR_LIST:S|^|${LLVM_PREFIX}/|} -type f) | \
${SED} -e 's|${PREFIX}/||' | ${SORT} >> ${PLIST}
${FIND} ${DOCSDIR} -type f | \
${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
${SORT} >> ${PLIST}
${FIND} ${PLIST_DIR_LIST:S|^|${LLVM_PREFIX}/|} -type d | \
${SED} -e 's|${PREFIX}/||' | \
${SORT} -r | ${SED} -e 's|^|@dirrm |' >> ${PLIST}
${FIND} ${DOCSDIR} -type d | ${SORT} -r | \
${SED} -e 's|${DOCSDIR}|%%PORTDOCS%%@dirrm %%DOCSDIR%%|' >> ${PLIST}
.if make(svn-patch)
.if !defined(PATCH_REV)
.error svn-patch requires that PATCH_REV be set
.endif
_PATCH_FILE=${FILESDIR}/patch-svn-${PATCH_REV}
_LLVM_BASE=http://llvm.org/svn/llvm-project/cfe/trunk
svn-patch:
${PRINTF} "$$%s$$\n" FreeBSD > ${_PATCH_FILE}
svn log -c ${PATCH_REV} ${_LLVM_BASE} >> ${_PATCH_FILE}
svn diff -c ${PATCH_REV} ${_LLVM_BASE} | \
${SED} -e 's;^--- ;--- tools/clang/;' | \
${SED} -e 's;^+++ ;+++ tools/clang/;' >> \
${_PATCH_FILE}
.endif
.include <bsd.port.post.mk>
SHA256 (cfe-source-3.3rc3.tar.gz) = db2b5bdaa3a21632cd0c8fbf59c9cbe0c4688bcb444677bd75c5c8f62f372c6f
SIZE (cfe-source-3.3rc3.tar.gz) = 9423822
SHA256 (llvm-source-3.3rc3.tar.gz) = 22202303fc2ff667bd2ed1777f46985aed87a266efcc5d438451c25ec50e743b
SIZE (llvm-source-3.3rc3.tar.gz) = 13644242
$FreeBSD$
--- include/llvm/ADT/Triple.h.orig
+++ include/llvm/ADT/Triple.h
@@ -296,6 +296,11 @@
return isMacOSX() || getOS() == Triple::IOS;
}
+ /// isOSFreeBSD - Is this FreeBSD OS
+ bool isOSFreeBSD() const {
+ return getOS() == Triple::FreeBSD;
+ }
+
/// \brief Tests for either Cygwin or MinGW OS
bool isOSCygMing() const {
return getOS() == Triple::Cygwin || getOS() == Triple::MinGW32;
$FreeBSD$
--- tools/clang/include/clang/Analysis/Analyses/FormatString.h.orig
+++ tools/clang/include/clang/Analysis/Analyses/FormatString.h
@@ -117,7 +117,7 @@
// C99 conversion specifiers.
cArg,
dArg,
- DArg, // Apple extension
+ DArg, // Apple and FreeBSD extension
iArg,
IntArgBeg = dArg, IntArgEnd = iArg,
@@ -148,6 +148,9 @@
// ** Printf-specific **
+ // FreeBSD specific specifiers
+ bArg,
+
// Objective-C specific specifiers.
ObjCObjArg, // '@'
ObjCBeg = ObjCObjArg, ObjCEnd = ObjCObjArg,
$FreeBSD$
--- tools/clang/lib/Analysis/PrintfFormatString.cpp.orig
+++ tools/clang/lib/Analysis/PrintfFormatString.cpp
@@ -198,9 +198,10 @@
case '@': k = ConversionSpecifier::ObjCObjArg; break;
// Glibc specific.
case 'm': k = ConversionSpecifier::PrintErrno; break;
- // Apple-specific
+
+ // Apple-specific (and one FreeBSD)
case 'D':
- if (Target.getTriple().isOSDarwin())
+ if (Target.getTriple().isOSDarwin() || Target.getTriple().isOSFreeBSD())
k = ConversionSpecifier::DArg;
break;
case 'O':
@@ -211,11 +212,29 @@
if (Target.getTriple().isOSDarwin())
k = ConversionSpecifier::UArg;
break;
+
+ // FreeBSD-specific
+ case 'b':
+ if (Target.getTriple().isOSFreeBSD())
+ k = ConversionSpecifier::bArg;
+ break;
+ case 'r':
+ if (Target.getTriple().isOSFreeBSD())
+ k = ConversionSpecifier::xArg;
+ break;
+ case 'y':
+ if (Target.getTriple().isOSFreeBSD())
+ k = ConversionSpecifier::iArg;
+ break;
}
PrintfConversionSpecifier CS(conversionPosition, k);
FS.setConversionSpecifier(CS);
if (CS.consumesDataArgument() && !FS.usesPositionalArg())
FS.setArgIndex(argIndex++);
+ // FreeBSD extension
+ if (Target.getTriple().isOSFreeBSD() && (k == ConversionSpecifier::bArg ||
+ k == ConversionSpecifier::DArg))
+ argIndex++;
if (k == ConversionSpecifier::InvalidSpecifier) {
// Assume the conversion takes one argument.
$FreeBSD$
--- tools/clang/lib/Headers/Makefile.orig
+++ tools/clang/lib/Headers/Makefile
@@ -19,7 +19,7 @@
HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include
-HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
+HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*intrin*.h) mm3dnow.h mm_malloc.h)
OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS))
$FreeBSD$
--- tools/clang/lib/Sema/SemaChecking.cpp.orig
+++ tools/clang/lib/Sema/SemaChecking.cpp
@@ -1511,6 +1511,39 @@
CoveredArgs.set(argIndex);
}
+ // FreeBSD extensions
+ if (CS.getKind() == ConversionSpecifier::bArg || CS.getKind() == ConversionSpecifier::DArg) {
+ // claim the second argument
+ CoveredArgs.set(argIndex + 1);
+
+ // Now type check the data expression that matches the
+ // format specifier.
+ const Expr *Ex = getDataArg(argIndex);
+ QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy);
+ //const analyze_printf::ArgType &ATR = S.Context.IntTy;
+ const analyze_printf::ArgType &ATR = type;
+ if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType()))
+ S.Diag(getLocationOfByte(CS.getStart()),
+ diag::warn_printf_conversion_argument_type_mismatch)
+ << ATR.getRepresentativeType(S.Context) << Ex->getType()
+ << getSpecifierRange(startSpecifier, specifierLen)
+ << Ex->getSourceRange();
+
+ // Now type check the data expression that matches the
+ // format specifier.
+ Ex = getDataArg(argIndex + 1);
+ const analyze_printf::ArgType &ATR2 = ArgType::CStrTy;
+ if (ATR2.isValid() && !ATR2.matchesType(S.Context, Ex->getType()))
+ S.Diag(getLocationOfByte(CS.getStart()),
+ diag::warn_printf_conversion_argument_type_mismatch)
+ << ATR2.getRepresentativeType(S.Context) << Ex->getType()
+ << getSpecifierRange(startSpecifier, specifierLen)
+ << Ex->getSourceRange();
+
+ return true;
+ }
+ // END OF FREEBSD EXTENSIONS
+
// Check for using an Objective-C specific conversion specifier
// in a non-ObjC literal.
if (!IsObjCLiteral && CS.isObjCArg()) {
$FreeBSD$
--- tools/clang/tools/scan-build/scan-build.orig
+++ tools/clang/tools/scan-build/scan-build
@@ -423,7 +423,7 @@