Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===---------------------------------------------------------------------===// |
| 2 | // Random Notes |
| 3 | //===---------------------------------------------------------------------===// |
| 4 | |
| 5 | C90/C99/C++ Comparisons: |
| 6 | http://david.tribble.com/text/cdiffs.htm |
| 7 | |
| 8 | //===---------------------------------------------------------------------===// |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 9 | |
| 10 | To time GCC preprocessing speed without output, use: |
| 11 | "time gcc -MM file" |
| 12 | This is similar to -Eonly. |
| 13 | |
Chris Lattner | eab819b | 2009-01-16 19:33:59 +0000 | [diff] [blame] | 14 | //===---------------------------------------------------------------------===// |
| 15 | |
| 16 | Creating and using a PTH file for performance measurement (use a release-asserts |
| 17 | build). |
| 18 | |
| 19 | $ clang -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache |
| 20 | $ clang -token-cache /tmp/tokencache INPUTS/Cocoa_h.m |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 21 | |
| 22 | //===---------------------------------------------------------------------===// |
| 23 | |
| 24 | C++ Template Instantiation benchmark: |
| 25 | http://users.rcn.com/abrahams/instantiation_speed/index.html |
| 26 | |
| 27 | //===---------------------------------------------------------------------===// |
| 28 | |
| 29 | TODO: File Manager Speedup: |
| 30 | |
| 31 | We currently do a lot of stat'ing for files that don't exist, particularly |
| 32 | when lots of -I paths exist (e.g. see the <iostream> example, check for |
| 33 | failures in stat in FileManager::getFile). It would be far better to make |
| 34 | the following changes: |
| 35 | 1. FileEntry contains a sys::Path instead of a std::string for Name. |
| 36 | 2. sys::Path contains timestamp and size, lazily computed. Eliminate from |
| 37 | FileEntry. |
| 38 | 3. File UIDs are created on request, not when files are opened. |
| 39 | These changes make it possible to efficiently have FileEntry objects for |
| 40 | files that exist on the file system, but have not been used yet. |
| 41 | |
| 42 | Once this is done: |
| 43 | 1. DirectoryEntry gets a boolean value "has read entries". When false, not |
| 44 | all entries in the directory are in the file mgr, when true, they are. |
| 45 | 2. Instead of stat'ing the file in FileManager::getFile, check to see if |
| 46 | the dir has been read. If so, fail immediately, if not, read the dir, |
| 47 | then retry. |
| 48 | 3. Reading the dir uses the getdirentries syscall, creating an FileEntry |
| 49 | for all files found. |
| 50 | |
| 51 | //===---------------------------------------------------------------------===// |
Ted Kremenek | f4c45b0 | 2007-12-03 22:26:16 +0000 | [diff] [blame] | 52 | // Specifying targets: -triple and -arch |
| 53 | ===---------------------------------------------------------------------===// |
| 54 | |
Chris Lattner | 177b1c7 | 2008-03-09 01:36:43 +0000 | [diff] [blame] | 55 | The clang supports "-triple" and "-arch" options. At most one -triple and one |
| 56 | -arch option may be specified. Both are optional. |
Ted Kremenek | f4c45b0 | 2007-12-03 22:26:16 +0000 | [diff] [blame] | 57 | |
| 58 | The "selection of target" behavior is defined as follows: |
| 59 | |
Chris Lattner | 177b1c7 | 2008-03-09 01:36:43 +0000 | [diff] [blame] | 60 | (1) If the user does not specify -triple, we default to the host triple. |
| 61 | (2) If the user specifies a -arch, that overrides the arch in the host or |
| 62 | specified triple. |
Anders Carlsson | 3de54ff | 2008-03-13 03:45:48 +0000 | [diff] [blame] | 63 | |
| 64 | //===---------------------------------------------------------------------===// |
| 65 | |
| 66 | |
| 67 | verifyInputConstraint and verifyOutputConstraint should not return bool. |
| 68 | |
| 69 | Instead we should return something like: |
| 70 | |
| 71 | enum VerifyConstraintResult { |
| 72 | Valid, |
| 73 | |
| 74 | // Output only |
| 75 | OutputOperandConstraintLacksEqualsCharacter, |
| 76 | MatchingConstraintNotValidInOutputOperand, |
| 77 | |
| 78 | // Input only |
| 79 | InputOperandConstraintContainsEqualsCharacter, |
| 80 | MatchingConstraintReferencesInvalidOperandNumber, |
| 81 | |
| 82 | // Both |
| 83 | PercentConstraintUsedWithLastOperand |
| 84 | }; |
| 85 | |
| 86 | //===---------------------------------------------------------------------===// |