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