summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* fix Bug 12924Seth Cantrell2012-05-241-0/+16
| | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=12924 This issue was that the source location was pointing to a non-printable character and so CaretEnd was pointing one _column_ past the caret but not one _character_ past the caret. So the conversion between column and byte locations wasn't working (because the conversion is only valid from the first column or byte of a character). llvm-svn: 157372
* DR1152 / PR12931 / PR6177: A candidate function which requires binding a constRichard Smith2012-05-241-1/+1
| | | | | | | | volatile reference to a temporary is not viable. My interpretation is that DR1152 was a bugfix, not a rule change for C++11, so this is not conditional on the language mode. This matches g++'s behavior. llvm-svn: 157370
* Add a warning to diagnose statements in C++ like "*(volatile int*)x;". ↵Eli Friedman2012-05-243-52/+83
| | | | | | Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>. llvm-svn: 157362
* implement Sema support for the alloc_size attributeNuno Lopes2012-05-241-0/+76
| | | | | | | | Portions of this patch by Xi Wang. Reviewed by Jordy Rose. Thank you both. Codegen support will follow soon. llvm-svn: 157360
* modern objc translation: Add translation of @autoreleasepoolFariborz Jahanian2012-05-231-0/+25
| | | | | | statement. // rdar://11474836. llvm-svn: 157359
* Tooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be ↵NAKAMURA Takumi2012-05-232-4/+12
| | | | | | | | used here. It fixes test/Tooling on Win32 hosts. llvm-svn: 157350
* [arcmt] Remove an unused -autorelease, without failing with error, for thisArgyrios Kyrtzidis2012-05-234-18/+129
| | | | | | | | | | | idiom that is used commonly in setters: [backingValue autorelease]; backingValue = [newValue retain]; // in general a +1 assign rdar://9914061 llvm-svn: 157347
* [driver] Have the crash diagnostics print the clang version information.Chad Rosier2012-05-231-0/+3
| | | | | | rdar://11518308 llvm-svn: 157346
* Adds the Refactoring library, which is a layer on top of the Tooling libraryManuel Klimek2012-05-232-1/+180
| | | | | | that allows easy refactoring across translation units. llvm-svn: 157331
* Correct the starting location for instantiations of field declarations whichRichard Smith2012-05-231-1/+1
| | | | | | | | | | | | | start with a cv-qualifier. DeclaratorDecl::getTypeSpecStartLoc() does not produce the location of the first type-specifier (the cv-qualifier) in this case, because we don't track source locations for cv-qualifiers. No test here: I've not found a way to test this with a lit-style test, and introducing a gtest test for this seems unwarranted. Suggestions welcome! Patch by Daniel Jasper! llvm-svn: 157311
* If the first argument of __builtin_object_size can be folded to a constantRichard Smith2012-05-232-4/+17
| | | | | | | | pointer, but such folding encounters side-effects, ignore the side-effects rather than performing them at runtime: CodeGen generates wrong code for __builtin_object_size in that case. llvm-svn: 157310
* Emit C++11 enum class information if it exists.Eric Christopher2012-05-231-1/+4
| | | | | | Part of rdar://11496790 llvm-svn: 157304
* Recognize the MS inheritance attributes and turn them into attributesJohn McCall2012-05-224-5/+71
| | | | | | | | | on the RecordDecl. Persist the MS portability type attributes and ignore them in Sema rather than the parser. Patch by João Matos! llvm-svn: 157288
* wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes2012-05-224-9/+20
| | | | llvm-svn: 157262
* Adds a method overwriteChangedFiles to the Rewriter. This is implemented byManuel Klimek2012-05-221-1/+69
| | | | | | | | | first writing the changed files to a temporary location and then overwriting the original files atomically. Also adds a RewriterTestContext to aid unit testing rewrting logic in general. llvm-svn: 157260
* revert the usage of the objectsize intrinsic with 3 parameters (to match ↵Nuno Lopes2012-05-222-6/+2
| | | | | | LLVM r157255) llvm-svn: 157256
* [objcmt] Don't add redundant parentheses when migrating subscripting of an ivar.Argyrios Kyrtzidis2012-05-221-0/+2
| | | | | | rdar://11501256 llvm-svn: 157227
* objective-c: provide a useful 'fixit' suggestion whenFariborz Jahanian2012-05-211-1/+5
| | | | | | | errornously using commas to separate ObjC message arguments. // rdar://11376372 llvm-svn: 157216
* Revert r115805. An array type is required to have a range type,Eric Christopher2012-05-211-18/+14
| | | | | | | | | | however, the range can be unknown for the upper bound. Testcase to follow. Part of rdar://11457152 llvm-svn: 157212
* [analyzer] Bind UnknownVal to InitListExpr for unsupported typesAnna Zaks2012-05-211-2/+4
| | | | | | (ex: float). llvm-svn: 157211
* Function template version of the previous patch.Rafael Espindola2012-05-211-4/+5
| | | | llvm-svn: 157207
* Produce a hidden symbol for zed inRafael Espindola2012-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct HIDDEN foo { }; template <class P> struct bar { }; template <> struct HIDDEN bar<foo> { DEFAULT static void zed(); }; void bar<foo>::zed() { } Before we would produce a hidden symbol in struct HIDDEN foo { }; template <class P> struct bar { }; template <> struct bar<foo> { DEFAULT static void zed(); }; void bar<foo>::zed() { } But adding HIDDEN to the specialization would cause us to produce a default symbol. llvm-svn: 157206
* [driver] When creating the compiler invocation out of command-lineArgyrios Kyrtzidis2012-05-214-16/+18
| | | | | | | | arguments, force use of clang frontend for the driver. Fixes rdar://11356765. llvm-svn: 157205
* Analyzer: Fix PR12905, a crash when encountering a call to a function named "C".Benjamin Kramer2012-05-211-10/+9
| | | | | | While there clean up indentation. llvm-svn: 157204
* [arcmt] Revert r156999 "Remove the "it is not safe to remove an unused ↵Argyrios Kyrtzidis2012-05-211-0/+11
| | | | | | | | | | 'autorelease' message" ARC migration error". Per feedback from John this is useful to have in general. llvm-svn: 157198
* Remove unused argument in my last patch.Fariborz Jahanian2012-05-211-3/+2
| | | | llvm-svn: 157194
* objective-c: When default synthesizing readonly IBOutlet propertiesFariborz Jahanian2012-05-211-54/+42
| | | | | | provide a 'fixit' to change 'readonly' to 'readwrite'. // rdar://11448209 llvm-svn: 157193
* Teach Clang about the NVPTX backend.Peter Collingbourne2012-05-202-0/+100
| | | | llvm-svn: 157173
* Tell the driver that CUDA is a C++-like language, so that we get C++Peter Collingbourne2012-05-201-0/+1
| | | | | | header searches with CUDA. llvm-svn: 157172
* CUDA: add CodeGen support for global variable address spaces.Peter Collingbourne2012-05-204-6/+39
| | | | | | | | | Because in CUDA types do not have associated address spaces, globals are declared in their "native" address space, and accessed by bitcasting the pointer to address space 0. This relies on address space 0 being a unified address space. llvm-svn: 157167
* Bitpack CodeCompletionResults.Benjamin Kramer2012-05-201-7/+1
| | | | llvm-svn: 157158
* Error when using typeid() with -fno-rtti. PR 12888.Nico Weber2012-05-201-0/+4
| | | | llvm-svn: 157139
* Zap a bogus assert for delegating constructors. PR12890, part 2.Eli Friedman2012-05-201-1/+0
| | | | | | I'm pretty sure we are in fact doing the right thing here, but someone who knows the standard better should double-check that we are in fact supposed to zero out the member in the given testcase. llvm-svn: 157138
* Make delegating initializers use a similar codepath to base initializers in ↵Eli Friedman2012-05-191-0/+10
| | | | | | dependent contexts. PR12890. llvm-svn: 157136
* objective-c: Warn if default synthesizing readonly IBOutlet propertiesFariborz Jahanian2012-05-191-0/+67
| | | | | | | and provide a 'fixit' to change 'readonly' to 'readwrite'. 'fixit' part needs little more work. // rdar://11448209 llvm-svn: 157121
* Use RecordDecl::field_iterator because D1, D2 are RecordDecls. No ↵Dmitri Gribenko2012-05-191-2/+2
| | | | | | functional change. llvm-svn: 157119
* Apparently empty names are allowed here.Benjamin Kramer2012-05-192-4/+6
| | | | llvm-svn: 157117
* Simplify some users of DeclarationName::getNameKind. Fold ↵Benjamin Kramer2012-05-193-8/+7
| | | | | | getFETokenInfoAsVoid into its only caller. llvm-svn: 157116
* Inline a trivial clear() method.Benjamin Kramer2012-05-191-7/+0
| | | | llvm-svn: 157114
* Update API usage for llvm DIBuilder changes for rvalue referenceEric Christopher2012-05-191-4/+6
| | | | | | | | types and ensure we are actually creating the type. rdar://11479676 llvm-svn: 157095
* [analyzer] For locations, use isGLValue() instead of isLValue().Anna Zaks2012-05-194-15/+15
| | | | llvm-svn: 157088
* Suggest adding 'typename' when it would make the compilerKaelyn Uhrain2012-05-181-0/+39
| | | | | | accept the template argument expression as a type. llvm-svn: 157085
* [analyzer] Fix a c++11 crash: xvalues can be locations (VisitMemberExpr)Anna Zaks2012-05-181-1/+1
| | | | llvm-svn: 157082
* [analyzer] Malloc checker: remove unnecessary comparisons.Anna Zaks2012-05-181-16/+10
| | | | llvm-svn: 157081
* Lexer::ReadToEndOfLine: Only build the string if it's actually used and do ↵Benjamin Kramer2012-05-182-13/+12
| | | | | | so in a less malloc-intensive way. llvm-svn: 157064
* Centralize the handling of the "attribute declaration must precede definition"Rafael Espindola2012-05-181-23/+21
| | | | | | | warning. This also makes us warn on tags, which, ironically, is the only case gcc warns on. llvm-svn: 157039
* [analyzer]Malloc: refactor and report use after free by memoryAnna Zaks2012-05-181-10/+57
| | | | | | allocating functions. llvm-svn: 157037
* A selector match between two Objective-C methods does *not* guaranteeDouglas Gregor2012-05-172-15/+21
| | | | | | | | that the methods have the same number of parameters, although we certainly assumed this in many places. Objective-C can be insane sometimes. Fixes <rdar://problem/11460990>. llvm-svn: 157025
* In the override search for Objective-C methods, protect against ASTs that ↵Douglas Gregor2012-05-171-5/+8
| | | | | | have NULL interfaces behind a category, which can happen in invalid code. Fixes <rdar://problem/11478173>, a recent regression llvm-svn: 157021
* [arcmt] Remove the "it is not safe to remove an unused 'autorelease' ↵Argyrios Kyrtzidis2012-05-171-11/+0
| | | | | | | | | | | | | | message" ARC migration error. This is more trouble that it is worth; autoreleasing a value without holding on it is a valid use-case, we should not "punish" correct code for the minority of broken/fragile programs that depend on the behavior of -autorelease. rdar://9914061 llvm-svn: 156999
OpenPOWER on IntegriCloud