]>
granicus.if.org Git - clang/log
Argyrios Kyrtzidis [Fri, 21 Dec 2012 01:17:20 +0000 (01:17 +0000)]
[libclang] Make sure we can code-complete inside a macro argument even though
the macro invocation is not fully formed.
rdar://
11290992
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170824
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 21 Dec 2012 00:21:02 +0000 (00:21 +0000)]
EditedSource.cpp: Appease msvc, to add <cctype>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170817
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 21 Dec 2012 00:17:02 +0000 (00:17 +0000)]
docs: Convert ObjectiveCLiterals to reST.
Sphinx's syntax highlighter doesn't recognize the new literals, so the
syntax highlighting is pretty pathetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170814
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 21 Dec 2012 00:16:58 +0000 (00:16 +0000)]
docs: fix Sphinx toctree warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170813
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Fri, 21 Dec 2012 00:16:53 +0000 (00:16 +0000)]
docs: Convert DriverInternals to reST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170812
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 20 Dec 2012 23:49:09 +0000 (23:49 +0000)]
Fix some bugs where we would sometimes use 0, not -1, when emitting a null constant of type pointer-to-data-member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170806
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 20 Dec 2012 23:36:52 +0000 (23:36 +0000)]
Revert r170801, which breaks the mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170804
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 20 Dec 2012 23:11:42 +0000 (23:11 +0000)]
Eliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170801
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 20 Dec 2012 22:31:27 +0000 (22:31 +0000)]
Revert "Warn if a __weak variable is initialized with an Objective-C object literal."
Per code feedback, I want to see if there is a more general way to do this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170777
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 20 Dec 2012 21:05:53 +0000 (21:05 +0000)]
Use some heuristics so that when a fixit removes a source range, we try
to also remove a trailing space if possible.
For example, removing '__bridge' from:
i = (__bridge I*)p;
should result in:
i = (I*)p;
not:
i = ( I*)p;
rdar://
11314821
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170764
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 20 Dec 2012 20:55:03 +0000 (20:55 +0000)]
Warn if a __weak variable is initialized with an Objective-C object literal.
Such variables may immediately become nil or may have unpredictable
behavior.
Fixes <rdar://problem/
12569201 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170763
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Thu, 20 Dec 2012 20:51:59 +0000 (20:51 +0000)]
Documentation: use monospaced font in BlockLanguageSpec, and fix a link to this
document
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170762
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 20 Dec 2012 20:37:53 +0000 (20:37 +0000)]
Use the MaybeParseMicrosoftAttributes function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170761
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 20 Dec 2012 20:31:38 +0000 (20:31 +0000)]
Remove namespace qualifier that lead to build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170759
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 20 Dec 2012 20:25:19 +0000 (20:25 +0000)]
Move operator precedence calculation to new header
Thereby, it can be reused by clang-format and others.
Review: http://llvm-reviews.chandlerc.com/D229
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170757
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 20 Dec 2012 19:54:13 +0000 (19:54 +0000)]
Add objective-C style formatting to clang format and
use it to format xml declaration tags.
// rdar://
12378714
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170727
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 20 Dec 2012 19:36:22 +0000 (19:36 +0000)]
Update RetainCountChecker to understand attribute ns_returns_autoreleased.
Fixes <rdar://problem/
12887356 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170724
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 20 Dec 2012 19:36:20 +0000 (19:36 +0000)]
Attribute 'cf_returns_autoreleased' doesn't really exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170723
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 20 Dec 2012 19:27:06 +0000 (19:27 +0000)]
Rename llvm::Attributes to llvm::Attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170722
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 20 Dec 2012 19:22:21 +0000 (19:22 +0000)]
Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 20 Dec 2012 16:15:07 +0000 (16:15 +0000)]
Fix Generic_GCC::GCCVersion::operator<
Without this patch comparing two equal versions without patch numbers (4.7 for
example) will result in A < B and B < A.
Patch by Simon Atanasyan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170705
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 20 Dec 2012 13:30:10 +0000 (13:30 +0000)]
c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170693
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 20 Dec 2012 13:30:05 +0000 (13:30 +0000)]
c-index-test/Makefile: Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170692
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 20 Dec 2012 12:23:54 +0000 (12:23 +0000)]
Minor coding style issue: NULL -> 0
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170688
91177308 -0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 20 Dec 2012 12:03:13 +0000 (12:03 +0000)]
Add __has_feature(memory_sanitizer).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170686
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 20 Dec 2012 11:08:38 +0000 (11:08 +0000)]
ASTDumper coding style fixes.
http://llvm-reviews.chandlerc.com/D226
Patch by Philip Craig!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170684
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 20 Dec 2012 11:08:13 +0000 (11:08 +0000)]
clang/test/Driver/warning-options.cpp: Appease MSYS bash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170683
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 20 Dec 2012 03:30:30 +0000 (03:30 +0000)]
clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on all targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170645
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 20 Dec 2012 03:23:52 +0000 (03:23 +0000)]
Updated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst instead of BlockLanguageSpec.txt.
Thanks to Jean-Daniel Dupas for comments!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170644
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 20 Dec 2012 03:23:49 +0000 (03:23 +0000)]
Changed UTF-8 emdashes to --- ala Dmitri Gribenko's comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170643
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 20 Dec 2012 02:47:01 +0000 (02:47 +0000)]
Fix another uninitialized bool member bug found by -fsanitize=bool. This one
appears to currently be benign (we happen to test the flags in the right
order, so we never depend on the uninitialized value).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170640
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Thu, 20 Dec 2012 02:45:14 +0000 (02:45 +0000)]
Robustify the @encode code and add support for _Atomic.
Fixes PR14628.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170639
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 20 Dec 2012 02:22:15 +0000 (02:22 +0000)]
Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170636
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 20 Dec 2012 02:20:09 +0000 (02:20 +0000)]
Provide couple of DeclPrint tests for my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170635
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Thu, 20 Dec 2012 02:09:13 +0000 (02:09 +0000)]
Implement AST dumper for Decls.
http://llvm-reviews.chandlerc.com/D52
Patch by Philip Craig!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170634
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 20 Dec 2012 00:38:25 +0000 (00:38 +0000)]
[analyzer] Add the pointer escaped callback.
Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.
Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170625
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 19 Dec 2012 23:55:44 +0000 (23:55 +0000)]
[preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,
make sure they came from the same kind of FileIDs.
Thanks to Abramo Bagnara for providing the test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170616
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 19 Dec 2012 23:47:16 +0000 (23:47 +0000)]
Typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170613
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 19 Dec 2012 23:41:50 +0000 (23:41 +0000)]
[driver] Have -isysroot warn on nonexistent paths.
rdar://
12282267
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170611
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 23:36:00 +0000 (23:36 +0000)]
Audit DeclPrinter with -ast-dump on Cocoa.h and
fix any bad objectiveC syntax coming out of
DeclPrinter. This is on going. Also, introduce a new
PrintPolicy and use it as needed when declaration tag
is to be produced via DeclPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170606
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Wed, 19 Dec 2012 22:21:18 +0000 (22:21 +0000)]
[PCH/Modules] In ASTReader::completeVisibleDeclsMap, make sure to visit all
modules when getting the decls for a namespace or translation unit.
Otherwise the code-completion results will not be complete.
rdar://
12889089
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170596
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Wed, 19 Dec 2012 22:06:59 +0000 (22:06 +0000)]
Documentation: UsersManual.rst: some cleanups after semi-automatic conversion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170590
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 18:58:55 +0000 (18:58 +0000)]
objective-C: Don't warn of unimplemented property of protocols in
category, when those properties will be implemented in category's
primary class or one of its super classes. // rdar://
12568064
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170573
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Wed, 19 Dec 2012 18:42:42 +0000 (18:42 +0000)]
Forgot to remove trailing whitespace when I converted the BlockLanguageSpec.txt => BlockLanguageSpec.rst. It has been eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170572
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Wed, 19 Dec 2012 18:41:09 +0000 (18:41 +0000)]
Converted BlockLanguageSpec.txt => BlockLanguageSpec.rst.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170571
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 19 Dec 2012 18:30:38 +0000 (18:30 +0000)]
Change test to dump Filecheck output to an intermediate file. This makes it easier to update this test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170570
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Wed, 19 Dec 2012 17:34:55 +0000 (17:34 +0000)]
Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic
Patch by Janusz Chorko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170566
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Wed, 19 Dec 2012 17:29:30 +0000 (17:29 +0000)]
Add a missing 'else'. Found by grep '} if'
No testcase because this did not affect correctness: a declaration can only be
ClassTemplateDecl or a FunctionTemplateDecl, not both.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170565
91177308 -0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Wed, 19 Dec 2012 17:17:09 +0000 (17:17 +0000)]
Comment parsing: add a missing 'else'. Found by inspection.
No testcase because we were just building an extra AST node and eventually
throwing it away, so it did not affect correctness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170563
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 17:03:46 +0000 (17:03 +0000)]
Improve on header comment suggested by James Dennet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170555
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 19 Dec 2012 07:18:12 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170500
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 19 Dec 2012 03:15:32 +0000 (03:15 +0000)]
Attempt to clarify a vexing-parse diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170492
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 19 Dec 2012 02:27:38 +0000 (02:27 +0000)]
Fix assertion failure in self-host (and probably bogus template instantiation
too). When instantiating a direct-initializer, if we find it has zero
arguments, produce an empty ParenListExpr rather than returning a null
expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170490
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 19 Dec 2012 01:39:02 +0000 (01:39 +0000)]
PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):
Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170489
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 19 Dec 2012 01:35:35 +0000 (01:35 +0000)]
Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.
This is plumbing needed for later functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170488
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 19 Dec 2012 01:16:49 +0000 (01:16 +0000)]
Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170487
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 01:00:36 +0000 (01:00 +0000)]
fixes a doxygen comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170485
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 19 Dec 2012 00:57:48 +0000 (00:57 +0000)]
test/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170484
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 19 Dec 2012 00:45:41 +0000 (00:45 +0000)]
Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365
This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).
Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170482
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 00:35:23 +0000 (00:35 +0000)]
Increas number of iterations before a new libclang format object
is created to 1000.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170481
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 19 Dec 2012 00:26:58 +0000 (00:26 +0000)]
Make sure CodeGen uses a value of the correct type as the result of
of assignment to a bool bitfield. PR14638.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170480
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 19 Dec 2012 00:01:48 +0000 (00:01 +0000)]
Some code refactoring per Dimitri's comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170478
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 18 Dec 2012 23:32:47 +0000 (23:32 +0000)]
Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 18 Dec 2012 23:10:16 +0000 (23:10 +0000)]
Enable the loop vectorizer in clang via -fvectorize
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170472
91177308 -0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 18 Dec 2012 23:08:58 +0000 (23:08 +0000)]
Fix the fvectorize testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170469
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 18 Dec 2012 23:07:30 +0000 (23:07 +0000)]
Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.
This fixes a subtle bug reported in <rdar://problem/
12584554 > where a double-nested
macro could lead to an incorrect fixit location with live issues.
This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170468
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 18 Dec 2012 23:02:59 +0000 (23:02 +0000)]
This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170467
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)]
Be defensive when printing module import locations; the diagnostic printer needs to be robust
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170466
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 18 Dec 2012 22:22:16 +0000 (22:22 +0000)]
Similar to 170440 - fix build warning with gcc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170461
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 18 Dec 2012 21:09:25 +0000 (21:09 +0000)]
Add tests to check recent changes to some builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170458
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 18 Dec 2012 21:05:13 +0000 (21:05 +0000)]
Better support for constructor initializers.
We used to format initializers like this (with a sort of hacky implementation):
Constructor()
: Val1(A),
Val2(B) {
and now format like this (with a somewhat better solution):
Constructor()
: Val1(A), Val2(B) {
assuming this would not fit on a single line. Also added tests.
As a side effect we now first analyze whether an UnwrappedLine needs to be
split at all. If not, not splitting it is the best solution by definition. As
this should be a very common case in normal code, not exploring the entire
solution space can provide significant speedup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170457
91177308 -0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Tue, 18 Dec 2012 20:58:04 +0000 (20:58 +0000)]
CodeGen: Expand creal and cimag into complex field loads
PR 14529 was opened because neither Clang or LLVM was expanding
calls to creal* or cimag* into instructions that just load the
respective complex field. After some discussion, it was not
considered realistic to do this in LLVM because of the platform
specific way complex types are expanded. Thus a way to solve
this in Clang was pursued. GCC does a similar expansion.
This patch adds the feature to Clang by making the creal* and
cimag* functions library builtins and modifying the builtin code
generator to look for the new builtin types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170455
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Tue, 18 Dec 2012 19:56:56 +0000 (19:56 +0000)]
Make the format scrambler understand line comments.
This allows for writing tests including line comments easier and more readable.
We will need more of those tests in the future and also line comments are
useful to force line breaks in tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170446
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 18 Dec 2012 19:39:40 +0000 (19:39 +0000)]
CMake: Make sure to detect LibXml2 when Clang is built standalone
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170444
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 18 Dec 2012 18:53:14 +0000 (18:53 +0000)]
Fix a compilation warning with gcc 4.6
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170440
91177308 -0d34-0410-b5e6-
96231b3b80d8
Guy Benyei [Tue, 18 Dec 2012 14:38:23 +0000 (14:38 +0000)]
Re-commit r170428 changes with Linux style file endings.
Add OpenCL images as clang builtin types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170432
91177308 -0d34-0410-b5e6-
96231b3b80d8
Guy Benyei [Tue, 18 Dec 2012 14:30:41 +0000 (14:30 +0000)]
Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170431
91177308 -0d34-0410-b5e6-
96231b3b80d8
Guy Benyei [Tue, 18 Dec 2012 12:30:03 +0000 (12:30 +0000)]
Add OpenCL images as clang builtin types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170428
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Chisnall [Tue, 18 Dec 2012 10:24:07 +0000 (10:24 +0000)]
Remove obsolete FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170425
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 18 Dec 2012 05:14:30 +0000 (05:14 +0000)]
test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).
I don't want to suppress this to be excluded with the feature "dev-fd-fs". This should work also on freebsd.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170411
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 18 Dec 2012 04:29:34 +0000 (04:29 +0000)]
Inline hasAtomicCopyHelperAPI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170408
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 18 Dec 2012 04:18:55 +0000 (04:18 +0000)]
Merge storage classes even when contexts don't match.
This fixes the storage class of extern decls that are merged with file level
statics. The patch also fixes the linkage computation so that they are
considered internal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170406
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 18 Dec 2012 03:54:29 +0000 (03:54 +0000)]
Now that the uninitialized variable has been fixed in llvm, add this test back,
but remove unneeded options and fix the comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170405
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 18 Dec 2012 03:04:38 +0000 (03:04 +0000)]
Fix typo (thanks to Jordan for spotting it!).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170403
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 18 Dec 2012 02:37:32 +0000 (02:37 +0000)]
The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)
<rdar://problem/
12857117 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170402
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Tue, 18 Dec 2012 02:15:05 +0000 (02:15 +0000)]
docs: Nuke AnalyzerRegions.rst.
As per Ted's advice. It can be brought back from version control if
needed.
This also fixes a Sphinx warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170401
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 18 Dec 2012 01:29:20 +0000 (01:29 +0000)]
When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170399
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 18 Dec 2012 00:52:36 +0000 (00:52 +0000)]
More conservative fix for <rdar://problem/
12847524 > (a crash printing diagnostic ranges).
I'm not really happy with this fix, but I'm confident it's correct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170397
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 18 Dec 2012 00:37:10 +0000 (00:37 +0000)]
Use the correct return type (size_t) for these builtins.
<rdar://problem/
12646344 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170393
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 18 Dec 2012 00:34:49 +0000 (00:34 +0000)]
Add an expected parameter for the size of the destination.
<rdar://problem/
12622659 >
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170392
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 18 Dec 2012 00:31:10 +0000 (00:31 +0000)]
Add support for passing the main file name down to the assembler
for location information.
Part of PR14624
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170391
91177308 -0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 18 Dec 2012 00:22:45 +0000 (00:22 +0000)]
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
to an object outside its lifetime does not have undefined behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170387
91177308 -0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 17 Dec 2012 22:23:47 +0000 (22:23 +0000)]
Fix isThisDeclarationADefinition for extern following tentative.
An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170377
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 17 Dec 2012 21:40:04 +0000 (21:40 +0000)]
Fix PR14625 by teaching the driver to detect PWD for assembly files.
This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).
The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170373
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:19:56 +0000 (20:19 +0000)]
[c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170366
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:50 +0000 (20:10 +0000)]
Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170365
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:49 +0000 (20:10 +0000)]
Don't include the header outside the include guards, it defeats the purpose of the include guards.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170364
91177308 -0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:43 +0000 (20:10 +0000)]
[parser] Push a semi token for recovery only when it is actually missing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170363
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)]
[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170362
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Mon, 17 Dec 2012 20:08:51 +0000 (20:08 +0000)]
[analyzer] Implement "do not inline large functions many times"
performance heuristic
After inlining a function with more than 13 basic blocks 32 times, we
are not going to inline it anymore. The idea is that inlining large
functions leads to drastic performance implications. Since the function
has already been inlined, we know that we've analyzed it in many
contexts.
The following metrics are used:
- Large function is a function with more than 13 basic blocks (we
should switch to another metric, like cyclomatic complexity)
- We consider that we've inlined a function many times if it's been
inlined 32 times. This number is configurable with -analyzer-config
max-times-inline-large=xx
This heuristic addresses a performance regression introduced with
inlining on one benchmark. The analyzer on this benchmark became 60
times slower with inlining turned on. The heuristic allows us to analyze
it in 24% of the time. The performance improvements on the other
benchmarks I've tested with are much lower - under 10%, which is
expected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170361
91177308 -0d34-0410-b5e6-
96231b3b80d8