summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Mips] Add two new aliases for MIPS ABI names 32 (means o32 abi) and 64Simon Atanasyan2013-02-274-33/+59
| | | | | | | (means n64 abi) to improve compatibility with GNU tools. Patch by Jia Liu <proljc@gmail.com>. llvm-svn: 176187
* Better support for constructors with -cxx-abi microsoft, partly fixes PR12784Timur Iskhodzhanov2013-02-2710-90/+351
| | | | llvm-svn: 176186
* Make the negative test of recordType depend on a specific record.Manuel Klimek2013-02-271-2/+4
| | | | | | Otherwise it'll break if there's a record type in the AST by default. llvm-svn: 176181
* Fix formatting of multiplications in array subscripts.Daniel Jasper2013-02-272-0/+4
| | | | | | | | | | Before: a[a* a] = 1; After: a[a * a] = 1; llvm-svn: 176180
* [Sanitizer] Change driver behavior when linking with -fsanitize=thread and ↵Alexey Samsonov2013-02-274-126/+135
| | | | | | -fsanitize=memory. TSan/MSan also provide their versions of new/delete and should use the same strategy as ASan. Share the code that sets linker flags for all sanitizers. llvm-svn: 176178
* Enable bin-packing in Google style.Daniel Jasper2013-02-272-77/+105
| | | | | | | | | | | | | | After some discussions, it seems that this is the better path in the long run. Does not change Chromium style, as there, bin packing is forbidden by the style guide. Also fix two minor bugs wrt. formatting: 1. If a call parameter is a function call itself and is split before the "." or "->", split before the next parameter. 2. If a call parameter is string literal that has to be split onto two lines, split before the next parameter. llvm-svn: 176177
* Update clang for LLVM API change. No functionality change.Nick Lewycky2013-02-271-1/+2
| | | | llvm-svn: 176174
* Don't cache the visibility of types.Rafael Espindola2013-02-273-50/+117
| | | | | | | | | | | | | Since r175326 an implicitly hidden template argument can cause a template installation to become hidden, even if the template itself has an explicit default visibility. This requires that we keep track of "late" additions of the visibility attribute. This is hopefully the last followup change. It just removes the caching of visibilities from types so that we can see new attributes even after a type has been used. llvm-svn: 176164
* Use the correct alignment for POD-member memcpys where the first field is aLang Hames2013-02-272-7/+24
| | | | | | | | | | | | bitfield. CGBitField::StorageAlignment holds the alignment in chars, but emitMemcpy had been treating it as if it were held in bits, leading to underaligned memcpys. Related to PR15348. Thanks very much to Chandler for the diagnosis. llvm-svn: 176163
* Rename methods to comply with the LLVM Coding Standards.Rafael Espindola2013-02-276-40/+41
| | | | llvm-svn: 176159
* Change Type::getLinkageAndVisibility to return a LinkageInfo.Rafael Espindola2013-02-273-27/+17
| | | | llvm-svn: 176157
* Move LinkageInfo out of NamedDecl so that it can be used in Type.h.Rafael Espindola2013-02-275-94/+92
| | | | | | | Everything that cares about visibility also cares about linkage, so I just moved it to Visibility.h instead of creating a new .h. llvm-svn: 176155
* Update template diffing to handle template arguments that are declarations.Richard Trieu2013-02-272-4/+125
| | | | llvm-svn: 176153
* Add a test to make sure __has_include works from inside a macro.Argyrios Kyrtzidis2013-02-271-0/+6
| | | | llvm-svn: 176152
* Temporarily revert r176116 for compile-time performance regression.Adrian Prantl2013-02-277-166/+23
| | | | | | This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c. llvm-svn: 176151
* [analyzer] Add stop-gap patch to prevent assertion failure when analyzing ↵Ted Kremenek2013-02-271-1/+1
| | | | | | | | | | LLVM codebase. This potentially reduces a performance optimization of throwing away PreStmtPurgeDeadSymbols nodes. I'll investigate the performance impact soon and see if we need something better. llvm-svn: 176149
* [PCH] When deserializing an IdentifierInfo, call ↵Argyrios Kyrtzidis2013-02-272-3/+5
| | | | | | | | | IdentifierInfo::RevertTokenIDToIdentifier() only when it's not already an identifier. Fixes an assertion hit. rdar://13288735 llvm-svn: 176148
* comment parsing: Properties are considered like methods, and people Fariborz Jahanian2013-02-273-0/+27
| | | | | | | think of them as having return values that may be computed. Don't warn when using @return in their comment. // rdar://13189938 llvm-svn: 176147
* Don't crash when diagnosing path-constrained protectedJohn McCall2013-02-272-104/+176
| | | | | | | | access to a private member to which we have special access. rdar://12926092 llvm-svn: 176146
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-2732-204/+129
| | | | llvm-svn: 176145
* [analyzer] If a struct has a partial lazy binding, its fields aren't Undef.Jordan Rose2013-02-273-16/+57
| | | | | | | | | | | | | | | | | | | | | | This is essentially the same problem as r174031: a lazy binding for the first field of a struct may stomp on an existing default binding for the entire struct. Because of the way RegionStore is set up, we can't help but lose the top-level binding, but then we need to make sure that accessing one of the other fields doesn't come back as Undefined. In this case, RegionStore is now correctly detecting that the lazy binding we have isn't the right type, but then failing to follow through on the implications of that: we don't know anything about the other fields in the aggregate. This fix adds a test when searching for other kinds of default values to see if there's a lazy binding we rejected, and if so returns a symbolic value instead of Undefined. The long-term fix for this is probably a new Store model; see <rdar://problem/12701038>. Fixes <rdar://problem/13292559>. llvm-svn: 176144
* Refine SourceManager's isBeforeInTranslationUnit() cache to have more entries.Ted Kremenek2013-02-272-5/+47
| | | | | | | | | | | | | | | | | | | | | | isBeforeInTranslationUnit() uses a cache to reduce the expensive work to compute a common ancestor for two FileIDs. This work is very expensive, so even caching the latest used FileIDs was a big win. A closer analysis of the cache before, however, shows that the cache access pattern would oscillate between a working set of FileIDs, and thus caching more pairs would be profitable. This patch adds a side table for extending caching. This side table is bounded in size (experimentally determined in this case from a simple Objective-C project), and when the table gets too large we fall back to the single entry caching before as before. On Sketch (a small example Objective-C project), this optimization reduces -fsyntax-only time on SKTGraphicView.m by 5%. This is for a project that is already using PCH. Fixes <rdar://problem/13299847> llvm-svn: 176142
* Use existing macros to simplify the test a bit.Rafael Espindola2013-02-261-19/+19
| | | | llvm-svn: 176138
* Temporarily revert r176133 until testcases are modified.Bill Wendling2013-02-261-0/+13
| | | | llvm-svn: 176137
* Fix testcases to not rely upon target-* attributes.Bill Wendling2013-02-2619-289/+270
| | | | llvm-svn: 176135
* Don't set the -target-cpu and -target-features attributes just now.Bill Wendling2013-02-261-13/+0
| | | | | | | This is causing some problems with some of the builders. It's non-trivial to reset the target's features. llvm-svn: 176133
* No need to initialize these variables.Chad Rosier2013-02-261-1/+1
| | | | llvm-svn: 176128
* doxygen command. Add 'attention' command to list of similarFariborz Jahanian2013-02-264-0/+4
| | | | | | doxygen commands. // rdar://12379053 llvm-svn: 176127
* Fix assertion failure when a field is given an address space.Matt Arsenault2013-02-264-11/+35
| | | | llvm-svn: 176122
* Fix initializer for variables with attribute address_space set.Matt Arsenault2013-02-262-5/+26
| | | | | | | | | | | | This would error in C++ mode unless the variable also had a cv qualifier. e.g. __attribute__((address_space(2))) float foo = 1.0f; would error but __attribute__((address_space(2))) const float foo = 1.0f; would not. llvm-svn: 176121
* Ensure that DIType is regenerated after we visited an implementation that ↵Adrian Prantl2013-02-267-23/+166
| | | | | | adds ivars to an interface. Fixes rdar://13175234 llvm-svn: 176116
* [analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is ↵Ted Kremenek2013-02-2616-253/+369
| | | | | | | | | | | | a VarRegion. Fixes PR15358 and <rdar://problem/13295437>. Along the way, shorten path diagnostics that say "Variable 'x'" to just be "'x'". By the context, it is obvious that we have a variable, and so this just consumes text space. llvm-svn: 176115
* Warn on dropping the return value from a warn_unused_result function, even inMatt Beaumont-Gay2013-02-262-5/+23
| | | | | | macros. llvm-svn: 176114
* Use the most recent decl in getExplicitVisibility.Rafael Espindola2013-02-262-29/+59
| | | | | | | | | | | | | | | | | | | Now that implicitly hidden template arguments can make an instantiation hidden, it is important to look at more than just the canonical decl of the argument in order to see if an attribute is available in a more recent decl. This has the disadvantage of exposing when getExplicitVisibility is called, but lets us handle cases like template <typename T> struct __attribute__((visibility("default"))) barT { static void zed() {} }; class foo; class __attribute__((visibility("default"))) foo; template struct barT<foo>; llvm-svn: 176112
* Be more careful in applying pragma weak. Fixes pr14974.Rafael Espindola2013-02-262-2/+41
| | | | | | | | | | GCC applies a pragma weak to a decl if it matches the mangled name. We used to apply if it matched the plain name. This patch is a compromise: we apply the pragma only if it matches the name and the decl has C language linkage. llvm-svn: 176110
* Fix bad line break decision.Daniel Jasper2013-02-262-3/+5
| | | | | | | | | | | | Before: if (Intervals[i].getRange().getFirst() < Intervals[i - 1] .getRange().getLast()) {} After: if (Intervals[i].getRange().getFirst() < Intervals[i - 1].getRange().getLast()) {} llvm-svn: 176092
* Allow dash before "ld" in android driver test.Evgeniy Stepanov2013-02-261-2/+2
| | | | | | Sometimes android linker is "arm-linux-androideabi-ld", and not just "ld". llvm-svn: 176088
* In range-based for-loops, prefer splitting after ":".Daniel Jasper2013-02-262-5/+7
| | | | | | | | | | | | Before: for (const aaaaaaaaaaaaaaaaaaaaa & aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} After: for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {} llvm-svn: 176087
* Only keep empty lines in unwrapped lines if they preceed a line comment.Daniel Jasper2013-02-263-13/+19
| | | | | | | | | | | | | | | | | | Empty lines followed by line comments are often used to highlight the comment. Empty lines somewhere else are usually left over from manual or automatic formatting and should probably be removed. Before (clang-format would keep): S s = { a, b }; After: S s = { a, b }; llvm-svn: 176086
* Only break string literals as a last resort.Daniel Jasper2013-02-262-1/+7
| | | | | | | | | | | | | | | | | We might want to move towards doing this if the formatting can be significantly improved, but we need to carefully evaluate the different situations first. Before (the string literal was split by clang-format here): aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa " "aaaaa aaa aaa aaaaaa")); After: aaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa")); llvm-svn: 176084
* Define CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ ↵Alexey Samsonov2013-02-261-3/+3
| | | | | | subdirectory. Otherwise, while configuring the build tree for the first time, Clang unit tests could avoid being added to 'check-clang' command, and thus avoid being built and executed. llvm-svn: 176080
* Unify clang/llvm attributes for asan/tsan/msan (Clang part)Kostya Serebryany2013-02-2614-33/+320
| | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S llvm-svn: 176076
* Update tests to do a full match against printed C++11 attributes.Michael Han2013-02-261-7/+7
| | | | llvm-svn: 176074
* [analyzer] Don't look through casts when creating pointer temporaries.Jordan Rose2013-02-263-12/+34
| | | | | | | | | | | | | | | Normally, we need to look through derived-to-base casts when creating temporary object regions (added in r175854). However, if the temporary is a pointer (rather than a struct/class instance), we need to /preserve/ the base casts that have been applied. This also ensures that we really do create a new temporary region when we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs. Fixes PR15342, although the test case doesn't include the crash because I couldn't isolate it. llvm-svn: 176069
* [analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.Jordan Rose2013-02-262-12/+13
| | | | | | | | | | | | With the new support for trivial copy constructors, we are not always consistent about whether a CXXTempObjectRegion gets reused or created from scratch, which affects whether qualifiers are preserved. However, we probably don't care anyway. This also switches to using the current PrintingPolicy for the type, which means C++ types don't get a spurious 'struct' prefix anymore. llvm-svn: 176068
* [ubsan] Emit single check for left shift.Will Dietz2013-02-253-21/+37
| | | | | | Avoids warning twice on same shift. llvm-svn: 176056
* [analyzer] Restrict ObjC type inference to methods that have related result ↵Anna Zaks2013-02-252-30/+49
| | | | | | | | | | | | type. This addresses a case when we inline a wrong method due to incorrect dynamic type inference. Specifically, when user code contains a method from init family, which creates an instance of another class. Use hasRelatedResultType() to find out if our inference rules should be triggered. llvm-svn: 176054
* [analyzer] Recover all PreStmtPurgeDeadSymbols nodes with a single successor ↵Ted Kremenek2013-02-251-2/+21
| | | | | | | | | | | | | | or predecessor. These nodes are never consulted by any analyzer client code, so they are used only for machinery for removing dead bindings. Once successor nodes are generated they can be safely removed. This greatly reduces the amount of nodes that are generated in some case, lowering the memory regression when analyzing Sema.cpp introduced by r176010 from 14% to 2%. llvm-svn: 176050
* Various additions to ASTMatcher library:Edwin Vane2013-02-253-1/+285
| | | | | | | | | | | | | | | | New type matchers: * recordType * elaboratedType New narrowing matchers: * hasQualifier * namesType * hasDeclContext Added tests and updated LibASTMatchersReference. Reviewers: klimek llvm-svn: 176047
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-2544-444/+449
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
OpenPOWER on IntegriCloud