| Chris Lattner | 5836033 | 2006-10-14 19:53:48 +0000 | [diff] [blame] | 1 | //===---------------------------------------------------------------------===// | 
|  | 2 | // Random Notes | 
|  | 3 | //===---------------------------------------------------------------------===// | 
|  | 4 |  | 
| Chris Lattner | 52f3dc1 | 2006-11-19 01:17:45 +0000 | [diff] [blame] | 5 | C90/C99/C++ Comparisons: | 
|  | 6 | http://david.tribble.com/text/cdiffs.htm | 
|  | 7 |  | 
| Chris Lattner | 5836033 | 2006-10-14 19:53:48 +0000 | [diff] [blame] | 8 | //===---------------------------------------------------------------------===// | 
| Chris Lattner | ecc6fc5 | 2006-07-04 19:29:50 +0000 | [diff] [blame] | 9 |  | 
|  | 10 | To time GCC preprocessing speed without output, use: | 
| Chris Lattner | ecbf7b4 | 2006-07-05 00:08:00 +0000 | [diff] [blame] | 11 | "time gcc -MM file" | 
| Chris Lattner | bfe9860 | 2006-10-14 17:39:56 +0000 | [diff] [blame] | 12 | This is similar to -Eonly. | 
|  | 13 |  | 
| Chris Lattner | 972347d | 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 |  | 
| John McCall | 86a6949 | 2009-09-24 22:03:45 +0000 | [diff] [blame] | 19 | $ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache | 
|  | 20 | $ clang-cc -token-cache /tmp/tokencache INPUTS/Cocoa_h.m | 
| Chris Lattner | bacf0bf | 2006-11-08 05:53:27 +0000 | [diff] [blame] | 21 |  | 
|  | 22 | //===---------------------------------------------------------------------===// | 
|  | 23 |  | 
|  | 24 | C++ Template Instantiation benchmark: | 
|  | 25 | http://users.rcn.com/abrahams/instantiation_speed/index.html | 
|  | 26 |  | 
| Chris Lattner | bfe9860 | 2006-10-14 17:39:56 +0000 | [diff] [blame] | 27 | //===---------------------------------------------------------------------===// | 
| Chris Lattner | db878cd | 2006-07-10 06:34:50 +0000 | [diff] [blame] | 28 |  | 
| Chris Lattner | f78e603 | 2006-11-05 17:54:43 +0000 | [diff] [blame] | 29 | TODO: File Manager Speedup: | 
| Chris Lattner | db878cd | 2006-07-10 06:34:50 +0000 | [diff] [blame] | 30 |  | 
| Chris Lattner | f78e603 | 2006-11-05 17:54:43 +0000 | [diff] [blame] | 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 | 8cdc08e | 2007-12-03 22:26:16 +0000 | [diff] [blame] | 52 | // Specifying targets:  -triple and -arch | 
| Ken Dyck | 8d6d4b84 | 2009-11-13 18:50:18 +0000 | [diff] [blame^] | 53 | //===---------------------------------------------------------------------===// | 
| Ted Kremenek | 8cdc08e | 2007-12-03 22:26:16 +0000 | [diff] [blame] | 54 |  | 
| Chris Lattner | e4a6b18 | 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 | 8cdc08e | 2007-12-03 22:26:16 +0000 | [diff] [blame] | 57 |  | 
|  | 58 | The "selection of target" behavior is defined as follows: | 
|  | 59 |  | 
| Chris Lattner | e4a6b18 | 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 | 8ec6a6f | 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 | //===---------------------------------------------------------------------===// |