summaryrefslogtreecommitdiff
path: root/NOTES.txt
blob: f66a96120a81cfa48a8f512e6bef8cab1ac43c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//===---------------------------------------------------------------------===//
// Random Notes
//===---------------------------------------------------------------------===//

C90/C99/C++ Comparisons:
http://david.tribble.com/text/cdiffs.htm

//===---------------------------------------------------------------------===//

To time GCC preprocessing speed without output, use:
   "time gcc -MM file"
This is similar to -Eonly.

//===---------------------------------------------------------------------===//

Creating and using a PTH file for performance measurement (use a release build).

$ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache
$ clang -cc1 -token-cache /tmp/tokencache INPUTS/Cocoa_h.m

//===---------------------------------------------------------------------===//

  C++ Template Instantiation benchmark:
     http://users.rcn.com/abrahams/instantiation_speed/index.html

//===---------------------------------------------------------------------===//

TODO: File Manager Speedup:

 We currently do a lot of stat'ing for files that don't exist, particularly
 when lots of -I paths exist (e.g. see the <iostream> example, check for
 failures in stat in FileManager::getFile).  It would be far better to make
 the following changes:
   1. FileEntry contains a sys::Path instead of a std::string for Name.
   2. sys::Path contains timestamp and size, lazily computed.  Eliminate from
      FileEntry.
   3. File UIDs are created on request, not when files are opened.
 These changes make it possible to efficiently have FileEntry objects for
 files that exist on the file system, but have not been used yet.
 
 Once this is done:
   1. DirectoryEntry gets a boolean value "has read entries".  When false, not
      all entries in the directory are in the file mgr, when true, they are.
   2. Instead of stat'ing the file in FileManager::getFile, check to see if 
      the dir has been read.  If so, fail immediately, if not, read the dir,
      then retry.
   3. Reading the dir uses the getdirentries syscall, creating an FileEntry
      for all files found.

//===---------------------------------------------------------------------===//
// Specifying targets:  -triple and -arch
//===---------------------------------------------------------------------===//

The clang supports "-triple" and "-arch" options. At most one -triple and one
-arch option may be specified.  Both are optional.

The "selection of target" behavior is defined as follows:

(1) If the user does not specify -triple, we default to the host triple.
(2) If the user specifies a -arch, that overrides the arch in the host or
    specified triple. 

//===---------------------------------------------------------------------===//


verifyInputConstraint and verifyOutputConstraint should not return bool. 

Instead we should return something like:

enum VerifyConstraintResult {
  Valid,
  
  // Output only
  OutputOperandConstraintLacksEqualsCharacter,
  MatchingConstraintNotValidInOutputOperand,

  // Input only
  InputOperandConstraintContainsEqualsCharacter,
  MatchingConstraintReferencesInvalidOperandNumber,
  
  // Both
  PercentConstraintUsedWithLastOperand
};

//===---------------------------------------------------------------------===//