summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Cache the bindings accessible through a LazyCompoundVal.Jordan Rose2013-02-151-30/+68
| | | | | | | This means we don't have to recompute them all later for every removeDeadSymbols check. llvm-svn: 175233
* [analyzer] Scan the correct store when finding symbols in a LazyCompoundVal.Jordan Rose2013-02-151-2/+10
| | | | | | | | Previously, we were scanning the current store. Now, we properly scan the store that the LazyCompoundVal came from, which may have very different live symbols. llvm-svn: 175232
* [analyzer] Tweak LazyCompoundVal reuse check to ignore qualifiers.Jordan Rose2013-02-151-1/+1
| | | | | | This is optimization only; no behavioral change. llvm-svn: 175231
* [analyzer] Use collectSubRegionKeys to make removeDeadBindings faster.Jordan Rose2013-02-151-19/+33
| | | | | | | | | | | Previously, whenever we had a LazyCompoundVal, we crawled through the entire store snapshot looking for bindings within the LCV's region. Now, we just ask for the subregion bindings of the lazy region and only visit those. This is an optimization (so no test case), but it may allow us to clean up more dead bindings than we were previously. llvm-svn: 175230
* [analyzer] Refactor RegionStore's sub-region bindings traversal.Jordan Rose2013-02-152-46/+82
| | | | | | | | | | | This is going to be used in the next commit. While I'm here, tighten up assumptions about symbolic offset BindingKeys, and make offset calculation explicitly handle all MemRegion kinds. No functionality change. llvm-svn: 175228
* objective-C: synthesize properties in order of theirFariborz Jahanian2013-02-143-12/+20
| | | | | | | | declarations to synthesize their ivars in similar determinstic order so they are laid out in a determinstic order. // rdar://13192366 llvm-svn: 175214
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-143-2/+31
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* [analyzer] Try constant-evaluation for all variables, not just globals.Jordan Rose2013-02-141-21/+34
| | | | | | | | | | | | | | | | | | | | | In C++, constants captured by lambdas (and blocks) are not actually stored in the closure object, since they can be expanded at compile time. In this case, they will have no binding when we go to look them up. Previously, RegionStore thought they were uninitialized stack variables; now, it checks to see if they are a constant we know how to evaluate, using the same logic as r175026. This particular code path is only for scalar variables. Constant arrays and structs are still unfortunately unhandled; we'll need a stronger solution for those. This may have a small performance impact, but only for truly-undefined local variables, captures in a non-inlined block, and non-constant globals. Even then, in the non-constant case we're only doing a quick type check. <rdar://problem/13105553> llvm-svn: 175194
* [arcmt] Make sure the function has an associated parameter for the argumentArgyrios Kyrtzidis2013-02-141-1/+1
| | | | | | | | before checking for its attributes. rdar://13192395 llvm-svn: 175184
* Mangle extern "C" functions whose names are not simple identifiers.Rafael Espindola2013-02-141-2/+6
| | | | llvm-svn: 175166
* Fix counting of parameters so that r175162 works as expected.Daniel Jasper2013-02-142-9/+12
| | | | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() .aaaaaaaaaaaaaaaaa()); After: aaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa()); Not sure which of the formattings above is better, but we should not pick one by accident. llvm-svn: 175165
* Reduce penalty for breaking before ./-> after complex calls.Daniel Jasper2013-02-142-9/+9
| | | | | | | | | | | | | | | | | This gives a clearer separation of the context, e.g. in GMOCK statements. Before: EXPECT_CALL(SomeObject, SomeFunction(Parameter)).WillRepeatedly(Return(SomeValue)); After: EXPECT_CALL(SomeObject, SomeFunction(Parameter)) .WillRepeatedly(Return(SomeValue)); Minor format cleanups. llvm-svn: 175162
* Remove a const_cast by propagating constness to called functionsDmitri Gribenko2013-02-141-2/+2
| | | | llvm-svn: 175161
* Remove an unneeded const_castDmitri Gribenko2013-02-141-3/+2
| | | | llvm-svn: 175160
* Remove const_casts by making spec_begin()/spec_end() constDmitri Gribenko2013-02-142-9/+7
| | | | llvm-svn: 175159
* Remove the trailing whitespace of formatted lines.Daniel Jasper2013-02-141-13/+21
| | | | | | | | | | | | | | | So far, clang-format has always assumed the whitespace belonging to the subsequent token. This has the negative side-effect that when clang-format formats a line, it does not remove its trailing whitespace, as it belongs to the next token. Thus, this patch fixes most of llvm.org/PR15062. We are not zapping a file's trailing whitespace so far, as this does not belong to any token we see during formatting. We need to fix this in a subsequent patch. llvm-svn: 175152
* Get less confused by trailing comma in Google style.Daniel Jasper2013-02-141-1/+2
| | | | | | | | | | | | | | | | | The formatter can now format: void aaaaaaaaaaaaaaaaaa(int level, double *min_x, double *max_x, double *min_y, double *max_y, double *min_z, double *max_z, ) { } Although this is invalid code, it frequently happens during development and clang-format should be nicer :-). llvm-svn: 175151
* Align superclasses for multiple inheritence.Daniel Jasper2013-02-143-2/+14
| | | | | | | | | | | | | | | | This fixes llvm.org/PR15179. Before: class ColorChooserMac : public content::ColorChooser, public content::WebContentsObserver { }; After: class ColorChooserMac : public content::ColorChooser, public content::WebContentsObserver { }; llvm-svn: 175147
* Revert accidental commit.Bill Wendling2013-02-141-13/+0
| | | | llvm-svn: 175143
* Pass the target options through to code generation.Bill Wendling2013-02-145-10/+31
| | | | | | | The code generation stuff is going to set attributes on the functions it generates. To do that it needs the target options. Pass them through. llvm-svn: 175141
* Partially revert r175117 so that we don't break assumptions about howRafael Espindola2013-02-142-0/+17
| | | | | | | static functions in extern "C" contexts are mangled. Should fix the bootstrap. llvm-svn: 175132
* merge hasCLanguageLinkage and isExternC. Keep the shorter name.Rafael Espindola2013-02-144-65/+35
| | | | | | | | | | I added hasCLanguageLinkage while fixing some language linkage bugs some time ago so that I wouldn't have to check all users of isExternC. It turned out to be a much longer detour than expected, but this patch finally merges the two again. The isExternC function now implements just the standard notion of having C language linkage. llvm-svn: 175119
* Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fixRafael Espindola2013-02-144-26/+59
| | | | | | | | | | | | | | | some cases where functions with no language linkage were being treated as having C language linkage. In particular, don't warn in extern "C" { static NonPod foo(); } Since getLanguageLinkage checks the language linkage, the linkage computation cannot use the language linkage. Break the loop by checking just the context in the linkage computation. llvm-svn: 175117
* When marking derived classes' virtual methods ODR-used in order to triggerNick Lewycky2013-02-141-1/+1
| | | | | | | instantiation in order to permit devirtualization later in codegen, skip over pure functions since those can't be devirtualization targets. llvm-svn: 175116
* objective-C: Make order of ivars which are synthesizedFariborz Jahanian2013-02-131-7/+40
| | | | | | | | in the course of property synthesis deterministic (ordered by their type size), instead of having hashtable order (as it is currently). // rdar://13192366 llvm-svn: 175100
* ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,Richard Smith2013-02-134-5/+42
| | | | | | | base-to-derived casts have undefined behavior if the object is not actually an instance of the derived type. llvm-svn: 175078
* Allow breaking after the return type in function declarations.Daniel Jasper2013-02-132-6/+9
| | | | | | | | | | | | | | | | | This has so far been disabled for Google style, but should be done before breaking at nested name specifiers or in template parameters. Before (in Google style): template <typename T> aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa> aaaaaaaaaaaaaaaaaaaaaaaa< T>::aaaaaaa() {} After: template <typename T> aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa> aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {} llvm-svn: 175074
* Fix comment alignment close to the column limit.Daniel Jasper2013-02-131-1/+1
| | | | | | | Due to an error in one of the expressions, we used to not align comments although it would have been possible. llvm-svn: 175068
* Pull search state out as class members.Manuel Klimek2013-02-131-17/+13
| | | | | | Fix some comments. llvm-svn: 175052
* An attempt to make the search algorithm easier to understand.Manuel Klimek2013-02-131-49/+86
| | | | | | | | | | | | | | | | | | | | - clear ownership: the SpecificBumpPtrAllocator owns all StateNodes - this allows us to simplify the memoization data structure into a std::set (FIXME: figure out whether we want to use a hash based data structure). - introduces StateNode as recursive data structure, instead of using Edge and the Seen-map combined to drill through the graph - using a count to stabilize the penalty instead of relying on the container - pulled out a method to forward-apply states in the end This leads to a ~40% runtime decrease on Nico's benchmark. Main FiXME is that the parameter lists of some function get too long. I'd vote for either pulling the Queue etc into the Formatter proper, or creating an inner class just for the search algorithm. llvm-svn: 175051
* Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058Timur Iskhodzhanov2013-02-138-46/+194
| | | | llvm-svn: 175045
* Formatter: Refactor the cast detection code to be a bit more readable.Nico Weber2013-02-131-9/+10
| | | | | | No functionality change. Also add another cast test. llvm-svn: 175029
* Formatter: Detect ObjC method expressions after casts.Nico Weber2013-02-131-1/+1
| | | | | | Not all casts are correctly detected yet, but it helps in some cases. llvm-svn: 175028
* [analyzer] Use Clang's evaluation for global constants and default arguments.Jordan Rose2013-02-133-10/+41
| | | | | | | | | | | Previously, we were handling only simple integer constants for globals and the smattering of implicitly-valued expressions handled by Environment for default arguments. Now, we can use any integer constant expression that Clang can evaluate, in addition to everything we handled before. PR15094 / <rdar://problem/12830437> llvm-svn: 175026
* [analyzer] Use makeZeroVal in RegionStore's lazy evaluation of statics.Jordan Rose2013-02-131-23/+19
| | | | | | No functionality change. llvm-svn: 175025
* Order the methods in the global method pool based on when they become ↵Douglas Gregor2013-02-121-3/+40
| | | | | | visible, not when they become deserialized <rdar://problem/13203033>. llvm-svn: 175018
* Replace 'signed' with 'int'. 'signed' is not typical for LLVM styleDmitri Gribenko2013-02-121-1/+1
| | | | llvm-svn: 175015
* [preprocessing record] Add some sanity checks for the preprocessed entity indexArgyrios Kyrtzidis2013-02-121-4/+8
| | | | | | | | to make sure we don't crash on release if the index is not valid. rdar://13089714 llvm-svn: 175010
* Fix crash for incomplete labels in macros.Daniel Jasper2013-02-121-2/+2
| | | | | | | Still the formatting can be improved, but at least we don't assert any more. This happened when trying to format lib/Sema/SemaType.cpp. llvm-svn: 175003
* Fixing the MSVC compiler warning a different way; removed use of static_cast ↵Aaron Ballman2013-02-121-2/+2
| | | | | | and instead used a signed integer parameter. llvm-svn: 174996
* Removing a signed/unsigned mismatch warning triggered in MSVC 11.Aaron Ballman2013-02-121-1/+1
| | | | llvm-svn: 174986
* Accept over-qualified constructor in MSVC emulation modeDmitri Gribenko2013-02-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC accepts this: class A { A::A(); }; Clang accepts regular member functions with extra qualification as an MS extension, but not constructors. This changes the parser to defer rejecting qualified constructors so that the same Sema logic can apply to constructors as regular member functions. This also improves the error message when MS extensions are disabled (in my opinion). Before it was: /Users/jason/Desktop/test.cpp:2:8: error: expected member name or ';' after declaration specifiers A::A(); ~~~~ ^ 1 error generated. After: /Users/jason/Desktop/test.cpp:2:6: error: extra qualification on member 'A' A::A(); ~~~^ 1 error generated. Patch by Jason Haslam. llvm-svn: 174980
* Fix bug in the adjustment to existing lines.Daniel Jasper2013-02-121-6/+9
| | | | | | | | | | | | Before (if only the second line was reformatted): void f() {} void g() {} After: void f() {} void g() {} llvm-svn: 174978
* Formatter: Correctly format stars in `sizeof(int**)` and similar places.Nico Weber2013-02-121-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This redoes how '*' and '&' are classified as pointer / reference markers when followed by ')', '>', or ','. Previously, determineStarAmpUsage() marked a single '*' and '&' followed by ')', '>', or ',' as pointer or reference marker. Now, all '*'s and '&'s preceding ')', '>', or ',' are marked as pointer / reference markers. Fixes PR14884. Since only the last '*' in 'int ***' was marked as pointer before (the rest were unary operators, which don't reach spaceRequiredBetween()), spaceRequiredBetween() now had to be thought about handing multiple '*'s in sequence. Before: return sizeof(int * *); Type **A = static_cast<Type * *>(P); Now: return sizeof(int**); Type **A = static_cast<Type **>(P); While here, also make all methods of AnnotatingParser except parseLine() private. Review URL: http://llvm-reviews.chandlerc.com/D384 llvm-svn: 174975
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-125-13/+15
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Properly assemble PHIs after a null-checked invoke of objc_msgSend.John McCall2013-02-121-40/+67
| | | | | | rdar://12046763 llvm-svn: 174946
* Fix a bug reduced from a crash when trying to use modules with libc++. We checkRichard Smith2013-02-123-4/+9
| | | | | | | | the linkage of functions and variables while merging declarations from modules, and we don't necessarily have enough of the rest of the AST loaded at that point to allow us to compute linkage, so serialize it instead. llvm-svn: 174943
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-121-3/+69
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Change some CGF parameters to CGMs.John McCall2013-02-121-49/+49
| | | | llvm-svn: 174939
* Perform placeholder conversions on the controller of a _GenericJohn McCall2013-02-121-0/+6
| | | | | | expression. llvm-svn: 174930
OpenPOWER on IntegriCloud