summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Basic: [asmSymbolicName] follows the same rule as numbers in asm inputsDavid Majnemer2015-01-112-0/+11
| | | | | | | | | Input constraints like "0" and "[foo]" should be treated the same when it comes to their corresponding output constraint. This fixes PR21850. llvm-svn: 225605
* Basic: The asm constraint '#m' isn't valid, reject itDavid Majnemer2015-01-112-1/+14
| | | | llvm-svn: 225603
* CodeGen: Simplify consecutive '%' modifiersDavid Majnemer2015-01-112-2/+10
| | | | | | LLVM the consecutive '%' modifiers are redundant, skip them. llvm-svn: 225602
* CodeGen: Simplify consecutive '&' modifiersDavid Majnemer2015-01-112-0/+12
| | | | | | LLVM the consecutive '&' modifiers are redundant, skip them. llvm-svn: 225601
* Basic: The asm constraint '+#r' isn't valid, reject itDavid Majnemer2015-01-112-1/+11
| | | | llvm-svn: 225600
* Don't rely on the default constructor default constructing a begin andChandler Carruth2015-01-112-3/+10
| | | | | | | | | | | | end iterator for iterator_range<>. I removed this constructor because for some iterators (notably pointers) it left begin and end uninitialized. It also is an usual constraint that an iterator default constructs to a valid end iterator such that the pair of them for a valid range. In the three places where this was used in Clang, explicitly build the empty range from the iterators and comment on why default constructed iterators make sense here. llvm-svn: 225594
* fix pr18645. Correct logic concerning 'T &&' deduction against lvalues.Nathan Sidwell2015-01-102-30/+22
| | | | llvm-svn: 225587
* Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer2015-01-103-0/+16
| | | | | | Don't permit '+&m' to make it to CodeGen, it's invalid. llvm-svn: 225586
* Add a new warning, -Wself-move, to Clang.Richard Trieu2015-01-104-1/+132
| | | | | | | | -Wself-move is similiar to -Wself-assign. This warning is triggered when a value is attempted to be moved to itself. See r221008 for a bug that would have been caught with this warning. llvm-svn: 225581
* Fix temporary lifetime extension from an initializer using braced "functional"Richard Smith2015-01-102-7/+14
| | | | | | cast notation T{...} when T is a reference type. llvm-svn: 225571
* Don't emit implicit template instantiations eagerly (PR21718)Hans Wennborg2015-01-104-17/+69
| | | | | | | | | | | | | | Their linkage can change if they are later explicitly instantiated. We would previously emit such functions eagerly (as opposed to lazily on first use) if they have a 'dllexport' or 'used' attribute, and fail an assert when hitting the explicit instantiation. This is achieved by replacing the old CodeGenModule::MayDeferGeneration() method with two new ones: MustBeEmitted() and MayBeEmittedEagerly(). Differential Revision: http://reviews.llvm.org/D6674 llvm-svn: 225570
* Remove unnecessary/incorrect XFAIL after the revert of 225000David Blaikie2015-01-091-2/+0
| | | | llvm-svn: 225561
* clang-format: [Java] Support formatting qualified annotations.Nico Weber2015-01-093-23/+45
| | | | llvm-svn: 225559
* Revert "DebugInfo: Generalize debug info location handling" and related commitsDavid Blaikie2015-01-0919-156/+220
| | | | | | | | | | | | This reverts commit r225000, r225021, r225083, r225086, r225090. The root change (r225000) still has several issues where it's caused calls to be emitted without debug locations. This causes assertion failures if/when those calls are inlined. I'll work up some test cases and fixes before recommitting this. llvm-svn: 225555
* Parse: Don't crash when an annotation token shows up in a C++11 attrDavid Majnemer2015-01-092-3/+12
| | | | | | | It's not safe to blindly call getIdentifierInfo without checking the token is not an annotation token. llvm-svn: 225533
* Driver: tweak the code for determining default image nameHans Wennborg2015-01-093-9/+18
| | | | | | | | It seemed odd to have to make DefaultImageName be a mutable member of Driver. We don't need to the full result of computeTargetTriple() to determine the image name; just base it on DefaultTargetTriple. llvm-svn: 225530
* Sema: Don't crash when variable is redefined as a constexpr functionDavid Majnemer2015-01-092-1/+6
| | | | | | | | | We have a diagnostic describing that constexpr changed in C++14 when compiling in C++11 mode. While doing this, it examines the previous declaration and assumes that it is a function. However it is possible, in the context of error recovery, for this to not be the case. llvm-svn: 225518
* Add the shifted cursor position to XML output, so it can be used by editor ↵Manuel Klimek2015-01-091-0/+4
| | | | | | integrations. llvm-svn: 225516
* Fix test from my previous commitOlivier Goffart2015-01-091-2/+2
| | | | | | (I should have re-run the test after running clang-format) llvm-svn: 225515
* Parse: Don't crash when namespace is in GNU statement exprDavid Majnemer2015-01-095-16/+20
| | | | | | | | | | | Parser::ParseNamespace can get a little confused when it found itself inside a compound statement inside of a non-static data member initializer. Try to determine that the statement expression's scope makes sense before trying to parse it's contents. llvm-svn: 225514
* Fix crash in typo correction while correcting enum within a struct in COlivier Goffart2015-01-092-2/+15
| | | | llvm-svn: 225513
* Sema: RecordDecl shouldn't have a FunctionDecl as a DeclDavid Majnemer2015-01-092-2/+13
| | | | | | | RecordDecls should have things like CXXMethodDecls or FriendDecls as a decl but not things like FunctionDecls. llvm-svn: 225511
* Sema: Don't crash when specializing a global scope function in a classDavid Majnemer2015-01-092-1/+7
| | | | | | | | We assumed that class-scope specializations would result in a CXXMethodDecl for that class. However, globally qualified functions will result in normal FunctionDecls. llvm-svn: 225508
* Sema: Remove some dead code from CreateNewFunctionDeclDavid Majnemer2015-01-091-3/+0
| | | | | | | The same code is already in Sema::ActOnFunctionDeclarator, the only caller of CreateNewFunctionDecl. llvm-svn: 225506
* Parse: Don't crash when trailing return type is missingDavid Majnemer2015-01-092-5/+11
| | | | | | | | | Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo. Don't let the AST contain the malformed lambda. This fixes PR22122. llvm-svn: 225505
* Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool2015-01-096-0/+60
| | | | | | | | | | Allow blessed access to the symbol rewriter from the driver. Although the symbol rewriter could be invoked through tools like opt and llc, it would not accessible from the frontend. This allows us to read the rewrite map files in the frontend rather than the backend and enable symbol rewriting for actually performing the symbol interpositioning. llvm-svn: 225504
* InstrProf: Don't emit counter increments in dead codeJustin Bogner2015-01-092-0/+17
| | | | | | | | | We were previously emitting counter increments even if we didn't have an insertion point, which would result in a CallInst with no parent. This leads to a crash, as in pr22166, if we try to do GlobalDCE. llvm-svn: 225495
* Sema: Dependent array designators cannot be checkedDavid Majnemer2015-01-092-2/+9
| | | | | | | | | | | We forgot to mark designated initializer expression that contain type dependent array designators as type dependent. This would lead to crashes when we try to determine which array element we were trying to initialize. This fixes PR22056. llvm-svn: 225494
* PR22117: Fix a case where we would get confused about which function parameterRichard Smith2015-01-093-8/+39
| | | | | | | | | | we're instantiating, if there's a ParmVarDecl within a FunctionDecl context that is not a parameter of that function. Add some asserts to catch this kind of issue more generally, and fix another bug exposed by those asserts where we were missing a local instantiation scope around substitution of explicitly-specified template arguments. llvm-svn: 225490
* Don't invent a '$auto-x-y' name for auto types in generic lambdas. This is noRichard Smith2015-01-092-12/+3
| | | | | | | | | better than the 'template-parameter-x-y' name that we'd get in AST printing, and is worse in several ways (it's harder to distinguish it from a user-supplied name, it's wrong after substituting some number of outer levels, it wastes time and space constructing an IdentifierInfo, ...). llvm-svn: 225489
* Use APSInt::isSameValue instead of operator== in a place where two APSInt'sRichard Trieu2015-01-092-1/+16
| | | | | | may have different sizes. Fixes PR22017 llvm-svn: 225488
* IR: Add 'distinct' MDNodes to bitcode and assembly (clang)Duncan P. N. Exon Smith2015-01-085-26/+26
| | | | | | | | | Update testcases for LLVM change in r225474 to make `MDNode`s explicitly distinct (when they aren't uniqued). Part of PR22111. llvm-svn: 225475
* Improve clang-format.el.Manuel Klimek2015-01-081-48/+117
| | | | | | | | | | | | - includes header/footer as required by MELPA - correctly handles buffers that are not associated with a file - displays stderr and exit code of clang-format process - customizable via the emacs customization interface and file-/directory- local variables Patch by Johann Klähn. llvm-svn: 225447
* clang-format: Force line break between "endl" and "<<".Daniel Jasper2015-01-082-28/+30
| | | | | | | | | | | | | | | | This makes piped output easier to read in many instances. Before: llvm::errs() << aaaa << std::endl << bbbb << std::endl; After: llvm::errs() << aaaa << std::endl << bbbb << std::endl; Also fix a few instance of "don't use else after return" as per the coding standards. llvm-svn: 225444
* Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.Logan Chien2015-01-082-9/+48
| | | | | | | | | | | | | | | | | | | | If there are some non-ascii character in the input source code, the column index might be smallar than the byte index. This will result in two possible assertion failures. This CL fixes the computation of the column index and byte index. 1. The assertion in startOfNextColumn() and startOfPreviousColumn() should not be raised when the byte index is greater than the column index since the non-ascii characters may use more than one bytes to store a character in a column. 2. The length of the caret line should be equal to the number of columns of source line, instead of the length of the source line. Otherwise, the assertion in selectInterestingSourceRegion will be raised because the removed columns plus the kept columns are not greater than the max column, which means that we should not remove any column at all. llvm-svn: 225442
* clang-format: Improve template parameter detection.Daniel Jasper2015-01-082-2/+6
| | | | | | | | | | Before: struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>; After: struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>; llvm-svn: 225435
* Attempt to fix test from r225423 to get build bots green.Richard Trieu2015-01-081-7/+7
| | | | llvm-svn: 225426
* When the diagnostic text is simply "%0", sanitize the string for anyRichard Trieu2015-01-082-0/+26
| | | | | | unprintable characters. Fixes PR22048. llvm-svn: 225423
* Wrap to 80 columns. No behavior change.Nico Weber2015-01-071-29/+20
| | | | llvm-svn: 225414
* Add help text for mmacosx-version-min=, mios-version-min=.Nico Weber2015-01-071-2/+4
| | | | | | | | | I keep forgetting the exact spelling of -macosx-version-min=, and now I can run `bin/clang --help | grep version -A 2` to remind myself. While here, also document -mios-version-min=. Don't document -mios-simulator-version-min= as it's just an alias for -mios-version-min= these days. llvm-svn: 225409
* Handle OpaqueValueExprs more intelligently in the TransformTypos treeKaelyn Takata2015-01-074-1/+17
| | | | | | | | | | | | transform. Also diagnose typos in the initializer of an invalid C++ declaration. Both issues were hit using the same line of test code, depending on whether the code was treated as C or C++. Fixes PR22092. llvm-svn: 225389
* Slightly simplify the test from r225361.Nico Weber2015-01-071-22/+7
| | | | | | | | Shorter and doesn't need -O2 -- but still suboptimal as it's still doing -emit-obj. dblaikie says he'll improve this when he'll reland his change with a fix. llvm-svn: 225364
* clang-format: Let Chromium use the Google default for AlignTrailingComments.Nico Weber2015-01-071-1/+0
| | | | | | | | | | | r225141 changed the defaults of AllowShortIfStatementsOnASingleLine and AlignTrailingComments for Google style and added explicit overrides for Chromium style to undo these changes. For AllowShortIfStatementsOnASingleLine that's good as the Android style guide (which Chromium uses for Java) explicitly permits single-line ifs. But it's silent on trailing comments, to it makes sense for Chromium style to just follow Google style. llvm-svn: 225363
* Revert r225085, it caused PR22096.Nico Weber2015-01-073-0/+37
| | | | | | | | PR22096 has several test cases that assert that look fairly different. I'm adding one of those as an automated test, but when relanding the other cases should probably be checked as well. llvm-svn: 225361
* Debug info: pass in the correct size for a pointer to a member function.Adrian Prantl2015-01-072-2/+12
| | | | | | This corrects a bug I introduced in r224781. llvm-svn: 225359
* clang-format: Understand single-line comments at the end of blocks.Daniel Jasper2015-01-072-4/+14
| | | | | | | | | | | This prevents clang-format from moving/aligning the comment in the snippet: void f() { int i; // some comment // some unrelated comment } llvm-svn: 225352
* clang-format: Fix unary operator detection.Daniel Jasper2015-01-072-4/+5
| | | | | | | | | | Before: ** outparam = 1; After: **outparam = 1; llvm-svn: 225349
* Fix comment typo.Nico Weber2015-01-071-1/+1
| | | | llvm-svn: 225340
* Fix grammar-o in comment.Nico Weber2015-01-061-1/+1
| | | | llvm-svn: 225324
* Suppress clang warnings in a codegen test.Rafael Espindola2015-01-061-8/+8
| | | | | | | This makes the output of FileCheck way easier to read since this test hits many warnings. llvm-svn: 225322
OpenPOWER on IntegriCloud