summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* We don't add ExprWithCleanups to the CFG, and getSVal looksJohn McCall2011-11-091-0/+4
| | | | | | | through it, so we should look through it for the live-values analysis as well. llvm-svn: 144190
* Define some built-ins macros on mips32 platform, from Simon Atanasyan!Douglas Gregor2011-11-091-0/+4
| | | | llvm-svn: 144189
* Reflow one line I missed in previous cleanup commit. No functionality change.Nick Lewycky2011-11-091-2/+1
| | | | llvm-svn: 144168
* Minor cleanup, mostly reindenting. Remove one helper function that just calledNick Lewycky2011-11-092-22/+15
| | | | | | | the other helper functions, since we already differentiated the cases it was testing between. No functionality change. llvm-svn: 144167
* Fix an issue that Duncan discovered on a specific (no longer current)Chandler Carruth2011-11-092-9/+8
| | | | | | | | | | | | version of Ubuntu. It has a very broken multiarch configuration, and so we need special logic to handle it correctly. Fixing and testing this uncovered a few other trivial issues with the logic that are fixed as well. I added tests to cover this as it is hard to notice if you install recent versions of the OS. llvm-svn: 144165
* Emit the copy and dipose helpers for ARC __strongJohn McCall2011-11-091-10/+48
| | | | | | | | | | | | | | | | | | | | block-typed __block variables using objc_retainBlock and objc_dispose. Previously we were using _Block_object_assign and _Block_object_destroy with BLOCK_BYREF_CALLER, which causes the runtime to completely ignore the retain and release. In most cases this doesn't cause catastrophe because the retain/release are balanced and because the block in the variable was copied upon assignment there. However, the stack copy of the variable will be released when it goes out of scope, which is a problem if that value was released due to an assignment to the heap copy. Similarly, a leak can occur if the variable is assigned after the copy to the heap. llvm-svn: 144162
* Don't crash when transforming an ill-formed pseudo-destructorDouglas Gregor2011-11-091-1/+1
| | | | | | expression. Fixes PR11339. llvm-svn: 144159
* Introduce proper spacing after the Objective-C parameter qualifiersDouglas Gregor2011-11-091-11/+6
| | | | | | (bycopy, inout, etc.). Fixes <rdar://problem/10402900>. llvm-svn: 144157
* Constant expression evaluation: support for default arguments.Richard Smith2011-11-091-0/+2
| | | | llvm-svn: 144156
* [PCH] Fix reading from PCH of diagnostic pragmas.Argyrios Kyrtzidis2011-11-092-12/+7
| | | | | | | | | | | In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations leading to crash because the main FileID was not yet initialized. Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking invariants. Fix this by having the ASTReader set up the internal state directly. llvm-svn: 144153
* Don't crash on invalid objc code.Argyrios Kyrtzidis2011-11-091-0/+5
| | | | llvm-svn: 144150
* [arcmt] Take into account that all properties are strong-by-default now and ↵Argyrios Kyrtzidis2011-11-081-42/+7
| | | | | | fix the test. llvm-svn: 144146
* Bind function "r-values" as l-values when emitting them asJohn McCall2011-11-082-2/+9
| | | | | | opaque values. Silly C type system. llvm-svn: 144144
* objc: Don't crash on missing @interface decl.Fariborz Jahanian2011-11-081-6/+7
| | | | | | // rdar://10415026 llvm-svn: 144143
* [arcmt] Now that readonly properties are strong-by-default, do not add ↵Argyrios Kyrtzidis2011-11-081-1/+1
| | | | | | redundant 'strong'. llvm-svn: 144136
* objc-arc: 'readonly' property of retainable objectFariborz Jahanian2011-11-081-3/+2
| | | | | | type is strong by default too. // rdar://10410903 llvm-svn: 144118
* serialized diagnostics: serialize the version info in a separate meta block.Ted Kremenek2011-11-081-20/+31
| | | | llvm-svn: 144115
* [analyzer] Remove redundant check from DivZeroCheckerAnna Zaks2011-11-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Analysis by Ted: " if (stateZero && !stateNotZero) { is checking to see if: (A) "it is possible for the value to be zero" (stateZero) AND (B) "it is not possible for the value to be non-zero" (!stateNotZero) That said, the only way for both B to be true AND A to be false is if the path is completely infeasible by the time we reach the divide-by-zero check. For the most part (all cases?), such cases should automatically get pruned out at branches (i.e., an infeasible path gets dropped), which is the case in our tests. So the question is whether or not such an infeasible path might not get dropped earlier? I can't envision any right now. Indeed, the rest of the checker assumes that if the bug condition didn't fire then 'stateNotZero' is non-NULL: C.addTransition(stateNotZero); " llvm-svn: 144114
* Mark the overloaded atomic builtins as having custom type checking,Douglas Gregor2011-11-081-8/+0
| | | | | | | | | which they do. This avoids all of the default argument promotions that we (1) don't want, and (2) undo during that custom type checking, and makes sure that we don't run into trouble during template instantiation. Fixes PR11320. llvm-svn: 144110
* Misc fixes for clang driver on Mips Linux. Patch by Simon Atanasyan.Eli Friedman2011-11-082-0/+35
| | | | llvm-svn: 144108
* From Vassil Vassilev: add checks for removing Decls for more use cases.Axel Naumann2011-11-082-2/+3
| | | | llvm-svn: 144094
* Add a default system include of '/include'. This isn't particularlyChandler Carruth2011-11-081-0/+5
| | | | | | | | | | | | useful when using Clang as a system-compiler, but its harmless. When using Clang as a cross-compiler, this can be very handy as quite a few toolchains ship their libc headers here rather than under '/usr/include'. For reference, this is the beginning of my work to also make the Clang driver more suitable as a cross-compiler. llvm-svn: 144089
* [arcmt] Now that properties are strong by default, avoid adding redundant ↵Argyrios Kyrtzidis2011-11-081-2/+4
| | | | | | | | '(strong)' property attribute. llvm-svn: 144078
* [arcmt] NSViewController does not support weak.Argyrios Kyrtzidis2011-11-081-0/+1
| | | | llvm-svn: 144077
* Check pointer types for arguments of Neon load/store macros. rdar://9958031Bob Wilson2011-11-081-3/+54
| | | | | | | | | | | The Neon load/store intrinsics need to be implemented as macros to avoid hiding alignment attributes on the pointer arguments, and the macros can only evaluate those pointer arguments once (in case they have side effects), so it has been hard to get the right type checking for those pointers. I tried various alternatives in the arm_neon.h header, but it's much more straightforward to just check directly in Sema. llvm-svn: 144075
* Misc fixes to pcmp*stri.Eli Friedman2011-11-081-10/+10
| | | | llvm-svn: 144073
* Fix the layout of vb-tables and vf-tables in the MS C++ ABI.John McCall2011-11-082-217/+279
| | | | | | Based on work by Dmitry Sokolov! llvm-svn: 144072
* lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.NAKAMURA Takumi2011-11-081-3/+3
| | | | llvm-svn: 144065
* TypePrinter: print OpenCL address space names. Patch by RichardPeter Collingbourne2011-11-081-3/+15
| | | | | | Membarth, test case by myself. llvm-svn: 144063
* DeclPrinter: print the declaration's storage class specifier asPeter Collingbourne2011-11-081-3/+4
| | | | | | | | | written, instead of the resolved storage class, which might not be legal to specify on the declaration (such as out-of-line definitions of static class members in C++, and __local variables in OpenCL). Initial patch by Richard Membarth. llvm-svn: 144062
* [arcmt] When we already removed a __weak, don't try to change it to ↵Argyrios Kyrtzidis2011-11-082-2/+6
| | | | | | | | __unsafe_unretained later on, or we will end up with a redundant '__unsafe_unretained'. llvm-svn: 144059
* Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.Matt Beaumont-Gay2011-11-081-3/+2
| | | | | | (TIL: -Wnon-virtual-dtor is not in -Wall.) llvm-svn: 144058
* Fix a cluster of related issues involving value-dependence and constantRichard Smith2011-11-082-9/+19
| | | | | | | | | | | | | | expression evaluation: - When folding a non-value-dependent expression, we may try to use the initializer of a value-dependent variable. If that happens, give up. - In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE is of integral or enumeration type (a reference isn't OK!) - In C++11, DeclRefExprs for objects of const literal type initialized with value-dependent expressions are themselves value-dependent. - So are references initialized with value-dependent expressions (though this case is missing from the C++11 standard, along with many others). llvm-svn: 144056
* Clean up type flags for overloaded Neon builtins. No functional change.Bob Wilson2011-11-082-52/+67
| | | | | | | | | This patch just adds a simple NeonTypeFlags class to replace the various hardcoded constants that had been used until now. Unfortunately I couldn't figure out a good way to avoid duplicating that class between clang and TableGen, but since it's small and rarely changes, that's not so bad. llvm-svn: 144054
* There are some crazy cases that LookupMethodInReceiverTypeJohn McCall2011-11-071-1/+8
| | | | | | | | | doesn't duplicate, but they all surface as implicit properties. It's also a useful optimization to not duplicate the implicit getter lookup. So, trust the getter lookup that was already done in these cases. llvm-svn: 144031
* constexpr: static data members declared constexpr are required to have anRichard Smith2011-11-072-36/+17
| | | | | | | | initializer; all other constexpr variables are merely required to be initialized. In particular, a user-provided constexpr default constructor can be used for such initialization. llvm-svn: 144028
* When we notice that a member function is defined with "= delete" or "=Douglas Gregor2011-11-076-22/+42
| | | | | | | | | | | | default", make a note of which is used when creating the initial declaration. Previously, we would wait until later to handle default/delete as a definition, but this is too late: when adding the declaration, we already treated the declaration as "user-provided" when in fact it was merely "user-declared". Fixes PR10861 and PR10442, along with a bunch of FIXMEs. llvm-svn: 144011
* Whitespace.Chad Rosier2011-11-071-1/+1
| | | | llvm-svn: 144002
* Tablegenify -g options.Chad Rosier2011-11-071-15/+0
| | | | llvm-svn: 144001
* ASTConsumer::handleTopLevelDecl will end up getting called forDouglas Gregor2011-11-071-1/+4
| | | | | | function template instantiations. Fixes <rdar://problem/10398005> / PR11312. llvm-svn: 143984
* [arcmt] Fix handling NSMakeCollectable inside an objc method.Argyrios Kyrtzidis2011-11-071-1/+2
| | | | llvm-svn: 143980
* [arcmt] In GC, handle (assign) @properties.Argyrios Kyrtzidis2011-11-074-130/+269
| | | | | | | | | -Move __strong/__weak added to a property type to the property attribute, e.g. "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;" -Remove (assign) in a property so that it becomes strong-by-default in ARC. llvm-svn: 143979
* [arcmt] Map property decls to their GC attributes.Argyrios Kyrtzidis2011-11-073-3/+12
| | | | llvm-svn: 143978
* Add support for printing integer literals of type short, unsigned short,Richard Trieu2011-11-071-0/+7
| | | | | | | | __int128_t and __uint128_t. Short and unsigned short integer literals support is only to work around a crasher as reported in PR11179 and will be removed once Clang no longer builds short integer literals. llvm-svn: 143977
* [arcmt] In GC, change '__weak' -> '__unsafe_unretained' when appliedArgyrios Kyrtzidis2011-11-073-5/+33
| | | | | | to objects of classes that don't support ARC weak llvm-svn: 143976
* When applying ARC __weak to a non-objc pointer, do not give error thatArgyrios Kyrtzidis2011-11-071-1/+1
| | | | | | | | | __weak is unsupported by the deployment target, since it is going to be ignored anyway. Makes it easier for incremental migration from GC. llvm-svn: 143975
* Better fix for -Wnon-virtual-dtorMatt Beaumont-Gay2011-11-071-2/+3
| | | | llvm-svn: 143972
* Drastically simplify the mapping from the declaration corresponding toDouglas Gregor2011-11-071-66/+40
| | | | | | | | | | | | | | | | | | | | | | | | the injected-class-name of a class (or class template) to the declaration that results from substituting the given template arguments. Previously, we would actually perform a substitution into the injected-class-name type and then retrieve the resulting declaration. However, in certain, rare circumstances involving deeply-nested member templates, we would get the wrong substitution arguments. This new approach just matches up the declaration with a declaration that's part of the current context (or one of its parents), which will either be an instantiation (during template instantiation) or the declaration itself (during the definition of the template). This is both more efficient (we're avoiding a substitution) and more correct (we can't get the template arguments wrong in the member-template case). Fixes <rdar://problem/9676205>. Reinstated, now that we have the fix in r143967. llvm-svn: 143968
* Tighten up the conditions under which we consider ourselves to beDouglas Gregor2011-11-075-17/+33
| | | | | | | entering the context of a nested-name-specifier. Fixes <rdar://problem/10397846>. llvm-svn: 143967
* Appease -Wnon-virtual-dtorMatt Beaumont-Gay2011-11-071-0/+2
| | | | llvm-svn: 143965
OpenPOWER on IntegriCloud