summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression in r170489: when instantiating a direct initializer which is aRichard Smith2012-12-213-7/+28
| | | | | | | | CXXScalarValueInitExpr (or an ImplicitValueInitExpr), strip it back down to an empty pair of parentheses so that the initialization code can tell that we're performing value-initialization. llvm-svn: 170867
* Extend checkUnsafeAssigns() to also handle assigning an object literal to a ↵Ted Kremenek2012-12-214-6/+112
| | | | | | | | | | weak reference. Thanks to Jordan Rose and John McCall for their sage code review. Fixes <rdar://problem/12569201>. llvm-svn: 170864
* Refactor checkUnsafeAssigns() to avoid code duplication with while loop.Ted Kremenek2012-12-211-16/+22
| | | | | | | | This is just a minor bit of refactoring, but it is nice cleanup for the subsequent patch that adds warning support for assigning literals to weak variables. llvm-svn: 170863
* Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for ↵Richard Smith2012-12-214-8/+51
| | | | | | a value-initialized bool! llvm-svn: 170837
* Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when ↵NAKAMURA Takumi2012-12-213-45/+8
| | | | | | | | emitting a null constant of type pointer-to-data-member." It broke stage2. llvm-svn: 170835
* [libclang] Follow-up to r170824, provide the correct number of arguments forArgyrios Kyrtzidis2012-12-212-1/+12
| | | | | | a not-fully-formed macro invocation during code-completion. llvm-svn: 170833
* [analyzer] Address Jordan's nitpicks as per code review of r170625.Anna Zaks2012-12-219-36/+38
| | | | llvm-svn: 170832
* Revert r170826. The output ofRafael Espindola2012-12-214-36/+69
| | | | | | | | ./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks changes in each run. llvm-svn: 170829
* Don't eagerly emit a global static merged with a local extern.Rafael Espindola2012-12-214-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we are visiting the extern declaration of 'i' in static int i = 99; int foo() { extern int i; return i; } We should not try to handle it as if it was an function static. That is, we must consider the written storage class. Fixing this then exposes that the assert in EmitGlobalVarDeclLValue and the if leading to its call are not completely accurate. They were passing before because the second decl was marked as having external storage. I changed them to check the linkage, which I find easier to understand. Last but not least, there is something strange going on with cuda and opencl. My guess is that the linkage computation for these languages needs to be audited, but I didn't want to change that in this patch so I just updated the storage classes to keep the current behavior. Thanks to Reed Kotler for reporting this. llvm-svn: 170827
* [analyzer] Traverse the Call Graph in topological order.Anna Zaks2012-12-214-69/+36
| | | | | | | | | | | | | | | | | Modify the call graph by removing the parentless nodes. Instead all nodes are children of root to ensure they are all reachable. Remove the tracking of nodes that are "top level" or global. This information is not used and can be obtained from the Decls stored inside CallGraphNodes. Instead of existing ordering hacks, analyze the functions in topological order over the Call Graph. Together with the addition of devirtualizable ObjC message sends and blocks to the call graph, this gives around 6% performance improvement on several large ObjC benchmarks. llvm-svn: 170826
* [analyzer] Add blocks and ObjC messages to the call graph.Anna Zaks2012-12-213-51/+95
| | | | | | | | | | | This paves the road for constructing a better function dependency graph. If we analyze a function before the functions it calls and inlines, there is more opportunity for optimization. Note, we add call edges to the called methods that correspond to function definitions (declarations with bodies). llvm-svn: 170825
* [libclang] Make sure we can code-complete inside a macro argument even thoughArgyrios Kyrtzidis2012-12-212-14/+35
| | | | | | | | the macro invocation is not fully formed. rdar://11290992 llvm-svn: 170824
* EditedSource.cpp: Appease msvc, to add <cctype>.NAKAMURA Takumi2012-12-211-0/+1
| | | | llvm-svn: 170817
* docs: Convert ObjectiveCLiterals to reST.Sean Silva2012-12-213-423/+558
| | | | | | | Sphinx's syntax highlighter doesn't recognize the new literals, so the syntax highlighting is pretty pathetic. llvm-svn: 170814
* docs: fix Sphinx toctree warning.Sean Silva2012-12-211-0/+1
| | | | llvm-svn: 170813
* docs: Convert DriverInternals to reST.Sean Silva2012-12-213-523/+401
| | | | llvm-svn: 170812
* Fix some bugs where we would sometimes use 0, not -1, when emitting a null ↵Richard Smith2012-12-203-8/+45
| | | | | | constant of type pointer-to-data-member. llvm-svn: 170806
* Revert r170801, which breaks the mingw build.Douglas Gregor2012-12-201-0/+1
| | | | llvm-svn: 170804
* Eliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!Douglas Gregor2012-12-201-1/+0
| | | | llvm-svn: 170801
* Revert "Warn if a __weak variable is initialized with an Objective-C object ↵Ted Kremenek2012-12-203-46/+1
| | | | | | | | literal." Per code feedback, I want to see if there is a more general way to do this. llvm-svn: 170777
* Use some heuristics so that when a fixit removes a source range, we tryArgyrios Kyrtzidis2012-12-203-5/+86
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 170764
* Warn if a __weak variable is initialized with an Objective-C object literal.Ted Kremenek2012-12-203-1/+46
| | | | | | | | | Such variables may immediately become nil or may have unpredictable behavior. Fixes <rdar://problem/12569201>. llvm-svn: 170763
* Documentation: use monospaced font in BlockLanguageSpec, and fix a link to thisDmitri Gribenko2012-12-202-7/+6
| | | | | | document llvm-svn: 170762
* Use the MaybeParseMicrosoftAttributes function.Chad Rosier2012-12-201-2/+1
| | | | llvm-svn: 170761
* Remove namespace qualifier that lead to build breakage.Daniel Jasper2012-12-201-2/+2
| | | | llvm-svn: 170759
* Move operator precedence calculation to new headerDaniel Jasper2012-12-205-85/+130
| | | | | | | Thereby, it can be reused by clang-format and others. Review: http://llvm-reviews.chandlerc.com/D229 llvm-svn: 170757
* Add objective-C style formatting to clang format andFariborz Jahanian2012-12-208-38/+96
| | | | | | | use it to format xml declaration tags. // rdar://12378714 llvm-svn: 170727
* Update RetainCountChecker to understand attribute ns_returns_autoreleased.Ted Kremenek2012-12-202-4/+12
| | | | | | Fixes <rdar://problem/12887356>. llvm-svn: 170724
* Attribute 'cf_returns_autoreleased' doesn't really exist.Ted Kremenek2012-12-201-5/+0
| | | | llvm-svn: 170723
* Rename llvm::Attributes to llvm::Attribute.Bill Wendling2012-12-2012-85/+85
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-2034-288/+288
| | | | | | which is wrong here. llvm-svn: 170721
* Fix Generic_GCC::GCCVersion::operator<Rafael Espindola2012-12-201-1/+2
| | | | | | | | | 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. llvm-svn: 170705
* c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable ↵NAKAMURA Takumi2012-12-201-0/+1
| | | | | | hosts. llvm-svn: 170693
* c-index-test/Makefile: Reformat.NAKAMURA Takumi2012-12-201-1/+2
| | | | llvm-svn: 170692
* Minor coding style issue: NULL -> 0Alexander Kornienko2012-12-201-1/+1
| | | | llvm-svn: 170688
* Add __has_feature(memory_sanitizer).Evgeniy Stepanov2012-12-202-0/+12
| | | | llvm-svn: 170686
* ASTDumper coding style fixes.Alexander Kornienko2012-12-201-17/+16
| | | | | | | | http://llvm-reviews.chandlerc.com/D226 Patch by Philip Craig! llvm-svn: 170684
* clang/test/Driver/warning-options.cpp: Appease MSYS bash.NAKAMURA Takumi2012-12-201-1/+1
| | | | llvm-svn: 170683
* clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on ↵NAKAMURA Takumi2012-12-201-2/+2
| | | | | | all targets. llvm-svn: 170645
* Updated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst ↵Michael Gottesman2012-12-201-1/+1
| | | | | | | | instead of BlockLanguageSpec.txt. Thanks to Jean-Daniel Dupas for comments! llvm-svn: 170644
* Changed UTF-8 emdashes to --- ala Dmitri Gribenko's comments.Michael Gottesman2012-12-201-7/+7
| | | | llvm-svn: 170643
* Fix another uninitialized bool member bug found by -fsanitize=bool. This oneRichard Smith2012-12-201-0/+1
| | | | | | | appears to currently be benign (we happen to test the flags in the right order, so we never depend on the uninitialized value). llvm-svn: 170640
* Robustify the @encode code and add support for _Atomic.John McCall2012-12-202-52/+113
| | | | | | Fixes PR14628. llvm-svn: 170639
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-2010-13/+52
| | | | | | | | 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. llvm-svn: 170636
* Provide couple of DeclPrint tests for my last patch.Fariborz Jahanian2012-12-201-0/+18
| | | | llvm-svn: 170635
* Implement AST dumper for Decls.Alexander Kornienko2012-12-2019-226/+1556
| | | | | | | | http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! llvm-svn: 170634
* [analyzer] Add the pointer escaped callback.Anna Zaks2012-12-2016-127/+295
| | | | | | | | | | 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. llvm-svn: 170625
* [preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,Argyrios Kyrtzidis2012-12-193-2/+20
| | | | | | | | make sure they came from the same kind of FileIDs. Thanks to Abramo Bagnara for providing the test case. llvm-svn: 170616
* Typo.Chad Rosier2012-12-191-1/+1
| | | | llvm-svn: 170613
* [driver] Have -isysroot warn on nonexistent paths.Chad Rosier2012-12-193-1/+12
| | | | | | rdar://12282267 llvm-svn: 170611
OpenPOWER on IntegriCloud