summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [ms-cxxabi] Implement member data pointers for non-dynamic classesReid Kleckner2013-03-223-10/+130
| | | | | | | | | | | | | | | | | | | | Summary: For non-dynamic classes (no virtual bases), member data pointers are simple offsets from the base of the record. Dynamic classes use an aggregate for member data pointers and are therefore currently unsupported. Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic classes. Non-polymorphic classes use -1 like Itanium, since 0 is a valid field offset. Reviewers: rjmccall CC: timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D558 llvm-svn: 177753
* <rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex ↵Douglas Gregor2013-03-223-113/+55
| | | | | | | | | | | | | | interaction to eliminate a pile of extraneous stats(). The refactoring in r177367 introduced a serious performance bug where the "lazy" resolution of module file names in the global module index to actual module file entries in the module manager would perform repeated negative stats(). The new interaction requires the module manager to inform the global module index when a module file has been loaded, eliminating the extraneous stat()s and a bunch of bookkeeping on both sides. llvm-svn: 177750
* documentation parsing. Provide code completion comment Fariborz Jahanian2013-03-221-0/+14
| | | | | | | | for self.GetterName where GetterName is the getter method for a property with name different from the property name (declared via a property getter attribute) // rdar://12791315 llvm-svn: 177744
* Better fix for r177725.Daniel Jasper2013-03-222-7/+4
| | | | | | | | | | | | It turns out that -foo; can be an objective C method declaration. So instead of the previous solution, recognize objective C methods only if we are in a declaration scope. llvm-svn: 177740
* Align comments to surrounding unformatted comments.Daniel Jasper2013-03-221-3/+18
| | | | | | | | | | | | | | | Before: int a; // not formatted // formatting this line only After: int a; // not formatted // formatting this line only This makes clang-format stable independent of whether the whole file or single lines are formatted in most cases. llvm-svn: 177739
* [cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching itReid Kleckner2013-03-221-32/+16
| | | | | | As the comment says, it's a little silly to cache it in the ABI code. llvm-svn: 177738
* More precisely recognize ObjC method declarations.Daniel Jasper2013-03-221-3/+5
| | | | | | | | | Otherwise, +/- and the beginning of constants can be recognized incorrectly. Before: #define A - 1 After: #define A -1 llvm-svn: 177725
* Fix DeclRefExpr::getFoundDecl() for usages by reference.Daniel Jasper2013-03-221-6/+6
| | | | llvm-svn: 177721
* Make clang-format understand more line comments.Daniel Jasper2013-03-221-0/+1
| | | | | | | | | | | Apparently one needs to set LangOptions.LineComment. Before "//* */" got reformatted to "/ /* */" as the lexer was returning the token sequence (slash, comment). This could also lead to weird other stuff, e.g. for people that like to using comments like: //**************** llvm-svn: 177720
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-2221-3/+554
| | | | llvm-svn: 177705
* Warn about attempts to reinterpret_cast between two types that areJohn McCall2013-03-221-2/+87
| | | | | | | | hierarchy-related at a possibly nonzero offset. Patch by Alexander Zinenko! llvm-svn: 177698
* Fix a crash-on-valid where a block capture copy expression wasJohn McCall2013-03-225-4/+15
| | | | | | | | | | | | picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. llvm-svn: 177692
* ubsan: Pass floating-point arguments to the runtime by value if they fit theRichard Smith2013-03-221-1/+10
| | | | | | value argument. If not, be sure we don't accidentally use a dynamic alloca. llvm-svn: 177690
* <rdar://problem/13479214> Make Clang's <stddef.h> robust against system ↵Douglas Gregor2013-03-221-5/+19
| | | | | | | | | | | | | | headers defining size_t/ptrdiff_t/wchar_t. Clang's <stddef.h> provides definitions for the C standard library types size_t, ptrdiff_t, and wchar_t. However, the system's C standard library headers tend to provide the same typedefs, and the two generally avoid each other using the macros _SIZE_T/_PTRDIFF_T/_WCHAR_T. With modules, however, we need to see *all* of the places where these types are defined, so provide the typedefs (ignoring the macros) when modules are enabled. llvm-svn: 177686
* <rdar://problem/13477190> Give the Clang module cache directory some ↵Douglas Gregor2013-03-211-1/+2
| | | | | | | | | | structure, so it's easier to find. We now put the Clang module cache in <system-temp-directory>/org.llvm.clang/ModuleCache. Perhaps some day there will be other caches under <system-temp-directory>/org.llvm.clang>. llvm-svn: 177671
* Fix indentationDavid Blaikie2013-03-211-3/+3
| | | | llvm-svn: 177665
* Objective-C: Tighten the rules when warningFariborz Jahanian2013-03-212-1/+68
| | | | | | | | | | is issused for on overriding 'readwrite' property which is not auto-synthesized. Buttom line is that if hueristics determine that there will be a user implemented setter, no warning will be issued. // rdar://13388503 llvm-svn: 177662
* Remove unused variable.Benjamin Kramer2013-03-211-3/+0
| | | | llvm-svn: 177657
* Avoid warnings from compilers that think you can drop off the end of a fully ↵Benjamin Kramer2013-03-211-0/+2
| | | | | | covered switch. llvm-svn: 177656
* [analyzer] Print return values from debug.DumpCalls checker.Jordan Rose2013-03-211-1/+23
| | | | | | Debug utility only, no functionality change. llvm-svn: 177649
* Better block comment formatting.Alexander Kornienko2013-03-211-29/+35
| | | | | | | | | | | | | | | | | Summary: 1. When splitting one-line block comment, use indentation and *s. 2. Remove trailing whitespace from all lines of a comment, not only the ones being splitted. 3. Add backslashes for all lines if a comment is used insed a preprocessor directive. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D557 llvm-svn: 177635
* [ASan] Let the users to invoke `clang -fsanitize=address` to link binaries ↵Alexander Potapenko2013-03-211-8/+10
| | | | | | targeting the iOS simulator. llvm-svn: 177633
* <rdar://problem/13037793> Allow the names of modules to differ from the name ↵Douglas Gregor2013-03-211-8/+31
| | | | | | of their subdirectory in the include path. llvm-svn: 177621
* Further weaken block conversion rules to permit blocks withJohn McCall2013-03-211-10/+25
| | | | | | | | | enum return type to be converted to blocks with any integer type of the same size. rdar://13463504 llvm-svn: 177613
* Split ubsan runtime into three pieces (clang part):Richard Smith2013-03-201-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | * libclang_rt-san-* is sanitizer_common, and is linked in only if no other sanitizer runtime is present. * libclang_rt-ubsan-* is the piece of the runtime which doesn't depend on a C++ ABI library, and is always linked in. * libclang_rt-ubsan_cxx-* is the piece of the runtime which depends on a C++ ABI library, and is only linked in when linking a C++ binary. This change also switches us to using -whole-archive for the ubsan runtime (which is made possible by the above split), and switches us to only linking the sanitizer runtime into the main binary and not into DSOs (which is made possible by using -whole-archive). The motivation for this is to only link a single copy of sanitizer_common into any binary. This is becoming important now because we want to share more state between multiple sanitizers in the same process (for instance, we want a single shared output mutex). The Darwin ubsan runtime is unchanged; because we use a DSO there, we don't need this complexity. llvm-svn: 177605
* [ms-cxxabi] Mangle function pointer template arguments correctlyReid Kleckner2013-03-201-1/+3
| | | | | | | | | | Reviewers: rjmccall CC: timurrrr, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D554 llvm-svn: 177589
* [analyzer] Appease buildbots: include template arguments in base class ref.Jordan Rose2013-03-201-1/+1
| | | | llvm-svn: 177583
* Documentation cleanup for MacroInfo.James Dennett2013-03-201-4/+4
| | | | | | | | | | | | | | * Clarify what MacroInfo::isBuiltinMacro means, as it really means something more like "isMagicalMacro" or "requiresProcessingBeforeExpansion" -- the macros defined in "<built-in>" are not considered built-in by this function; * Escape __LINE__ as \__LINE__ in Doxygen comments so that the underscores don't get replaced by *bold* output; * Turn comments in MacroInfo.cpp into non-Doxygen comments, so that they don't result in duplicated/badly formatted Doxygen output; * Clean up a bunch of \brief formatting, and add a \file comment for MacroInfo.h. llvm-svn: 177581
* <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, ↵Douglas Gregor2013-03-207-43/+216
| | | | | | and warn when a newly-imported module conflicts with an already-imported module. llvm-svn: 177577
* [analyzer] Don't invalidate globals when there's no call involved.Jordan Rose2013-03-201-11/+9
| | | | | | | | | | | | | | This fixes some mistaken condition logic in RegionStore that caused global variables to be invalidated when /any/ region was invalidated, rather than only as part of opaque function calls. This was only being used by CStringChecker, and so users will now see that strcpy() and friends do not invalidate global variables. Also, add a test case we don't handle properly: explicitly-assigned global variables aren't being invalidated by opaque calls. This is being tracked by <rdar://problem/13464044>. llvm-svn: 177572
* [analyzer] Track malloc'd memory into struct fields.Jordan Rose2013-03-201-6/+0
| | | | | | | | | | | | | | | Due to improper modelling of copy constructors (specifically, their const reference arguments), we were producing spurious leak warnings for allocated memory stored in structs. In order to silence this, we decided to consider storing into a struct to be the same as escaping. However, the previous commit has fixed this issue and we can now properly distinguish leaked memory that happens to be in a struct from a buffer that escapes within a struct wrapper. Originally applied in r161511, reverted in r174468. <rdar://problem/12945937> llvm-svn: 177571
* [analyzer] Invalidate regions indirectly accessible through const pointers.Jordan Rose2013-03-203-66/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | In this case, the value of 'x' may be changed after the call to indirectAccess: struct Wrapper { int *ptr; }; void indirectAccess(const Wrapper &w); void test() { int x = 42; Wrapper w = { x }; clang_analyzer_eval(x == 42); // TRUE indirectAccess(w); clang_analyzer_eval(x == 42); // UNKNOWN } This is important for modelling return-by-value objects in C++, to show that the contents of the struct are escaping in the return copy-constructor. <rdar://problem/13239826> llvm-svn: 177570
* [analyzer] Remove strip of ElementRegion in CallEvent::invalidateRegions.Jordan Rose2013-03-201-26/+0
| | | | | | | | | | | | | | This is a bit of old code trying to deal with the fact that functions that take pointers often use them to access an entire array via pointer arithmetic. However, RegionStore already conservatively assumes you can use pointer arithmetic to access any part of a region. Some day we may want to go back to handling this specifically for calls, but we can do that in the future. No functionality change. llvm-svn: 177569
* Do the error recovery for @end only.Fariborz Jahanian2013-03-201-4/+7
| | | | | | | | I am not sure how much we can improve for when a randon ObjC keyword is thrown into the ivar decl. block. // rdar://6854840 llvm-svn: 177553
* Objective-C [qoi] more gracefull recovery when Fariborz Jahanian2013-03-201-17/+28
| | | | | | | '}' is missing for the ivar declarations. // rdar://6854840 llvm-svn: 177549
* PR7256: Provide a fixit for incorrect destructor declarationsDavid Blaikie2013-03-201-2/+10
| | | | | | Fix by Ismail Pazarbasi (ismail.pazarbasi@gmail.com), review by Dmitri Gribenko. llvm-svn: 177546
* Only introduce the SDKSettings.plist dependency in modules/PCH files that ↵Douglas Gregor2013-03-201-1/+1
| | | | | | don't depend on any other modules or PCH files. llvm-svn: 177542
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-207-12/+64
| | | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. Updated from r177211. rdar://12818789 llvm-svn: 177541
* Support for pointers-to-members usage via .*Alexander Kornienko2013-03-201-2/+4
| | | | | | | | | | | | | | Summary: Added support for pointers-to-members usage via .* and a few tests. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D556 llvm-svn: 177537
* Remove assertion that can be triggered on bad input.Daniel Jasper2013-03-201-2/+1
| | | | | | | clang-format can't do anything useful, so it should leave the remainder of the line unchanged, but it should not assert/segfault. llvm-svn: 177530
* Fix infinite-loop in unwrapped line parser.Daniel Jasper2013-03-201-1/+1
| | | | | | Discovered when accidentally formatting a python file :-). llvm-svn: 177527
* Do not consider comments when adjusting to local indent style.Daniel Jasper2013-03-201-1/+2
| | | | | | | | | | | | | | | | Before (when only reformatting "int b"): int a; // comment // comment int b; After: int a; // comment // comment int b; This also fixes llvm.org/PR15433. llvm-svn: 177524
* Reduce penalty for breaks after "(" for functions with parameters.Daniel Jasper2013-03-202-3/+3
| | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 177521
* Add extra indentation for multiline comparisons.Daniel Jasper2013-03-203-31/+30
| | | | | | | | | | | | | | | | This seems to be generally more desired. Before: if (aaaaaaaa && bbbbbbbb > cccccccc) {} After: if (aaaaaaaa && bbbbbbbb > cccccccc) {} Also: Some formatting cleanup on clang-format's files. llvm-svn: 177514
* Don't remove all indentation when in #defines.Daniel Jasper2013-03-201-1/+1
| | | | | | | | | | Otherwise, this can become hard to read. Before: #define A \ case 1: After: #define A \ case 1: llvm-svn: 177509
* Improve formatting of function types in template parameters.Daniel Jasper2013-03-201-3/+9
| | | | | | Before: A<int * (int)>; After: A<int *(int)>; llvm-svn: 177505
* Fix redundant comparison in gcc::Common::ConstructJob.Hans Wennborg2013-03-201-1/+1
| | | | | | | | | | We were checking "Arch == llvm::Triple::x86_64 || Arch == llvm::Triple::x86_64", but the rhs should actually check for powerpc64. Found while experimenting with a potential new Clang warning. llvm-svn: 177496
* Remove some dead code.John McCall2013-03-201-11/+0
| | | | | | Patch by Stephen Lin! llvm-svn: 177490
* Make sure that Module::ConfigMacrosExhaustive gets initialized and ↵Douglas Gregor2013-03-202-6/+10
| | | | | | | | | deserialized correctly. This fixes regressions introduced in r177466 that caused several module tests to fail sporadically. llvm-svn: 177481
* Teach statement / declaration disambiguation about C++11-style generalized ↵Richard Smith2013-03-201-7/+21
| | | | | | initializers. llvm-svn: 177480
OpenPOWER on IntegriCloud