summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Add more attributes from the command line to functions.Bill Wendling2013-02-2543-448/+385
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Add the testcase from PR13573, this used to crash.Benjamin Kramer2013-02-241-0/+5
| | | | | | The error is a bit strange tbh, but better than crashing. llvm-svn: 175996
* [analyzer] tracking stores/constraints now works for ObjC ivars or struct ↵Ted Kremenek2013-02-244-447/+814
| | | | | | | | | | | | | | | | | | | | | | | fields. This required more changes than I originally expected: - ObjCIvarRegion implements "canPrintPretty" et al - DereferenceChecker indicates the null pointer source is an ivar - bugreporter::trackNullOrUndefValue() uses an alternate algorithm to compute the location region to track by scouring the ExplodedGraph. This allows us to get the actual MemRegion for variables, ivars, fields, etc. We only hand construct a VarRegion for C++ references. - ExplodedGraph no longer drops nodes for expressions that are marked 'lvalue'. This is to facilitate the logic in the previous bullet. This may lead to a slight increase in size in the ExplodedGraph, which I have not measured, but it is likely not to be a big deal. I have validated each of the changed plist output. Fixes <rdar://problem/12114812> llvm-svn: 175988
* Add regression test for serialized diagnostics for notes without locations.Ted Kremenek2013-02-241-0/+30
| | | | | | This meant to be included in r175802. llvm-svn: 175986
* PR15338: Don't assert if -fsanitize=bounds sees array indexing on an incompleteRichard Smith2013-02-241-0/+7
| | | | | | array type. llvm-svn: 175982
* Implement __builtin_eh_return_data_regno() for ARM and MIPS.Logan Chien2013-02-232-0/+14
| | | | llvm-svn: 175954
* ubsan: Emit bounds checks for array indexing, vector indexing, and (in ↵Richard Smith2013-02-233-11/+94
| | | | | | really simple cases) pointer arithmetic. This augments the existing bounds checking with language-level array bounds information. llvm-svn: 175949
* Test that attribute(availability) doesn't override private_extern.John McCall2013-02-231-0/+7
| | | | | | rdar://12399248 llvm-svn: 175943
* Remove the hack that avoided mangling static functions in extern C contexts.Rafael Espindola2013-02-232-7/+9
| | | | | | | | | | | | | | | | | Weather we should give C language linkage to functions and variables with internal linkage probably depends on how much code assumes it. The standard says they should have no language linkage, but gcc and msvc assign them C language linkage. This commit removes the hack that was preventing the mangling on static functions declare in extern C contexts. It is an experiment to see if we can implement the rules in the standard. If it turns out that many users depend on these functions and variables having C language linkage, we should change isExternC instead and try to convince the CWG to change the standard. llvm-svn: 175937
* Revert r175912, "Add support for coldcc to clang" at John's request.Peter Collingbourne2013-02-231-12/+0
| | | | llvm-svn: 175936
* [libclang] Fix assertion hit when code-completing inside a function macro ↵Argyrios Kyrtzidis2013-02-221-2/+8
| | | | | | | | with more arguments than it should accept. llvm-svn: 175925
* objective-C arg: provide fixit support whenFariborz Jahanian2013-02-221-0/+19
| | | | | | | c++'s named cast need be replaced for bridge casting. // rdar://12788838 llvm-svn: 175923
* Update tests so that we don't test for function-only attributes on call sites.Bill Wendling2013-02-225-16/+19
| | | | llvm-svn: 175921
* Driver: Pass down the -march setting down to -cc1as on x86 too.Benjamin Kramer2013-02-221-0/+8
| | | | | | | The assembler historically didn't make use of any target features, but this has changed when support for old CPUs that don't support long nops was added. llvm-svn: 175919
* Split out the command handling for split debug info, we're goingEric Christopher2013-02-221-0/+5
| | | | | | | | | to want to propagate some information through the module into the back end and so need to pass it through to codegen. Also make the methods file static so we can use them in other places. llvm-svn: 175916
* [analyzer] Don't canonicalize the RecordDecl used in CXXBaseObjectRegion.Jordan Rose2013-02-221-0/+30
| | | | | | | | | | | This Decl shouldn't be the canonical Decl; it should be the Decl used by the CXXBaseSpecifier in the subclass. Unfortunately, that means continuing to throw getCanonicalDecl() on all comparisons. This fixes MemRegion::getAsOffset's use of ASTRecordLayout when redeclarations are involved. llvm-svn: 175913
* Add support for coldcc to clangPeter Collingbourne2013-02-221-0/+12
| | | | llvm-svn: 175912
* [preprocessing record] Have the MacroDefinitions map point to the ↵Argyrios Kyrtzidis2013-02-221-0/+6
| | | | | | | | | | MacroDefinition object instead its index in the preprocessed entities vector. This is because the order of the entities in the vector can change in some (uncommon) cases. llvm-svn: 175907
* Make sure pragmas don't attach visibility attributes to auto variables withRafael Espindola2013-02-221-0/+12
| | | | | | internal linkage. llvm-svn: 175903
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-222-1/+4
| | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. llvm-svn: 175900
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-222-0/+46
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Fix MergeFunctionDecl implicit CC for static methods.Timur Iskhodzhanov2013-02-221-0/+86
| | | | | | Patch by Alexander Zinenko! llvm-svn: 175890
* Don't crash if we try to apply 'alignas' to a variable declared with anRichard Smith2013-02-221-0/+3
| | | | | | incomplete type. llvm-svn: 175880
* Don't accidentally and silently accept C++11 attributes in decl-specifier-seqsRichard Smith2013-02-221-0/+3
| | | | | | in C++98. llvm-svn: 175879
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-2238-243/+308
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributesRichard Smith2013-02-221-0/+5
| | | | | | if it has declarators. We were missing the check for this in a couple of places. llvm-svn: 175876
* Handle alignas(foo...) pack expansions.Richard Smith2013-02-222-6/+34
| | | | llvm-svn: 175875
* In LookupResult::resolveKind(), when handling multiple found declarations, ↵Argyrios Kyrtzidis2013-02-222-5/+8
| | | | | | | | | ignore invalid declarations. This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit with an invalid code test case. llvm-svn: 175869
* When a parameter list in a C function has an error, recover by forming a K&R ↵Argyrios Kyrtzidis2013-02-222-1/+5
| | | | | | | | function, instead of a non-function type. llvm-svn: 175868
* Don't crash when applying an alloc_size attribute on a K&R function.Argyrios Kyrtzidis2013-02-221-0/+1
| | | | llvm-svn: 175867
* Don't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,Richard Smith2013-02-221-0/+3
| | | | | | and we used to assert if it did. llvm-svn: 175866
* Teach -ast-print how to print trailing-return-types.Richard Smith2013-02-221-2/+1
| | | | llvm-svn: 175864
* [analyzer] Implement "Loop executed 0 times" diagnostic correctly.Ted Kremenek2013-02-221-33/+1552
| | | | | | Fixes <rdar://problem/13236549> llvm-svn: 175863
* Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out ofRichard Smith2013-02-223-0/+105
| | | | | | | | the normal attribute-merging path, because we can't merge alignment attributes without knowing the complete set of alignment attributes which apply to a particular declaration. llvm-svn: 175861
* [libclang] Fix a crash with invalid code, while skip function bodies is enabled.Argyrios Kyrtzidis2013-02-221-0/+4
| | | | llvm-svn: 175860
* Only suppress instance context if a member is actuallyJohn McCall2013-02-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | accessible in its declaring class; otherwise we might fail to apply [class.protected] when considering accessibility in derived classes. Noticed by inspection; <rdar://13270329>. I had an existing test wrong. Here's why it's wrong: Follow the rules (and notation) of [class.access]p5. The naming class (N) is B and the context (R) is D::getX. - 'x' as a member of B is protected, but R does not occur in a member or friend of a class derived from B. - There does exist a base class of B, A, which is accessible from R, and 'x' is accessible at R when named in A because 'x' as a member of A is protected and R occurs in a member of a class, D, that is derived from A; however, by [class.protected], the class of the object expression must be equal to or derived from that class, and A does not derive from D. llvm-svn: 175858
* [analyzer] Place all inlining policy checks into one palceAnna Zaks2013-02-221-0/+1
| | | | | | | | | | | | | Previously, we had the decisions about inlining spread out over multiple functions. In addition to the refactor, this commit ensures that we will always inline BodyFarm functions as long as the Decl is available. This fixes false positives due to those functions not being inlined when no or minimal inlining is enabled such (as shallow mode). llvm-svn: 175857
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-221-1/+13
| | | | | | | | | | | to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting levels for parentheses, brackets and braces. Some code with heavy macro use exceeds the default limit of 256, but we don't want to increase it generally to avoid stack overflow on stack-constrained systems. llvm-svn: 175855
* [analyzer] Make sure a materialized temporary matches its bindings.Jordan Rose2013-02-222-7/+15
| | | | | | | | | | | | | | | | | This is a follow-up to r175830, which made sure a temporary object region created for, say, a struct rvalue matched up with the initial bindings being stored into it. This does the same for the case in which the AST actually tells us that we need to create a temporary via a MaterializeObjectExpr. I've unified the two code paths and moved a static helper function onto ExprEngine. This also caused a bit of test churn, causing us to go back to describing temporary regions without a 'const' qualifier. This seems acceptable; it's our behavior from a few months ago. <rdar://problem/13265460> (part 2) llvm-svn: 175854
* Fix regression in modeling assignments of an address of a variable to ↵Ted Kremenek2013-02-221-0/+6
| | | | | | itself. Fixes <rdar://problem/13226577>. llvm-svn: 175852
* Make sure we only use the output file as a base for debug splittingEric Christopher2013-02-221-0/+6
| | | | | | if we're compiling. llvm-svn: 175851
* objective-C arc: Diagnostic can not say to use bridgeFariborz Jahanian2013-02-221-0/+9
| | | | | | | casts with c++ named casts. Change notes to say use bridge with c-style cast instead. // rdar://12788838 llvm-svn: 175850
* Preproceessor: fix #if skipping under -traditional-cpp.Jordan Rose2013-02-221-0/+16
| | | | | | | | | | | | When parsing directives within skipped #if blocks, we don't want to retain any whitespace. Previously we were just skipping comments, but it's not possible to skip comments and retain other whitespace. This change matches the usual behavior for parsing directives (i.e. the behavior outside of skipped #if blocks). <rdar://problem/13267695> llvm-svn: 175840
* Make for x86 to stop it failing on ARM buildbots.Bill Wendling2013-02-221-3/+3
| | | | llvm-svn: 175834
* [analyzer] Make sure a temporary object region matches its initial bindings.Jordan Rose2013-02-211-0/+26
| | | | | | | | | | | | | | | | When creating a temporary region (say, when a struct rvalue is used as the base of a member expr), make sure we account for any derived-to-base casts. We don't actually record these in the LazyCompoundVal that represents the rvalue, but we need to make sure that the temporary region we're creating (a) matches the bindings, and (b) matches its expression. Most of the time this will do exactly the same thing as before, but it fixes spurious "garbage value" warnings introduced in r175234 by the use of lazy bindings to model trivial copy constructors. <rdar://problem/13265460> llvm-svn: 175830
* Ignore visibility from enclosing template argumentsJohn McCall2013-02-211-0/+45
| | | | | | for explicit member specializations. llvm-svn: 175827
* clang/test/Driver/qa_override.c: Appease gcc-driver.NAKAMURA Takumi2013-02-211-0/+3
| | | | llvm-svn: 175824
* Fix typo 'with with' in diagnostic.Richard Smith2013-02-212-3/+3
| | | | llvm-svn: 175823
* Don't pass -split-dwarf= to the backend unless we're on linux forEric Christopher2013-02-211-0/+4
| | | | | | now. llvm-svn: 175814
* Remove the SplitDebug action and replace with a set of commandsEric Christopher2013-02-211-12/+3
| | | | | | | in the compilation setup. Note that this doesn't currently work for -no-integrated-as. llvm-svn: 175813
OpenPOWER on IntegriCloud