summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* privatize all of the string literal memory allocation/creationChris Lattner2009-02-184-61/+31
| | | | | | stuff behind a private static function. llvm-svn: 64898
* Don't allow calls to functions marked "unavailable". There's more workDouglas Gregor2009-02-182-5/+29
| | | | | | | | | | to do in this area, since there are other places that reference FunctionDecls. Don't allow "overloadable" functions (in C) to be declared without a prototype. llvm-svn: 64897
* add some comments describing what is happening here.Chris Lattner2009-02-181-9/+17
| | | | llvm-svn: 64896
* simplify the code used to compute the type of an objc string. This makesChris Lattner2009-02-181-27/+29
| | | | | | it faster in the common case when NSConstantString is around. llvm-svn: 64895
* rename CheckBuiltinCFStringArgument -> CheckObjCStringChris Lattner2009-02-183-6/+6
| | | | llvm-svn: 64894
* simplify some code.Chris Lattner2009-02-181-5/+3
| | | | llvm-svn: 64893
* change the StringLiteral AST node to track all of the SourceLocations of Chris Lattner2009-02-184-22/+45
| | | | | | | | the various PPTokens that are pasted together to make it. In the course of working on this, I discovered ParseObjCStringLiteral which needs some work. I'll tackle it next. llvm-svn: 64892
* Fix performance bug in RangeConstraintManager (that I introduced):Ted Kremenek2009-02-181-9/+23
| | | | | | | | | | | | | | When comparing if one Range is "less" than another, compare the actual APSInt numeric values instead of their pointer addresses. This ensures that the ImmutableSet in RangeSet always has a consistent ordering between Ranges. This is critical for generating the same digest/hash for the contents of the sets. This was a serious performance bug because it would often cause state caching to be disabled along complicated paths. Along the way: - Put Range and RangeSet in the "anonymous namespace" and mark them hidden llvm-svn: 64890
* Representation of objc gc's attribute using ExtQualType.Fariborz Jahanian2009-02-183-4/+71
| | | | | | | Note that one test attr-objc-gc.m fails. I will fix this after removing these attributes from the Decl nodes. llvm-svn: 64889
* fix rdar://6597252: two exactly identical pointer types are alwaysChris Lattner2009-02-181-7/+15
| | | | | | | compatible, even if they are weird implicit objc pointer types like Class. llvm-svn: 64885
* rename some variables, no functionality change.Chris Lattner2009-02-181-71/+72
| | | | llvm-svn: 64884
* Hooked up the necessary machinery to allow the retain/release checker referenceTed Kremenek2009-02-183-64/+169
| | | | | | | | | | | | | back to the summary used when evaluating the statement associated with a simulation node. This is now being used to help improve the checker's diagnostics. To get things started, the checker now emits a path diagnostic indicating that 'autorelease' is a no-op in GC mode. Some of these changes are exposing further grossness in the interface between BugReporter and the ExplodedGraph::Trim facilities. These really need to be cleaned up one day. llvm-svn: 64881
* x86_64 ABI: Two bug fixes.Daniel Dunbar2009-02-181-4/+36
| | | | | | | | | | | | | | | | | | 1. Return of _Complex long double used wrong type. 2. va_arg of types passed in two SSE registers didn't account for extra space in register save area. Down to 18 failures on gcc/compat/x86_64. Combined 32/64 results are: -- === gcc Summary === # of expected passes 1292 # of unexpected failures 34 # of unsupported tests 2 -- llvm-svn: 64880
* retain/release checker: Record the summary used to generate a given node.Ted Kremenek2009-02-181-5/+10
| | | | llvm-svn: 64876
* isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.Daniel Dunbar2009-02-181-3/+16
| | | | | | | Add assert to isICE that, on success, result must be the same as EvaluateAsInt()... this enforces a minimum level of sanity. llvm-svn: 64865
* Convert isIntegerConstantExpr to use ASTContext::MakeIntValue. Daniel Dunbar2009-02-181-39/+29
| | | | | | | | | | | | | | | - This idiom ensures that the result will have the right width and type. - Tested on most of x86_64/llvm-test to satisfy my paranoia. - This fixes at least the following bugs: o UnaryTypeTraitExpr wasn't setting the width correctly. o Arithmetic on _Bool wasn't setting the width correctly. And probably a number more. llvm-svn: 64864
* stop searching GCC install directories for standard C headers (butChris Lattner2009-02-181-79/+6
| | | | | | | | | keep searching for C++ headers when in C++ mode). In theory clang should be able to find all of its own headers now. If not, the CPATH or C_INCLUDE_PATH environment variables can be specified to add a include path. llvm-svn: 64862
* Add panic function.Ted Kremenek2009-02-171-1/+2
| | | | llvm-svn: 64852
* Avoid getNameAsCString when the decl doesn't have a name.Mike Stump2009-02-171-2/+3
| | | | | | Build of the parm list with the iterator, not end(). llvm-svn: 64851
* Rename UnaryTypeTraitExpr::Evaluate to EvaluateTrait to not collideDaniel Dunbar2009-02-173-3/+3
| | | | | | with Expr::Evaluate(). llvm-svn: 64850
* gcc spells it "warn_unused_result" (already supported) not "warnunusedresult"Chris Lattner2009-02-171-3/+0
| | | | llvm-svn: 64849
* Implement basic parsing and semantic analysis for explicitDouglas Gregor2009-02-177-105/+369
| | | | | | | | | | | | | | | | | | specialization of class templates, e.g., template<typename T> class X; template<> class X<int> { /* blah */ }; Each specialization is a different *Decl node (naturally), and can have different members. We keep track of forward declarations and definitions as for other class/struct/union types. This is only the basic framework: we still have to deal with checking the template headers properly, improving recovery when there are failures, handling nested name specifiers, etc. llvm-svn: 64848
* Attribute 'iboutlet' can be applied to Objective-C property declarations.Ted Kremenek2009-02-171-3/+3
| | | | llvm-svn: 64831
* Eek! getDeclAlign sometimes returned alignment in bits.Daniel Dunbar2009-02-172-4/+4
| | | | | | | | | | | - Renamed to getDeclAlignInBytes since most other query functions work in bits. - Fun to track down as isIntegerConstantExpr was getting it right, but Evaluate() was getting it wrong. Maybe we should assert they compute the same thing when they succeed? llvm-svn: 64828
* initial reimplement tgmath.h, written by Howard Hinnant!Chris Lattner2009-02-172-147/+1355
| | | | llvm-svn: 64826
* Simplified ExtQualType per Chris's feedback.Fariborz Jahanian2009-02-172-8/+5
| | | | llvm-svn: 64820
* Remove one more redundant dyn_cast.Argyrios Kyrtzidis2009-02-171-3/+0
| | | | llvm-svn: 64808
* Move DeclContext::getParent and getLexicalParent in-line.Argyrios Kyrtzidis2009-02-171-8/+0
| | | | llvm-svn: 64806
* Currently all DeclContexts are Decls as well; use cast<Decl> instead of ↵Argyrios Kyrtzidis2009-02-171-8/+2
| | | | | | dyn_cast. llvm-svn: 64805
* Remove some redundant Decl -> Decl castings.Argyrios Kyrtzidis2009-02-172-8/+3
| | | | llvm-svn: 64804
* Now that ObjC decls have DeclContexts too, remove an ugly hack from ↵Argyrios Kyrtzidis2009-02-172-86/+1
| | | | | | IdentifierResolver. llvm-svn: 64802
* All Decls have a DeclContext now, hooray! Fans of consistency rejoice.Argyrios Kyrtzidis2009-02-172-5/+5
| | | | | | Pass the DeclContext to ObjCIvarDecls as well. llvm-svn: 64801
* Added support for objc's gc attribute in ExtQualType.Fariborz Jahanian2009-02-172-3/+20
| | | | llvm-svn: 64800
* Revised RangeConstraintManager based on several discussions with Ben Laurie andTed Kremenek2009-02-171-519/+180
| | | | | | | | | | | | | | | | | Zhongxing Xu. The resultant code is less than 1/2 the size of the original. Key highlights: - All CouldBeXXX methods have been removed. Checking for feasibility is now just done in the AddXXX methods. - RangeSets now represent "all possible values" explicitly as the range set { [min, max] } instead of the empty set. The empty set now represents "no feasible values". This change consolidated much of the core algorithm to only have one code path instead of alternate paths that considered the empty set to represent "all possible falues." llvm-svn: 64787
* Change EmitConstantExpr to allow failure.Daniel Dunbar2009-02-173-21/+49
| | | | | | | | | | | | | | IRgen no longer relies on isConstantInitializer, instead we just try to emit the constant. If that fails then in C we emit an error unsupported (this occurs when Sema accepted something that it doesn't know how to fold, and IRgen doesn't know how to emit) and in C++ we emit a guarded initializer. This ends up handling a few more cases, because IRgen was actually able to emit some of the constants Sema accepts but can't Evaluate(). For example, PR3398. llvm-svn: 64780
* 80-cols.Daniel Dunbar2009-02-171-9/+11
| | | | llvm-svn: 64779
* Renamed ASQualType to ExtQualType to reflect its moreFariborz Jahanian2009-02-178-75/+75
| | | | | | | general use; as for, objc2's gc type attributes. No change in functionality. llvm-svn: 64778
* Add '_assert' to list of known panic functions.Ted Kremenek2009-02-171-2/+4
| | | | llvm-svn: 64772
* Handle fatal errors.Ben Laurie2009-02-171-0/+1
| | | | llvm-svn: 64770
* Be sure to initialize Name.Mike Stump2009-02-171-1/+1
| | | | llvm-svn: 64769
* Fixup spacing a little.Mike Stump2009-02-171-6/+6
| | | | llvm-svn: 64768
* Remove the error about redefining library functions. It's causing tooDouglas Gregor2009-02-171-5/+3
| | | | | | much pain when compiling the Linux kernel (PR3592). llvm-svn: 64767
* As an experimental hack, emit "instantiated from" information inChris Lattner2009-02-171-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics. I'm not sure I want to keep this, but hey, it's easy and could be useful or something, even if guarded by a -fshow-me-tons-of-details option. A silly example is: #define A B #define C A #define D C int y = D; We now emit: t.c:11:9: error: use of undeclared identifier 'B' int y = D; ^ t.c:9:11: note: instantiated from: #define D C ^ t.c:8:11: note: instantiated from: #define C A ^ t.c:7:11: note: instantiated from: #define A B ^ A more useful example is from tgmath: t.c:4:9: error: no matching function for call to '__tg_acos' return acos(x); ^~~~~~~ /Users/sabre/llvm/Debug/Headers/tgmath-sofar.h:51:17: note: instantiated from: #define acos(x) __tg_acos(x) ^ ... candidate set follows ... This does not yet print ranges in instantiation info, (e.g. highlighting the range "__tg_acos(x)" in the last example), but that could be added if we decide this is a good idea :). Thoughts and bug reports welcome! llvm-svn: 64761
* add an accessor.Chris Lattner2009-02-171-0/+9
| | | | llvm-svn: 64760
* emit:Chris Lattner2009-02-172-4/+5
| | | | | | | | | | | | | | | t.c:4:9: error: invalid type 'short *' to __real operator __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), ^ instead of: t.c:4:9: error: invalid type 'short *' to __real or __imag operator __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), ^ fixing a fixme. It would be even fancier to get the spelling of the token, but I don't care *that* much :) llvm-svn: 64759
* add an accessor.Chris Lattner2009-02-171-0/+12
| | | | llvm-svn: 64758
* Spell __always_inline__ correctly.Daniel Dunbar2009-02-171-4/+4
| | | | llvm-svn: 64757
* x86_64 ABI: Fix assert on return of _Complex long double.Daniel Dunbar2009-02-171-5/+6
| | | | llvm-svn: 64756
* sink a call to getInstantiationLoc to eliminate an assertion.Chris Lattner2009-02-171-4/+5
| | | | llvm-svn: 64755
* break down EmitCaretDiagnostic to use more primitive calls.Chris Lattner2009-02-171-13/+27
| | | | llvm-svn: 64754
OpenPOWER on IntegriCloud