| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
until we've had a lot more discussion.
llvm-svn: 71125
|
|
|
|
| |
llvm-svn: 71066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generates untraceable warnings
The "instantiated from" messages coming from the caret diagnostics system are
basically walking the macro expansion tree, emitting each level as it goes. However, it was
skipping certain leaves in the tree by skipping up the entire instantiation arm every time
it went up one spelling arm. This caused it to miss some things. For example, in this
testcase:
#define M1(x) x
#define M2 1;
void foo() {
M1(M2)
}
we now print:
/Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused
M1(M2)
^~~~~~
/Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from:
M1(M2)
^~
/Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from:
#define M2 1;
^
Previously we didn't print the last line, so we never emitted the caret pointing to the 1!
Incidentally, the spaces between the lines is really noisy, I think we should reconsider
this heuristic (which adds them when the printed code starts too close to the start of the
line).
The regression test can't use -verify, because -verify doesn't catch notes for macro
instantiation history.
llvm-svn: 71025
|
|
|
|
| |
llvm-svn: 70990
|
|
|
|
| |
llvm-svn: 70952
|
|
|
|
| |
llvm-svn: 70940
|
|
|
|
| |
llvm-svn: 70897
|
|
|
|
|
|
|
|
|
|
|
| |
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'
Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.
llvm-svn: 70884
|
|
|
|
|
|
| |
non-whitespace text with each expansion step. It's easier and seems to have better results.
llvm-svn: 70833
|
|
|
|
|
|
|
|
|
| |
1) First of all, we treat _ as part of an identifier and not as
punctuation (oops).
2) Second of all, always make sure that the token that the ^ is
pointing at is fully within the "interesting" part of the range.
llvm-svn: 70831
|
|
|
|
|
|
|
|
|
|
| |
- The diagnostic is still poor, however. Doug, can you investigate?
- Improved the test case to not depend on the file name, now it can
be extended to actually check the formatting of the diagnostics
(I'm hoping grep -A is portable here).
llvm-svn: 70807
|
|
|
|
|
|
|
| |
printing. Also, when we only need to truncate the line at the end,
make sure there is room for the ellipsis.
llvm-svn: 70781
|
|
|
|
| |
llvm-svn: 70681
|
|
|
|
|
|
|
|
|
| |
fix-it hint is much worse than no fix-it hint. (Fixes PR4084).
When we need to truncate a source line to fix in the terminal, make
sure to take the width of the fix-it information into account, too.
llvm-svn: 70656
|
|
|
|
|
|
|
|
|
|
|
|
| |
show an ellipsis where we have removed text. An example:
/Users/dgregor/Projects/llvm/tools/clang/test/Misc/message-length.c:18:120:
warning:
comparison of distinct pointer types ('int *' and 'float *')
...a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ...
~~ ^ ~~~~~~~~~~~~
llvm-svn: 70655
|
|
|
|
|
|
|
|
|
|
|
| |
word-wrapping by default in Emacs; yay!). Thanks, Daniel.
Use LLVM's System layer rather than calling isatty() directly.
Fix a thinko in printing the indentation string that was causing some
weird output.
llvm-svn: 70654
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
might be wider than we're supposed to print. In this case, we try to
select the "important" subregion of the source line, which contains
everything that we want to show (e.g., with underlining and the caret
itself) and tries to also contain some of the context.
From the fantastically long line in the test case, we get an error
message that slices down to this:
message-length.c:18:120: warning: comparison of distinct pointer types
('int *' and 'float *')
a_func_to_call(ip == FloatPointer, ip[ALongIndexName],
~~ ^ ~~~~~~~~~~~~
There are a bunch of gee-it-sounds-good heuristics in here, which seem
to do well on the various simple tests I've thrown at it. However,
we're going to need to look at a bunch more diagnostics to tweak these
heuristics.
This is the second part of <rdar://problem/6711348>. Almost there!
llvm-svn: 70597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:
decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
type can only take one argument
typeof(int)(a,5)<<a;
However, here is a case where we need the vertical separation (since
there is no horizontal separation):
message-length.c:10:46: warning: incompatible pointer types initializing 'void
(int, float, char, float)', expected 'int (*)(int, float, short,
float)'
int (*fp1)(int, float, short, float) = f;
This is part one of <rdar://problem/6711348>.
llvm-svn: 70578
|
|
|
|
| |
llvm-svn: 70506
|
|
|
|
|
|
|
|
| |
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.
llvm-svn: 70464
|
|
|
|
|
|
|
|
|
| |
- Add an (optional) short description for BugReports for clients that want
to distinguish between long and short descriptions for bugs
- Make the bug report for VLA less obscene for Plist diagnostics by using
the short description
llvm-svn: 70415
|
|
|
|
|
|
|
| |
lines that clang extracts from the source code so that machine parsing can
easily ignore them.
llvm-svn: 70337
|
|
|
|
|
|
| |
to add 'CFMakeCollectable' semantics to a method.
llvm-svn: 70336
|
|
|
|
|
|
|
| |
compilation if the user requested a PCH file but no such PCH file
exists.
llvm-svn: 70332
|
|
|
|
| |
llvm-svn: 70330
|
|
|
|
|
|
| |
now gotten back about 180k of the 500k we lost.
llvm-svn: 70326
|
|
|
|
|
|
|
|
| |
which eliminates the storage for IdentifierInfo in the "uninteresting
identifier" cases. Sadly, this only brought back 7k of the 500k we
lost :(
llvm-svn: 70325
|
|
|
|
| |
llvm-svn: 70322
|
|
|
|
|
|
|
|
| |
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.
llvm-svn: 70321
|
|
|
|
|
|
|
|
|
|
| |
for identifiers to separate "interesting" from "uninteresting"
identifiers. However, to cope with compiler invocations where the
predefines buffers mismatch, we need to be able to search the complete
identifier table. Cocoa.h.pch is now about 500k larger that it used to
be :(
llvm-svn: 70320
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).
We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).
llvm-svn: 70316
|
|
|
|
| |
llvm-svn: 70282
|
|
|
|
|
|
|
|
|
| |
Clang version value rather than hard-coding "1.0".
Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.
llvm-svn: 70264
|
|
|
|
| |
llvm-svn: 70263
|
|
|
|
| |
llvm-svn: 70259
|
|
|
|
|
|
|
| |
processing to after PCH is loaded. -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.
llvm-svn: 70257
|
|
|
|
|
|
| |
ignore a PCH file.
llvm-svn: 70251
|
|
|
|
|
|
| |
these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.
llvm-svn: 70240
|
|
|
|
|
|
|
| |
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.
llvm-svn: 70235
|
|
|
|
| |
llvm-svn: 70229
|
|
|
|
|
|
| |
entries, shaving 100K off the PCH file for cocoa.
llvm-svn: 70228
|
|
|
|
|
|
|
|
| |
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.
llvm-svn: 70223
|
|
|
|
|
|
|
|
| |
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).
llvm-svn: 70218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of 64 bits. This cuts 400KB off the PCH file for cocoa (7.1 ->
6.7MB):
Before:
Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 5168252 100.00 DECL_OFFSET
1 952700 100.00 TYPE_OFFSET
After:
Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 2584156 100.00 DECL_OFFSET
1 476380 100.00 TYPE_OFFSET
llvm-svn: 70216
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.
Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0
After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902
llvm-svn: 70199
|
|
|
|
|
|
| |
of the normal stream cursor.
llvm-svn: 70198
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file. In particular, only eagerly load source location entries for
files and for the predefines buffer. Other buffers and
macro-instantiation source location entries are loaded lazily.
With the Cocoa-prefixed "Hello, World", we only load 815/26555 source
location entities. This halves the amount of user time we spend in
this "Hello, World" program with -fsyntax-only (down to .007s).
This optimization is part 1 of 2 for the source manager. This
eliminates most of the user time in loading a PCH file. We still spend
too much time initialize File structures (especially in the calls to
stat), so we need to either make the loading of source location
entries for files lazy or import the stat cache from the PTH
implementation.
llvm-svn: 70196
|
|
|
|
| |
llvm-svn: 70194
|
|
|
|
| |
llvm-svn: 70193
|
|
|
|
| |
llvm-svn: 70192
|