Will Wilson
0fafd34a6e
Implement MSVC header search algorithm in MicrosoftMode.
...
Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx
llvm-svn: 198082
2013-12-27 19:46:16 +00:00
Alp Toker
08c2500f9c
Fix raw lex crash and -frewrite-includes noeol-at-eof failure
...
Raw lexers don't have a preprocessor so we need to null check.
llvm-svn: 197245
2013-12-13 17:04:55 +00:00
NAKAMURA Takumi
ebde2aef9f
[CMake] clang/lib: Prune redundant dependencies.
...
llvm-svn: 196864
2013-12-10 02:36:22 +00:00
NAKAMURA Takumi
65d42bcc2b
[CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on target_link_libraries() and LLVM_LINK_COMPONENTS.
...
I will prune redundant dependencies later.
llvm-svn: 196800
2013-12-09 19:04:43 +00:00
Alp Toker
52937abc8b
Check the initial line number without going through PresumedLoc
...
No practical difference in this case and would return 1 either way, but this is
more self-explanatory.
llvm-svn: 196511
2013-12-05 17:28:42 +00:00
Alp Toker
f6a24ce40f
Fix a tranche of comment, test and doc typos
...
llvm-svn: 196510
2013-12-05 16:25:25 +00:00
Alp Toker
d473363876
Correct hyphenations in comments and assert messages
...
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.
llvm-svn: 196466
2013-12-05 04:47:09 +00:00
Alp Toker
f580a3cc05
Add an assert to make it clear we're on the first line
...
A raw lexer in its initial state is guaranteed to be on line number one.
llvm-svn: 196461
2013-12-05 03:41:20 +00:00
NAKAMURA Takumi
ddc867985a
Revert r196372, "do not warn about unknown pragmas in modes that do not handle them (pr9537)"
...
It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes.
llvm-svn: 196376
2013-12-04 11:12:26 +00:00
Lubos Lunak
5c4269c688
do not warn about unknown pragmas in modes that do not handle them (pr9537)
...
And refactor to have just one place in code that sets up the empty
pragma handlers.
llvm-svn: 196372
2013-12-04 10:21:41 +00:00
Alp Toker
3dfeafd9db
InclusionRewriter: Avoid duplicated BOM check
...
The lexer already knows its position in the file, so use that instead of
guessing it might be 3.
llvm-svn: 195910
2013-11-28 07:21:44 +00:00
Lubos Lunak
c6b9270d04
strip UTF-8 BOM in -frewrite-includes (PR#15664)
...
llvm-svn: 195877
2013-11-27 21:14:43 +00:00
Fariborz Jahanian
d38951acff
ObjectiveC modern translator. Fixes a translation bug
...
tranalation @protocol expression. // rdar://15517895
llvm-svn: 195480
2013-11-22 18:43:41 +00:00
Benjamin Kramer
e28815758e
Fix typo: inccrementally
...
llvm-svn: 192551
2013-10-13 12:02:16 +00:00
Fariborz Jahanian
d29406233b
ObjectiveC modern rewriter. Rewrite typedefs
...
declared locally in ObjectiveC containers.
// rdar://15143875
llvm-svn: 192127
2013-10-07 19:54:22 +00:00
Fariborz Jahanian
0dded8ab04
Revert my patch in r191155 to allow forward
...
class/protocol decls in @implementation and
fixup modern rewriter to handle that.
// rdar://15066233
llvm-svn: 191311
2013-09-24 17:03:07 +00:00
Fariborz Jahanian
ff0c460863
ObjectiveC modern translator: Provide proper cast of
...
the ObjectiveC object of an @synchronized statement.
// rdar://14993814
llvm-svn: 190874
2013-09-17 17:51:48 +00:00
Eli Friedman
9fc443aaed
Address review comment on r189557.
...
We need to escape filenames the same way in InclusionRewriter whether
UseLineDirective is true or false.
Review comment from http://llvm.org/bugs/show_bug.cgi?id=17018#c2
llvm-svn: 190834
2013-09-17 00:51:31 +00:00
Eli Friedman
39996f42cf
Remove unused variable.
...
llvm-svn: 190445
2013-09-10 23:00:03 +00:00
Fariborz Jahanian
b1a2124652
Modern ObjectiveC translator. Fix translation of
...
message sent to aggregate-valued methods. Fix
visibility of trampoline type used in translation
of such expressions. // rdar://14932320
llvm-svn: 190341
2013-09-09 19:59:59 +00:00
Benjamin Kramer
60509af49a
Fix constructor-related typos.
...
Noticed by Roman Divacky.
llvm-svn: 190311
2013-09-09 14:48:42 +00:00
Fariborz Jahanian
6c0af64f0c
ObjectiveC modern translator: fix up generated fast enumeration
...
code to work for bit 32bit and 64bit APIs.
// rdar://14913632
llvm-svn: 190072
2013-09-05 17:17:32 +00:00
Eli Friedman
80e45b8cd4
Properly escape filenames in line directives.
...
Fixes PR17018. Only partial test coverage because I don't want
to try to write a test which generates a file whose name contains a newline.
llvm-svn: 189557
2013-08-29 01:42:42 +00:00
Eli Friedman
5ba37d5282
Split isFromMainFile into two functions.
...
Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).
llvm-svn: 188968
2013-08-22 00:27:10 +00:00
Argyrios Kyrtzidis
17ff2e577f
[frontend] '-frewrite-includes' should not ignore headers included from command-line.
...
rdar://14556182
llvm-svn: 187207
2013-07-26 15:32:04 +00:00
Lubos Lunak
ba5ee4da1d
avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)
...
llvm-svn: 186764
2013-07-20 14:30:01 +00:00
Lubos Lunak
4c22f6a695
fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)
...
Every #include is surrounded by #if 0 in order to comment it out, which adds
lines. That is fixed up right after, but that all can be inside #if part
that is not processed, so fix up also after every end of a conditional part.
llvm-svn: 186763
2013-07-20 14:23:27 +00:00
Rafael Espindola
16125fb652
Update for llvm API change.
...
llvm-svn: 186448
2013-07-16 19:44:23 +00:00
Rafael Espindola
a36e78ef5d
Use llvm::sys::fs::createTemporaryFile.
...
llvm-svn: 185717
2013-07-05 20:00:06 +00:00
Craig Topper
5603df45df
Use SmallVectorImpl& for function arguments instead of SmallVector.
...
llvm-svn: 185715
2013-07-05 19:34:19 +00:00
Craig Topper
2341c0d3b2
Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily.
...
llvm-svn: 185610
2013-07-04 03:08:24 +00:00
Argyrios Kyrtzidis
d391046930
Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
...
This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location
when the the FileID is for an empty file.
rdar://13803893
llvm-svn: 181285
2013-05-07 04:29:22 +00:00
Douglas Gregor
30071cead9
Remove DiagnosticConsumer::clone(), a bad idea that is now unused.
...
llvm-svn: 181070
2013-05-03 23:07:45 +00:00
Benjamin Kramer
b10e615c44
rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency.
...
This broke e.g. compiling a crash report from a glibc system on Darwin. Sadly,
the implementation had to game the lexer a lot as we're not using a real
preprocessor here. It also doesn't handle special cases like arbitrary macros in
__has_include, but since this macro isn't common outside of clang's headers we
can get away with that.
Fixes PR14422.
Differential Revision: http://llvm-reviews.chandlerc.com/D594
llvm-svn: 179616
2013-04-16 19:08:41 +00:00
Argyrios Kyrtzidis
cf22d1f3ab
[frontend] -frewrite-includes: turn implicit module imports into @imports.
...
rdar://13610250
llvm-svn: 179145
2013-04-10 01:53:50 +00:00
Argyrios Kyrtzidis
953ef33f59
[frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that indicates return from another file.
...
llvm-svn: 179143
2013-04-10 01:53:37 +00:00
Rafael Espindola
6ae7e50be4
Add 178663 back.
...
http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green
before it processed the reverted 178663, so it could not have been the culprit.
Revert "Revert 178663."
This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41.
llvm-svn: 178682
2013-04-03 19:27:57 +00:00
Rafael Espindola
985a3abee4
Revert 178663.
...
Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb
Revert "Don't compute a patched/semantic storage class."
This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05.
llvm-svn: 178681
2013-04-03 19:22:20 +00:00
Fariborz Jahanian
3a65ce3a56
Objective-C modern rewriter. Fixes a bug
...
rewriting typedef for a qualified object type
and also when two declarations happen to be on the
same line. // rdar://13562505
llvm-svn: 178680
2013-04-03 19:11:21 +00:00
Rafael Espindola
adea16bd9e
Don't compute a patched/semantic storage class.
...
For variables and functions clang used to store two storage classes. The one
"as written" in the code and a patched one, which, for example, propagates
static to the following decls.
This apparently is from the days clang lacked linkage computation. It is now
redundant and this patch removes it.
llvm-svn: 178663
2013-04-03 15:50:00 +00:00
Jordan Rose
755a2ffd79
Add some assertions to appease the static analyzer.
...
No functionality change.
llvm-svn: 177185
2013-03-15 21:41:35 +00:00
Jordan Rose
5c38272c1a
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
...
No (intended) functionality change.
llvm-svn: 176726
2013-03-08 21:51:21 +00:00
Dmitri Gribenko
20b16ace16
Use trailing documentation comments properly
...
Patch by Alexander Zinenko.
llvm-svn: 175376
2013-02-16 22:21:38 +00:00
Fariborz Jahanian
b0fdab26d1
objective-C modern translator: Fixes a mistranslation
...
of @throw statement by finding location of the ';'
correctly. // rdar://13186010
llvm-svn: 174898
2013-02-11 19:30:33 +00:00
Jordan Rose
a7d03840e6
Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.
...
Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.
llvm-svn: 174768
2013-02-08 22:30:41 +00:00
Fariborz Jahanian
4254cdb7ed
objective-C modern translation: Fix another random translation bug
...
involving property getter expressions on rhs of property setter.
// rdar://13138459
llvm-svn: 174729
2013-02-08 18:57:50 +00:00
Fariborz Jahanian
e8730a3558
objective-C modern translator. Fixes a trivial
...
rewriting bug where #ifdef ended up on the same
line as the attribute declaration.
llvm-svn: 174719
2013-02-08 17:15:07 +00:00
Fariborz Jahanian
e4c7e855f1
objective-C modern translator. Generate #line
...
info in the translated code under -g only.
// rdar://13138170
llvm-svn: 174684
2013-02-08 00:27:34 +00:00
Fariborz Jahanian
e499613d60
objective-C modern translator. More fixups for
...
modern meta-data abi translation. Still wip.
// rdar://13138459
llvm-svn: 174672
2013-02-07 22:50:40 +00:00
Fariborz Jahanian
57dd66baa4
objective-C modern translator. Fix up the translated
...
metadata to handle ivar bitfields. This is wip.
// rdar://13138459
llvm-svn: 174573
2013-02-07 01:53:15 +00:00