summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit vtables for an extern template class as available_externally, not asRichard Smith2013-02-161-8/+10
| | | | | | | linkonce_odr. Emit construction vtables as internal in this case, since the ABI does not guarantee that they will be availble externally. llvm-svn: 175330
* [PCH] Deserializing the DeclContext of a template parameter is not safeArgyrios Kyrtzidis2013-02-162-14/+16
| | | | | | | | | | | until recursive loading is finished. Otherwise we may end up with a template trying to deserialize a template parameter that is in the process of getting loaded. rdar://13135282 llvm-svn: 175329
* Rework the visibility computation algorithm in preparationJohn McCall2013-02-161-186/+303
| | | | | | | | | | | | | | | | for distinguishing type vs. value visibility. The changes to the visibility of explicit specializations are intentional. The change to the "ugly" test case is a consequence of a sensible implementation, and I am happy to argue that this is better behavior. Other changes may or may not be intended; it is quite difficult to divine intent from some of the code I altered. I've left behind a comment which I hope explains the philosophy behind visibility computation. llvm-svn: 175326
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-0/+13
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* objective-C: Fixes a compiler crash when encodingFariborz Jahanian2013-02-151-4/+10
| | | | | | | an ivar of type pointer to a typedef'ed object. // rdar://13190095 llvm-svn: 175298
* Recognize < and > as binary expressions in builder-type calls.Daniel Jasper2013-02-151-3/+5
| | | | | | | | | | | | | | | | | The current heuristic assumes that there can't be binary operators in builder-type calls (excluding assigments). However, it also excluded < and > in general, which is wrong. Now they are only excluded if they are template parameters. Before: return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa()i .aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa(); After: return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa(); llvm-svn: 175291
* Fixed diagnostic nondeterministic order bug (pr14901).Enea Zaffanella2013-02-151-7/+10
| | | | llvm-svn: 175289
* Done break between 'operator' and '<<'.Daniel Jasper2013-02-151-1/+1
| | | | | | | | | | | | Before: ostream &operator <<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue); After: ostream &operator<<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue); llvm-svn: 175286
* Fix crash-on-invalid where a ParenListExpr shows up as a message receiverArgyrios Kyrtzidis2013-02-151-0/+7
| | | | | | | | while trying to do error recovery. rdar://13207886 llvm-svn: 175282
* When a statement is dropped from the AST because it was invalid, make sureArgyrios Kyrtzidis2013-02-152-5/+7
| | | | | | | we don't do the scope checks otherwise we are going to hit assertion checks since a label may not have been actually added. llvm-svn: 175281
* Re-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.Daniel Jasper2013-02-151-0/+3
| | | | | | | | | This got lost and was untested as the same effect is achieved by avoiding bin packing, which is active in Google style by default. However, moving forward, we want more control over the bin packing option(s) and thus, this flag should work as expected. llvm-svn: 175277
* Sema: Unnest early exit and remove an unnecessary bad cast.Benjamin Kramer2013-02-151-13/+12
| | | | | | | cast<ObjCObjectPointerType> doesn't look through sugar, getAs does. Fixes PR15257. llvm-svn: 175272
* Abstract out emitting the vdtor calls and do it properly when using -cxx-abi ↵Timur Iskhodzhanov2013-02-154-12/+74
| | | | | | microsoft; also fix vdtor calls for the ARM ABI llvm-svn: 175271
* Make helper functions static.Benjamin Kramer2013-02-154-6/+6
| | | | llvm-svn: 175265
* Prevent only breaking before "?" in conditional expressions.Daniel Jasper2013-02-151-1/+12
| | | | | | | | | | | | | | | This is almost always more readable. Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa; After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 175262
* [analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.Jordan Rose2013-02-151-0/+25
| | | | | | | | | | | | | | | This just adds a very simple check that if a DerivedToBase CastExpr is operating on a value with known C++ object type, and that type is not the base type specified in the AST, then the cast is invalid and we should return UnknownVal. In the future, perhaps we can have a checker that specifies that this is illegal, but we still shouldn't assert even if the user turns that checker off. PR14872 llvm-svn: 175239
* Re-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."Jordan Rose2013-02-152-14/+75
| | | | | | | | | | | | | | ...after a host of optimizations related to the use of LazyCompoundVals (our implementation of aggregate binds). Originally applied in r173951. Reverted in r174069 because it was causing hangs. Re-applied in r174212. Reverted in r174265 because it was /still/ causing hangs. If this needs to be reverted again it will be punted to far in the future. llvm-svn: 175234
* [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
OpenPOWER on IntegriCloud