2011-02-12 07:46:38 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS mc)
|
|
|
|
|
2008-10-26 08:56:18 +08:00
|
|
|
add_clang_library(clangBasic
|
2009-06-14 09:05:48 +08:00
|
|
|
Builtins.cpp
|
2009-04-01 23:50:34 +08:00
|
|
|
ConvertUTF.c
|
2008-10-26 08:56:18 +08:00
|
|
|
Diagnostic.cpp
|
2010-11-19 05:19:52 +08:00
|
|
|
DiagnosticIDs.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
FileManager.cpp
|
2010-11-24 03:19:34 +08:00
|
|
|
FileSystemStatCache.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
IdentifierTable.cpp
|
2011-09-14 01:21:33 +08:00
|
|
|
LangOptions.cpp
|
2011-12-01 07:21:26 +08:00
|
|
|
Module.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
SourceLocation.cpp
|
|
|
|
SourceManager.cpp
|
|
|
|
TargetInfo.cpp
|
|
|
|
Targets.cpp
|
|
|
|
TokenKinds.cpp
|
2009-10-06 04:33:49 +08:00
|
|
|
Version.cpp
|
Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,
void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));
says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:
- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.
Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.
The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.
Addresses <rdar://problem/6690412>.
As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.
llvm-svn: 128127
2011-03-23 08:50:03 +08:00
|
|
|
VersionTuple.cpp
|
2008-10-26 08:56:18 +08:00
|
|
|
)
|
2009-03-17 07:06:59 +08:00
|
|
|
|
2009-10-06 04:33:49 +08:00
|
|
|
# Determine Subversion revision.
|
|
|
|
# FIXME: This only gets updated when CMake is run, so this revision number
|
|
|
|
# may be out-of-date!
|
2010-10-23 01:16:39 +08:00
|
|
|
if( NOT IS_SYMLINK "${CLANG_SOURCE_DIR}" ) # See PR 8437
|
|
|
|
find_package(Subversion)
|
|
|
|
endif()
|
2009-10-25 04:32:58 +08:00
|
|
|
if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn")
|
2009-10-06 04:33:49 +08:00
|
|
|
Subversion_WC_INFO(${CLANG_SOURCE_DIR} CLANG)
|
|
|
|
set_source_files_properties(Version.cpp
|
|
|
|
PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${CLANG_WC_REVISION}\"")
|
|
|
|
endif()
|
|
|
|
|
2010-09-14 07:54:41 +08:00
|
|
|
add_dependencies(clangBasic
|
|
|
|
ClangARMNeon
|
|
|
|
ClangAttrList
|
|
|
|
ClangDiagnosticAnalysis
|
|
|
|
ClangDiagnosticAST
|
|
|
|
ClangDiagnosticCommon
|
|
|
|
ClangDiagnosticDriver
|
|
|
|
ClangDiagnosticFrontend
|
|
|
|
ClangDiagnosticGroups
|
|
|
|
ClangDiagnosticLex
|
|
|
|
ClangDiagnosticParse
|
2011-04-16 06:04:17 +08:00
|
|
|
ClangDiagnosticSema
|
2011-12-18 04:08:54 +08:00
|
|
|
ClangDiagnosticSerialization
|
2011-04-16 06:04:17 +08:00
|
|
|
ClangDiagnosticIndexName)
|
2010-09-14 07:54:41 +08:00
|
|
|
|