blob: dc7a9bc0e7540f4e62a6fdc8149ebc49cbe697a4 [file] [log] [blame]
Chris Lattner58360332006-10-14 19:53:48 +00001//===---------------------------------------------------------------------===//
2// Random Notes
3//===---------------------------------------------------------------------===//
4
Chris Lattner52f3dc12006-11-19 01:17:45 +00005C90/C99/C++ Comparisons:
6http://david.tribble.com/text/cdiffs.htm
7
Chris Lattner58360332006-10-14 19:53:48 +00008//===---------------------------------------------------------------------===//
Chris Lattnerecc6fc52006-07-04 19:29:50 +00009
10To time GCC preprocessing speed without output, use:
Chris Lattnerecbf7b42006-07-05 00:08:00 +000011 "time gcc -MM file"
Chris Lattnerbfe98602006-10-14 17:39:56 +000012This is similar to -Eonly.
13
Chris Lattner972347d2009-01-16 19:33:59 +000014//===---------------------------------------------------------------------===//
15
16Creating and using a PTH file for performance measurement (use a release-asserts
17build).
18
John McCall86a69492009-09-24 22:03:45 +000019$ 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 Lattnerbacf0bf2006-11-08 05:53:27 +000021
22//===---------------------------------------------------------------------===//
23
24 C++ Template Instantiation benchmark:
25 http://users.rcn.com/abrahams/instantiation_speed/index.html
26
Chris Lattnerbfe98602006-10-14 17:39:56 +000027//===---------------------------------------------------------------------===//
Chris Lattnerdb878cd2006-07-10 06:34:50 +000028
Chris Lattnerf78e6032006-11-05 17:54:43 +000029TODO: File Manager Speedup:
Chris Lattnerdb878cd2006-07-10 06:34:50 +000030
Chris Lattnerf78e6032006-11-05 17:54:43 +000031 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 Kremenek8cdc08e2007-12-03 22:26:16 +000052// Specifying targets: -triple and -arch
Ken Dyck8d6d4b842009-11-13 18:50:18 +000053//===---------------------------------------------------------------------===//
Ted Kremenek8cdc08e2007-12-03 22:26:16 +000054
Chris Lattnere4a6b182008-03-09 01:36:43 +000055The clang supports "-triple" and "-arch" options. At most one -triple and one
56-arch option may be specified. Both are optional.
Ted Kremenek8cdc08e2007-12-03 22:26:16 +000057
58The "selection of target" behavior is defined as follows:
59
Chris Lattnere4a6b182008-03-09 01:36:43 +000060(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 Carlsson8ec6a6f2008-03-13 03:45:48 +000063
64//===---------------------------------------------------------------------===//
65
66
67verifyInputConstraint and verifyOutputConstraint should not return bool.
68
69Instead we should return something like:
70
71enum 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//===---------------------------------------------------------------------===//