summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Alter the internal representation of the condition variable inDouglas Gregor2010-06-214-39/+178
| | | | | | | | | | | | | | | | if/while/switch/for statements to ensure that walking the children of these statements actually works. Previously, we stored the condition variable as a VarDecl. However, StmtIterator isn't able to walk from a VarDecl to a set of statements, and would (in some circumstances) walk beyond the end of the list of statements, cause Bad Behavior. In this change, we've gone back to representing the condition variables as DeclStmts. While not as memory-efficient as VarDecls, it greatly simplifies iteration over the children. Fixes the remainder of <rdar://problem/8104754>. llvm-svn: 106504
* Avoid using a local static for providing lexicalFariborz Jahanian2010-06-211-3/+1
| | | | | | order of priorotized global object initializations. llvm-svn: 106503
* Zero out a stale pointerDouglas Gregor2010-06-211-0/+1
| | | | llvm-svn: 106497
* When semantic analysis fail to introduce a class or class template,Douglas Gregor2010-06-211-30/+35
| | | | | | | | just skip over the body of the class or class template: it's a semantic disaster that's likely to cause invariants to break. Fixes part of <rdar://problem/8104754>. llvm-svn: 106496
* In fragile-abi (32bit mode abi) generate global symbolFariborz Jahanian2010-06-211-1/+11
| | | | | | | objc_category_name_xxx for each category implementation. (fixes PR7431) patch by Nico Weber. llvm-svn: 106492
* In supporting init-priority, globals with the same init_priority must beFariborz Jahanian2010-06-212-3/+31
| | | | | | emitted in the order in which they are seen (still radar 8076356). llvm-svn: 106485
* Bug 7377: printf checking fails to flag some undefined behavior Tom Care2010-06-212-30/+34
| | | | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=7377 Updated format string highlighting and fixits to take advantage of the new CharSourceRange class. - Change HighlightRange to allow highlighting whitespace only in a CharSourceRange (for warnings about the ' ' (space) flag) - Change format specifier range helper function to allow for half-open ranges (+1 to end) - Enabled previously failing tests (FIXMEs/XFAILs removed) - Small fixes and additions to format string test cases M test/Sema/format-strings.c M test/Sema/format-strings-fixit.c M lib/Frontend/TextDiagnosticPrinter.cpp M lib/Sema/SemaChecking.cpp llvm-svn: 106480
* Fix an Obj-C++ miscompile when calling an Obj-C method that returns a C++ ↵Anders Carlsson2010-06-213-5/+20
| | | | | | reference. llvm-svn: 106477
* When folding additive operations, convert the values to the same type. When ↵Jordy Rose2010-06-212-26/+44
| | | | | | assuming relationships, convert the integers to the same type as the symbol, at least for now. llvm-svn: 106458
* If a nonnull argument evaluates to UnknownVal, don't warn (and don't crash).Jordy Rose2010-06-211-2/+7
| | | | llvm-svn: 106456
* Use more efficient API of SmallVector/array_pod_sortFariborz Jahanian2010-06-211-3/+3
| | | | | | for sorting (radar 8076356). llvm-svn: 106453
* IRGen for implementation of init-priority attribute.Fariborz Jahanian2010-06-213-6/+31
| | | | | | | Test case will be checked in llvm test suite. (finishes off radar 8076356). llvm-svn: 106441
* Instantiations subject to an explicit template instantiationDouglas Gregor2010-06-211-7/+32
| | | | | | | declaration have default visibility even under -fvisibility=hidden. Fixes <rdar://problem/8109763>. llvm-svn: 106440
* Fixes a corner case bug whereby declaring and defining an extern variable in a Fariborz Jahanian2010-06-212-1/+13
| | | | | | | particular sequence causes its definition to not be generated in the object file. (fixes radar 8071804). llvm-svn: 106424
* Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in ↵Argyrios Kyrtzidis2010-06-212-31/+21
| | | | | | FunctionTemplateDecl. llvm-svn: 106412
* Implement remaining codegen for NEON, all operations should now work.Nate Begeman2010-06-201-41/+173
| | | | llvm-svn: 106407
* Support PCH emitting/reading of using declarations.Argyrios Kyrtzidis2010-06-202-8/+8
| | | | llvm-svn: 106404
* Add braces to avoid an ambiguous else, fixing a GCC warning.Benjamin Kramer2010-06-201-3/+3
| | | | llvm-svn: 106403
* Adds analyzer support for idempotent and tautological binary operations such ↵Jordy Rose2010-06-201-9/+108
| | | | | | as "a*0" and "a+0". This is not very powerful, but does make the analyzer look a little smarter than it actually is. llvm-svn: 106402
* Casting to void* or any other pointer-to-sizeless type (e.g. function ↵Jordy Rose2010-06-201-0/+5
| | | | | | pointers) causes a divide-by-zero error. Simple fix: check if the pointee type size is 0 and bail out early if it is. llvm-svn: 106401
* Cure for Doug's insomnia.Argyrios Kyrtzidis2010-06-191-3/+3
| | | | llvm-svn: 106394
* Include a hack to allow loading of templated CXXRecordDecls and test ↵Argyrios Kyrtzidis2010-06-192-1/+14
| | | | | | template reading from PCH. llvm-svn: 106393
* Initial support for reading templates from PCH.Argyrios Kyrtzidis2010-06-193-21/+204
| | | | llvm-svn: 106392
* Initial support for writing templates to PCH.Argyrios Kyrtzidis2010-06-195-22/+193
| | | | llvm-svn: 106391
* More AltiVec support.Anton Korobeynikov2010-06-192-441/+4923
| | | | | | Patch by Anton Yartsev! llvm-svn: 106387
* Fix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it lessEli Friedman2010-06-191-59/+45
| | | | | | conservative for static variables in templated classes. llvm-svn: 106385
* Fix PR7097, a bad interaction between -fno-use-cxa-atexit andChris Lattner2010-06-193-10/+7
| | | | | | -mconstructor-aliases by using a WeakVH instead of a raw pointer. llvm-svn: 106384
* More Sema Check and a test case for init_priority attr.Fariborz Jahanian2010-06-181-0/+15
| | | | | | (radar 8076356). llvm-svn: 106350
* Fold additive constants, and support comparsions of the form $sym+const1 <> ↵Jordy Rose2010-06-185-271/+462
| | | | | | const2 llvm-svn: 106339
* introduce a new CharSourceRange class, and enhance the diagnostics routinesChris Lattner2010-06-184-22/+40
| | | | | | | | | | | | | | | to use them instead of SourceRange. CharSourceRange is just a SourceRange plus a bool that indicates whether the range has the end character resolved or whether the end location is the start of the end token. While most of the compiler wants to think of ranges that have ends that are the start of the end token, the printf diagnostic stuff wants to highlight ranges within tokens. This is transparent to the diagnostic stuff. To start taking advantage of the new capabilities, you can do something like this: Diag(..) << CharSourceRange::getCharRange(Begin,End) llvm-svn: 106338
* A trivial fix for a test case that's too horrible to commit. FixesDouglas Gregor2010-06-181-0/+3
| | | | | | <rdar://problem/8108088>. llvm-svn: 106328
* Implements Sema part of init_priority(priority) attributeFariborz Jahanian2010-06-183-0/+41
| | | | | | (radar 8076356) - wip. llvm-svn: 106322
* Don't complain about missing field initializers when the initializerDouglas Gregor2010-06-181-1/+1
| | | | | | list is completely empty, from Lasse Kärkkäinen! Fixes PR7413. llvm-svn: 106320
* Merge the "regparm" attribute from a previous declaration of aDouglas Gregor2010-06-181-2/+16
| | | | | | function to redeclarations of that function. Fixes PR7025. llvm-svn: 106317
* Mangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.Charles Davis2010-06-181-0/+63
| | | | | | | Also, test that static members with default visibility in a struct have the right mangling. llvm-svn: 106276
* Printf format strings: Added some more tests and fixed some minor bugs.Tom Care2010-06-181-3/+4
| | | | | | | | | | | | | | - Precision toStrings shouldn't print a dot when they have no value. - Length of char length modifier is now returned correctly. - Added several fixit tests. Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now. M test/Sema/format-strings-fixit.c M include/clang/Analysis/Analyses/PrintfFormatString.h M lib/Analysis/PrintfFormatString.cpp llvm-svn: 106275
* Add null stream check for more APIs.Zhongxing Xu2010-06-181-16/+70
| | | | llvm-svn: 106274
* Change two static variables into instance variables of ASTContext. This ↵Ted Kremenek2010-06-181-3/+2
| | | | | | | | allows us to have multiple copies of ASTContext at the same time. llvm-svn: 106258
* Given Decl::isUsed() a flag indicating when to consider the "used"Douglas Gregor2010-06-176-16/+19
| | | | | | | | | attribute as part of the calculation. Sema::MarkDeclReferenced(), and a few other places, want only to consider the "used" bit to determine, e.g, whether to perform template instantiation. Fixes a linkage issue with Boost.Serialization. llvm-svn: 106252
* objective-C++ IRGen: property reference as an Fariborz Jahanian2010-06-171-1/+9
| | | | | | | | lvalue when performing a derived-to-base conversion. Fixes radar 7501812. Added an executable test to llvm-test suite. llvm-svn: 106247
* Bug 7394 - Fixed toString representation of Precisions in format strings.Tom Care2010-06-171-0/+3
| | | | | | | M include/clang/Analysis/Analyses/PrintfFormatString.h M lib/Analysis/PrintfFormatString.cpp llvm-svn: 106245
* Do not treat @selector as lvalue (unlike g++).Fariborz Jahanian2010-06-172-1/+2
| | | | | | Patch by Nico Weber (pr7390). llvm-svn: 106242
* Objective-c++ IRGen. Support for @selector expression asFariborz Jahanian2010-06-176-13/+36
| | | | | | an lvalue. Fixes PR7390. llvm-svn: 106235
* Bug 7377: Fixed several bad printf format string bugs.Tom Care2010-06-172-45/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added warning for undefined behavior when using field specifier - Added warning for undefined behavior when using length modifier - Fixed warnings for invalid flags - Added warning for ignored flags - Added fixits for the above warnings - Fixed accuracy of detecting several undefined behavior conditions - Receive normal warnings in addition to security warnings when using %n - Fix bug where '+' flag would remain on unsigned conversion suggestions Summary of changes: - Added expanded tests - Added/expanded warnings - Added position info to OptionalAmounts for fixits - Extracted optional flags to a wrapper class with position info for fixits - Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior - Fixed conversion specifier checking to conform to C99 standard - Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly. M test/Sema/format-strings.c M include/clang/Basic/DiagnosticSemaKinds.td M include/clang/Analysis/Analyses/PrintfFormatString.h M lib/Analysis/PrintfFormatString.cpp M lib/Sema/SemaChecking.cpp llvm-svn: 106233
* When pushing a copy of the TypeLoc information for a dependentDouglas Gregor2010-06-171-1/+2
| | | | | | | template specialization type, copy the location information but use the new type. Fixes PR7385. llvm-svn: 106224
* Use UnaryOperator as the representation of dependent expressions whenDouglas Gregor2010-06-171-0/+6
| | | | | | | no overloaded operators were found in scope, mirroring what we already do for BinaryOperator. llvm-svn: 106222
* Update CMake build system for ARM NEON generation.Douglas Gregor2010-06-174-6/+7
| | | | llvm-svn: 106220
* fix some more gcc3.4 constness warningsGabor Greif2010-06-171-1/+2
| | | | llvm-svn: 106216
* Make sure the caching mechanism in Parser::ParseLexedMethodDefs is robust ↵Argyrios Kyrtzidis2010-06-171-4/+16
| | | | | | against the parser reading too few tokens. llvm-svn: 106214
* Make sure parens/braces/brackets are correctly balanced.Argyrios Kyrtzidis2010-06-174-1/+33
| | | | | | | | | | | In a line like: (; the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren). This may affect later parsing and result in bad recovery for parsing errors. llvm-svn: 106213
OpenPOWER on IntegriCloud