summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add support for sparcv9 targets.Jakob Stoklund Olesen2013-04-161-13/+61
| | | | | | | | | | | | The SPARC v8 and SPARC v8 architectures are very similar, so use a base class to share most information between them. Include operating systems with known SPARC v9 ports. Also fix two issues with the SPARC v8 data layout string: SPARC v8 is a big endian target with a 64-bit aligned stack. llvm-svn: 179596
* Basic support for Microsoft property declarations andJohn McCall2013-04-1628-26/+598
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Correctly propagate the storage class to function template instantiations.Rafael Espindola2013-04-161-1/+1
| | | | | | | This fixes pr15753. This is another case of the fuzzy definition of the "as written" storage class of an instantiation. llvm-svn: 179581
* [analyzer] Improve the malloc checker stack hint messageAnna Zaks2013-04-161-8/+8
| | | | llvm-svn: 179580
* [analyzer] Do not crash when processing binary "?:" in C++Anna Zaks2013-04-152-9/+32
| | | | | | | | | | | | | | | | | | | | | | When computing the value of ?: expression, we rely on the last expression in the previous basic block to be the resulting value of the expression. This is not the case for binary "?:" operator (GNU extension) in C++. As the last basic block has the expression for the condition subexpression, which is an R-value, whereas the true subexpression is the L-value. Note the operator evaluation just happens to work in C since the true subexpression is an R-value (like the condition subexpression). CFG is the same in C and C++ case, but the AST nodes are different, which the LValue to Rvalue conversion happening after the BinaryConditionalOperator evaluation. Changed the logic to only use the last expression from the predecessor only if it matches either true or false subexpression. Note, the logic needed fortification anyway: L and R were passed but not even used by the function. Also, change the conjureSymbolVal to correctly compute the type, when the expression is an LG-value. llvm-svn: 179574
* [analyzer] Add pretty printing to CXXBaseObjectRegion.Anna Zaks2013-04-151-1/+5
| | | | llvm-svn: 179573
* [analyzer] Address code review for r179395Anna Zaks2013-04-151-15/+24
| | | | | | Mostly refactoring + handle the nested fields by printing the innermost field only. llvm-svn: 179572
* [analyzer] Add more specialized error messages for corner cases as per ↵Anna Zaks2013-04-151-11/+25
| | | | | | Jordan's code review for r179396 llvm-svn: 179571
* Break after multiline parameters.Daniel Jasper2013-04-151-1/+3
| | | | | | | | | | | | | | | | | We do this in general, but missed a few cases. Before: void aaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbb bbbb); After: void aaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbb bbbb); llvm-svn: 179570
* [analyzer] Don't assert on a temporary of pointer-to-member type.Jordan Rose2013-04-151-1/+2
| | | | | | | | | | While we don't do anything intelligent with pointers-to-members today, it's perfectly legal to need a temporary of pointer-to-member type to, say, pass by const reference. Tweak an assertion to allow this. PR15742 and PR15747 llvm-svn: 179563
* Remove some dead code that has not been used since 2010.Joey Gouly2013-04-151-11/+0
| | | | llvm-svn: 179558
* [analyzer] Be lazy about struct/array global invalidation too.Jordan Rose2013-04-151-10/+7
| | | | | | | | | | Structs and arrays can take advantage of the single top-level global symbol optimization (described in the previous commit) just as well as scalars. No intended behavioral change. llvm-svn: 179555
* [analyzer] Re-enable using global regions as a symbolic base.Jordan Rose2013-04-151-10/+9
| | | | | | | | | | | | | | | | Now that we're invalidating global regions properly, we want to continue taking advantage of a particular optimization: if all global regions are invalidated together, we can represent the bindings of each region with a "derived region value" symbol. Essentially, this lazily links each global region with a single symbol created at invalidation time, rather than binding each region with a new symbolic value. We used to do this, but haven't been for a while; the previous commit re-enabled this code path, and this handles the fallout. <rdar://problem/13464044> llvm-svn: 179554
* [analyzer] Properly invalidate global regions on opaque function calls.Jordan Rose2013-04-151-21/+60
| | | | | | | | | | | | | | | | | | | | This fixes a regression where a call to a function we can't reason about would not actually invalidate global regions that had explicit bindings. void test_that_now_works() { globalInt = 42; clang_analyzer_eval(globalInt == 42); // expected-warning{{TRUE}} invalidateGlobals(); clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}} } This has probably been around since the initial "cluster" refactoring of RegionStore, if not longer. <rdar://problem/13464044> llvm-svn: 179553
* Revert "Speed-up ObjCMethodDecl::getOverriddenMethods()."Argyrios Kyrtzidis2013-04-152-42/+27
| | | | | | | | | | | This reverts commit r179436. Due to caching, it was possible that we could miss overridden methods that were introduced by categories later on. Along with reverting the commit I also included a test case that would have caught this. llvm-svn: 179547
* Fix unused variable warning with assertions disabled.Alexander Kornienko2013-04-151-3/+4
| | | | llvm-svn: 179531
* Unified token breaking logic for strings and block comments.Alexander Kornienko2013-04-156-467/+804
| | | | | | | | | | | | | | | | | | | | | | Summary: Both strings and block comments are broken into lines in breakProtrudingToken. Logic specific for strings or block comments is abstracted in implementations of the BreakToken interface. Among other goodness, this change fixes placement of backslashes after a block comment inside a preprocessor directive (see removed FIXMEs in unit tests). The code is far from being polished, and some parts of it will be changed for line comments support. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D665 llvm-svn: 179526
* Remove hasExternalLinkageUncached.Rafael Espindola2013-04-153-20/+12
| | | | | | | | It was being used correctly, but it is a very dangerous API to have around. Instead, move the logic from the filtering to when we are deciding if we should link two decls. llvm-svn: 179523
* Fix the storage class of method instantiations.Rafael Espindola2013-04-152-16/+3
| | | | | | | | | We keep the "as written" storage class, but that is a fuzzy concept for instantiations. With this patch instantiations of methods of class templates now get a storage class that is based on the semantics of isStatic(). With this can simplify isStatic() itself. llvm-svn: 179521
* Local thread_local variables are implicitly 'static'. (This doesn't apply to ↵Richard Smith2013-04-151-2/+11
| | | | | | _Thread_local nor __thread.) llvm-svn: 179517
* Properly check for a constant initializer for a thread-local variable.Richard Smith2013-04-151-1/+2
| | | | llvm-svn: 179516
* Add a new flag -vectorize-slp-aggressive to enable Hals BB vectorizer.Nadav Rotem2013-04-151-0/+7
| | | | llvm-svn: 179507
* Rename the slp-vectorizer clang/llvm flags. No functionality change.Nadav Rotem2013-04-151-1/+1
| | | | llvm-svn: 179506
* CodeGen support for function-local static thread_local variables withRichard Smith2013-04-147-20/+40
| | | | | | | | | non-constant constructors or non-trivial destructors. Plus bugfixes for thread_local references bound to temporaries (the temporaries themselves are lifetime-extended to become thread_local), and the corresponding case for std::initializer_list. llvm-svn: 179496
* Removed #if 0 code that doesn't compiled if uncommented.Rafael Espindola2013-04-141-9/+0
| | | | llvm-svn: 179495
* Diagnose if a __thread or _Thread_local variable has a non-constant initializerRichard Smith2013-04-141-0/+22
| | | | | | or non-trivial destructor. llvm-svn: 179491
* [Mips] Support -mmicromips / -mno-micromips command line options.Simon Atanasyan2013-04-142-1/+13
| | | | llvm-svn: 179489
* [Mips] Fix indentation.Simon Atanasyan2013-04-141-1/+1
| | | | llvm-svn: 179488
* [Mips] Follow-up to r179481. Reduce code duplication. UseSimon Atanasyan2013-04-141-10/+3
| | | | | | | AddTargetFeature() routine to handle -msingle-float / -mdouble-float options. llvm-svn: 179487
* [Mips] Follow-up to r179481. Consider "single-float" as a separateSimon Atanasyan2013-04-141-6/+8
| | | | | | independent of float ABI feature in the MipsTargetInfoBase class. llvm-svn: 179486
* Add driver support for fedora 18 on ARM.Rafael Espindola2013-04-141-0/+1
| | | | llvm-svn: 179484
* Handle incompatible redeclarations of library builtins better.John McCall2013-04-141-11/+21
| | | | | | | | | Invalid redeclarations of valid explicit declarations shouldn't take the same path as redeclarations of implicit declarations, and invalid local extern declarations shouldn't foul things up for everybody else. llvm-svn: 179482
* [Mips] Remove "single" from the list of valid MIPS float ABI names. AddSimon Atanasyan2013-04-141-7/+11
| | | | | | | | | two new options –msingle-float and –mdouble-float. These options can be used simultaneously with float ABI selection options (-mfloat-abi, -mhard-float, -msoft-float). They mark whether a floating-point coprocessor supports double-precision operations. llvm-svn: 179481
* Remove duplicated comment.Simon Atanasyan2013-04-131-2/+0
| | | | llvm-svn: 179454
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-1314-38/+67
| | | | | | the AST. llvm-svn: 179447
* Use MapVector rather than simulating it.Richard Smith2013-04-132-8/+7
| | | | llvm-svn: 179438
* Speed-up ObjCMethodDecl::getOverriddenMethods().Argyrios Kyrtzidis2013-04-132-27/+42
| | | | | | | Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its results instead of re-calculating the categories multiple times. llvm-svn: 179436
* Introduce SourceManager::getDecomposedIncludedLoc, that returns the ↵Argyrios Kyrtzidis2013-04-131-11/+30
| | | | | | | | | "included/expanded in" decomposed location of the given FileID. The main benefit is to speed-up SourceManager::isBeforeInTranslationUnit which is common to query the included/expanded location of the same FileID multiple times. llvm-svn: 179435
* Don't replace an existing decl in the scope chains with itsJohn McCall2013-04-131-28/+0
| | | | | | | | | local-extern redeclaration; type refinements, default arguments, etc. must all be locally scoped. rdar://13535367 llvm-svn: 179430
* [analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.Anton Yartsev2013-04-121-2/+9
| | | | llvm-svn: 179428
* Headers: Add support for ISO9899:2011 rsize_t.Daniel Dunbar2013-04-122-0/+17
| | | | llvm-svn: 179427
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-128-73/+144
| | | | | | semantics as __thread for now. llvm-svn: 179424
* tl;dr: Teach Clang to work around g++ changing its workaround to glibc'sRichard Smith2013-04-121-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | implementation of C99's attempt to control the C++ standard. *sigh* The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX, should not be defined when the header is included in C++ mode, unless __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard says "Thanks, but no thanks" and C11 removed this rule, but various C library implementations (such as glibc) follow C99 anyway. g++ prior to 4.8 worked around the C99 / glibc behavior by defining __STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is supposed to provide these macros too. g++ 4.8 works around it by defining __STDC_*_MACROS in its builtin <stdint.h> header. This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now countermands any attempt by the C library to implement the undesired C99 rules, by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98 mode, since that was the intent of the C++ committee, matches the behavior required in C11, and matches our built-in implementation of <stdint.h>. llvm-svn: 179419
* <rdar://problem/13643854> Only emit ambiguous-expansion warnings when at ↵Douglas Gregor2013-04-121-26/+8
| | | | | | | | least one of the macro definitions comes from a non-system header. This slightly weakens the heuristic introduced in r178109. llvm-svn: 179411
* [analyzer] Makes NewDeleteLeaks checker work independently from NewDelete.Anton Yartsev2013-04-121-1/+1
| | | | llvm-svn: 179410
* [analyzer] Print a diagnostic note even if the region cannot be printed.Anna Zaks2013-04-121-21/+32
| | | | | | | | | There are few cases where we can track the region, but cannot print the note, which makes the testing limited. (Though, I’ve tested this manually by making all regions non-printable.) Even though the applicability is limited now, the enhancement will be more relevant as we start tracking more regions. llvm-svn: 179396
* [analyzer]Print field region even when the base region is not printableAnna Zaks2013-04-123-20/+35
| | | | llvm-svn: 179395
* Sema: Give a typically small DenseMap some inline capacity.Benjamin Kramer2013-04-121-4/+3
| | | | | | Also reflow code a bit, no change in functionality. llvm-svn: 179382
* Revamps structural error detection / handling.Manuel Klimek2013-04-123-40/+44
| | | | | | | | | | | | | | | | | | | | | Previously we'd only detect structural errors on the very first level. This leads to incorrectly balanced braces not being discovered, and thus incorrect indentation. This change fixes the problem by: - changing the parser to use an error state that can be detected anywhere inside the productions, for example if we get an eof on SOME_MACRO({ some block <eof> - previously we'd never break lines when we discovered a structural error; now we break even in the case of a structural error if there are two unwrapped lines within the same line; thus, void f() { while (true) { g(); y(); } } will still be re-formatted, even if there's missing braces somewhere in the file - still exclude macro definitions from generating structural error; macro definitions are inbalanced snippets llvm-svn: 179379
* [analyzer] Fix grammar in comment.Jordan Rose2013-04-121-1/+1
| | | | | | By Adam Schnitzer! llvm-svn: 179352
OpenPOWER on IntegriCloud