aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
AgeCommit message (Collapse)AuthorFilesLines
2015-01-11Basic: [asmSymbolicName] follows the same rule as numbers in asm inputsDavid Majnemer1-0/+4
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
2015-01-11Basic: The asm constraint '#m' isn't valid, reject itDavid Majnemer1-1/+7
llvm-svn: 225603
2015-01-11CodeGen: Simplify consecutive '%' modifiersDavid Majnemer1-2/+3
LLVM the consecutive '%' modifiers are redundant, skip them. llvm-svn: 225602
2015-01-11CodeGen: Simplify consecutive '&' modifiersDavid Majnemer1-0/+5
LLVM the consecutive '&' modifiers are redundant, skip them. llvm-svn: 225601
2015-01-11Basic: The asm constraint '+#r' isn't valid, reject itDavid Majnemer1-1/+5
llvm-svn: 225600
2015-01-10fix pr18645. Correct logic concerning 'T &&' deduction against lvalues.Nathan Sidwell1-30/+17
llvm-svn: 225587
2015-01-10Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer1-0/+7
Don't permit '+&m' to make it to CodeGen, it's invalid. llvm-svn: 225586
2015-01-10Add a new warning, -Wself-move, to Clang.Richard Trieu1-1/+87
-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
2015-01-10Fix temporary lifetime extension from an initializer using braced "functional"Richard Smith1-7/+7
cast notation T{...} when T is a reference type. llvm-svn: 225571
2015-01-10Don't emit implicit template instantiations eagerly (PR21718)Hans Wennborg2-17/+41
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
2015-01-09clang-format: [Java] Support formatting qualified annotations.Nico Weber2-23/+35
llvm-svn: 225559
2015-01-09Revert "DebugInfo: Generalize debug info location handling" and related commitsDavid Blaikie16-117/+209
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
2015-01-09Parse: Don't crash when an annotation token shows up in a C++11 attrDavid Majnemer1-3/+5
It's not safe to blindly call getIdentifierInfo without checking the token is not an annotation token. llvm-svn: 225533
2015-01-09Driver: tweak the code for determining default image nameHans Wennborg1-6/+8
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
2015-01-09Sema: Don't crash when variable is redefined as a constexpr functionDavid Majnemer1-1/+1
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
2015-01-09Parse: Don't crash when namespace is in GNU statement exprDavid Majnemer2-13/+13
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
2015-01-09Fix crash in typo correction while correcting enum within a struct in COlivier Goffart1-2/+4
llvm-svn: 225513
2015-01-09Sema: RecordDecl shouldn't have a FunctionDecl as a DeclDavid Majnemer1-1/+6
RecordDecls should have things like CXXMethodDecls or FriendDecls as a decl but not things like FunctionDecls. llvm-svn: 225511
2015-01-09Sema: Don't crash when specializing a global scope function in a classDavid Majnemer1-1/+1
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
2015-01-09Sema: Remove some dead code from CreateNewFunctionDeclDavid Majnemer1-3/+0
The same code is already in Sema::ActOnFunctionDeclarator, the only caller of CreateNewFunctionDecl. llvm-svn: 225506
2015-01-09Parse: Don't crash when trailing return type is missingDavid Majnemer1-5/+4
Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo. Don't let the AST contain the malformed lambda. This fixes PR22122. llvm-svn: 225505
2015-01-09Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool3-0/+29
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
2015-01-09InstrProf: Don't emit counter increments in dead codeJustin Bogner1-0/+2
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
2015-01-09Sema: Dependent array designators cannot be checkedDavid Majnemer1-2/+2
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
2015-01-09PR22117: Fix a case where we would get confused about which function parameterRichard Smith2-7/+29
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
2015-01-09Don't invent a '$auto-x-y' name for auto types in generic lambdas. This is noRichard Smith1-11/+2
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
2015-01-09Use APSInt::isSameValue instead of operator== in a place where two APSInt'sRichard Trieu1-1/+5
may have different sizes. Fixes PR22017 llvm-svn: 225488
2015-01-08clang-format: Force line break between "endl" and "<<".Daniel Jasper1-28/+26
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
2015-01-08Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.Logan Chien1-9/+11
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
2015-01-08clang-format: Improve template parameter detection.Daniel Jasper1-2/+5
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
2015-01-08When the diagnostic text is simply "%0", sanitize the string for anyRichard Trieu1-0/+15
unprintable characters. Fixes PR22048. llvm-svn: 225423
2015-01-07Wrap to 80 columns. No behavior change.Nico Weber1-29/+20
llvm-svn: 225414
2015-01-07Handle OpaqueValueExprs more intelligently in the TransformTypos treeKaelyn Takata2-1/+9
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
2015-01-07clang-format: Let Chromium use the Google default for AlignTrailingComments.Nico Weber1-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
2015-01-07Revert r225085, it caused PR22096.Nico Weber2-0/+11
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
2015-01-07Debug info: pass in the correct size for a pointer to a member function.Adrian Prantl1-2/+2
This corrects a bug I introduced in r224781. llvm-svn: 225359
2015-01-07clang-format: Understand single-line comments at the end of blocks.Daniel Jasper1-4/+6
This prevents clang-format from moving/aligning the comment in the snippet: void f() { int i; // some comment // some unrelated comment } llvm-svn: 225352
2015-01-07clang-format: Fix unary operator detection.Daniel Jasper1-4/+4
Before: ** outparam = 1; After: **outparam = 1; llvm-svn: 225349
2015-01-07Fix comment typo.Nico Weber1-1/+1
llvm-svn: 225340
2015-01-06Fix grammar-o in comment.Nico Weber1-1/+1
llvm-svn: 225324
2015-01-06Add __builtin_amdgpu_classMatt Arsenault1-0/+3
llvm-svn: 225314
2015-01-06R600: Handle amdgcn tripleTom Stellard4-0/+6
For now there is no difference between amdgcn and r600. llvm-svn: 225294
2015-01-06Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool3-0/+71
Add additional constraint checking for target specific behaviour for inline assembly constraints. We would previously silently let all arguments through for these constraints. In cases where the constraints were violated, we could end up failing to select instructions and triggering assertions or worse, silently ignoring instructions. llvm-svn: 225244
2015-01-06Set the default ISA for OpenBSD/mips64 to MIPS III.Brad Smith1-0/+4
llvm-svn: 225241
2015-01-06Allow -fsanitize-coverage=N with ubsan, clang partKostya Serebryany1-2/+3
Summary: Allow -fsanitize-coverage=N with ubsan, clang part. This simply allows the flag combination. The LLVM will work out of the box, the compile-rt part will follow as a separate patch. Test Plan: check-clang Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6849 llvm-svn: 225229
2015-01-05Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"Duncan P. N. Exon Smith2-3/+27
This reverts commit r225212. It's failing on multiple buildbots [1][2]. [1]: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22032 [2]: http://lab.llvm.org:8080/green/view/Clang/job/clang-stage1-cmake-RA-incremental_check/2357/ llvm-svn: 225221
2015-01-05Use the integrated assembler by default on 32-bit PowerPC and SPARCBrad Smith2-27/+3
llvm-svn: 225212
2015-01-05Fix formatting. NFC.Rafael Espindola1-6/+3
llvm-svn: 225168
2015-01-05clang-format: [Java] Fix incorrect detection of cast.Daniel Jasper1-0/+2
After: return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaa) : aaaaaaaaaaaaaaaaaaaaaaa; After: return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa) : aaaaaaaaaaaaaaaaaaaaaaa; llvm-svn: 225161
2015-01-04clang-format: [Java] Fix incorrect recognition of annonymous classes.Daniel Jasper1-2/+3
Before: someFunction(new Runnable() { public void run() { System.out.println(42); } }); After: someFunction(new Runnable() { public void run() { System.out.println(42); } }); llvm-svn: 225142