NOTES.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //===---------------------------------------------------------------------===//
  2. // Random Notes
  3. //===---------------------------------------------------------------------===//
  4. //===---------------------------------------------------------------------===//
  5. To time GCC preprocessing speed without output, use:
  6. "time gcc -MM file"
  7. This is similar to -Eonly.
  8. //===---------------------------------------------------------------------===//
  9. C++ Template Instantiation benchmark:
  10. http://users.rcn.com/abrahams/instantiation_speed/index.html
  11. //===---------------------------------------------------------------------===//
  12. TODO: File Manager Speedup:
  13. We currently do a lot of stat'ing for files that don't exist, particularly
  14. when lots of -I paths exist (e.g. see the <iostream> example, check for
  15. failures in stat in FileManager::getFile). It would be far better to make
  16. the following changes:
  17. 1. FileEntry contains a sys::Path instead of a std::string for Name.
  18. 2. sys::Path contains timestamp and size, lazily computed. Eliminate from
  19. FileEntry.
  20. 3. File UIDs are created on request, not when files are opened.
  21. These changes make it possible to efficiently have FileEntry objects for
  22. files that exist on the file system, but have not been used yet.
  23. Once this is done:
  24. 1. DirectoryEntry gets a boolean value "has read entries". When false, not
  25. all entries in the directory are in the file mgr, when true, they are.
  26. 2. Instead of stat'ing the file in FileManager::getFile, check to see if
  27. the dir has been read. If so, fail immediately, if not, read the dir,
  28. then retry.
  29. 3. Reading the dir uses the getdirentries syscall, creating a FileEntry
  30. for all files found.
  31. //===---------------------------------------------------------------------===//
  32. // Specifying targets: -triple and -arch
  33. //===---------------------------------------------------------------------===//
  34. The clang supports "-triple" and "-arch" options. At most one -triple and one
  35. -arch option may be specified. Both are optional.
  36. The "selection of target" behavior is defined as follows:
  37. (1) If the user does not specify -triple, we default to the host triple.
  38. (2) If the user specifies a -arch, that overrides the arch in the host or
  39. specified triple.
  40. //===---------------------------------------------------------------------===//
  41. verifyInputConstraint and verifyOutputConstraint should not return bool.
  42. Instead we should return something like:
  43. enum VerifyConstraintResult {
  44. Valid,
  45. // Output only
  46. OutputOperandConstraintLacksEqualsCharacter,
  47. MatchingConstraintNotValidInOutputOperand,
  48. // Input only
  49. InputOperandConstraintContainsEqualsCharacter,
  50. MatchingConstraintReferencesInvalidOperandNumber,
  51. // Both
  52. PercentConstraintUsedWithLastOperand
  53. };
  54. //===---------------------------------------------------------------------===//
  55. Blocks should not capture variables that are only used in dead code.
  56. The rule that we came up with is that blocks are required to capture
  57. variables if they're referenced in evaluated code, even if that code
  58. doesn't actually rely on the value of the captured variable.
  59. For example, this requires a capture:
  60. (void) var;
  61. But this does not:
  62. if (false) puts(var);
  63. Summary of <rdar://problem/9851835>: if we implement this, we should
  64. warn about non-POD variables that are referenced but not captured, but
  65. only if the non-reachability is not due to macro or template
  66. metaprogramming.
  67. //===---------------------------------------------------------------------===//
  68. We can still apply a modified version of the constructor/destructor
  69. delegation optimization in cases of virtual inheritance where:
  70. - there is no function-try-block,
  71. - the constructor signature is not variadic, and
  72. - the parameter variables can safely be copied and repassed
  73. to the base constructor because either
  74. - they have not had their addresses taken by the vbase initializers or
  75. - they were passed indirectly.
  76. //===---------------------------------------------------------------------===//