summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* In SourceManager::getFileIDLoaded(), add some sanity checks to make sure we ↵Argyrios Kyrtzidis2013-03-011-0/+7
| | | | | | | | don't enter an infinite loop. rdar://13120919 llvm-svn: 176331
* Restore order to placate test. I had no real reason to switch them.John McCall2013-03-011-1/+1
| | | | llvm-svn: 176328
* Re-use bit from superclass and extract stuff into a localJohn McCall2013-03-011-9/+10
| | | | | | function. Serves a patch we're kicking around out-of-tree. llvm-svn: 176327
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-0/+60
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Use the actual ABI-determined C calling convention for runtimeJohn McCall2013-02-2821-336/+470
| | | | | | | | | | | | | | | | | | | | | | calls and declarations. LLVM has a default CC determined by the target triple. This is not always the actual default CC for the ABI we've been asked to target, and so we sometimes find ourselves annotating all user functions with an explicit calling convention. Since these calling conventions usually agree for the simple set of argument types passed to most runtime functions, using the LLVM-default CC in principle has no effect. However, the LLVM optimizer goes into histrionics if it sees this kind of formal CC mismatch, since it has no concept of CC compatibility. Therefore, if this module happens to define the "runtime" function, or got LTO'ed with such a definition, we can miscompile; so it's quite important to get this right. Defining runtime functions locally is quite common in embedded applications. llvm-svn: 176286
* objective-C code completion. Property accessors may notFariborz Jahanian2013-02-281-1/+6
| | | | | | | | have their own code completion comments. Use those in their properties in this case. // rdar://12791315 llvm-svn: 176271
* Reduce penalty for splitting after "{" in static initializers.Daniel Jasper2013-02-281-3/+1
| | | | | | | | | | | | | | | | | | | | | This fixes llvm.org/PR15379. Before: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; After: const uint8_t aaaaaaaaaaaaaaaaaaaaaa[0] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // comment 0x00, 0x00, 0x00, 0x00 // comment }; llvm-svn: 176262
* Dont break between (( in __attribute__((.Daniel Jasper2013-02-281-1/+4
| | | | | | | | | | | | | | Before: void aaaaaaaaaaaaaaaaaa() __attribute__( (aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa)); After: void aaaaaaaaaaaaaaaaaa() __attribute__((aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaa)); llvm-svn: 176260
* Improve property metadata generation with the GNUstep runtime.David Chisnall2013-02-281-18/+42
| | | | llvm-svn: 176254
* No spaces around pointers to members.Daniel Jasper2013-02-281-2/+5
| | | | | | Before: (a ->* f)() After: (a->*f)() llvm-svn: 176252
* First step towards adding a parent map to the ASTContext.Manuel Klimek2013-02-281-85/+6
| | | | | | | | | | | | This does not yet implement the LimitNode approach discussed. The impact of this is an O(n) in the number of nodes in the AST reduction of complexity for certain kinds of matchers (as otherwise the parent map gets recreated for every new MatchFinder). See FIXMEs in the comments for the direction of future work. llvm-svn: 176251
* Improve formatting of #defines.Daniel Jasper2013-02-281-5/+10
| | | | | | | | | | | Two improvements: 1) Always leave at least one space before "\". Otherwise is can look bad and there is a risk of unwillingly joining to characters to a different token. 2) Use the full column limit for single-line #defines. Fixes llvm.org/PR15148 llvm-svn: 176245
* Fix bug when formatting "A<A<A>>".Daniel Jasper2013-02-281-0/+1
| | | | | | | | | | | Before: A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaa); Before: A<A<A>> ReadKansas(int aaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 176244
* Fix incorrect recognition of bin-packing.Daniel Jasper2013-02-281-1/+2
| | | | | | | | | | | | | | | | | Before (in Google style): Constructor() : aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa( aaaaaa) {} After: Constructor() : aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa), aaaaa(aaaaaa) {} llvm-svn: 176242
* Fix spacing after binary operator as macro parameter.Daniel Jasper2013-02-281-1/+2
| | | | | | Before: COMPARE(a, == , b); After: COMPARE(a, ==, b); llvm-svn: 176241
* Fix global overflow in types::lookupTypeForTypeSpecifier.Evgeniy Stepanov2013-02-281-3/+1
| | | | | | | | memcpy() is allowed to read entire contents of both memory areas. Found with AddressSanitizer. llvm-svn: 176237
* [analyzer] RegionStore: collectSubRegionKeys -> collectSubRegionBindingsJordan Rose2013-02-281-37/+46
| | | | | | | | | By returning the (key, value) binding pairs, we save lookups afterwards. This also enables further work later on. No functionality change. llvm-svn: 176230
* PR15360: nullptr as a non-type template argument to a function type non-type ↵David Blaikie2013-02-271-9/+10
| | | | | | template parameter llvm-svn: 176216
* [analyzer] Teach FindLastStoreBRVisitor to understand stores of the same value.Jordan Rose2013-02-271-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Consider this case: int *p = 0; p = getPointerThatMayBeNull(); *p = 1; If we inline 'getPointerThatMayBeNull', we might know that the value of 'p' is NULL, and thus emit a null pointer dereference report. However, we usually want to suppress such warnings as error paths, and we do so by using FindLastStoreBRVisitor to see where the NULL came from. In this case, though, because 'p' was NULL both before and after the assignment, the visitor would decide that the "last store" was the initialization, not the re-assignment. This commit changes FindLastStoreBRVisitor to consider all PostStore nodes that assign to this region. This still won't catches changes made directly by checkers if they re-assign the same value, but it does handle the common case in user-written code and will trigger ReturnVisitor's suppression machinery as expected. <rdar://problem/13299738> llvm-svn: 176201
* [analyzer] Turn on C++ constructor inlining by default.Jordan Rose2013-02-271-1/+1
| | | | | | | | | | This enables constructor inlining for types with non-trivial destructors. The plan is to enable destructor inlining within the next month, but that needs further verification. <rdar://problem/12295329> llvm-svn: 176200
* [driver] The failure of any phase (e.g., preprocess, compile, assemble) for aChad Rosier2013-02-271-1/+28
| | | | | | | | | single translation unit should prevent later phases from executing. Otherwise, this generates lots of noise in build systems. This a fallout from r173825. Patch by Matthew Curtis <mcurtis@codeaurora.org>. rdar://13298009 llvm-svn: 176198
* [Mips] Add two new aliases for MIPS ABI names 32 (means o32 abi) and 64Simon Atanasyan2013-02-272-25/+31
| | | | | | | (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-279-50/+204
| | | | llvm-svn: 176186
* Fix formatting of multiplications in array subscripts.Daniel Jasper2013-02-271-0/+3
| | | | | | | | | | 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-271-49/+33
| | | | | | -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-271-1/+7
| | | | | | | | | | | | | | 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-271-32/+95
| | | | | | | | | | | | | 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-271-7/+10
| | | | | | | | | | | | 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-273-28/+29
| | | | llvm-svn: 176159
* Change Type::getLinkageAndVisibility to return a LinkageInfo.Rafael Espindola2013-02-272-24/+10
| | | | llvm-svn: 176157
* Move LinkageInfo out of NamedDecl so that it can be used in Type.h.Rafael Espindola2013-02-273-19/+16
| | | | | | | 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-271-4/+91
| | | | llvm-svn: 176153
* Temporarily revert r176116 for compile-time performance regression.Adrian Prantl2013-02-273-65/+22
| | | | | | 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-271-1/+1
| | | | | | | | | 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-271-0/+11
| | | | | | | 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-271-104/+153
| | | | | | | | access to a private member to which we have special access. rdar://12926092 llvm-svn: 176146
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-13/+0
| | | | llvm-svn: 176145
* [analyzer] If a struct has a partial lazy binding, its fields aren't Undef.Jordan Rose2013-02-272-16/+46
| | | | | | | | | | | | | | | | | | | | | | 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-271-1/+31
| | | | | | | | | | | | | | | | | | | | | | 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
* Temporarily revert r176133 until testcases are modified.Bill Wendling2013-02-261-0/+13
| | | | llvm-svn: 176137
* 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
* Fix assertion failure when a field is given an address space.Matt Arsenault2013-02-262-10/+15
| | | | llvm-svn: 176122
* Fix initializer for variables with attribute address_space set.Matt Arsenault2013-02-261-5/+1
| | | | | | | | | | | | 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-263-22/+65
| | | | | | adds ivars to an interface. Fixes rdar://13175234 llvm-svn: 176116
* [analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is ↵Ted Kremenek2013-02-261-1/+3
| | | | | | | | | | | | 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-261-5/+17
| | | | | | macros. llvm-svn: 176114
* Use the most recent decl in getExplicitVisibility.Rafael Espindola2013-02-261-29/+26
| | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud