summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* CGDecl.cpp: Prune three descriptions in two methods, ↵NAKAMURA Takumi2012-12-241-8/+0
| | | | | | | | | | CodeGenFunction::pushIrregularPartialArrayCleanup() and CodeGenFunction::pushRegularPartialArrayCleanup(). [-Wdocumentation] /// \param array - a value of type elementType* /// \param destructionKind - the kind of destruction required /// \param initializedElementCount - a value of type size_t* holding the number of successfully-constructed elements llvm-svn: 171013
* DiagnosticRenderer.cpp: Prune one description in ↵NAKAMURA Takumi2012-12-241-1/+0
| | | | | | | | DiagnosticRenderer::emitMacroExpansions(). [-Wdocumentation] /// \param MacroSkipEnd The depth to stop skipping macro expansions. llvm-svn: 171012
* CGValue.h: Update one \param to Addr in MakeBitfield(). [-Wdocumentation]NAKAMURA Takumi2012-12-241-1/+1
| | | | llvm-svn: 171011
* Take operator precedence into account when splitting lines.Daniel Jasper2012-12-241-3/+7
| | | | | | | | | | | | | | | With this patch, splitting after binary operators has a panelty corresponding to the operator's precedence. We used to ignore this and eagerly format like: if (aaaaaaaaaaaaaaaaaaaaaaaaa || bbbbbbbbbbbbbbbbbbbbbbbbb && ccccccccccccccccccccccccc) { .. } With this patch, this becomes: if (aaaaaaaaaaaaaaaaaaaaaaaaa || bbbbbbbbbbbbbbbbbbbbbbbbb && ccccccccccccccccccccccccc) { .. } llvm-svn: 171007
* libFormat: Teach the *& usage heuristic that "return" starts a rhs too.Nico Weber2012-12-231-5/+8
| | | | | | | | "return a*b;" was formatted as "return a *b;" and is now formatted as "return a * b;". Fixes PR14687 partially. llvm-svn: 170993
* Move a declaration closer to its use. No functionality change.Nico Weber2012-12-231-2/+2
| | | | llvm-svn: 170992
* [libclang] Fix crash when code-completing a macro invocation thatArgyrios Kyrtzidis2012-12-222-14/+33
| | | | | | reached EOF and did not expand the argument into the source context. llvm-svn: 170980
* [libclang] Don't try to translate diagnostics from the precompiled preamble ↵Argyrios Kyrtzidis2012-12-221-11/+0
| | | | | | | | | | | to the code-completion results, the SourceManager state may be slightly different when code-completing. And we don't even care for diagnostics when code-completing, anyway. llvm-svn: 170979
* PR14695: Fix assert from bad cast<>. Not every namespace is a NamespaceDecl; ↵Richard Smith2012-12-221-5/+12
| | | | | | it might instead be a TranslationUnitDecl. llvm-svn: 170976
* Add back -Wduplicate-enum which I mistakenly removed.Ted Kremenek2012-12-221-0/+178
| | | | | | | | | | | | This was removed with -Wunique-enum, which is still removed. The corresponding thread on cfe-comments for that warning is here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024224.html If we get specific user feedback for -Wduplicate-enum we can evaluate whether or not to keep it. llvm-svn: 170974
* Fix typo: objc_no_direct_instance_variable_assignmemt => ↵Ted Kremenek2012-12-222-3/+3
| | | | | | | | objc_no_direct_instance_variable_assignment. Fixes <rdar://problem/12927551>. llvm-svn: 170971
* [analyzer] Convert SimpleStreamChecker to use the PointerEscape callbackAnna Zaks2012-12-221-80/+16
| | | | | | The new callback greatly simplifies the checker. llvm-svn: 170969
* Use a safe default width for template-diff'ing integral arguments, inDouglas Gregor2012-12-211-1/+1
| | | | | | | case we can't find an exact width to use. Fixes crash in <rdar://problem/12456626>. llvm-svn: 170951
* Tweak Sema::CheckLiteralKind() to also include block literalsTed Kremenek2012-12-212-11/+9
| | | | | | | This simplifies some diagnostic logic in checkUnsafeAssignLiteral(), hopefully making it less error prone. llvm-svn: 170945
* Add comments back that were accidentally removed in r170933.Chad Rosier2012-12-211-0/+2
| | | | llvm-svn: 170938
* Remove unused arguments and rename to conform to coding standards.Chad Rosier2012-12-212-12/+7
| | | | llvm-svn: 170933
* Change checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().Ted Kremenek2012-12-212-25/+16
| | | | | | | | | | Along the way, fix a bug in CheckLiteralKind(), previously in diagnoseObjCLiteralComparison, where we didn't ignore parentheses in boxed expressions for purpose of classification. In other words, both @42 and @(42) should be classified as numeric literals. llvm-svn: 170931
* Hoist logic for classifying Objective-C literals into Sema (proper) for use ↵Ted Kremenek2012-12-211-52/+45
| | | | | | | | with other diagnostics. No immediate (intended) functionality change. llvm-svn: 170930
* Fixes couple of friend declaration -ast-print bugFariborz Jahanian2012-12-211-5/+3
| | | | | | | | | found by running -ast-print on all-std-headers.cpp which caused it to go into infinite loop. Now -ast-print prints all declarations found in all-std-headers.cpp. llvm-svn: 170928
* Indent.Chad Rosier2012-12-211-2/+1
| | | | llvm-svn: 170925
* Remove unnecessary checks.Chad Rosier2012-12-211-6/+3
| | | | llvm-svn: 170924
* Use descriptive enum instead of raw integers for checkUnsafeAssignLiteral().Ted Kremenek2012-12-211-7/+9
| | | | llvm-svn: 170920
* Sink call to checkUnsafeAssignLiteral() into checkUnsafeAssignObject().Ted Kremenek2012-12-211-23/+22
| | | | llvm-svn: 170919
* Fix indent.Chad Rosier2012-12-211-1/+1
| | | | llvm-svn: 170918
* format: Handle #import as include directive too.Nico Weber2012-12-211-0/+1
| | | | llvm-svn: 170914
* clang-format: No spaces around directory specifiersDaniel Jasper2012-12-211-2/+37
| | | | | | | | | | This fixes PR14683. We used to format like this: #include <a / b> And this patch changes this to: #include <a/b> llvm-svn: 170910
* Add ARM cortex-r5 subtarget as available mcpuQuentin Colombet2012-12-213-1/+4
| | | | llvm-svn: 170909
* [analyzer] Fix typos.Anna Zaks2012-12-211-2/+2
| | | | llvm-svn: 170907
* [analyzer] Re-apply r170826 and make the dumping of the GallGraphAnna Zaks2012-12-212-57/+34
| | | | | | | | | | | | | | | | | | | | | | | deterministic. Commit message for r170826: [analyzer] Traverse the Call Graph in topological order. 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: 170906
* Sort the includes according to the coding standard.Roman Divacky2012-12-211-1/+1
| | | | llvm-svn: 170905
* Fix typo.Fariborz Jahanian2012-12-211-1/+1
| | | | llvm-svn: 170904
* Remove duplicate includes.Roman Divacky2012-12-217-8/+0
| | | | llvm-svn: 170903
* Basic support for formatting for-loops.Daniel Jasper2012-12-211-7/+42
| | | | | | | | | | | | | We used to not really format them. Now we do: for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(), SE = BB->succ_end(); SI != SE; ++SI) { This is just one example and I am sure we still mess some of them up, but it is a step forward. llvm-svn: 170899
* Update comments.Rafael Espindola2012-12-211-3/+2
| | | | llvm-svn: 170890
* Use OperatorPrecedence.h in clang-formatDaniel Jasper2012-12-211-28/+14
| | | | | | | No indented functional changes other than handling more operators correctly. llvm-svn: 170875
* Formatting fixes for PR14680Daniel Jasper2012-12-211-62/+61
| | | | | | Also, some (automated) formatting fixes and slight cleanups. llvm-svn: 170873
* Fix regression in r170489: when instantiating a direct initializer which is aRichard Smith2012-12-212-7/+22
| | | | | | | | 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-211-0/+39
| | | | | | | | | | 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-212-8/+5
| | | | | | a value-initialized bool! llvm-svn: 170837
* Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when ↵NAKAMURA Takumi2012-12-212-5/+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-211-0/+11
| | | | | | 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-216-18/+15
| | | | llvm-svn: 170832
* Revert r170826. The output ofRafael Espindola2012-12-212-20/+52
| | | | | | | | ./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-213-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-212-52/+20
| | | | | | | | | | | | | | | | | 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-212-44/+85
| | | | | | | | | | | 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-211-14/+26
| | | | | | | | 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
* Fix some bugs where we would sometimes use 0, not -1, when emitting a null ↵Richard Smith2012-12-202-8/+5
| | | | | | constant of type pointer-to-data-member. llvm-svn: 170806
OpenPOWER on IntegriCloud