summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revamp of the basic layouting algorithm in clang-format.Daniel Jasper2013-02-011-117/+122
| | | | | | | | | | | | | | | | | | | | In order to end up with good solutions, clang-format needs to try "all" combinations of line breaks, evaluate them and select the best one. Before, we have done this using a DFS with memoization and cut-off conditions. However, this approach is very limited as shown by the huge static initializer in the attachment of llvm.org/PR14959. Instead, this new implementation uses a variant of Dijkstra's algorithm to do a prioritized BFS over the solution space. Some numbers: lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s Attachment of PR14959: 10min+ (didn't finish) -> 10s No functional changes intended. llvm-svn: 174166
* Fix diagnostic for bad alignas use: it can't be applied to functions.Richard Smith2013-02-011-2/+5
| | | | llvm-svn: 174160
* Add a new -Wundefined-inline warning for inline functions which are used but notNick Lewycky2013-02-016-51/+90
| | | | | | defined. Fixes PR14993! llvm-svn: 174158
* Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.Richard Smith2013-02-013-38/+99
| | | | | | Also support alignas(0), which C++11 and C11 require us to ignore. llvm-svn: 174157
* Add PPC A2Q core and BG/Q preprocessor definitionsHal Finkel2013-02-012-2/+21
| | | | | | The a2q core is the variant of the a2 core used on the BG/Q supercomputers. llvm-svn: 174151
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-013-31/+20
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* Don't do delayed exception-specification checking on an invalidDouglas Gregor2013-02-011-0/+8
| | | | | | class. Fixes <rdar://problem/13017229>. llvm-svn: 174145
* Enable -fno-altivec, -mno-altivec for PowerPC.Bill Schmidt2013-02-012-0/+37
| | | | | | | | | | | Introduces these negation forms explicitly and uses them to control a new "altivec" target feature for PowerPC. This allows avoiding generating Altivec instructions on processors that support Altivec. The new test case verifies that the Altivec "lvx" instruction is not used when -fno-altivec is present on the command line. llvm-svn: 174140
* [Sema][Attr]Fix alignment attribute printing.Michael Han2013-02-012-21/+21
| | | | | | | | | Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should only model those appear in source code. Introduce attribute Accessor, and teach TableGen to generate syntax kind accessors for Align attribute, and use those accessors to decide if an alignment attribute is a declspec attribute. llvm-svn: 174133
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-1/+8
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* [analyzer]RetainCount: Fix an autorelease related false positive.Anna Zaks2013-01-311-1/+1
| | | | | | | The Cnt variable is adjusted (incremented) for simplification of checking logic. The increment should not be stored in the state. llvm-svn: 174104
* [analyzer] Don't track autorelease pools created by +new.Jordan Rose2013-01-311-14/+2
| | | | | | | | | | | | | This matches our behavior for autorelease pools created by +alloc. Some people like to create autorelease pools in one method and release them somewhere else. If you want safe autorelease pool semantics, use the new ARC-compatible syntax: @autoreleasepool { ... } <rdar://problem/13121353> llvm-svn: 174096
* Lexer: Don't warn about Unicode in preprocessor directives.Jordan Rose2013-01-311-2/+4
| | | | | | | | | This allows people to use Unicode in their #pragma mark and in macros that exist only to be string-ized. <rdar://problem/13107323&13121362> llvm-svn: 174081
* Preprocessor: initialize member introduced in r173881.Jordan Rose2013-01-311-0/+1
| | | | | | | Compilation always sets this explicitly, but creating a preprocessor manually should still put the 'IsPreprocessedOutput' flag in a valid state. llvm-svn: 174077
* Micro-change: moved a brace for better readabilityAlexander Kornienko2013-01-311-2/+2
| | | | llvm-svn: 174075
* Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."Jordan Rose2013-01-312-75/+14
| | | | | | | | | It's causing hangs on our internal analyzer buildbot. Will restore after investigating. This reverts r173951 / baa7ca1142990e1ad6d4e9d2c73adb749ff50789. llvm-svn: 174069
* Never break inside something that was a preprocessor directive.Manuel Klimek2013-01-311-1/+1
| | | | | | Just put it in one unwrapped line and let the formatter handle it. llvm-svn: 174063
* Several improvements to the formatting of static initializers.Daniel Jasper2013-01-312-11/+41
| | | | | | | | | | | | | 1. Never avoid bin packing in static initializers as this can lead to terrible results. 2. If an element has to be broken over multiple lines, break after the following comma. This should be a step forward, but there are still many cases especially with nested static initializers that we handle badly. More patches will follow. llvm-svn: 174061
* Add support for AArch64 target.Tim Northover2013-01-319-6/+737
| | | | | | | | | | | | | In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. llvm-svn: 174055
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-315-19/+43
| | | | llvm-svn: 174050
* [msan] Run more optimizations after MemorySanitizer pass.Evgeniy Stepanov2013-01-311-0/+12
| | | | | | | | | | | | MSan instrumentation is driven by the original code. We take every incoming instruction and emit another instruction (or ten) next to it, operating on the shadow values (but sometimes on the real values, too). Two programs in one, essentially. There can be any kinds of redundancies in the second one, so we just run whatever is normally run at -O2, and then exclude some passes that do not help much with benchmarks. llvm-svn: 174049
* When we're emitting a constructor or destructor call from a delegatingDouglas Gregor2013-01-314-21/+39
| | | | | | | constructor, retrieve our VTT parameter directly. Fixes PR14588 / <rdar://problem/12867962>. llvm-svn: 174042
* Improve 'failed template argument deduction' diagnostic for the case where weRichard Smith2013-01-312-39/+71
| | | | | | | | have a direct mismatch between some component of the template and some component of the argument. The diagnostic now says what the mismatch was, but doesn't yet say which part of the template doesn't match. llvm-svn: 174039
* When code completing in a statement, parenthesized expression, orDouglas Gregor2013-01-311-1/+9
| | | | | | | | Objective-C message receiver, the user is as likely to want to write a type name as any other declaration, so give types the same priority as other declarations. Fixes <rdar://problem/12480600>. llvm-svn: 174038
* Allow the computation of the base priority for a declaration code completion ↵Douglas Gregor2013-01-312-47/+65
| | | | | | result to consider the completion context llvm-svn: 174037
* Replace "failed template argument deduction" diagnostic with something usefulRichard Smith2013-01-312-7/+30
| | | | | | in the one case where we've already factored out a reason code. llvm-svn: 174036
* Remove elements from Sema.UndefinedInternals as functions are defined. AlsoNick Lewycky2013-01-315-33/+65
| | | | | | | filter the elements before emitting them into a PCH. No user-visible functionality change, except that PCH files may be smaller? llvm-svn: 174034
* Fix grammar in comment.Nick Lewycky2013-01-311-1/+1
| | | | llvm-svn: 174033
* Clarify the diagnostic for -Wnested-anon-types.Richard Smith2013-01-311-1/+2
| | | | llvm-svn: 174032
* [analyzer] If a lazy binding is undefined, pretend that it's unknown instead.Jordan Rose2013-01-311-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | This is a hack to work around the fact that we don't track extents for our default bindings: CGPoint p; p.x = 0.0; p.y = 0.0; rectParam.origin = p; use(rectParam.size); // warning: uninitialized value in rectParam.size.width In this case, the default binding for 'p' gets copied into 'rectParam', because the 'origin' field is at offset 0 within CGRect. From then on, rectParam's old default binding (in this case a symbol) is lost. This patch silences the warning by pretending that lazy bindings are never made from uninitialized memory, but not only is that not true, the original default binding is still getting overwritten (see FIXME test cases). The long-term solution is tracked in <rdar://problem/12701038> PR14765 and <rdar://problem/12875012> llvm-svn: 174031
* When comparing two template template arguments in the template differ, considerRichard Trieu2013-01-311-5/+14
| | | | | | | | | | | them the same if they are actually the same; having the same name isn't enough. Similar to r174013, template template arguments were also mistakenly considered the same when they had the same name but were in different namespaces. In addition, when printing template template arguments, use the qualified name if the regular name is the same. llvm-svn: 174029
* Fix -Wcovered-switch-default and -Wunused-private-field warnings.Richard Smith2013-01-311-19/+17
| | | | llvm-svn: 174025
* Add indents to AST dumping and removed parenthesis from AST nodes.Richard Trieu2013-01-311-44/+280
| | | | | | | | | | | | | | | | | | | | | Indents were given the color blue when outputting with color. AST dumping now looks like this: Node |-Node | `-Node `-Node `-Node Compared to the previous: (Node (Node (Node)) (Node (Node))) llvm-svn: 174022
* Fix ODR-use of a MemberExpr to check before marking a pure function used. RemoveNick Lewycky2013-01-312-3/+13
| | | | | | a workaround for this bug from the -Wundefined-internals warning. llvm-svn: 174020
* [analyzer] Fix a bug in region store that lead to undefined value falseAnna Zaks2013-01-311-16/+8
| | | | | | | | | | positives. The includeSuffix was only set on the first iteration through the function, resulting in invalid regions being produced by getLazyBinding (ex: zoomRegion.y). llvm-svn: 174016
* When comparing two templates in the template differ, consider them theDouglas Gregor2013-01-311-2/+2
| | | | | | | same if they are actually the same; having the same name isn't enough. Fixes <rdar://problem/12931988>. llvm-svn: 174013
* Make sure that the Attribute object represents one attribute only.Bill Wendling2013-01-315-22/+31
| | | | | | | | Several places were still treating the Attribute object as respresenting multiple attributes. Those places now use the AttributeSet to represent multiple attributes. llvm-svn: 174004
* Fix unused variable warnings in -asserts buildMatt Beaumont-Gay2013-01-311-2/+2
| | | | llvm-svn: 173996
* Reinstate r173952, this time limiting it to exactly the formDouglas Gregor2013-01-301-1/+4
| | | | | | | | #define X X for which there is no point warning, ever. llvm-svn: 173991
* Diagnostics: Clarify name of line-length-limiting constant in r173976.Jordan Rose2013-01-301-3/+3
| | | | | | Thanks, Sean. llvm-svn: 173981
* Changed to static_cast, due to post-commit review.Filipe Cabecinhas2013-01-301-2/+2
| | | | llvm-svn: 173980
* Cast to remove the narrowing conversion error in c++11.Filipe Cabecinhas2013-01-301-2/+2
| | | | llvm-svn: 173978
* Diagnostics: if a line is longer than 4096 characters, don't print it.Jordan Rose2013-01-301-1/+9
| | | | | | | | | | | | | Specifically, don't print snippets, caret diagnostics, or ranges for lines over 4096 characters. We copy the line around a few times in our diagnostics machinery, and we have to print a caret line that's just as long. This uses a lot of memory just to create a poor user experience as we print out a line much too long for anyone to read...or spend extra energy trying to fit it to -fmessage-length. <rdar://problem/13106850> llvm-svn: 173976
* Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""Argyrios Kyrtzidis2013-01-301-4/+1
| | | | | | This reverts commit r173952 llvm-svn: 173970
* Handle passing non-Qualtypes to %diff better. Instead of asserting, fall backRichard Trieu2013-01-301-5/+23
| | | | | | to printing the default case. This is a fix for PR15023. llvm-svn: 173965
* Add OpenCL error that a kernel function must have void return type. Includes ↵Tanya Lattner2013-01-301-1/+8
| | | | | | a test case. llvm-svn: 173963
* Fix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.Jordan Rose2013-01-301-0/+1
| | | | | | | | This caused hangs as we processed the same invalid byte over and over. <rdar://problem/13115651> llvm-svn: 173959
* [analyzer] Make shallow mode more shallow.Anna Zaks2013-01-303-5/+39
| | | | | | | | | | | | | | | | Redefine the shallow mode to inline all functions for which we have a definite definition (ipa=inlining). However, only inline functions that are up to 4 basic blocks large and cut the max exploded nodes generated per top level function in half. This makes shallow faster and allows us to keep inlining small functions. For example, we would keep inlining wrapper functions and constructors/destructors. With the new shallow, it takes 104s to analyze sqlite3, whereas the deep mode is 658s and previous shallow is 209s. llvm-svn: 173958
* [analyzer] Use analyzer config for max-inlinable-size option.Anna Zaks2013-01-303-4/+7
| | | | llvm-svn: 173957
* [analyzer] Move report false positive suppression to report visitors.Anna Zaks2013-01-302-34/+38
| | | | llvm-svn: 173956
OpenPOWER on IntegriCloud