]> granicus.if.org Git - clang/blobdiff - NOTES.txt
Merging r308996:
[clang] / NOTES.txt
index 0f4a8de0aa99ad70a347ee1bbc41307f16ba796c..53f35a01863ac70bda0097048162f6d368d269e2 100644 (file)
--- a/NOTES.txt
+++ b/NOTES.txt
@@ -2,15 +2,18 @@
 // Random Notes
 //===---------------------------------------------------------------------===//
 
-C90/C99/C++ Comparisons:
-http://david.tribble.com/text/cdiffs.htm
-
 //===---------------------------------------------------------------------===//
 
 To time GCC preprocessing speed without output, use:
    "time gcc -MM file"
 This is similar to -Eonly.
 
+//===---------------------------------------------------------------------===//
+
+Creating and using a PTH file for performance measurement (use a release build).
+
+$ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache
+$ clang -cc1 -token-cache /tmp/tokencache INPUTS/Cocoa_h.m
 
 //===---------------------------------------------------------------------===//
 
@@ -31,76 +34,19 @@ TODO: File Manager Speedup:
    3. File UIDs are created on request, not when files are opened.
  These changes make it possible to efficiently have FileEntry objects for
  files that exist on the file system, but have not been used yet.
+
  Once this is done:
    1. DirectoryEntry gets a boolean value "has read entries".  When false, not
       all entries in the directory are in the file mgr, when true, they are.
-   2. Instead of stat'ing the file in FileManager::getFile, check to see if 
+   2. Instead of stat'ing the file in FileManager::getFile, check to see if
       the dir has been read.  If so, fail immediately, if not, read the dir,
       then retry.
-   3. Reading the dir uses the getdirentries syscall, creating an FileEntry
+   3. Reading the dir uses the getdirentries syscall, creating a FileEntry
       for all files found.
 
-//===---------------------------------------------------------------------===//
-
-TODO: Fast #Import:
-
- * Get frameworks that don't use #import to do so, e.g. 
-   DirectoryService, AudioToolbox, CoreFoundation, etc.  Why not using #import?
-   Because they work in C mode? C has #import.
- * Have the lexer return a token for #import instead of handling it itself.
-   - Create a new preprocessor object with no external state (no -D/U options
-     from the command line, etc).  Alternatively, keep track of exactly which
-     external state is used by a #import: declare it somehow.
- * When having reading a #import file, keep track of whether we have (and/or
-   which) seen any "configuration" macros.  Various cases:
-   - Uses of target args (__POWERPC__, __i386): Header has to be parsed 
-     multiple times, per-target.  What about #ifndef checks?  How do we know?
-   - "Configuration" preprocessor macros not defined: POWERPC, etc.  What about
-     things like __STDC__ etc?  What is and what isn't allowed.
- * Special handling for "umbrella" headers, which just contain #import stmts:
-   - Cocoa.h/AppKit.h - Contain pointers to digests instead of entire digests
-     themselves?  Foundation.h isn't pure umbrella!
- * Frameworks digests:
-   - Can put "digest" of a framework-worth of headers into the framework
-     itself.  To open AppKit, just mmap
-     /System/Library/Frameworks/AppKit.framework/"digest", which provides a
-     symbol table in a well defined format.  Lazily unstream stuff that is
-     needed.  Contains declarations, macros, and debug information.
-   - System frameworks ship with digests.  How do we handle configuration
-     information?  How do we handle stuff like:
-       #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2
-     which guards a bunch of decls?  Should there be a couple of default
-     configs, then have the UI fall back to building/caching its own?
-   - GUI automatically builds digests when UI is idle, both of system
-     frameworks if they aren't not available in the right config, and of app
-     frameworks.
-   - GUI builds dependence graph of frameworks/digests based on #imports.  If a
-     digest is out date, dependent digests are automatically invalidated.
-
- * New constraints on #import for objc-v3:
-   - #imported file must not define non-inline function bodies.
-     - Alternatively, they can, and these bodies get compiled/linked *once*
-       per app into a dylib.  What about building user dylibs?
-   - Restrictions on ObjC grammar: can't #import the body of a for stmt or fn.
-   - Compiler must detect and reject these cases.
-   - #defines defined within a #import have two behaviors:
-     - By default, they escape the header.  These macros *cannot* be #undef'd
-       by other code: this is enforced by the front-end.
-     - Optionally, user can specify what macros escape (whitelist) or can use
-       #undef.
-
-//===---------------------------------------------------------------------===//
-
-TODO: New language feature: Configuration queries:
-  - Instead of #ifdef __POWERPC__, use "if (strcmp(`cpu`, __POWERPC__))", or
-    some other, better, syntax.
-  - Use it to increase the number of "architecture-clean" #import'd files,
-    allowing a single index to be used for all fat slices.
-
 //===---------------------------------------------------------------------===//
 // Specifying targets:  -triple and -arch
-===---------------------------------------------------------------------===//
+//===---------------------------------------------------------------------===//
 
 The clang supports "-triple" and "-arch" options. At most one -triple and one
 -arch option may be specified.  Both are optional.
@@ -109,4 +55,57 @@ The "selection of target" behavior is defined as follows:
 
 (1) If the user does not specify -triple, we default to the host triple.
 (2) If the user specifies a -arch, that overrides the arch in the host or
-    specified triple. 
+    specified triple.
+
+//===---------------------------------------------------------------------===//
+
+
+verifyInputConstraint and verifyOutputConstraint should not return bool.
+
+Instead we should return something like:
+
+enum VerifyConstraintResult {
+  Valid,
+
+  // Output only
+  OutputOperandConstraintLacksEqualsCharacter,
+  MatchingConstraintNotValidInOutputOperand,
+
+  // Input only
+  InputOperandConstraintContainsEqualsCharacter,
+  MatchingConstraintReferencesInvalidOperandNumber,
+
+  // Both
+  PercentConstraintUsedWithLastOperand
+};
+
+//===---------------------------------------------------------------------===//
+
+Blocks should not capture variables that are only used in dead code.
+
+The rule that we came up with is that blocks are required to capture
+variables if they're referenced in evaluated code, even if that code
+doesn't actually rely on the value of the captured variable.
+
+For example, this requires a capture:
+  (void) var;
+But this does not:
+  if (false) puts(var);
+
+Summary of <rdar://problem/9851835>: if we implement this, we should
+warn about non-POD variables that are referenced but not captured, but
+only if the non-reachability is not due to macro or template
+metaprogramming.
+
+//===---------------------------------------------------------------------===//
+
+We can still apply a modified version of the constructor/destructor
+delegation optimization in cases of virtual inheritance where:
+  - there is no function-try-block,
+  - the constructor signature is not variadic, and
+  - the parameter variables can safely be copied and repassed
+    to the base constructor because either
+    - they have not had their addresses taken by the vbase initializers or
+    - they were passed indirectly.
+
+//===---------------------------------------------------------------------===//