summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.Jordy Rose2011-07-151-1/+4
| | | | llvm-svn: 135294
* Fix typoJoerg Sonnenberger2011-07-151-1/+1
| | | | llvm-svn: 135285
* Use the new APFloat::convertToInt(APSInt) function to simplify uses ofJeffrey Yasskin2011-07-152-11/+8
| | | | | | convertToInt(integerParts*) and make them more reliable. llvm-svn: 135279
* Store bracket locations for array subscript expressions, from Erik Verbruggen!Douglas Gregor2011-07-152-8/+26
| | | | llvm-svn: 135275
* When creating a property in a class extension, make sure to check itsDouglas Gregor2011-07-151-0/+1
| | | | | | attributes. Fixes <rdar://problem/9561076>. llvm-svn: 135273
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-1511-66/+69
| | | | llvm-svn: 135265
* Restore the C-style cast hack for enum template arguments,John McCall2011-07-151-1/+10
| | | | | | | | which is required given the current setup for template argument deduction substitution validation, and add a test case to make sure we don't break it in the future. llvm-svn: 135262
* Move the Serialization library from 'instantiation' to 'expansion', withChandler Carruth2011-07-152-14/+14
| | | | | | the exception of its uses of SourceManager and SourceLocation APIs. llvm-svn: 135260
* Add serialization support for SubstNonTypeTemplateParmExpr.John McCall2011-07-152-285/+135
| | | | | | | | | | Also add the missing serialization support for SEHTryStmt, SEHFinallyStmt, and SEHExceptStmt, and fix and finish the serialization support for AsTypeExpr. In addition, change the code so that it will no longer link if a Stmt subclass is missing serialization support. llvm-svn: 135258
* Fix the definition of AsTypeExpr. I'm still not sure thisJohn McCall2011-07-151-1/+1
| | | | | | | | | | is right --- shouldn't there be a TypeLoc in here somewhere? --- but at least it doesn't have a redundant QualType and a broken children() method. Noticed this while doing things in serialization. llvm-svn: 135257
* protect some calls to ConvertType when a function info is under constructionChris Lattner2011-07-151-3/+3
| | | | | | | to prevent recursive compilation problems. This fixes a failure of CodeGen/decl.c on x86-32 targets that don't fill in the coerce-to type. llvm-svn: 135256
* Clean up UnixAPIChecker, including switching its array of BugTypes to ↵Jordy Rose2011-07-151-70/+40
| | | | | | llvm::OwningPtr<BugType> vars (the new convention). No functionality change. llvm-svn: 135255
* Clean up MacOSXAPIChecker, including switching its array of BugTypes to a ↵Jordy Rose2011-07-151-53/+26
| | | | | | single llvm::OwningPtr<BugType> (the new convention). No functionality change. llvm-svn: 135250
* Enhance the IR type lowering code to be much smarter about recursively loweringChris Lattner2011-07-153-68/+172
| | | | | | | | | | | | | | | | | | | | | | | | | types. Fore xample, we used to lower: struct bar { int a; }; struct foo { void (*FP)(struct bar); } G; to: %struct.foo = type { {}* } since the function pointer would cause recursive translation of bar and we didn't know if that would get us into trouble. We are now smart enough to know that it is fine, so we get this type instead: %struct.foo = type { void (i32)* } Codegen still needs to be prepared for uncooperative types at any place, which is why I let the maximally uncooperative code sit around for awhile to help shake out the bugs. llvm-svn: 135244
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-1514-86/+128
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Switch a comment in Rewrite from 'instantiation' to 'expansion'.Chandler Carruth2011-07-151-1/+1
| | | | llvm-svn: 135226
* Switch comments and assert text in AST from 'instantiation' toChandler Carruth2011-07-151-3/+3
| | | | | | 'expansion'. llvm-svn: 135224
* Switch comments about 'macro instantiation' to 'macro expansion' inChandler Carruth2011-07-151-2/+2
| | | | | | ARCMigrate. llvm-svn: 135223
* Remove warnings of constant operands of logical operators from template ↵Richard Trieu2011-07-151-2/+2
| | | | | | | | | | | | | | instantiations. Upon instantiation of template, value-dependent parameters are replaced by equivalent literals, so code like: template<unsigned int A, unsigned int B> struct S { int foo() { int x = A && B; } } will not warn on A && B on every instantiation. This will still warn on other cases inside templates, which will be caught on checking the template definition. llvm-svn: 135222
* Fix false negative reported in PR 10358 by using 'Unknown' in ↵Ted Kremenek2011-07-141-4/+6
| | | | | | -Wuninitialized to avoid cascading warnings. Patch by Kaelyn Uhrain. llvm-svn: 135217
* [arcmt] Don't remove retains/releases on a global variable, flag them with ↵Argyrios Kyrtzidis2011-07-144-11/+22
| | | | | | errors. rdar://9402555. llvm-svn: 135213
* Revert 135177 to fix PR10363.Rafael Espindola2011-07-141-225/+80
| | | | | | | | Revert "For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either." This reverts commit ac420c5053d6aa41d59f782caad9e46e5baaf2c2. llvm-svn: 135210
* [arcmt] Allow -retain of an __unsafe_unretained receiver if the result gets ↵Argyrios Kyrtzidis2011-07-141-1/+2
| | | | | | | | used. Keep the error if the result is unused. rdar://9552694. llvm-svn: 135209
* Teach -Wconversion, -Wsign-compare etc. about division and remainder.John McCall2011-07-141-4/+44
| | | | llvm-svn: 135208
* PR10359: Template declarations which define classes are not permitted to ↵Richard Smith2011-07-141-0/+5
| | | | | | | | | | | | also contain declarators. Previously we would accept code like this: template<typename T> struct S { } f() { return 0; } This case now produces a missing ';' diagnostic, since that seems like a much more likely error than an attempt to declare a function or variable in addition to the class template. Treat this llvm-svn: 135195
* [arcmt] Emit an error for unused -autorelease messages.Argyrios Kyrtzidis2011-07-141-2/+14
| | | | | | | | | | | An unused autorelease is badness. If we remove it the receiver will likely die immediately while previously it was kept alive by the autorelease pool. This is bad practice in general, so leave it and emit an error to force the user to restructure his code. rdar://9599884 llvm-svn: 135193
* For C++11, do more checking of initializer lists up-front, enabling some ↵Sebastian Redl2011-07-141-80/+225
| | | | | | | | | | subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either. This is a first baby step towards supporting generalized initializer lists. This also removes an aggregate test case that was just plain wrong, assuming that non-aggregates couldn't be initialized with initializer lists in C++11 mode. llvm-svn: 135177
* Remove InitializationSequence::ReferenceBinding, the last redundant sequence ↵Sebastian Redl2011-07-141-9/+7
| | | | | | kind. llvm-svn: 135175
* simplifyChris Lattner2011-07-141-1/+1
| | | | llvm-svn: 135170
* StringMap::first() is about to start returning a StringRef, adapt.Chris Lattner2011-07-142-3/+4
| | | | llvm-svn: 135166
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-147-113/+105
| | | | | | function in LLVM does. llvm-svn: 135155
* Revert r135147 and r135075. The consensus was that this wasn't the right ↵Ted Kremenek2011-07-141-14/+12
| | | | | | thing to do. llvm-svn: 135152
* Update the remaining comments in Frontend to 'expansion'.Chandler Carruth2011-07-141-2/+2
| | | | llvm-svn: 135150
* Add extra sanity checking in FormatString::matchesType() that we are ↵Ted Kremenek2011-07-141-3/+6
| | | | | | comparing integers to integers. This happens not to be an issue now, but the extra check helps future proof in case of future refactorings. llvm-svn: 135147
* NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2011-07-142-8/+8
| | | | | | | | | | | | | | | | This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
* Move the rest of the preprocessor terminology from 'instantiate' andChandler Carruth2011-07-146-36/+35
| | | | | | | | | | | | | variants to 'expand'. This changed a couple of public APIs, including one public type "MacroInstantiation" which is now "MacroExpansion". The rest of the codebase was updated to reflect this, especially the libclang code. Two of the C++ (and thus easily changed) libclang APIs were updated as well because they pertained directly to the old MacroInstantiation class. No functionality changed. llvm-svn: 135139
* Convert terminology in the Lexer from 'instantiate' and variants toChandler Carruth2011-07-144-30/+31
| | | | | | | | | 'expand'. Also update the public API it provides to the new term, and propagate that update to the various clients. No functionality changed. llvm-svn: 135138
* Switch the TokenLexer's terminology from various forms of 'instantiate'Chandler Carruth2011-07-141-21/+21
| | | | | | | | | to 'expand' for macros. Only comments and uses local to the TokenLexer are updated. No functionality changed. llvm-svn: 135137
* Switch all local code and comments from '[Ii]nstantiat(ion|ed)' toChandler Carruth2011-07-141-14/+14
| | | | | | | | '[Ee]xpan(sion|ded)' in the TextDiagnosticPrinter. No functionality changed. llvm-svn: 135136
* Switch the diagnostic messages about macros to use the terms 'expanded'Chandler Carruth2011-07-141-2/+2
| | | | | | | | | and 'expansions' rather than 'instantiated' and 'contexts'. This is the first of several patches migrating Clang's terminology surrounding macros from 'instantiation' to 'expansion'. llvm-svn: 135135
* Reapply r135075, but modify format-strings.c and format-strings-fixit.c test ↵Ted Kremenek2011-07-141-10/+9
| | | | | | cases to be more portable with an explicit target triple. llvm-svn: 135134
* Revert r135075, "format string checking: long and int have the same widths ↵NAKAMURA Takumi2011-07-141-9/+10
| | | | | | | | on 32-bit, so we shouldn't warn about using" It fails on freebsd, mingw and msvc10. llvm-svn: 135129
* Add a hackaround to avoid the crash in PR10355. However, our recoveryDouglas Gregor2011-07-141-2/+4
| | | | | | | is still terrible here because typo correction is not behaving well in the presence of overloaded functions. llvm-svn: 135128
* [arcmt] Make sure migrating to ARC works even if '-fobjc-arc' is included in ↵Argyrios Kyrtzidis2011-07-141-1/+9
| | | | | | command-line flags. rdar://9567824 llvm-svn: 135115
* PR8800: When building a conversion to A& using a member operatorA&(), do not ↵Richard Smith2011-07-131-4/+4
| | | | | | require A to be a complete type. llvm-svn: 135101
* Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite ↵Bruno Cardoso Lopes2011-07-131-2/+10
| | | | | | failures. llvm-svn: 135091
* Add 'mutable' to the function declarator chunk, to be used whenDouglas Gregor2011-07-135-0/+6
| | | | | | parsing lambda expressions, from John Freeman! llvm-svn: 135090
* Fix an incorrect namespace typo-correction diagnostic, from KaelynDouglas Gregor2011-07-131-3/+0
| | | | | | Uhrain! Fixes PR10318. llvm-svn: 135086
* Emit debug info for extended vectors.Devang Patel2011-07-131-3/+0
| | | | llvm-svn: 135083
* format string checking: long and int have the same widths on 32-bit, so we ↵Ted Kremenek2011-07-131-10/+9
| | | | | | | | shouldn't warn about using an "int" format specifier with a "long" type in 32-bit. llvm-svn: 135075
OpenPOWER on IntegriCloud