summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Mark a variable as used in the absence of asserts to silence a GCC warning.Chandler Carruth2010-05-061-0/+1
| | | | llvm-svn: 103165
* Remove a dependency on Frontend headers in the Driver library. Also savesChandler Carruth2010-05-061-13/+8
| | | | | | | building and passing arguments to cc1 layer when setting values to their defaults. llvm-svn: 103162
* Turn -analyzer-inline-call on for C functions. This also fixed a bug thatZhongxing Xu2010-05-061-0/+26
| | | | | | after inlining post-call checking shouldn't be done. llvm-svn: 103161
* Make -analyzer-inline-call not a separate analysis. Instead it's a boolean Zhongxing Xu2010-05-063-3/+4
| | | | | | | flag now, and can be used with other analyses. Only turned it on for C++ methods for now. llvm-svn: 103160
* Partial and full specializations of a class template may have aDouglas Gregor2010-05-065-19/+19
| | | | | | | | | different tag kind ("struct" vs. "class") than the primary template, which has an affect on access control. Should fix the last remaining Boost.Accumulors failure. llvm-svn: 103144
* Workaround a really serious caching bug in ↵Ted Kremenek2010-05-061-0/+5
| | | | | | | | | | SourceManager::isBeforeInTranslationUnit() where the method will sometimes return different results for the same input SourceLocations. I haven't unraveled this method completely yet, so this truly is a workaround until a better fix comes along. llvm-svn: 103143
* Clean up the {} and else placement. This fixes an ambiguous else as well asChandler Carruth2010-05-061-6/+6
| | | | | | picking a more consistent pattern. llvm-svn: 103142
* Silence a pedantic GCC warning by making the grouping of && and || explicit.Chandler Carruth2010-05-061-4/+4
| | | | llvm-svn: 103141
* Add IgnoreParenImpCasts() to Expr, which is basically like IgnoreParenCastsJohn McCall2010-05-051-1/+15
| | | | | | | | | except it only skips implicit casts. Also fix ObjCImplicitGetterSetterRefExpr's child_begin to skip the base expression if it's actually a type reference (which you get with static property references). llvm-svn: 103132
* Pass the globaldecl into GetOrCreateLLVMFunction so that llvmChris Lattner2010-05-051-1/+1
| | | | | | | | | function attributes like byval get applied to the function definition. This fixes PR7058 and makes i386 llvm/clang bootstrap pass all the same tests as x86-64 bootstrap for me (the llvmc tests still fail in both). llvm-svn: 103131
* When implicit definition of the copy-assignment operator fails,Douglas Gregor2010-05-051-6/+12
| | | | | | | | | provide a note that shows where the copy-assignment operator was needed. We used to have this, but I broke it during refactoring. Finishes PR6999. llvm-svn: 103127
* This patch deals with Sema Part of Setter/Getter synthesisFariborz Jahanian2010-05-057-25/+73
| | | | | | | of properties which are of C++ objects. Code Gen to follow (Radar 7468090). llvm-svn: 103123
* When we emit a non-constant initializer for a global variable ofDouglas Gregor2010-05-051-2/+4
| | | | | | | | reference type, make sure that the initializer we build is the of the appropriate type for the *reference*, not for the thing that it refers to. Fixes PR7050. llvm-svn: 103115
* Test commit.mike-m2010-05-051-1/+1
| | | | llvm-svn: 103090
* For thread-safe static initialization of local statics withDouglas Gregor2010-05-051-33/+48
| | | | | | | | destructors, place the __cxa_atexit call after the __cxa_guard_release call, mimicking GCC/LLVM-GCC behavior. Noticed while debugging something related. llvm-svn: 103088
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-056-16/+16
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. llvm-svn: 103087
* Revert r103072; I accidentally ended up deleting a bunch of trailingAlexis Hunt2010-05-056-354/+354
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. llvm-svn: 103086
* Support for 'template' as a disambiguator (PR7030)Douglas Gregor2010-05-052-14/+34
| | | | | | | | | | | | | ParseOptionalCXXScopeSpecifier() only annotates the subset of template-ids which are not subject to lexical ambiguity. Add support for the more general case in ParseUnqualifiedId() to handle cases such as A::template B(). Also improve some diagnostic locations. Fixes PR7030, from Alp Toker! llvm-svn: 103081
* add a new --print-diagnostic-categories option, which causes the driver toChris Lattner2010-05-051-0/+13
| | | | | | | | | | | | | | | print out all of the category numbers with their description. This is useful for clients that want to map the numbers produced by --fdiagnostics-show-category=id to their human readable string form. The output is simple but utilitarian: $ clang --print-diagnostic-categories 1,Format String 2,Something Else This implements rdar://7928193 llvm-svn: 103080
* Reimplement code generation for copying fields in theDouglas Gregor2010-05-054-278/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicitly-generated copy constructor. Previously, Sema would perform some checking and instantiation to determine which copy constructors, etc., would be called, then CodeGen would attempt to figure out which copy constructor to call... but would get it wrong, or poke at an uninstantiated default argument, or fail in other ways. The new scheme is similar to what we now do for the implicit copy-assignment operator, where Sema performs all of the semantic analysis and builds specific ASTs that look similar to the ASTs we'd get from explicitly writing the copy constructor, so that CodeGen need only do a direct translation. However, it's not quite that simple because one cannot explicit write elementwise copy-construction of an array. So, I've extended CXXBaseOrMemberInitializer to contain a list of indexing variables used to copy-construct the elements. For example, if we have: struct A { A(const A&); }; struct B { A array[2][3]; }; then we generate an implicit copy assignment operator for B that looks something like this: B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { } CodeGen will loop over the invented variables i0 and i1 to visit all elements in the array, so that each element in the destination array will be copy-constructed from the corresponding element in the source array. Of course, if we're dealing with arrays of scalars or class types with trivial copy-assignment operators, we just generate a memcpy rather than a loop. Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes all of its regression tests. Conspicuously missing from this patch is handling for the exceptional case, where we need to destruct those objects that we have constructed. I'll address that case separately. llvm-svn: 103079
* Use a more appropriate LLVM type for the vtable pointer.Anders Carlsson2010-05-051-3/+5
| | | | llvm-svn: 103078
* Unbreak CMake build.Douglas Gregor2010-05-056-4/+9
| | | | llvm-svn: 103077
* fit in 80 colsChris Lattner2010-05-051-3/+6
| | | | llvm-svn: 103075
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesAlexis Hunt2010-05-056-354/+354
| | | | llvm-svn: 103072
* add a new -fdiagnostics-show-category=none/id/name option, giving controlChris Lattner2010-05-043-2/+31
| | | | | | | | | | | | over choice of: t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat] t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1] t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String] dox to come. llvm-svn: 103056
* When -fdiagnostics-print-source-range-info is specified,Chris Lattner2010-05-042-4/+58
| | | | | | | | | | | | | | | | | | | | | | | print the diagnostic category number in the [] at the end of the line. For example: $ cat t.c #include <stdio.h> void foo() { printf("%s", 4); } $ clang t.c -fsyntax-only -fdiagnostics-print-source-range-info t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1] printf("%s", 4); ~^ ~ 1 warning generated. Clients that want category information can now pick the number out of the output, rdar://7928231. More coming. llvm-svn: 103053
* Emit the globals, metadata, etc. associated with static variables even whenJohn McCall2010-05-042-5/+5
| | | | | | | | they're unreachable. This matters because (if they're POD, or if this is C) the scope containing the variable might be reachable even if the variable isn't. Fixes PR7044. llvm-svn: 103052
* add the ability to associate 'category' names with diagnosticsChris Lattner2010-05-041-4/+6
| | | | | | | | | and diagnostic groups. This allows the compiler to group diagnostics together (e.g. "Logic Warning", "Format String Warning", etc) like the static analyzer does. This is not exposed through anything in the compiler yet. llvm-svn: 103051
* Fixes a code gen. crash when ivar object has trivial constructor.Fariborz Jahanian2010-05-041-12/+14
| | | | llvm-svn: 103028
* When instantiating a function that was declared via a typedef, e.g.,Douglas Gregor2010-05-045-6/+32
| | | | | | | | | | | | | typedef int functype(int, int); functype func; also instantiate the synthesized function parameters for the resulting function declaration. With this change, Boost.Wave builds and passes all of its regression tests. llvm-svn: 103025
* Fixes a code gen crash when block is a reference type, etc.Fariborz Jahanian2010-05-041-0/+2
| | | | | | (radar 7495203). llvm-svn: 103022
* Introduce a limit on the depth of the macro instantiation backtraceDouglas Gregor2010-05-043-24/+84
| | | | | | | | | | | | | | printed in a diagnostic, similar to the limit we already have on the depth of the template instantiation backtrace. The macro instantiation backtrace is limited to 10 "instantiated from:" diagnostics; when it's longer than that, we'll show the first half, then say how many were suppressed, then show the second half. The limit can be changed with -fmacro-instantiation-limit=N, and turned off with N=0. This eliminates a lot of note spew with libraries making use of the Boost.Preprocess library. llvm-svn: 103014
* When creating a call to a base subobject's operator= in anDouglas Gregor2010-05-041-4/+29
| | | | | | | | | implicitly-defined copy assignment operator, suppress the protected access check. This eliminates the remaining failure in the Boost.SmartPtr library (that was a product of the copy-assignment generation rewrite) and, presumably, the Boost.TR1 library as well. llvm-svn: 103010
* Let StmtDumper.cpp handle using declarations.Sebastian Redl2010-05-041-0/+7
| | | | llvm-svn: 103006
* An access is permitted if the current template instantiates to the appropriateJohn McCall2010-05-041-3/+29
| | | | | | class. Add some conservative support for the idea. Fixes PR 7024. llvm-svn: 102999
* When inheriting a default argument expression, inherit the full expression,John McCall2010-05-042-3/+7
| | | | | | | | | not just the inner expression. This is important if the expression has any temporaries. Fixes PR 7028. Basically a symptom of really tragic method names. llvm-svn: 102998
* Fixes a Code Gen. Crash when calling destructor on a __blockFariborz Jahanian2010-05-041-4/+9
| | | | | | | variabe. Blocks and their construction/destruction is wip though. llvm-svn: 102985
* When computing the template arguments for the instantiation of aDouglas Gregor2010-05-033-7/+16
| | | | | | | | | | | | | friend function template, be sure to adjust the computed template argument lists based on the location of the definition of the function template: it's possible that the definition we're instantiating with and the template declaration that we found when creating the specialization are in different contexts, which meant that we would end up using the wrong template arguments for instantiation. Fixes PR7013; all Boost.DynamicBitset tests now pass. llvm-svn: 102974
* Just bail out immediately when emitting an unreachable function-local staticJohn McCall2010-05-031-0/+3
| | | | | | variable. Surprisingly, this does seem to be the right way to solve this. llvm-svn: 102961
* For the sake of Objective-c++ overload resolution,Fariborz Jahanian2010-05-032-2/+45
| | | | | | | | treat argument types of objective-c pointer types which only differ in their protocol qualifiers as the same type (radar 7925668). llvm-svn: 102955
* When instantiating a function-local variable definition, introduce theDouglas Gregor2010-05-031-0/+3
| | | | | | | | mapping from the declaration in the template to the instantiated declaration before transforming the initializer, in case some crazy lunatic decides to use a variable in its own initializer. Fixes PR7016. llvm-svn: 102945
* Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since ↵Ted Kremenek2010-05-031-2/+10
| | | | | | | | | they don't go in the DeclContext for the translation unit. This is to workaround a fundamental issue in how ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available. llvm-svn: 102944
* If we're generating code to create a pointer-to-member functionDouglas Gregor2010-05-031-0/+6
| | | | | | | aggregate and the result of the aggregate is unused, bail out early. Fixes PR7027. llvm-svn: 102942
* Diagnose unused exception parameters under a different warning groupDouglas Gregor2010-05-035-5/+17
| | | | | | | | (-Wunused-exception-parameter) than normal variables, since it's more common to name and then ignore an exception parameter. This warning is neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>. llvm-svn: 102931
* Complain when we try to initialize an object of Objective-C class typeDouglas Gregor2010-05-031-3/+7
| | | | | | | | (which is ill-formed) with an initializer list. Also, change the fallback from an assertion to a generic error message, which is far friendlier. Fixes <rdar://problem/7730948>. llvm-svn: 102930
* It's okay to reference an enum in a template definition, even thoughDouglas Gregor2010-05-031-9/+12
| | | | | | it's ill-formed to form an enum template. Fixes <rdar://problem/7933063>. llvm-svn: 102926
* When computing the address of a virtual member function pointer, use the ↵Anders Carlsson2010-05-032-2/+12
| | | | | | pointer width instead of hardcoding for 64-bit. llvm-svn: 102921
* Do not issue warning on unimplemented property in the class, if itFariborz Jahanian2010-05-032-1/+40
| | | | | | | | conforms to a protocol as one of its super classes does. This is because conforming super class will implement the property. This implements new warning rules for unimplemented properties (radar 7884086). llvm-svn: 102919
* The array form of 'new' can never have initializers.Anders Carlsson2010-05-031-0/+9
| | | | llvm-svn: 102917
* When creating the declaration reference for implicit copy-constructionDouglas Gregor2010-05-031-1/+1
| | | | | | of a base class, give it real source-location information. Fixes PR7017. llvm-svn: 102916
OpenPOWER on IntegriCloud