summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Let ASTReader optionally delete its ASTDeserializationListener.Nico Weber2014-05-083-69/+76
| | | | | | | | | | | | | | | | | | | | Use this to fix the leak of DeserializedDeclsDumper and DeserializedDeclsChecker in FrontendAction (found by LSan), PR19560. The "delete this" bool is necessary because both PCHGenerator and ASTUnit return the same object from both getDeserializationListener() and getASTMutationListener(), so ASTReader can't just have a unique_ptr. It's also not possible to just let FrontendAction (or CompilerInstance) own these listeners due to lifetime issues (see comments on PR19560). Finally, ASTDeserializationListener can't easily be refcounted, since several of the current listeners are allocated on the stack. Having this bool isn't ideal, but it's a pattern that's used in other places in the codebase too, and it seems better than leaking. llvm-svn: 208277
* Driver: parse -mcmodel earlierSaleem Abdulrasool2014-05-082-15/+24
| | | | | | | | | | | This addresses an existing FIXME item in the driver. The code model flag was parsed in the actual tool rather than in the driver. This was problematic since the value may be invalid. In that case, we would silently treat it as a default value in non-assert builds, and abort in assert builds. Add a check in the driver to validate that the value being passed is valid, and if not provide a proper error message. llvm-svn: 208275
* Fix latent bug. This can't actually manifest at the moment, but is a time-bombRichard Smith2014-05-081-1/+1
| | | | | | for the next time someone adds something to this function. llvm-svn: 208270
* Enable alternative tokens by default for clang-format.Nikola Smiljanic2014-05-081-0/+1
| | | | | | Patch by Bobby Moretti. llvm-svn: 208269
* fmodules-search-all: Removed dead code and added some comments.John Thompson2014-05-071-6/+5
| | | | llvm-svn: 208259
* CodeGen: Don't set hidden visibility on symbols with local linkageDuncan P. N. Exon Smith2014-05-072-2/+6
| | | | llvm-svn: 208258
* Add an Extension warning for applying unary * to an operand of type 'void*' inRichard Smith2014-05-071-4/+13
| | | | | | | C++. This seems like a pointless (and indeed harmful) restriction to me, so I've suggested removing it to -core and disabled this diagnostic by default. llvm-svn: 208254
* NSOrCFErrorDerefChecker: Don't leak bug type. Similar to r208110/r208155. ↵Nico Weber2014-05-071-4/+12
| | | | | | Found by LSan. llvm-svn: 208251
* When doing int<->ptr coercion for big-endian, calculate the shift amount ↵James Molloy2014-05-071-2/+3
| | | | | | | | | | | | | | | correctly. Previously we calculated the shift amount based upon DataLayout::getTypeAllocSizeInBits. This will only work for legal types - types such as i24 that are created as part of structs for bitfields will return "32" from that function. Change to using getTypeSizeInBits. It turns out that AArch64 didn't run across this problem because it always returned [1 x i64] as the type for a bitfield, whereas ARM64 returns i64 so goes down this (better, but wrong) codepath. llvm-svn: 208231
* PR19562: Fix another temporary node leak in Clang debug info emissionDavid Blaikie2014-05-071-10/+10
| | | | | | | | | | | | | | While constructing ObjC Interface types we might create the declaration of some normal C++ types, thus adding things to the ReplaceMap. Make sure we process the ReplaceMap after the ObjC interfaces. In theory we know at this point, since we're at the end of the TU, that we won't be upgrading any declarations to definitions, so we could just construct non-temporary nodes, but that would require extra state in CGDebugInfo to conditionalize the creation of declaration nodes which seems annoying/more work than is appropriate. llvm-svn: 208226
* [mips] Pass nan2008 info to the back-end.Matheus Almeida2014-05-072-4/+7
| | | | | | | | | | | | Summary: The initial support for NaN2008 was added to the back-end in r206396. Reviewers: atanasyan Reviewed By: atanasyan Differential Revision: http://reviews.llvm.org/D3448 llvm-svn: 208220
* [ARM64-BE] Correctly deal with single element HFAs in varargs.James Molloy2014-05-071-2/+4
| | | | | | | Just because the first "if" didn't fire, doesn't mean we can not have an HFA in the "else" clause. llvm-svn: 208216
* DebugInfo: Use enum instead of unsignedEd Maste2014-05-072-11/+13
| | | | | | | | This makes debuging DebugInfo generation with LLDB a little more pleasant. Differential Revision: http://reviews.llvm.org/D3626 llvm-svn: 208203
* ARM: Fix assertion caused by passing bitfield struct using ↵Oliver Stannard2014-05-071-1/+2
| | | | | | | | | | | | ABIArgInfo::getExpandWithPadding In cases where a struct must, according to the AAPCS, not be split between general purpose and floating point registers, we use ABIArgInfo::getExpandWithPadding to add the padding arguments. However, ExpandWithPadding does not work if the struct contains bitfields, so we instead must use ABIArgInfo::getDirect. llvm-svn: 208185
* Use nullptr instead of 0 for const char * value.Yaron Keren2014-05-071-5/+5
| | | | llvm-svn: 208178
* clang-format: Be slightly more aggressive on single-line functions.Daniel Jasper2014-05-071-2/+6
| | | | | | | | | | | | | | So that JS functions can also be merged into a single line. Before: var func = function() { return 1; }; After: var func = function() { return 1; }; llvm-svn: 208176
* clang-format: Fix corner cases for comments in if conditions.Daniel Jasper2014-05-072-3/+4
| | | | | | | | | | | | Before: if ( // a x + 3) { .. After: if ( // a x + 3) { .. llvm-svn: 208175
* Drop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.Joerg Sonnenberger2014-05-072-2/+10
| | | | | | | Don't bother with keeping the old support for x86_64 in 6.99.23+, just use a single range. Update test cases for the always-on --eh-frame-hdr. llvm-svn: 208170
* Also recognize Big Endian ARM variants.Joerg Sonnenberger2014-05-071-0/+2
| | | | llvm-svn: 208169
* clang-format: Fix bad space before braced initializer.Daniel Jasper2014-05-071-1/+2
| | | | | | | | | | Before: new int {1}; After: new int{1}; llvm-svn: 208168
* Fix up indentation and fix an 80 column violation.Craig Topper2014-05-071-19/+20
| | | | llvm-svn: 208164
* [C++11] Use 'nullptr'.Craig Topper2014-05-0718-307/+310
| | | | llvm-svn: 208163
* [OPENMP] Fixed problem with temp removal on some platforms in codegen for ↵Alexey Bataev2014-05-072-10/+7
| | | | | | '#pragma omp parallel' llvm-svn: 208162
* PR19562: Fix memory leak when ObjC interface types cause the creation of ↵David Blaikie2014-05-071-1/+5
| | | | | | further interfaces. llvm-svn: 208161
* [analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.Jordan Rose2014-05-071-10/+6
| | | | | | Follow-up to Nico's leak-stopping patch in r208110. llvm-svn: 208155
* [analyzer] Functions marked __attribute__((const)) don't modify any memory.Jordan Rose2014-05-071-0/+5
| | | | | | | | | This applies to __attribute__((pure)) as well, but 'const' is more interesting because many of our builtins are marked 'const'. PR19661 llvm-svn: 208154
* If an instantiation of a template is required to be a complete type, checkRichard Smith2014-05-074-11/+80
| | | | | | | whether the definition of the template is visible rather than checking whether the instantiated definition happens to be in an imported module. llvm-svn: 208150
* Try harder to ensure a strict weak ordering of overload candidates thatKaelyn Takata2014-05-071-6/+11
| | | | | | have arity mismatches. llvm-svn: 208146
* AST: Update reference temporary manglingDavid Majnemer2014-05-061-24/+26
| | | | | | | | | | | | | | | Summary: Update our mangling to match the discussion on cxx-abi-dev. This involves using a seq-id instead of an optional number. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3631 llvm-svn: 208140
* Include translation unit filename in global ctor symbol names.Nico Weber2014-05-061-3/+16
| | | | | | | | | | | | | | | | | This makes it easier to see where a global ctor comes from, and it also makes ASan's init order analyzer output easier to understand. gcc does this too, but only in -fPIC mode for some reason. Don't do this for constructors with explicit init priority. Also prepend "sub_" before the 'I', that way regular constructors stay lexicographically after symbols with init priority (because ord('s') > ord('I')). gold seems to ignore the name of constructor symbols, and ld only looks at the symbol if it includes an init priority, which this patch doesn't change. Before: __GLOBAL_I_a Now: __GLOBAL_sub_I_myfile.cc llvm-svn: 208128
* Reapply: DebugInfo: Emit the definition of enums when the definition ↵David Blaikie2014-05-063-0/+35
| | | | | | | | | | | | | | | | | | | preceeds the declaration and initial use. Reverting r208106 to reapply r208065 with a fix for the regression. The issue was that the enum tried to be built even if the declaration hadn't been constructed for debug info - presenting problems for enum templates and typedefs of enums with names for linkage purposes. Original commit message: This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208114
* Fix leak in ObjCSelfInitChecker, found by LSan.Nico Weber2014-05-061-19/+18
| | | | | | | | BugReport doesn't take ownership of the bug type, so let the checker own the the bug type. (Requires making the bug type mutable, which is icky, but which is also what other checkers do.) llvm-svn: 208110
* Revert "DebugInfo: Emit the definition of enums when the definition preceeds ↵David Blaikie2014-05-063-35/+0
| | | | | | | | | | | the declaration and initial use." This is breaking the compiler-rt build. Reverting while I investigate/fix. This reverts commit r208065. llvm-svn: 208106
* Add driver support for AArch64 Fedora.Tilmann Scheller2014-05-061-2/+3
| | | | | | Reviewed by Eric Christopher. llvm-svn: 208105
* clang-format: [JS] Keep space after closure style comments.Daniel Jasper2014-05-061-2/+2
| | | | | | | | | | Before: var x = /** @type {foo} */ (bar); After: var x = /** @type {foo} */(bar); llvm-svn: 208093
* clang-format: [JS] Keep space between 'return' and '['.Daniel Jasper2014-05-061-3/+4
| | | | llvm-svn: 208090
* clang-format: [JS] Don't indent in goog.scope blocks.Daniel Jasper2014-05-061-2/+20
| | | | | | | | | | | | | | | | Before: goog.scope(function() { var x = a.b; var y = c.d; }); // goog.scope After: goog.scope(function() { var x = a.b; var y = c.d; }); // goog.scope llvm-svn: 208088
* Fixed one issue with castingDinesh Dwivedi2014-05-061-2/+3
| | | | | | | | | | | | Before: (void) SimplifyICmpOperands(Cond, LHS, RHS); After: (void)SimplifyICmpOperands(Cond, LHS, RHS); Differential Revision: http://reviews.llvm.org/D3615 llvm-svn: 208080
* [OPENMP] Initial codegen for '#pragma omp parallel'Alexey Bataev2014-05-0616-31/+588
| | | | llvm-svn: 208077
* [PATCH] [ARM64] Enable alignment control option in front-end for ARM64.Kevin Qin2014-05-061-2/+10
| | | | | | | This patch is to get "-mno-unaligned-access" and "-munaligned-access" work in front-end for ARM64 target. llvm-svn: 208075
* XCore target: fix initialization bug found by MSan Bot.Robert Lytton2014-05-061-0/+1
| | | | llvm-svn: 208072
* Pulled out cast detection in TokenAnnotator into its own functionDinesh Dwivedi2014-05-061-58/+58
| | | | | | | | This is to remove FIXME added in r207964. Differential Revision: http://reviews.llvm.org/D3619 llvm-svn: 208071
* DebugInfo: Emit the definition of enums when the definition preceeds the ↵David Blaikie2014-05-063-0/+35
| | | | | | | | | | | | declaration and initial use. This regressed a little further 208055 though it was already a little broken. While the requiresCompleteType optimization should be implemented here. Future (possibly near future) work. llvm-svn: 208065
* Fix crash when one overload candidate is a template instead of a function. ↵Nick Lewycky2014-05-061-0/+1
| | | | | | | | | | Patch by Kaelyn Takata. Testcase coming out of creduce will land in a separate commit shortly. Also, it appears that this callback is used even in a SFINAE context where the results are never displayed. llvm-svn: 208062
* [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP ↵Alexey Bataev2014-05-068-4/+110
| | | | | | clause 'proc_bind' llvm-svn: 208060
* PR19598: Ensure temporary metadata nodes used in debug info are destroyed.David Blaikie2014-05-062-40/+34
| | | | | | | | | | | | | | | | | | | CGDebugInfo and DIBuilder were lax in their handling of temporary MDNodes. All temporary nodes need to be deleted, which means they need to be RAUW'd with a permanent node. This was not happening. To ensure this, leverage DIBuilder's new ability to create both permanent and temporary declarations. Ensure all temporary declarations are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where it is replaced with itself and creates a new, duplicate permanent node to replace itself with) This means that all temporary declarations must be added to the ReplacementMap even if they're never upgraded to definitions - so move the point of insertion into the map to the point of creation of the declarations. llvm-svn: 208055
* Support field references to struct names and c++11 aliases from inline asm.Nico Weber2014-05-061-1/+3
| | | | | | This is in addition to the existing support for typedefs. llvm-svn: 208053
* Build debug info for ObjC interface types at the end of the translation unit ↵David Blaikie2014-05-052-107/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to ensure all ivars are included. This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. llvm-svn: 208015
* During parsing, update the range of the Declarator to include the identifier.Richard Trieu2014-05-051-0/+1
| | | | llvm-svn: 208011
* [Basic/FileManager] Propagate whether a file 'IsVolatile' to the file ↵Argyrios Kyrtzidis2014-05-052-8/+15
| | | | | | | | opening functions. Needs llvm r208007. llvm-svn: 208008
OpenPOWER on IntegriCloud