summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* First step in implementation of mips16 and nomips16 attributes.Reed Kotler2013-01-162-0/+58
| | | | | | Waiting for new llvm attribute code for the next step. llvm-svn: 172626
* Fix a bug where we would move a following line into a comment.Daniel Jasper2013-01-161-1/+1
| | | | | | | | | | | Before: Constructor() : a(a), // comment a(a) {} After: Constructor() : a(a), // comment a(a) {} Needed this as a quick fix. Will add more tests for this in a future commit. llvm-svn: 172624
* [preprocessor] Call the MacroUndefined callback even when the macro was not ↵Argyrios Kyrtzidis2013-01-162-5/+8
| | | | | | | | defined. Patch by Enea Zaffanella! llvm-svn: 172623
* Fix parsing error in conditional expressions.Daniel Jasper2013-01-161-4/+3
| | | | | | | | | | | | | We used to incorrectly parse aaaaaa ? aaaaaa(aaaaaa) : aaaaaaaa; Due to an l_paren being followed by a colon, we assumed it to be part of a constructor initializer. Thus, we never found the colon belonging to the conditional expression, marked the line as bing incorrect and did not format it. llvm-svn: 172621
* [PCH/Modules] Change how macro [re]definitions are de/serialized.Argyrios Kyrtzidis2013-01-163-65/+33
| | | | | | | | | | | | | | | | | | Previously we would serialize the macro redefinitions as a list, part of the identifier, and try to chain them together across modules individually without having the info that they were already chained at definition time. Change this by serializing the macro redefinition chain and then try to synthesize the chain parts across modules. This allows us to correctly pinpoint when 2 different definitions are ambiguous because they came from unrelated modules. Fixes bogus "ambiguous expansion of macro" warning when a macro in a PCH is redefined without undef'ing it first. rdar://13016031 llvm-svn: 172620
* Improve understanding of unary operators.Daniel Jasper2013-01-161-1/+1
| | | | | | Before: int x = ** a; After: int x = **a; llvm-svn: 172619
* Disable inlining of short ifs in Google style.Daniel Jasper2013-01-161-1/+1
| | | | | | | | | Various reasons seem to speak against it, so I am disabling this for now. Changed tests to still test this option. llvm-svn: 172618
* Add option to avoid "bin-packing" of parameters.Daniel Jasper2013-01-161-8/+60
| | | | | | | | | | | | | | | | "Bin-packing" here means allowing multiple parameters on one line, if a function call/declaration is spread over multiple lines. This is required by the Chromium style guide and probably desired for the Google style guide. Not making changes to LLVM style as I don't have enough data. With this enabled, we format stuff like: aaaaaaaaaaaaaaa(aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa(); llvm-svn: 172617
* Add debugging support for split penalties.Manuel Klimek2013-01-162-2/+41
| | | | llvm-svn: 172616
* Use standard llvm Debug.h support for debugging output.Manuel Klimek2013-01-161-17/+16
| | | | | | | | Leave a quick "// Uncomment this." hint to enable the debug output in tests. FIXME: figure out whether we want to enable debug command line handling for all tests. llvm-svn: 172608
* Clang Format: Handle missing semicolonAlexander Kornienko2013-01-161-2/+5
| | | | llvm-svn: 172606
* Fix uninitialized bool flag access in SanitizerArgs parserAlexey Samsonov2013-01-161-2/+2
| | | | llvm-svn: 172605
* Calculate the total length of a line up to each token up front.Daniel Jasper2013-01-162-57/+34
| | | | | | | | | | This makes the tedious fitsIntoLimit() method unnecessary and I can replace one hack (constructor initializers) by a slightly better hack. Furthermore, this will enable calculating whether a certain part of a line fits into the limit for future modifications. llvm-svn: 172604
* Change the datastructure for UnwrappedLines.Daniel Jasper2013-01-163-62/+43
| | | | | | | | | | | | | | It was quite convoluted leading to us accidentally introducing O(N^2) complexity while copying from UnwrappedLine to AnnotatedLine. We might still want to improve the datastructure in AnnotatedLine (most importantly not put them in a vector where they need to be copied on vector resizing but that will be done as a follow-up. This fixes most of the regression in llvm.org/PR14959. No formatting changes intended. llvm-svn: 172602
* Never merge < and ::, as it produces different tokens.Daniel Jasper2013-01-161-4/+4
| | | | | | Before: vector<::Type> t; After: vector< ::Type> t; llvm-svn: 172601
* Remove errors were if statements were incorrectly put on a single line.Daniel Jasper2013-01-161-0/+7
| | | | | | | Before: if (a) // This comment confused clang-format f(); After: if (a) // No more confusion f(); llvm-svn: 172600
* [analyzer] Add an annotation to allow suppression of direct ivarAnna Zaks2013-01-161-0/+18
| | | | | | assignment llvm-svn: 172597
* [analyzer] Fix warning typo.Anna Zaks2013-01-161-2/+2
| | | | llvm-svn: 172596
* [analyzer] Refactor: parameter rename.Anna Zaks2013-01-162-2/+2
| | | | llvm-svn: 172595
* Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so thatDouglas Gregor2013-01-163-2/+18
| | | | | | users can explicitly enable/disable modules autolinking. llvm-svn: 172592
* Collect both normal and static data members of a class in sourceEric Christopher2013-01-162-106/+173
| | | | | | | | | | order. Describe static data members to metadata using new interfaces. Part of PR14471. Patch by Paul Robinson! llvm-svn: 172591
* One can have an unavailable method overridden by an available method,Douglas Gregor2013-01-161-1/+1
| | | | | | | but not vice-versa. Fix bug introduced in r172567 and noticed by Jordan, thanks! llvm-svn: 172586
* Apply adjustment to function- and array-typed non-type templateDouglas Gregor2013-01-161-0/+13
| | | | | | | parameters (per C++ [temp.param]p8) when computing the type of a reference to a non-type template parameter. Fixes <rdar://problem/13000548>. llvm-svn: 172585
* Fix signed/unsigned CompareDavid Greene2013-01-151-1/+2
| | | | | | Do some casting to avoid a signed/unsigned compare. llvm-svn: 172571
* Avoid unsigned Compare to intDavid Greene2013-01-151-1/+1
| | | | | | Cast arithmetic results to avoid comparison of an unsigned to an int. llvm-svn: 172570
* When checking availability attributes for consistency between anDouglas Gregor2013-01-153-27/+87
| | | | | | | | overriding and overridden method, allow the overridden method to have a narrower contract (introduced earlier, deprecated/obsoleted later) than the overriding method. Fixes <rdar://problem/12992023>. llvm-svn: 172567
* Fix CastDavid Greene2013-01-151-1/+2
| | | | | | Properly use const_cast to fix a cast-away-const error. llvm-svn: 172561
* Fix CastingDavid Greene2013-01-151-1/+1
| | | | | | Make the const_cast explicit to silence a compiler warning. llvm-svn: 172560
* Fix Const CastDavid Greene2013-01-151-1/+2
| | | | | | Do proper casting to avoid a cast-away-const error. llvm-svn: 172559
* Fix CastDavid Greene2013-01-151-1/+2
| | | | | | Avoid a cast-away-const error by properly using const_cast<>. llvm-svn: 172558
* Fix Cast CodeDavid Greene2013-01-151-2/+3
| | | | | | | Eliminate a cast and resulting cast-qual warning by using a temporary as the target of memcpy. llvm-svn: 172557
* Typo correction; no functional change.Aaron Ballman2013-01-151-1/+1
| | | | llvm-svn: 172555
* [driver/Darwin] Adjust SDKROOT handling code to not generate "-isysroot /".Daniel Dunbar2013-01-151-3/+4
| | | | llvm-svn: 172548
* Do not traverse the break-state when we know we cannot break anyway.Manuel Klimek2013-01-151-5/+6
| | | | | | | | | This is an optimization that djasper spottet. For now, we do not format anything after the first token that belongs to such an implicit string literal. All our state is not made for handling that anyway, so we'll revisit this if we find a problem. llvm-svn: 172537
* Fix formatting of preprocessor directives (incluces, warnings & errors).Manuel Klimek2013-01-151-6/+30
| | | | | | | | | | | | | | | | | | Treat tokens inside <> for includes and everything from the second token of a warning / error on as an implicit string literal, e.g. do not change its whitespace at all. Now correctly formats: #include < path with space > #error Leave all white!!!!! space* alone! Note that for #error and #warning we still format the space up to the first token of the text, so: # error Text will become #error Text llvm-svn: 172536
* Improve operator kind detection in presence of comments.Daniel Jasper2013-01-151-28/+56
| | | | | | | | | | | We used to incorrectly identify some operators (*, &, +, -, etc.) if there were comments around them. Example: Before: int a = /**/ - 1; After: int a = /**/ -1; llvm-svn: 172533
* Fixes various bugs around the keywords class, struct and union.Manuel Klimek2013-01-152-23/+24
| | | | | | | | | | | | | | | | | | | | This switches to parsing record definitions only if we can clearly identify them. We're specifically allowing common patterns for visibility control through macros and attributes, but we cannot currently fix all instances. This fixes all known bugs we have though. Before: static class A f() { return g(); } int x; After: static class A f() { return g(); } int x; llvm-svn: 172530
* Resolved merge error with r172323 (llvm::X -> X)Alexander Kornienko2013-01-151-1/+1
| | | | llvm-svn: 172528
* Don't crash when binding a reference to a temporary pointer created fromRichard Smith2013-01-151-0/+4
| | | | | | | | resolving an overloaded function reference within an initializer list. Previously we would try to resolve the overloaded function reference without first stripping off the InitListExpr wrapper. llvm-svn: 172517
* PR14950: Fix out-of-bounds function parameter access in literal operator lookup.Richard Smith2013-01-151-1/+1
| | | | llvm-svn: 172514
* PR14918: Don't confuse braced-init-lists after template variable declarationsRichard Smith2013-01-151-27/+17
| | | | | | | | | | | with function definitions. We really should remove Parser::isDeclarationAfterDeclarator entirely, since it's meaningless in C++11 (an open brace could be either a function definition or an initializer, which is what it's trying to differentiate between). The other caller of it happens to be correct right now... llvm-svn: 172510
* Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!Douglas Gregor2013-01-152-0/+13
| | | | llvm-svn: 172509
* Fix behavior of [[gnu::]] function attributes. Per g++'s behavior, theseRichard Smith2013-01-151-0/+14
| | | | | | | | | | | attributes appertain to a declaration, even though they would be much more naturally modelled as appertaining to a function type. Previously, we would try to distribute them from the declarator to the function type, then reject them for being at an incorrect location. Now, we just distribute them as far as the declarator; the existing attribute handling code can actually apply them there just fine. llvm-svn: 172504
* [driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier2013-01-151-1/+8
| | | | | | | | | | driver needs to process the warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 llvm-svn: 172497
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-147-65/+94
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* Multiprecision subtraction builtins.Michael Gottesman2013-01-141-2/+22
| | | | | | We lower these into 2x chained usub.with.overflow intrinsics. llvm-svn: 172476
* Topologically sort the link options generated for modules based onDouglas Gregor2013-01-142-67/+115
| | | | | | | module-import dependencies, so we'll get the link order correct for those silly linkers that need it. llvm-svn: 172459
* When forming the link options for an imported module, also include theDouglas Gregor2013-01-141-2/+7
| | | | | | link options for the modules it imports. llvm-svn: 172448
* [analyzer] Add ProgramStatePartialTrait<const void *>.Jordan Rose2013-01-141-2/+2
| | | | | | This should fix cast-away-const warnings reported by David Greene. llvm-svn: 172446
* [analyzer] -drain is not an alias for -release.Jordan Rose2013-01-141-4/+0
| | | | | | | | | | | This was previously added to support -[NSAutoreleasePool drain], which behaves like -release under non-GC and "please collect" under GC. We're not currently modeling the autorelease pool stack, though, so we can just take this out entirely. Fixes PR14927. llvm-svn: 172444
OpenPOWER on IntegriCloud