summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix test for r182677.Jordan Rose2013-05-241-24/+24
| | | | llvm-svn: 182678
* [analyzer] Treat analyzer-synthesized function bodies like implicit bodies.Jordan Rose2013-05-244-98/+123
| | | | | | | | | | | | | | | | When generating path notes, implicit function bodies are shown at the call site, so that, say, copying a POD type in C++ doesn't jump you to a header file. This is especially important when the synthesized function itself calls another function (or block), in which case we should try to jump the user around as little as possible. By checking whether a called function has a body in the AST, we can tell if the analyzer synthesized the body, and if we should therefore collapse the call down to the call site like a true implicitly-defined function. <rdar://problem/13978414> llvm-svn: 182677
* [analyzer; new edges] Properly set location after exiting an inlined call.Jordan Rose2013-05-242-109/+310
| | | | | | | | | | | | | | | | | The new edge algorithm would keep track of the previous location in each location context, so that it could draw arrows coming in and out of each inlined call. However, it tried to access the location of the call before it was actually set (at the CallEnter node). This only affected unterminated calls at the end of a path; calls with visible exit nodes already had a valid location. This patch ditches the location context map, since we're processing the nodes in order anyway, and just unconditionally updates the PrevLoc variable after popping out of an inlined call. <rdar://problem/13983470> llvm-svn: 182676
* Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.Michael J. Spencer2013-05-243-3/+3
| | | | llvm-svn: 182675
* DebugInfo: Rename CreatePointerType to getOrCreateTypeDeclarationDavid Blaikie2013-05-242-10/+12
| | | | | | | | | | | | | | | | To make this more consistent with 'getOrCreateType' & clarify the distinction between the two. The only thing I couldn't quite communicate in the name is that getOrCreateTypeDeclaration may actually produce a full definition (in -fno-limit-debug-info) but the point is to call it whenever only a declaration is needed & the implementation can choose whether to provide a declaration or definition. (also, unfortunately, getOrCreateType can produce declarations too - we should sure this up by making it not do that - any caller that can tolerate a declaration should be calling getOrCreateTypeDeclaration instead) llvm-svn: 182674
* PR16091: Error when attempting to emit debug info for undeduced auto return ↵David Blaikie2013-05-242-2/+14
| | | | | | | | | | | | types Perhaps we should just suppress this, rather than erroring, but since we have the infrastructure for it I figured I'd use it - if this is determined to be not the right thing we should probably remove that infrastructure entirely. I guess it's lying around from the early days of implementing debug info support. llvm-svn: 182673
* [PATCH] Generate cold attribute for functions marked __atribute__((cold))Diego Novillo2013-05-242-3/+4
| | | | | | | | | | | | | This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now generate the IR attribute in addition to marking the function to be optimized for size. I tried adding a separate CHECK in the existing test, but it was failing. I suppose CHECK matches one line exactly once? This would be a problem if the attributes are listed in a different order, though they seem to be sorted. llvm-svn: 182666
* typo.Adrian Prantl2013-05-241-1/+1
| | | | llvm-svn: 182660
* [ms-inline asm] Don't diagnose an empty lookup for inline assmebly. This happenChad Rosier2013-05-244-3/+19
| | | | | | | | | | | | | for labels in inline assembly that aren't in the lookup tables. E.g., __asm { a: jmp a } rdar://13983623 llvm-svn: 182659
* Ignore contents of #if 0 blocks.Alexander Kornienko2013-05-243-1/+218
| | | | | | | | | | | | | | | | Summary: Added stack of preprocessor branching directives, and ignore all tokens inside #if 0 except for preprocessor directives. Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D855 llvm-svn: 182658
* Fix printing CXXTemporaryObjectExpr with default args.Rafael Espindola2013-05-242-0/+7
| | | | | | Patch by Will Wilson. llvm-svn: 182651
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-244-6/+22
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Add -lrt to sanitizer link arguments.Evgeniy Stepanov2013-05-242-0/+5
| | | | | | | | Sanitizer runtime intercepts functions from librt. Not doing this will fail if the librt dependency is not present at program startup (ex. comes from a dlopen()ed library). llvm-svn: 182645
* Fix comment typo pointed out by maslen on IRC.Duncan Sands2013-05-241-1/+1
| | | | llvm-svn: 182642
* User correct case for 'FileCheck'.Argyrios Kyrtzidis2013-05-241-1/+1
| | | | llvm-svn: 182632
* [modules] If we hit a failure while loading a PCH/module, abort parsing ↵Argyrios Kyrtzidis2013-05-2413-4/+84
| | | | | | | | | | instead of trying to continue in an invalid state. Also don't let libclang create a PCH with such an error. Fixes rdar://13953768 llvm-svn: 182629
* Update static analyzer build to checker-275.Ted Kremenek2013-05-242-1/+13
| | | | llvm-svn: 182626
* Fix crash-on-invalid if list-initialization works, but we bail out whenRichard Smith2013-05-232-1/+12
| | | | | | building the resulting expression because it invokes a deleted constructor. llvm-svn: 182624
* Constify the 'dump' method so that it can be called by a const object.Bill Wendling2013-05-232-4/+3
| | | | llvm-svn: 182620
* Fix assert on temporary std::initializer_list.Richard Smith2013-05-232-1/+12
| | | | llvm-svn: 182615
* More tests and a fix for braced init lists.Daniel Jasper2013-05-232-2/+6
| | | | | | Before: f(new vector<int> { 1, 2, 3 }); After: f(new vector<int>{ 1, 2, 3 }); llvm-svn: 182614
* [analyzer; alternate edges] Add a new test case file to regression test the ↵Ted Kremenek2013-05-231-0/+9280
| | | | | | | | new arrows algorithm. This essentially combines the tests in plist-output.m and plist-alternate-output.m. llvm-svn: 182612
* Fix aligning of comments.Manuel Klimek2013-05-232-4/+25
| | | | | | | | | | | | | | | | | Previously we started sequences to align for single line comments when the previous line had a trailing comment, but the sequence was broken for other reasons. Now we re-format: // a // b f(); // c to: // a // b f(); // c llvm-svn: 182608
* Fix aligning of comments that are at the start of the line.Manuel Klimek2013-05-232-3/+11
| | | | | | | | | | Now correctly leaves: f(); // comment // comment g(); // comment ... alone if the middle comment was aligned with g() before formatting. llvm-svn: 182605
* Add caveat to __builtin_readcyclecounter documentation.Tim Northover2013-05-231-1/+3
| | | | | | | The ARM cycle-counter can be restricted by the operating system; it's worth warning potential users of this issue. llvm-svn: 182604
* Increase test coverage for braced init lists.Daniel Jasper2013-05-232-1/+14
| | | | | | Also fix a minor bug for constructor initializers with braced init lists. llvm-svn: 182601
* Improve formatting of braced lists.Daniel Jasper2013-05-233-8/+6
| | | | | | Before: vector<int> v{ -1}; After: vector<int> v{-1}; llvm-svn: 182597
* clang-format integration for git.Daniel Jasper2013-05-231-0/+513
| | | | | | | | | | Put this somewhere on your path and use: git clang-format Awesome work by Mark Lodato. Many thanks! llvm-svn: 182596
* Make helper functions static.Benjamin Kramer2013-05-232-4/+5
| | | | llvm-svn: 182589
* Stop aligning trailing comments which are aligned with the next line.Manuel Klimek2013-05-232-1/+28
| | | | | | | | | | | | | | | | | | | | | | | Previously we would align: f(); // comment // other comment g(); Even if // other comment was at the start of the line. Now we do not align trailing comments if they have been already aligned correctly with the next line. Thus, f(); // comment // other comment g(); will not be changed, while: f(); // comment // other commment g(); will lead to the two trailing comments being aligned. llvm-svn: 182577
* Use a SourceRange for the whitespace location in FormatToken.Manuel Klimek2013-05-235-41/+53
| | | | | | | | | | | Replaces the use of WhitespaceStart + WhitspaceLength. This made a bug in the formatter obvous where we would incorrectly calculate the next column. FIXME: There's a similar bug left regarding TokenLength. We should probably also move to have a TokenRange instead. llvm-svn: 182572
* Improve formatting of braced lists.Daniel Jasper2013-05-234-18/+46
| | | | | | | | | | | | | Before: vector<int> x { 1, 2, 3 }; After: vector<int> x{ 1, 2, 3 }; Also add a style option to remove the spaces inside braced lists, so that the above becomes: std::vector<int> v{1, 2, 3}; llvm-svn: 182570
* Fix no-assert compiles.Manuel Klimek2013-05-231-1/+4
| | | | llvm-svn: 182569
* Expand parsing of braced init lists.Manuel Klimek2013-05-233-21/+174
| | | | | | | | | | | | | | | | Allows formatting of C++11 braced init list constructs, like: vector<int> v { 1, 2, 3 }; f({ 1, 2 }); This involves some changes of how tokens are handled in the UnwrappedLineFormatter. Note that we have a plan to evolve the design of the token flow into one where we create all tokens up-front and then annotate them in the various layers (as we currently already have to create all tokens at once anyway, the current abstraction does not help). Thus, this introduces FIXMEs towards that goal. llvm-svn: 182568
* [analyzer;alternate edges] fix type that was causing the wrong path piece to ↵Ted Kremenek2013-05-231-1/+1
| | | | | | get removed. llvm-svn: 182562
* Fix bitcode desynchronization when loading a PCH containing a class templateRichard Smith2013-05-234-18/+56
| | | | | | | | | | | specialization with modules enabled. Just don't merge them at all for now; we'll revisit this when support for template merging is added. In passing, make Decl::dump() a little safer to use with PCH/modules, by making it not deserialize any additional declarations. From a debugger you can call decls_begin() or similar first if you want to dump all child decls. llvm-svn: 182544
* PR14772: Support constant expression evaluation for _Atomic types.Richard Smith2013-05-234-20/+109
| | | | | | | | | * Treat _Atomic(T) as a literal type if T is a literal type. * Evaluate expressions of this type properly. * Fix a lurking bug where we built completely bogus ASTs for converting to _Atomic types in C++ in some cases, caught by the tests for this change. llvm-svn: 182541
* Adding in parsing and the start of semantic support for __sptr and __uptr ↵Aaron Ballman2013-05-2213-23/+216
| | | | | | | | | | pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes. For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx Patch reviewed by Richard Smith. llvm-svn: 182535
* Debug Info: Handle function/method types using the most specific typeDavid Blaikie2013-05-222-15/+15
| | | | llvm-svn: 182533
* Comment and cleanup.Adrian Prantl2013-05-221-5/+7
| | | | | | rdar://problem/13359718 llvm-svn: 182524
* Insert explicit casts to try appease overload resolution in the buildbotsPete Cooper2013-05-221-1/+1
| | | | llvm-svn: 182514
* Use scope-resolution operator to hopefully unbreak Windows builds.Ted Kremenek2013-05-221-1/+1
| | | | llvm-svn: 182509
* Simplifiy code using return value of erase().Ted Kremenek2013-05-221-3/+1
| | | | llvm-svn: 182506
* [analyzer; alternate edges] remove redundant adjacent "events" with the same ↵Ted Kremenek2013-05-221-0/+27
| | | | | | | | text. Fixes <rdar://problem/13949982> llvm-svn: 182505
* Bugfix for r181629:Adrian Prantl2013-05-222-3/+6
| | | | | | | | | - The return type should be a pointer to the class type. - Make the condition more specific. rdar://problem/13359718 llvm-svn: 182504
* [analyzer;alternate edges] remove puny edges on the same line that span less ↵Ted Kremenek2013-05-221-2/+70
| | | | | | | | | | | than 3 columns. These are legitimate control-flow edges, but visually they add no value. Implements <rdar://problem/13941325>. llvm-svn: 182502
* Remove unnecessary assignment.Ted Kremenek2013-05-221-2/+0
| | | | llvm-svn: 182501
* Remove unused #include <map>Reid Kleckner2013-05-221-1/+0
| | | | llvm-svn: 182500
* scan-build: use the xcodebuild specified by the user.Jordan Rose2013-05-221-9/+4
| | | | | | | | | | This is important if the user has multiple Xcodes installed on their system -- we use xcodebuild to do a version check, and therefore we need to make sure we match the actual build command. Reported by Howard Ling! llvm-svn: 182498
* [analyzer] Don't crash if a block doesn't have a type signature.Jordan Rose2013-05-223-5/+39
| | | | | | | | | | | Currently, blocks instantiated in templates lose their "signature as written"; it's not clear if this is intentional. Change the analyzer's use of BlockDecl::getSignatureAsWritten to check whether or not the signature is actually there. <rdar://problem/13954714> llvm-svn: 182497
OpenPOWER on IntegriCloud