summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Improve "assignment to cast" diagnostic.Daniel Dunbar2009-04-152-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Strip off extra parens when looking for casts. - Change the location info to point at the cast (instead of the assignment). For example, on int *b; #define a ((void*) b) void f0() { a = 10; } we now emit: /tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported a = 10; ^ ~ /tmp/t.c:2:12: note: instantiated from: #define a ((void*) b) ~^~~~~~~~~~ instead of: /tmp/t.c:4:5: error: expression is not assignable a = 10; ~ ^ llvm-svn: 69114
* PCH support for ParenExprDouglas Gregor2009-04-142-0/+22
| | | | llvm-svn: 69106
* Add PCH support for ImplicitCastExprs. This is the first expressionDouglas Gregor2009-04-142-49/+169
| | | | | | | | | | kind PCH handles that has an expression as an operand, so most of this work is in the infrastructure to rebuild expression trees from the serialized representation. We now store expressions in post-order (e.g., Reverse Polish Notation), so that we can easily rebuild the appropriate expression tree. llvm-svn: 69101
* Strip paren expressions when trying to diagnose "cast as lvalue"Daniel Dunbar2009-04-141-1/+1
| | | | | | extension. llvm-svn: 69100
* Change Lexer::MeasureTokenLength to take a LangOptions reference.Chris Lattner2009-04-149-61/+75
| | | | | | | | | | | | | | | | | | This allows it to accurately measure tokens, so that we get: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~~^ instead of the woefully inferior: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ Most of this is just plumbing to push the reference around. llvm-svn: 69099
* Diagnose properties which have no implementations;Fariborz Jahanian2009-04-141-19/+52
| | | | | | | either unimplemented setter/getter or no implementation directive. llvm-svn: 69098
* Set alignment on __cstring metadata variables to 1 (matchingDaniel Dunbar2009-04-141-15/+10
| | | | | | llvm-gcc). llvm-svn: 69097
* Avoid use of magic \01 prefix when unneeded.Daniel Dunbar2009-04-141-1/+1
| | | | llvm-svn: 69093
* Comment fix.Daniel Dunbar2009-04-141-1/+1
| | | | llvm-svn: 69091
* Make the implicit-int handling error recovery stuff handle C++Chris Lattner2009-04-141-20/+34
| | | | | | | | | | | | | | | | | | | nested name specifiers. Now we emit stuff like: t.cpp:8:13: error: unknown type name 'X' static foo::X P; ~~~~ ^ instead of: t.cpp:8:16: error: invalid token after top level declarator static foo::X P; ^ This is inspired by a really awful error message I got from g++ when I misspelt diag::kind as diag::Kind. llvm-svn: 69086
* Add PCH support for PredefinedExpr and FloatingLiteral expressionsDouglas Gregor2009-04-142-4/+53
| | | | llvm-svn: 69084
* refactor "implicit int error recovery" code out of Chris Lattner2009-04-141-62/+83
| | | | | | | ParseDeclarationSpecifiers into its own function, no functionality change. llvm-svn: 69083
* PCH support for a few very, very simple kinds of expressions. Hook upDouglas Gregor2009-04-142-17/+229
| | | | | | | expression (de-)serialization for VLAs, variable initializers, enum constant initializers, and bitfield widths. llvm-svn: 69075
* Fix a regression in a previous patch that broke implicit Chris Lattner2009-04-141-2/+4
| | | | | | int in a bitfield. Shantonu found this in a gcc testsuite file. llvm-svn: 69074
* Fix <rdar://problem/6252084> [sema] jumps into Obj-C exception blocks should ↵Steve Naroff2009-04-141-12/+13
| | | | | | | | be disallowed. This builds on Eli's work from http://llvm.org/viewvc/llvm-project?view=rev&revision=65678. llvm-svn: 69073
* remove dead enumChris Lattner2009-04-141-1/+0
| | | | llvm-svn: 69070
* Fix PR3988: extern inline functions get strong symbol definitions inChris Lattner2009-04-142-26/+23
| | | | | | | | C99 mode. This is a regression from an earlier patch of mine. This also simplifies the linkage enums a bit. llvm-svn: 69069
* Do not dead code strip global meta-data objects.Fariborz Jahanian2009-04-141-15/+10
| | | | | | This will match gcc's behavior in the arena. llvm-svn: 69061
* Fixup whitespacing.Mike Stump2009-04-143-4/+4
| | | | llvm-svn: 69055
* temporarily revert r69046Chris Lattner2009-04-141-4/+4
| | | | llvm-svn: 69054
* Fix comment.Daniel Dunbar2009-04-141-1/+1
| | | | llvm-svn: 69053
* implement some sema for gnuc_inline attribute. Reject always_inline and ↵Chris Lattner2009-04-141-5/+15
| | | | | | no_inline on objc methods. llvm-svn: 69051
* Support code generation of 'this' exprsAnders Carlsson2009-04-143-0/+20
| | | | llvm-svn: 69050
* Literal value calculation isn't likely to overflow on targets having int as ↵Sanjiv Gupta2009-04-141-4/+4
| | | | | | 32 or less. Fixing the assert as it otherwise triggers for PIC16 which as i16 as int. llvm-svn: 69046
* implement codegen support for __attribute((__gnuc_inline__)),Chris Lattner2009-04-142-38/+47
| | | | | | | | pulling some attribute munging stuff into GetLinkageForFunction. This should fix PR3986 llvm-svn: 69045
* recognize the gnuc_inline attribute.Chris Lattner2009-04-142-0/+18
| | | | llvm-svn: 69044
* When building a PCH file, don't perform end-of-translation-unitDouglas Gregor2009-04-143-6/+24
| | | | | | | | | wrap-up (e.g., turning tentative definitions into definitions). Also, very that, when we actually use the PCH file, we get the ride code generation for tentative definitions and definitions that show up in the PCH file. llvm-svn: 69043
* ASTContext::mergeTypes(): Loosen up the type checking for 'Class' (treating ↵Steve Naroff2009-04-141-5/+5
| | | | | | | | | | | | | | it like 'id'). This fixes <rdar://problem/6782722> XCDataTipsManager.m registers, observes notifications in class methods. The radar above is the result of clang typing 'self' in a class method as 'Class', which results in some spurious warnings (GCC types 'self' in a class method as 'id'). I considered changing the type of 'self' to 'id' (to conform to GCC), however this resulted in *many* test cases breaking. In addition, I really prefer a more strongly typed 'self'. All in all, this is the least obtrusive fix I could find for removing the spurious warnings (though we do loose some valid warnings). llvm-svn: 69041
* Refactor how attributes are set on values.Daniel Dunbar2009-04-142-101/+90
| | | | | | | | | | | | | | | | | | | | | | | | - Pull out SetCommonAttributes, which handles the things common to aliases, methods, functions, and variables. - Pull out SetLLVMFunctionAttributesForDefinition, which handles the LLVM attributes which we only want to apply to a definition (like noinline and alwaysinline). - Kill SetGVDeclarationAttributes (inlined into SetFunctionAttributes and specialized). - Kill SetFunctionAttributesForDefinition (inlined into sole caller). - Inline SetGVDefinitionAttributes into SetMethodAttributes and specialize. - Rename SetGVDefinitionAttributes to SetFunctionDefinitionAttributes. This is supposed to be a no functionality change commit, but I may have made a mistake. llvm-svn: 69036
* Split SetGlobalValueAttributes into definition/declaration halves.Daniel Dunbar2009-04-142-40/+45
| | | | | | - No functionality change. llvm-svn: 69035
* Rename (one) SetFunctionAttributes to SetLLVMFunctionAttributes toDaniel Dunbar2009-04-142-8/+13
| | | | | | | disambiguate it. - No functionality change. llvm-svn: 69034
* Reduce indentation, no functionality change.Daniel Dunbar2009-04-141-12/+13
| | | | llvm-svn: 69033
* defer emission of always_inline, extern_inline, and inline functions (when Chris Lattner2009-04-141-11/+16
| | | | | | not in c89 mode). llvm-svn: 69032
* give always_inline functions internal linkage. If they cannot be Chris Lattner2009-04-141-1/+3
| | | | | | | inlined for some reason, then we don't want a strong or even weak definition. llvm-svn: 69031
* set the linkage of an inline function according to its language rules.Chris Lattner2009-04-141-2/+26
| | | | llvm-svn: 69030
* Add a comment on SetGlobalValueAttributes.Daniel Dunbar2009-04-141-2/+7
| | | | llvm-svn: 69029
* add a new enum type for linkage, no functionality change.Chris Lattner2009-04-142-19/+35
| | | | llvm-svn: 69028
* Clean up handling of visibility.Daniel Dunbar2009-04-143-115/+59
| | | | llvm-svn: 69027
* reduce indentation, no functionality change.Chris Lattner2009-04-141-27/+23
| | | | llvm-svn: 69026
* do not set visibility on "private" or "available externally" linkage objects.Chris Lattner2009-04-141-2/+2
| | | | llvm-svn: 69025
* Offer a fixit hint for our warning about tokens at the end of a directive:Chris Lattner2009-04-141-1/+7
| | | | | | | | | | | | | t.c:3:8: warning: extra tokens at end of #endif directive #endif foo ^ // Don't do this in strict-C89 mode because bcpl comments aren't valid there, and it is too much trouble to analyze whether C block comments are safe. llvm-svn: 69024
* Fix the #import / #include_next "extra tokens at end of #foo directive" Chris Lattner2009-04-142-11/+11
| | | | | | | Warning to properly report that it is an import/include_next instead of claiming it is a #include. llvm-svn: 69023
* Use hasAttr instead of getAttr for conditionals.Mike Stump2009-04-142-2/+2
| | | | llvm-svn: 69021
* Audit __private_extern__ handling.Daniel Dunbar2009-04-147-44/+29
| | | | | | | | | | | | | | - Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. llvm-svn: 69020
* Add VarDecl::getStorageClassSpecifierString (StorageClass -> const char*).Daniel Dunbar2009-04-141-0/+14
| | | | | | - No functionality change. llvm-svn: 69019
* Fixup CodeGen for __weak __block variables. Radar 6756266Mike Stump2009-04-142-4/+6
| | | | llvm-svn: 69010
* Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).Steve Naroff2009-04-141-1/+1
| | | | llvm-svn: 69007
* When writing a PCH file, keep track of all of the non-static,Douglas Gregor2009-04-143-2/+50
| | | | | | | | | non-inline external definitions (and tentative definitions) that are found at the top level. The corresponding declarations are stored in a record in the PCH file, so that they can be provided to the ASTConsumer (via HandleTopLevelDecl) when the PCH file is read. llvm-svn: 69005
* Fix crasher in ASTContext::getObjCEncodingForMethodDecl().Steve Naroff2009-04-141-5/+7
| | | | | | This was exposed as a result of something else that was recently fixed. llvm-svn: 69004
* Partial PCH support for FileScopeAsmDecl and BlockDecl. Both requireDouglas Gregor2009-04-132-1/+52
| | | | | | expression or statement serialization before we can test them. llvm-svn: 69002
OpenPOWER on IntegriCloud