summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merging r232675:Tom Stellard2015-05-041-0/+7
| | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r232675 | rtrieu | 2015-03-18 17:52:47 -0400 (Wed, 18 Mar 2015) | 9 lines When cloning LocalInstantiationScope's, don't update the current scope in Sema. Construction of LocalInstantiationScope automatically updates the current scope inside Sema. However, when cloning a scope, the current scope does not change. Change the cloning function to preserve the current scope. Review: http://reviews.llvm.org/D8407 BUG: https://llvm.org/bugs/show_bug.cgi?id=22931 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@236441 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Merging r232439:"Tom Stellard2015-05-042-3/+0
| | | | | | | | | This reverts commit r236305. This commit requires an ABI change to LLVM, which is not allowed for stable releases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@236437 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r232439:Tom Stellard2015-05-012-0/+3
| | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r232439 | mail | 2015-03-16 19:52:21 -0400 (Mon, 16 Mar 2015) | 7 lines GCOV: Expose the -coverage-exit-block-before-body flag in clang -cc1 This exposes the optional exit block placement logic from r232438 as a clang -cc1 option. There is a test on the llvm side, but there isn't really a way to inspect the gcov options from clang to test it here as well. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@236305 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r229680:Daniel Sanders2015-04-271-0/+10
| | | | | | | | | | | | | ------------------------------------------------------------------------ r229680 | zjovanovic | 2015-02-18 15:21:35 +0000 (Wed, 18 Feb 2015) | 3 lines Change representation of member function pointers for MIPS targets Differential Revision: http://reviews.llvm.org/D7148 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@235841 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge r230255,231245,231280,231986:Joerg Sonnenberger2015-03-123-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Only lower __builtin_setjmp / __builtin_longjmp to llvm.eh.sjlj.setjmp / llvm.eh.sjlj.longjmp, if the backend is known to support them outside the Exception Handling context. The default handling in LLVM codegen doesn't work and will create incorrect code. The ARM backend on the other hand will assert if the intrinsics are used. -- Adjust the changes from r230255 to bail out if the backend can't lower __builtin_setjmp/__builtin_longjmp and don't fall back to the libc functions. -- Fix test/CodeGen/builtins.c for platforms that don't lower sjlj Opt in Win64 to supporting sjlj lowering. We have the backend lowering, so I think this was just an oversight because WinX86_64TargetCodeGenInfo doesn't inherit from X86_64TargetCodeGenInfo. -- Under duress, move check for target support of __builtin_setjmp/ __builtin_longjmp to Sema as requested by John McCall. git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@232028 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r228792:Hans Wennborg2015-02-113-0/+11
| | | | | | | | | | | | | | | ------------------------------------------------------------------------ r228792 | rsmith | 2015-02-10 18:41:33 -0800 (Tue, 10 Feb 2015) | 5 lines Add a warning for direct-list-initialization of a variable with a deduced type (or of a lambda init-capture, which is sort-of such a variable). The semantics of such constructs will change when we implement N3922, so we intend to warn on this in Clang 3.6 then change the semantics in Clang 3.7. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@228799 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r227251:Hans Wennborg2015-01-271-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r227251 | rikka | 2015-01-27 14:01:39 -0800 (Tue, 27 Jan 2015) | 17 lines Fix a think-o in handling ambiguous corrections for a TypoExpr. Under certain circumstances, the identifier mentioned in the diagnostic won't match the intended correction even though the replacement expression and the note pointing to the decl are both correct. Basically, the TreeTransform assumes the TypoExpr's Consumer points to the correct TypoCorrection, but the handling of typos that appear to be ambiguous from the point of view of TransformTypoExpr would cause that assumption to be violated by altering the Consumer's correction stream. This fix allows the Consumer's correction stream to be reset to the right TypoCorrection after successfully resolving the percieved ambiguity. Included is a fix to suppress correcting the RHS of an assignment to the LHS of that assignment for non-C++ code, to prevent a regression in test/SemaObjC/provisional-ivar-lookup.m. This fixes PR22297. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@227266 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r227062:Hans Wennborg2015-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r227062 | rengolin | 2015-01-25 15:17:48 -0800 (Sun, 25 Jan 2015) | 10 lines Allows Clang to use LLVM's fixes-x18 option This patch allows clang to have llvm reserve the x18 platform register on AArch64. FreeBSD will use this in the kernel for per-cpu data but has no need to reserve this register in userland so will need this flag to reserve it. This uses llvm r226664 to allow this register to be reserved. Patch by Andrew Turner. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@227151 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r226863:Hans Wennborg2015-01-231-0/+2
| | | | | | | | | | | | | ------------------------------------------------------------------------ r226863 | joerg | 2015-01-22 13:01:00 -0800 (Thu, 22 Jan 2015) | 3 lines When reporting constraints that should be constant, the type doesn't really help. Improve diagnostics. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@226916 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "r222906 - Create a new 'flag_enum' attribute."Hans Wennborg2015-01-206-44/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@226593 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.pyChandler Carruth2015-01-1418-23/+15
| | | | | | | | | | Sorry for the noise, I managed to miss a bunch of recent regressions of include orderings here. This should actually sort all the includes for Clang. Again, no functionality changed, this is just a mechanical cleanup that I try to run periodically to keep the #include lines as regular as possible across the project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225979 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Insert random noops to increase security against ROP attacks (clang)"JF Bastien2015-01-143-6/+1
| | | | | | | This reverts commit: http://reviews.llvm.org/D3393 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225947 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert random noops to increase security against ROP attacks (clang)JF Bastien2015-01-143-1/+6
| | | | | | | | | | | | | | | | | | | | A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks. Command line options: -noop-insertion // Enable noop insertion. -noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion) -max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions. In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future). -fdiversify This is the clang part of the patch. llvm part: D3392 http://reviews.llvm.org/D3393 Patch by Stephen Crane (@rinon) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225910 91177308-0d34-0410-b5e6-96231b3b80d8
* Update HelpText for -fsanitize= option.Alexey Samsonov2015-01-141-3/+2
| | | | | | | There are too many available sanitizers now - redirect to user manual instead of listing them all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225894 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: An extern declaration can't be a redeclaration of a parameterDavid Majnemer2015-01-141-0/+5
| | | | | | | | | | | | In the following: void f(int x) { extern int x; } The second declaration of 'x' shouldn't be considered a redeclaration of the parameter. This is a different approach to r225780. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225875 91177308-0d34-0410-b5e6-96231b3b80d8
* When attribute 'optnone' appears on the same declaration with aPaul Robinson2015-01-131-0/+1
| | | | | | | | | | | | | conflicting attribute, warn about the conflict and pick a "winning" attribute to preserve, instead of emitting an error. This matches the behavior when the conflicting attributes are on different declarations. Along the way I discovered that conflicts involving __forceinline were reported as 'always_inline' (alternate spelling, same attribute) so fixed that up to report the attribute as spelled in the source. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225813 91177308-0d34-0410-b5e6-96231b3b80d8
* Inherit attributes when infering a framework moduleBen Langmuir2015-01-131-3/+21
| | | | | | | | | | If a module map contains framework module * [extern_c] {} We will now infer [extern_c] on the inferred framework modules (we already inferred [system] as a special case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225803 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused method canInferFrameworkModuleBen Langmuir2015-01-131-16/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225801 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Consider global named register variables as threadprivate by default.Alexey Bataev2015-01-131-1/+1
| | | | | | | Register are thread-local by default, so we have to consider them as threadprivate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225759 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the self move warning to record types.Richard Trieu2015-01-131-0/+4
| | | | | | | | Move the logic for checking self moves into SemaChecking and add that function to Sema since it is now used in multiple places. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225756 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement -fsanitize-recover family of flags.Alexey Samsonov2015-01-124-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | Introduce the following -fsanitize-recover flags: - -fsanitize-recover=<list>: Enable recovery for selected checks or group of checks. It is forbidden to explicitly list unrecoverable sanitizers here (that is, "address", "unreachable", "return"). - -fno-sanitize-recover=<list>: Disable recovery for selected checks or group of checks. - -f(no-)?sanitize-recover is now a synonym for -f(no-)?sanitize-recover=undefined,integer and will soon be deprecated. These flags are parsed left to right, and mask of "recoverable" sanitizer is updated accordingly, much like what we do for -fsanitize= flags. -fsanitize= and -fsanitize-recover= flag families are independent. CodeGen change: If there is a single UBSan handler function, responsible for implementing multiple checks, which have different recoverable setting, then we emit two handler calls instead of one: the first one for the set of "unrecoverable" checks, another one - for set of "recoverable" checks. If all checks implemented by a handler have the same recoverability setting, then the generated code will be the same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225719 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC]To provide better compatibility with gcc I added the __bool keyword ↵Bill Seurer2015-01-121-0/+1
| | | | | | | | | | | | | | | | | | to the Alitivec support in clang. __bool is functionally identical to using bool when declaring vector types. For example: vector bool char v_bc; vector __bool char v___bc; clang already supported vector/__vector and pixel/__pixel but was missing __bool. http://llvm.org/bugs/show_bug.cgi?id=19220 For reference: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/PowerPC-AltiVec_002fVSX-Built-in-Functions.html http://reviews.llvm.org/D6882 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225664 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFCAlexey Bataev2015-01-122-13/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225624 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Get rid of cxx_exceptspec_end, use EOF insteadDavid Majnemer2015-01-121-1/+0
| | | | | | | | Similar to r225619, use a special EOF token to mark the end of the exception specification instead of cxx_exceptspec_end. Use the current scope as the marker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225622 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Get rid of tok::cxx_defaultarg_end, use EOF insteadDavid Majnemer2015-01-121-1/+0
| | | | | | | I added setEofData/getEofData to solve this sort of problem back in r224505. Use the Param's decl to tell us if this is *our* EOF token. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225619 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225594 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer2015-01-101-0/+3
| | | | | | Don't permit '+&m' to make it to CodeGen, it's invalid. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225586 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new warning, -Wself-move, to Clang.Richard Trieu2015-01-102-0/+5
| | | | | | | | | | -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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225581 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: tweak the code for determining default image nameHans Wennborg2015-01-091-3/+3
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225530 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Don't crash when namespace is in GNU statement exprDavid Majnemer2015-01-092-2/+2
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225514 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool2015-01-092-0/+10
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225504 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225409 91177308-0d34-0410-b5e6-96231b3b80d8
* Add __builtin_amdgpu_classMatt Arsenault2015-01-061-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225314 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Add support for -mcmpbHal Finkel2015-01-061-0/+2
| | | | | | | In r225106, support for the CMPB instruction was added to the PowerPC backend. This adds the associated GCC-compatible feature flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225312 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: fix compilation with MSVCSaleem Abdulrasool2015-01-061-2/+4
| | | | | | | | | | | | | | MSVC doesn't like the instantiation of the structure in the initializer list. Initialize it in the constructor body to repair the build. TargetInfo.h(545) : error C2143: syntax error : missing ')' before '{' TargetInfo.h(545) : error C2143: syntax error : missing ';' before '}' TargetInfo.h(545) : error C2059: syntax error : ')' TargetInfo.h(545) : error C2059: syntax error : ',' TargetInfo.h(547) : error C2143: syntax error : missing ';' before '{' TargetInfo.h(547) : error C2447: '{' : missing function header (old-style formal list?) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225247 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool2015-01-062-4/+22
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225244 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix dangling pointer in isDerivedFrom.Samuel Benzaquen2015-01-051-3/+3
| | | | | | | | | | | | | | | | Summary: Replace usage of StringRef with std::string in AST_MATCHER* generated matchers to make sure they keep their own copy of the string. The value could be a temporary and it causes the pointer to be dangling by the time the matcher is executed. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6843 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225180 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an assert that's not true on invalid code.Nico Weber2015-01-041-2/+3
| | | | | | | | | | | r185773 added an assert that checked that a CXXUnresolvedConstructExpr either has a valid rparen, or exactly one argument. This doesn't have to be true for invalid inputs. Convert the assert to an if, and add a test for this case. Found by SLi's afl bot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225140 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix default image name to 'a.exe' on Windows, instead 'a.out'.Yaron Keren2015-01-041-1/+1
| | | | | | | | This applies to mingw as clang-cl already has its own logic for the filename. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225134 91177308-0d34-0410-b5e6-96231b3b80d8
* Document that GetTypeForDeclarator() cannot return a null type.Nico Weber2015-01-041-4/+0
| | | | | | | | | | | | | | Also add a few asserts for this. The existing code assumes this in a bunch of places already (see e.g. the assert at the top of ParseTypedefDecl(), and there are many unchecked calls on the result of GetTypeForDeclarator()), and from looking through the code this should always be true from what I can tell. This allows removing ASTContext::getNullTypeSourceInfo() too as that's now unused. No behavior change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225125 91177308-0d34-0410-b5e6-96231b3b80d8
* Add non-const version getFileSystemOpts() access function.Yaron Keren2014-12-301-0/+3
| | | | | | | | All the other get*Opts have both versions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224995 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Ignore '::' in 'struct :: {'David Majnemer2014-12-291-7/+5
| | | | | | | Let's pretend that we didn't see the '::' instead of go on believing that we've got some anonymous, but globally qualified, struct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224945 91177308-0d34-0410-b5e6-96231b3b80d8
* [multilib] Teach Clang's code about multilib by threadingChandler Carruth2014-12-292-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a CLANG_LIBDIR_SUFFIX down from the build system and using that as part of the default resource dir computation. Without this, essentially nothing that uses the clang driver works when building clang with a libdir suffix. This is probably the single biggest missing piece of support for multilib as without this people could hack clang to end up installed in the correct location, but it would then fail to find its own basic resources. I know of at least one distro that has some variation on this patch to hack around this; hopefully they'll be able to use the libdir suffix functionality directly as the rest of these bits land. This required fixing a copy of the code to compute Clang's resource directory that is buried inside of the frontend (!!!). It had bitrotted significantly relative to the driver code. I've made it essentially a clone of the driver code in order to keep tests (which use cc1 heavily) passing. This copy should probably just be removed and the frontend taught to always rely on an explicit resource directory from the driver, but that is a much more invasive change for another day. I've also updated one test which actually encoded the resource directory in its checked output to tolerate multilib suffixes. Note that this relies on a prior LLVM commit to add a stub to the autoconf build system for this variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224924 91177308-0d34-0410-b5e6-96231b3b80d8
* [x86] Fix an accidental commit of a change from Ii to iC on ↵Craig Topper2014-12-291-1/+1
| | | | | | __builtin_ia32_cmpps512_mask. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224914 91177308-0d34-0410-b5e6-96231b3b80d8
* [x86] Put 'C' after 'i' on all the AVX-512 intrisics that take const ints. ↵Craig Topper2014-12-291-55/+55
| | | | | | 'C' is a suffix modifier not a prefix modififier. Also put 'C' on the pointers in all of the gather instrinsics. I think they previously had one due to the misordering. I'm still thinking the 'iC' actually need to be a 'Ii' since they really require an ICE. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224913 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: Don't crash when solitary :: token appears before { in struct defDavid Majnemer2014-12-291-5/+7
| | | | | | | | hasDeclaratorForAnonDecl, getDeclaratorForAnonDecl and getTypedefNameForAnonDecl are expected to handle the case where NamedDeclOrQualifier holds the wrong type or nothing at all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224912 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: Forbid inconsistent constraint alternativesDavid Majnemer2014-12-291-0/+2
| | | | | | Verify that asm constraints have the same number of alternatives git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224911 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: Don't crash when an inject class name has a nested redefinitionDavid Majnemer2014-12-281-0/+5
| | | | | | | | | We expected the type of a TagDecl to be a TagType, not an InjectedClassNameType. Introduced a helper method, Type::getAsTagDecl, to abstract away the difference; redefine Type::getAsCXXRecordDecl to be in terms of it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224898 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: Don't let annotation tokens get into macro expansionDavid Majnemer2014-12-281-1/+1
| | | | | | | | | | We'd let annotation tokens from '#pragma pack' and the like get inside a function-like macro. This would lead to terror and mayhem; stop the madness early. This fixes PR22037. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224896 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C: Serialize "more than one decl" state of ObjCMethodList.Nico Weber2014-12-272-1/+2
| | | | | | | | | | | | | | | | | | This fixes PR21587, what r221933 fixed for regular programs is now also fixed for decls coming from PCH files. Use another bit from the count/bits uint16_t for storing the "more than one decl" bit. This reduces the number of bits for the count from 14 to 13. The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits should still be plenty. Since this changes the meaning of a serialized bit pattern, also increase clang::serialization::VERSION_MAJOR. Storing the "more than one decl" state of only the first overload isn't quite correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at the state of the first overload so it's good enough for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224892 91177308-0d34-0410-b5e6-96231b3b80d8