summaryrefslogtreecommitdiffstats
path: root/NOTES.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-05 01:18:20 +0000
committerChris Lattner <sabre@nondot.org>2008-03-05 01:18:20 +0000
commit42e6737f2efb113563140ad794c21c7709250402 (patch)
treea308f3a2092db95c7aa132a84c820447da8d1a30 /NOTES.txt
parent424f67155475296804f9b9159dba606859441924 (diff)
Remove the first layer of support for "portability" warnings. This is
theoretically useful, but not useful in practice. It adds a bunch of complexity, and not much value. It's best to nuke it. One big advantage is that it means the target interfaces will soon lose their SLoc arguments and target queries can never emit diagnostics anymore (yay). Removing this also simplifies some of the core preprocessor which should make it slightly faster. Ted, I didn't simplify TripleProcessor, which can now have at most one triple, and can probably just be removed. Please poke at it when you have time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'NOTES.txt')
-rw-r--r--NOTES.txt120
1 files changed, 0 insertions, 120 deletions
diff --git a/NOTES.txt b/NOTES.txt
index 1266718ec0..623f01cd64 100644
--- a/NOTES.txt
+++ b/NOTES.txt
@@ -6,27 +6,6 @@ C90/C99/C++ Comparisons:
http://david.tribble.com/text/cdiffs.htm
//===---------------------------------------------------------------------===//
-Extensions:
-
- * "#define_target X Y"
- This preprocessor directive works exactly the same was as #define, but it
- notes that 'X' is a target-specific preprocessor directive. When used, a
- diagnostic is emitted indicating that the translation unit is non-portable.
-
- If a target-define is #undef'd before use, no diagnostic is emitted. If 'X'
- were previously a normal #define macro, the macro is tainted. If 'X' is
- subsequently #defined as a non-target-specific define, the taint bit is
- cleared.
-
- * "#define_other_target X"
- The preprocessor directive takes a single identifier argument. It notes
- that this identifier is a target-specific #define for some target other than
- the current one. Use of this identifier will result in a diagnostic.
-
- If 'X' is later #undef'd or #define'd, the taint bit is cleared. If 'X' is
- already defined, X is marked as a target-specific define.
-
-//===---------------------------------------------------------------------===//
To time GCC preprocessing speed without output, use:
"time gcc -MM file"
@@ -159,102 +138,3 @@ The "selection of target" behavior is defined as follows:
ppc64-apple-darwin9 (secondary target)
The secondary targets are used in the 'portability' model (see below).
-
-//===---------------------------------------------------------------------===//
-
-The 'portability' model in clang is sufficient to catch translation units (or
-their parts) that are not portable, but it doesn't help if the system headers
-are non-portable and not fixed. An alternative model that would be easy to use
-is a 'tainting' scheme. Consider:
-
-int32_t
-OSHostByteOrder(void) {
-#if defined(__LITTLE_ENDIAN__)
- return OSLittleEndian;
-#elif defined(__BIG_ENDIAN__)
- return OSBigEndian;
-#else
- return OSUnknownByteOrder;
-#endif
-}
-
-It would be trivial to mark 'OSHostByteOrder' as being non-portable (tainted)
-instead of marking the entire translation unit. Then, if OSHostByteOrder is
-never called/used by the current translation unit, the t-u wouldn't be marked
-non-portable. However, there is no good way to handle stuff like:
-
-extern int X, Y;
-
-#ifndef __POWERPC__
-#define X Y
-#endif
-
-int bar() { return X; }
-
-When compiling for powerpc, the #define is skipped, so it doesn't know that bar
-uses a #define that is set on some other target. In practice, limited cases
-could be handled by scanning the skipped region of a #if, but the fully general
-case cannot be implemented efficiently. In this case, for example, the #define
-in the protected region could be turned into either a #define_target or
-#define_other_target as appropriate. The harder case is code like this (from
-OSByteOrder.h):
-
- #if (defined(__ppc__) || defined(__ppc64__))
- #include <libkern/ppc/OSByteOrder.h>
- #elif (defined(__i386__) || defined(__x86_64__))
- #include <libkern/i386/OSByteOrder.h>
- #else
- #include <libkern/machine/OSByteOrder.h>
- #endif
-
-The realistic way to fix this is by having an initial #ifdef __llvm__ that
-defines its contents in terms of the llvm bswap intrinsics. Other things should
-be handled on a case-by-case basis.
-
-
-We probably have to do something smarter like this in the future. The C++ header
-<limits> contains a lot of code like this:
-
- static const int digits10 = __LDBL_DIG__;
- static const int min_exponent = __LDBL_MIN_EXP__;
- static const int min_exponent10 = __LDBL_MIN_10_EXP__;
- static const float_denorm_style has_denorm
- = bool(__LDBL_DENORM_MIN__) ? denorm_present : denorm_absent;
-
- ... since this isn't being used in an #ifdef, it should be easy enough to taint
-the decl for these ivars.
-
-
-/usr/include/sys/cdefs.h contains stuff like this:
-
-#if defined(__ppc__)
-# if defined(__LDBL_MANT_DIG__) && defined(__DBL_MANT_DIG__) && \
- __LDBL_MANT_DIG__ > __DBL_MANT_DIG__
-# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1040
-# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBLStub")
-# else
-# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBL128")
-# endif
-# define __DARWIN_LDBL_COMPAT2(x) __asm("_" __STRING(x) "$LDBL128")
-# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0
-# else
-# define __DARWIN_LDBL_COMPAT(x) /* nothing */
-# define __DARWIN_LDBL_COMPAT2(x) /* nothing */
-# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 1
-# endif
-#elif defined(__i386__) || defined(__ppc64__) || defined(__x86_64__)
-# define __DARWIN_LDBL_COMPAT(x) /* nothing */
-# define __DARWIN_LDBL_COMPAT2(x) /* nothing */
-# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0
-#else
-# error Unknown architecture
-#endif
-
-An ideal way to solve this issue is to mark __DARWIN_LDBL_COMPAT /
-__DARWIN_LDBL_COMPAT2 / __DARWIN_LONG_DOUBLE_IS_DOUBLE as being non-portable
-because they depend on non-portable macros. In practice though, this may end
-up being a serious problem: every use of printf will mark the translation unit
-non-portable if targetting ppc32 and something else.
-
-//===---------------------------------------------------------------------===//
-