blob: f06ea8c70cd3409491a5ada64709d1d526284cc1 [file] [log] [blame]
Chris Lattner58360332006-10-14 19:53:481//===---------------------------------------------------------------------===//
2// Random Notes
3//===---------------------------------------------------------------------===//
4
Chris Lattner58360332006-10-14 19:53:485//===---------------------------------------------------------------------===//
Chris Lattnerecc6fc52006-07-04 19:29:506
7To time GCC preprocessing speed without output, use:
Chris Lattnerecbf7b42006-07-05 00:08:008 "time gcc -MM file"
Chris Lattnerbfe98602006-10-14 17:39:569This is similar to -Eonly.
10
Chris Lattner972347d2009-01-16 19:33:5911//===---------------------------------------------------------------------===//
12
Chris Lattnerbacf0bf2006-11-08 05:53:2713 C++ Template Instantiation benchmark:
14 http://users.rcn.com/abrahams/instantiation_speed/index.html
15
Chris Lattnerbfe98602006-10-14 17:39:5616//===---------------------------------------------------------------------===//
Chris Lattnerdb878cd2006-07-10 06:34:5017
Chris Lattnerf78e6032006-11-05 17:54:4318TODO: File Manager Speedup:
Chris Lattnerdb878cd2006-07-10 06:34:5019
Chris Lattnerf78e6032006-11-05 17:54:4320 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 Chupin10a84042014-07-13 17:11:4530
Chris Lattnerf78e6032006-11-05 17:54:4331 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 Chupin10a84042014-07-13 17:11:4534 2. Instead of stat'ing the file in FileManager::getFile, check to see if
Chris Lattnerf78e6032006-11-05 17:54:4335 the dir has been read. If so, fail immediately, if not, read the dir,
36 then retry.
Andy Gibbs40808192012-10-18 15:24:4637 3. Reading the dir uses the getdirentries syscall, creating a FileEntry
Chris Lattnerf78e6032006-11-05 17:54:4338 for all files found.
39
40//===---------------------------------------------------------------------===//
Ted Kremenek8cdc08e2007-12-03 22:26:1641// Specifying targets: -triple and -arch
Ken Dyck8d6d4b842009-11-13 18:50:1842//===---------------------------------------------------------------------===//
Ted Kremenek8cdc08e2007-12-03 22:26:1643
Chris Lattnere4a6b182008-03-09 01:36:4344The clang supports "-triple" and "-arch" options. At most one -triple and one
45-arch option may be specified. Both are optional.
Ted Kremenek8cdc08e2007-12-03 22:26:1646
47The "selection of target" behavior is defined as follows:
48
Chris Lattnere4a6b182008-03-09 01:36:4349(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 Chupin10a84042014-07-13 17:11:4551 specified triple.
Anders Carlsson8ec6a6f2008-03-13 03:45:4852
53//===---------------------------------------------------------------------===//
54
55
Pavel Chupin10a84042014-07-13 17:11:4556verifyInputConstraint and verifyOutputConstraint should not return bool.
Anders Carlsson8ec6a6f2008-03-13 03:45:4857
58Instead we should return something like:
59
60enum VerifyConstraintResult {
61 Valid,
Pavel Chupin10a84042014-07-13 17:11:4562
Anders Carlsson8ec6a6f2008-03-13 03:45:4863 // Output only
64 OutputOperandConstraintLacksEqualsCharacter,
65 MatchingConstraintNotValidInOutputOperand,
66
67 // Input only
68 InputOperandConstraintContainsEqualsCharacter,
69 MatchingConstraintReferencesInvalidOperandNumber,
Pavel Chupin10a84042014-07-13 17:11:4570
Anders Carlsson8ec6a6f2008-03-13 03:45:4871 // Both
72 PercentConstraintUsedWithLastOperand
73};
74
75//===---------------------------------------------------------------------===//
John McCallfabe0792011-07-28 07:41:2276
77Blocks should not capture variables that are only used in dead code.
78
79The rule that we came up with is that blocks are required to capture
80variables if they're referenced in evaluated code, even if that code
81doesn't actually rely on the value of the captured variable.
82
83For example, this requires a capture:
84 (void) var;
85But this does not:
86 if (false) puts(var);
87
88Summary of <rdar://problem/9851835>: if we implement this, we should
89warn about non-POD variables that are referenced but not captured, but
90only if the non-reachability is not due to macro or template
91metaprogramming.
92
93//===---------------------------------------------------------------------===//
John McCall88313032012-03-30 04:25:0394
95We can still apply a modified version of the constructor/destructor
96delegation 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//===---------------------------------------------------------------------===//