summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous ↵Ted Kremenek2010-07-201-6/+6
| | | | | | enum for scanf checking. llvm-svn: 108898
* Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to matchTed Kremenek2010-07-201-4/+4
| | | | | | | analagous enum in analyze_scanf. This is prep for refactoring the logic for handling ConversionSpecifiers for both scanf and printf. llvm-svn: 108897
* Rename diagnostic so that it can be reused with scanf checking. No ↵Ted Kremenek2010-07-201-1/+1
| | | | | | functionality change. llvm-svn: 108896
* delete a loop that just generates dead code. In an exampleChris Lattner2010-07-201-10/+0
| | | | | | | | | | | | | | | | | | | | like this: void *test(long N) { return new int[N][42][42]; } the loop generates two dead mul instructions: %tmp = load i64* %N.addr ; <i64> [#uses=2] %0 = mul i64 %tmp, 7056 ; <i64> [#uses=1] %1 = mul i64 %tmp, 42 ; <i64> [#uses=1] %2 = mul i64 %1, 42 ; <i64> [#uses=0] %call = call noalias i8* @_Znam(i64 %0) ; <i8*> [#uses=1] The scale of these multiplies is already handled by the typesize stuff. llvm-svn: 108884
* remove the special case for constant array sizes from Chris Lattner2010-07-201-24/+2
| | | | | | | EmitCXXNewAllocSize. This code uses IRBuilder, which does constant folding already. llvm-svn: 108882
* Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach2010-07-201-5/+15
| | | | | | ObjC ABI version 2 this time. llvm-svn: 108847
* Complain when string literals are too long for the active languageDouglas Gregor2010-07-201-0/+14
| | | | | | standard's minimum requirements. llvm-svn: 108837
* Hide FunctionTemplateDecl's specializations folding set as implementation ↵Argyrios Kyrtzidis2010-07-205-30/+37
| | | | | | | | | | | detail and introduce FunctionTemplateDecl::findSpecialization. Redeclarations of specializations will not cause the previous decl to be removed from the set, the set will keep the canonical decl. findSpecialization will return the most recent redeclaration. llvm-svn: 108834
* Whether the specialization should be added to template's folding set when ↵Argyrios Kyrtzidis2010-07-202-11/+5
| | | | | | | | read from PCH, is determined by a isCanonicalDecl check. llvm-svn: 108833
* Hide the specializations folding sets of ClassTemplateDecl as an ↵Argyrios Kyrtzidis2010-07-203-73/+63
| | | | | | | | | | | | | implementation detail (InsertPos leaks though) and add methods to its interface for adding/finding specializations. Simplifies its users a bit and we no longer need to replace specializations in the folding set with their redeclarations. We just return the most recent redeclarations. As a bonus, it fixes http://llvm.org/PR7670. llvm-svn: 108832
* Add -lstdc++ to DragonFly tools.Rafael Espindola2010-07-201-0/+5
| | | | | | Patch by Sascha Wildner. llvm-svn: 108830
* Constify all references to Stmt* and CFGBlock* in libChecker.Zhongxing Xu2010-07-207-174/+182
| | | | llvm-svn: 108811
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-2020-82/+168
| | | | llvm-svn: 108807
* Constify.Zhongxing Xu2010-07-201-12/+15
| | | | llvm-svn: 108804
* remove const_cast.Zhongxing Xu2010-07-201-2/+1
| | | | llvm-svn: 108803
* constify.Zhongxing Xu2010-07-201-2/+2
| | | | llvm-svn: 108801
* Constify.Zhongxing Xu2010-07-203-11/+12
| | | | llvm-svn: 108800
* Correct line info for declarations/definitions. Radar 8063111.Stuart Hastings2010-07-191-0/+1
| | | | llvm-svn: 108785
* Temporarily revert. Some odd internal breakage is likely related.Jim Grosbach2010-07-191-4/+4
| | | | llvm-svn: 108764
* Remove PCHReader::getStream(), it was unused. Inline ↵Sebastian Redl2010-07-191-1/+1
| | | | | | PCHReader::getDelsCursor() into its sole caller and remove it. This reduces the attack surface of multiple PCH files towards code outside the PCH implementation. llvm-svn: 108763
* Promote IdentifierOffsets to per-file data.Sebastian Redl2010-07-191-12/+12
| | | | llvm-svn: 108762
* Promote DeclOffsets and TypeOffsets to per-file data.Sebastian Redl2010-07-191-10/+21
| | | | llvm-svn: 108760
* Patch to type match comparing Objective-C Classes which implement Fariborz Jahanian2010-07-191-1/+31
| | | | | | protocols (Radar 8191774). llvm-svn: 108758
* Don't warn when a '%%' or '%*d' (scanf) is used in a format string with ↵Ted Kremenek2010-07-191-22/+26
| | | | | | | | positional arguments, since these don't actually consume an argument. llvm-svn: 108757
* Introduce a new libclang API, clang_reparseTranslationUnit(), whichDouglas Gregor2010-07-192-76/+133
| | | | | | | | reparses an already-parsed translation unit. At the moment it's just a convenience function, but we hope to use it for performance optimizations. llvm-svn: 108756
* Hook up 'invalid conversion' warning for scanf format strings.Ted Kremenek2010-07-191-23/+59
| | | | llvm-svn: 108750
* Put ObjC method names, method types and class names in separate string literalJim Grosbach2010-07-191-4/+4
| | | | | | sections. rdar://8207705 llvm-svn: 108749
* Promote the identifier table to per-file data. Also, if a CHAINED_METADATA ↵Sebastian Redl2010-07-191-21/+30
| | | | | | record exists, it has to be the first thing in the PCH file. llvm-svn: 108748
* Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes ↵Ted Kremenek2010-07-191-0/+4
| | | | | | <rdar://problem/8204052>. llvm-svn: 108742
* Driver: Make -fnext-runtime the default when rewriting Objective-C.Daniel Dunbar2010-07-191-2/+7
| | | | llvm-svn: 108741
* Driver/Darwin: Add deployment target after doing argument translation, so thatDaniel Dunbar2010-07-192-11/+13
| | | | | | -mmacosx-version-min works inside a -Xarch_ flag. llvm-svn: 108712
* Driver: Factor out Darwin::AddDeploymentTarget.Daniel Dunbar2010-07-192-10/+20
| | | | llvm-svn: 108711
* Remove unused location-to-AST-node resolver. libclang's implementation ↵Douglas Gregor2010-07-192-603/+0
| | | | | | supercedes it llvm-svn: 108708
* Categories cannot synthesize property ivars,Fariborz Jahanian2010-07-191-5/+5
| | | | | | and a minor cleanup. llvm-svn: 108707
* Fix construction of AnalysisContext. Thanks Daniel.Zhongxing Xu2010-07-191-1/+1
| | | | llvm-svn: 108694
* Fix http://llvm.org/PR7660Argyrios Kyrtzidis2010-07-191-1/+2
| | | | | | | A ParmVarDecl instantiated from a FunctionProtoType may have Record as DeclContext, in which case isStaticDataMember() will erroneously return true. llvm-svn: 108692
* tidy up comment.Chris Lattner2010-07-191-2/+1
| | | | llvm-svn: 108676
* remove CallInliner.cpp.Zhongxing Xu2010-07-191-0/+0
| | | | llvm-svn: 108670
* Add double close check to StreamChecker. Patch by Lei Zhang.Zhongxing Xu2010-07-191-4/+87
| | | | llvm-svn: 108669
* Reapply r108617.Zhongxing Xu2010-07-198-75/+73
| | | | llvm-svn: 108668
* Driver: Change the driver to take the path to the main executable, instead ofDaniel Dunbar2010-07-192-8/+7
| | | | | | | | | taking it in pieces. - Fixes a problem where the Clang executable path was not initialized properly on Win32, because sys::Path::getBasename() doesn't do what I always think it does. Imagine that, a sys::Path interface that is confusing! llvm-svn: 108667
* Driver: Fix a possible use after free.Daniel Dunbar2010-07-181-4/+4
| | | | llvm-svn: 108659
* Fix a goof in my previous patch -- not all of the builtins return a value, someChandler Carruth2010-07-181-1/+7
| | | | | | fixed return types. llvm-svn: 108657
* Fix mangling for static member variables of classes inside an extern "C"Eli Friedman2010-07-181-0/+4
| | | | | | | linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. llvm-svn: 108656
* When instantiating function definitions set parameter names to those used in ↵Peter Collingbourne2010-07-181-4/+8
| | | | | | | | | | | | | | template The rationale is that we are copying the entire definition including parameter names which may differ between the declaration and the definition. This is particularly important if any parameters are unnamed in the declaration, as a DeclRef to an unnamed ParmVarDecl would cause the pretty printer to produce invalid output. llvm-svn: 108643
* Improve the representation of the atomic builtins in a few ways. First, we makeChandler Carruth2010-07-182-64/+93
| | | | | | | | | | | | | | | their call expressions synthetically have the "deduced" types based on their first argument. We only insert conversions in the AST for arguments whose values require conversion to match the value type expected. This keeps PR7600 closed by maintaining the return type, but avoids assertions due to unexpected implicit casts making the type unsigned (test case added from Daniel). The magic is moved into the codegen for the atomic builtin which inserts the casts as needed at the IR level to raise the type to an integer suitable for the LLVM intrinsic. This shouldn't cause any real change in functionality, but now we can make the builtin be more truly polymorphic. llvm-svn: 108638
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-1812-12/+0
| | | | llvm-svn: 108633
* Fix crash initializing a bit-field with a non-constant in a place where weEli Friedman2010-07-171-4/+3
| | | | | | try to evaluate the initializer as a constant. llvm-svn: 108632
* Check for casts to an incomplete type in C. Improves diagnostics for cast toEli Friedman2010-07-171-0/+4
| | | | | | | incomplete union (PR5692) and incomplete enum, and fixes obscure accepts-invalid on cast to incomplete struct. llvm-svn: 108630
* Added PCH/ASTImporter code for ObjCIvarDecl's field.Fariborz Jahanian2010-07-173-1/+4
| | | | llvm-svn: 108627
OpenPOWER on IntegriCloud