]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: [Java] Support formatting qualified annotations.
Nico Weber [Fri, 9 Jan 2015 23:25:06 +0000 (23:25 +0000)]
clang-format: [Java] Support formatting qualified annotations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225559 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "DebugInfo: Generalize debug info location handling" and related commits
David Blaikie [Fri, 9 Jan 2015 23:00:28 +0000 (23:00 +0000)]
Revert "DebugInfo: Generalize debug info location handling" and related commits

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225555 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: Don't crash when an annotation token shows up in a C++11 attr
David Majnemer [Fri, 9 Jan 2015 18:09:39 +0000 (18:09 +0000)]
Parse: Don't crash when an annotation token shows up in a C++11 attr

It's not safe to blindly call getIdentifierInfo without checking the
token is not an annotation token.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225533 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: tweak the code for determining default image name
Hans Wennborg [Fri, 9 Jan 2015 17:38:53 +0000 (17:38 +0000)]
Driver: tweak the code for determining default image name

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

9 years agoSema: Don't crash when variable is redefined as a constexpr function
David Majnemer [Fri, 9 Jan 2015 10:33:23 +0000 (10:33 +0000)]
Sema: Don't crash when variable is redefined as a constexpr function

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225518 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd the shifted cursor position to XML output, so it can be used by editor integrations.
Manuel Klimek [Fri, 9 Jan 2015 10:03:47 +0000 (10:03 +0000)]
Add the shifted cursor position to XML output, so it can be used by editor integrations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225516 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix test from my previous commit
Olivier Goffart [Fri, 9 Jan 2015 09:42:32 +0000 (09:42 +0000)]
Fix test from my previous commit

(I should have re-run the test after running clang-format)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225515 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: Don't crash when namespace is in GNU statement expr
David Majnemer [Fri, 9 Jan 2015 09:38:14 +0000 (09:38 +0000)]
Parse: Don't crash when namespace is in GNU statement expr

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

9 years agoFix crash in typo correction while correcting enum within a struct in C
Olivier Goffart [Fri, 9 Jan 2015 09:37:26 +0000 (09:37 +0000)]
Fix crash in typo correction while correcting enum within a struct in C

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225513 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: RecordDecl shouldn't have a FunctionDecl as a Decl
David Majnemer [Fri, 9 Jan 2015 07:36:13 +0000 (07:36 +0000)]
Sema: RecordDecl shouldn't have a FunctionDecl as a Decl

RecordDecls should have things like CXXMethodDecls or FriendDecls as a
decl but not things like FunctionDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225511 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Don't crash when specializing a global scope function in a class
David Majnemer [Fri, 9 Jan 2015 06:10:21 +0000 (06:10 +0000)]
Sema: Don't crash when specializing a global scope function in a class

We assumed that class-scope specializations would result in a
CXXMethodDecl for that class.  However, globally qualified functions
will result in normal FunctionDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225508 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Remove some dead code from CreateNewFunctionDecl
David Majnemer [Fri, 9 Jan 2015 05:56:10 +0000 (05:56 +0000)]
Sema: Remove some dead code from CreateNewFunctionDecl

The same code is already in Sema::ActOnFunctionDeclarator, the only
caller of CreateNewFunctionDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225506 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: Don't crash when trailing return type is missing
David Majnemer [Fri, 9 Jan 2015 05:10:55 +0000 (05:10 +0000)]
Parse: Don't crash when trailing return type is missing

Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo.
Don't let the AST contain the malformed lambda.

This fixes PR22122.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225505 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: begin threading frontend support for SymbolRewriter
Saleem Abdulrasool [Fri, 9 Jan 2015 05:10:20 +0000 (05:10 +0000)]
Driver: begin threading frontend support for SymbolRewriter

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

9 years agoInstrProf: Don't emit counter increments in dead code
Justin Bogner [Fri, 9 Jan 2015 01:46:40 +0000 (01:46 +0000)]
InstrProf: Don't emit counter increments in dead code

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225495 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Dependent array designators cannot be checked
David Majnemer [Fri, 9 Jan 2015 01:39:09 +0000 (01:39 +0000)]
Sema: Dependent array designators cannot be checked

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225494 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22117: Fix a case where we would get confused about which function parameter
Richard Smith [Fri, 9 Jan 2015 01:19:56 +0000 (01:19 +0000)]
PR22117: Fix a case where we would get confused about which function parameter
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225490 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't invent a '$auto-x-y' name for auto types in generic lambdas. This is no
Richard Smith [Fri, 9 Jan 2015 00:59:40 +0000 (00:59 +0000)]
Don't invent a '$auto-x-y' name for auto types in generic lambdas. This is no
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, ...).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225489 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse APSInt::isSameValue instead of operator== in a place where two APSInt's
Richard Trieu [Fri, 9 Jan 2015 00:58:16 +0000 (00:58 +0000)]
Use APSInt::isSameValue instead of operator== in a place where two APSInt's
may have different sizes.  Fixes PR22017

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225488 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Add 'distinct' MDNodes to bitcode and assembly (clang)
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:39:28 +0000 (22:39 +0000)]
IR: Add 'distinct' MDNodes to bitcode and assembly (clang)

Update testcases for LLVM change in r225474 to make `MDNode`s explicitly
distinct (when they aren't uniqued).

Part of PR22111.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225475 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImprove clang-format.el.
Manuel Klimek [Thu, 8 Jan 2015 15:29:03 +0000 (15:29 +0000)]
Improve clang-format.el.

- 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225447 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Force line break between "endl" and "<<".
Daniel Jasper [Thu, 8 Jan 2015 13:56:57 +0000 (13:56 +0000)]
clang-format: Force line break between "endl" and "<<".

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225444 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFrontend: Fix SourceColumnMap assertion failure on non-ascii characters.
Logan Chien [Thu, 8 Jan 2015 13:19:07 +0000 (13:19 +0000)]
Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225442 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Improve template parameter detection.
Daniel Jasper [Thu, 8 Jan 2015 08:48:21 +0000 (08:48 +0000)]
clang-format: Improve template parameter detection.

Before:
  struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>;

After:
  struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225435 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAttempt to fix test from r225423 to get build bots green.
Richard Trieu [Thu, 8 Jan 2015 02:40:08 +0000 (02:40 +0000)]
Attempt to fix test from r225423 to get build bots green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225426 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWhen the diagnostic text is simply "%0", sanitize the string for any
Richard Trieu [Thu, 8 Jan 2015 01:27:03 +0000 (01:27 +0000)]
When the diagnostic text is simply "%0", sanitize the string for any
unprintable characters.  Fixes PR22048.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225423 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Wed, 7 Jan 2015 23:50:05 +0000 (23:50 +0000)]
Wrap to 80 columns. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225414 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd help text for mmacosx-version-min=, mios-version-min=.
Nico Weber [Wed, 7 Jan 2015 22:40:55 +0000 (22:40 +0000)]
Add help text for mmacosx-version-min=, mios-version-min=.

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

9 years agoHandle OpaqueValueExprs more intelligently in the TransformTypos tree
Kaelyn Takata [Wed, 7 Jan 2015 21:16:39 +0000 (21:16 +0000)]
Handle OpaqueValueExprs more intelligently in the TransformTypos tree
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225389 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSlightly simplify the test from r225361.
Nico Weber [Wed, 7 Jan 2015 18:47:51 +0000 (18:47 +0000)]
Slightly simplify the test from r225361.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225364 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Let Chromium use the Google default for AlignTrailingComments.
Nico Weber [Wed, 7 Jan 2015 18:41:10 +0000 (18:41 +0000)]
clang-format: Let Chromium use the Google default for AlignTrailingComments.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225363 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r225085, it caused PR22096.
Nico Weber [Wed, 7 Jan 2015 18:23:08 +0000 (18:23 +0000)]
Revert r225085, it caused PR22096.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225361 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebug info: pass in the correct size for a pointer to a member function.
Adrian Prantl [Wed, 7 Jan 2015 17:49:30 +0000 (17:49 +0000)]
Debug info: pass in the correct size for a pointer to a member function.
This corrects a bug I introduced in r224781.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225359 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Understand single-line comments at the end of blocks.
Daniel Jasper [Wed, 7 Jan 2015 14:00:11 +0000 (14:00 +0000)]
clang-format: Understand single-line comments at the end of blocks.

This prevents clang-format from moving/aligning the comment in the
snippet:
  void f() {
    int i; // some comment
    // some unrelated comment
  }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225352 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix unary operator detection.
Daniel Jasper [Wed, 7 Jan 2015 12:19:53 +0000 (12:19 +0000)]
clang-format: Fix unary operator detection.

Before:
  ** outparam = 1;

After:
  **outparam = 1;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225349 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix comment typo.
Nico Weber [Wed, 7 Jan 2015 05:25:05 +0000 (05:25 +0000)]
Fix comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225340 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix grammar-o in comment.
Nico Weber [Tue, 6 Jan 2015 23:54:59 +0000 (23:54 +0000)]
Fix grammar-o in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225324 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSuppress clang warnings in a codegen test.
Rafael Espindola [Tue, 6 Jan 2015 23:53:13 +0000 (23:53 +0000)]
Suppress clang warnings in a codegen test.

This makes the output of FileCheck way easier to read since this test hits
many warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225322 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd __builtin_amdgpu_class
Matt Arsenault [Tue, 6 Jan 2015 23:14:57 +0000 (23:14 +0000)]
Add __builtin_amdgpu_class

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225314 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Add support for -mcmpb
Hal Finkel [Tue, 6 Jan 2015 23:06:41 +0000 (23:06 +0000)]
[PowerPC] Add support for -mcmpb

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

9 years agoUpdate for .ll syntax change.
Rafael Espindola [Tue, 6 Jan 2015 22:55:40 +0000 (22:55 +0000)]
Update for .ll syntax change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225303 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600: Handle amdgcn triple
Tom Stellard [Tue, 6 Jan 2015 20:34:47 +0000 (20:34 +0000)]
R600: Handle amdgcn triple

For now there is no difference between amdgcn and r600.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225294 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBasic: fix compilation with MSVC
Saleem Abdulrasool [Tue, 6 Jan 2015 05:55:56 +0000 (05:55 +0000)]
Basic: fix compilation with MSVC

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

9 years agoSema: analyze I,J,K,M,N,O constraints
Saleem Abdulrasool [Tue, 6 Jan 2015 04:26:34 +0000 (04:26 +0000)]
Sema: analyze I,J,K,M,N,O constraints

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

9 years agoSet the default ISA for OpenBSD/mips64 to MIPS III.
Brad Smith [Tue, 6 Jan 2015 02:53:17 +0000 (02:53 +0000)]
Set the default ISA for OpenBSD/mips64 to MIPS III.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225241 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow -fsanitize-coverage=N with ubsan, clang part
Kostya Serebryany [Tue, 6 Jan 2015 01:02:48 +0000 (01:02 +0000)]
Allow -fsanitize-coverage=N with ubsan, clang part

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225229 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"
Duncan P. N. Exon Smith [Mon, 5 Jan 2015 23:31:42 +0000 (23:31 +0000)]
Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"

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/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225221 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse the integrated assembler by default on 32-bit PowerPC and SPARC
Brad Smith [Mon, 5 Jan 2015 21:44:15 +0000 (21:44 +0000)]
Use the integrated assembler by default on 32-bit PowerPC and SPARC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225212 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix lit for builds under /opt
Francisco Lopes da Silva [Mon, 5 Jan 2015 19:59:24 +0000 (19:59 +0000)]
Fix lit for builds under /opt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225196 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test a bit stricter.
Rafael Espindola [Mon, 5 Jan 2015 18:48:18 +0000 (18:48 +0000)]
Make this test a bit stricter.

The first function is named __cxx_global_var_init, which is a substring of
the following functions @__cxx_global_var_init(1,2,3,etc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225191 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDisable warnings in this test.
Rafael Espindola [Mon, 5 Jan 2015 18:19:35 +0000 (18:19 +0000)]
Disable warnings in this test.

This makes it a lot easier to read the output from FileCheck when it fails.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225190 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix clash of gcc toolchains in driver regression tests.
Samuel Antao [Mon, 5 Jan 2015 17:07:42 +0000 (17:07 +0000)]
Fix clash of gcc toolchains in driver regression tests.

For some regression tests the path to the right toolchain is specified using the -sysroot switch. However, if clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by sysroot. This causes several regression tests to fail as they will be using an unexpected path. This patch fixes this issue by adding --gcc-toolchain='' to all tests that rely on that. The empty string causes the driver to pick the path from sysroot instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225182 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix dangling pointer in isDerivedFrom.
Samuel Benzaquen [Mon, 5 Jan 2015 15:26:42 +0000 (15:26 +0000)]
Fix dangling pointer in isDerivedFrom.

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

9 years agoclang/CMakeLists.txt: Introduce LLVM_SHLIB_OUTPUT_INTDIR also here, or plugins tests...
NAKAMURA Takumi [Mon, 5 Jan 2015 14:06:14 +0000 (14:06 +0000)]
clang/CMakeLists.txt: Introduce LLVM_SHLIB_OUTPUT_INTDIR also here, or plugins tests might fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225170 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix formatting. NFC.
Rafael Espindola [Mon, 5 Jan 2015 13:44:59 +0000 (13:44 +0000)]
Fix formatting. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225168 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Java] Fix incorrect detection of cast.
Daniel Jasper [Mon, 5 Jan 2015 10:33:39 +0000 (10:33 +0000)]
clang-format: [Java] Fix incorrect detection of cast.

After:
  return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa(
                                      aaaaaaaaaaaaaaaaaaaaa)
                                : aaaaaaaaaaaaaaaaaaaaaaa;

After:
  return (a instanceof List<?>)
      ? aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa)
      : aaaaaaaaaaaaaaaaaaaaaaa;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225161 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Java] Fix incorrect recognition of annonymous classes.
Daniel Jasper [Sun, 4 Jan 2015 20:40:51 +0000 (20:40 +0000)]
clang-format: [Java] Fix incorrect recognition of annonymous classes.

Before:
  someFunction(new Runnable() { public void run() { System.out.println(42);
  }
  });

After:
  someFunction(new Runnable() {
    public void run() {
      System.out.println(42);
    }
  });

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225142 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: [Java] Change a few flags for Google's Java style.
Daniel Jasper [Sun, 4 Jan 2015 20:40:45 +0000 (20:40 +0000)]
clang-format: [Java] Change a few flags for Google's Java style.

No tests added as all of these are already tested separately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225141 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove an assert that's not true on invalid code.
Nico Weber [Sun, 4 Jan 2015 20:32:12 +0000 (20:32 +0000)]
Remove an assert that's not true on invalid code.

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

9 years agoFix default image name to 'a.exe' on Windows, instead 'a.out'.
Yaron Keren [Sun, 4 Jan 2015 13:48:30 +0000 (13:48 +0000)]
Fix default image name to 'a.exe' on Windows, instead 'a.out'.
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

9 years agoclang-format: Re-enable comment re-indentation for Java/JS.
Daniel Jasper [Sun, 4 Jan 2015 09:11:17 +0000 (09:11 +0000)]
clang-format: Re-enable comment re-indentation for Java/JS.

This was broken by r224120.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225130 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix indentation. No behavior change.
Nico Weber [Sun, 4 Jan 2015 08:07:54 +0000 (08:07 +0000)]
Fix indentation. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225129 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns, no behavior change.
Nico Weber [Sun, 4 Jan 2015 07:59:35 +0000 (07:59 +0000)]
Wrap to 80 columns, no behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225128 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDocument that GetTypeForDeclarator() cannot return a null type.
Nico Weber [Sun, 4 Jan 2015 05:29:21 +0000 (05:29 +0000)]
Document that GetTypeForDeclarator() cannot return a null type.

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

9 years agoCrash less enthusiasticially on _Atomic or __restrict__ on invalid types.
Nico Weber [Sun, 4 Jan 2015 04:53:10 +0000 (04:53 +0000)]
Crash less enthusiasticially on _Atomic or __restrict__ on invalid types.

Many places in Sema cannot handle isNull() types.  This is fine, because in
most places the type building code recovers by falling back to IntTy.  In
GetFullTypeForDeclarator(), this is done at the end of the getNumTypeObjects()
loop body.  This function calls BuildQualifiedType() before this fallback is
done though, so it explicitly needs to check for isNull() types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225124 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns, no behavior change.
Nico Weber [Sun, 4 Jan 2015 00:47:22 +0000 (00:47 +0000)]
Wrap to 80 columns, no behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225122 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAST: Remove overzealous assertion from IsModifiable
David Majnemer [Sun, 4 Jan 2015 00:44:32 +0000 (00:44 +0000)]
AST: Remove overzealous assertion from IsModifiable

It's reasonable to ask if an l-value with class type is modifiable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225121 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: __attribute__((keyword)) shouldn't error
David Majnemer [Sat, 3 Jan 2015 19:41:00 +0000 (19:41 +0000)]
Parse: __attribute__((keyword)) shouldn't error

Weird constructs like __attribute__((inline)) or
__attibute__((typename)) should result in warnings, not errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225118 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoVolatile reads are side-effecting operations, but in the general case of access throu...
Aaron Ballman [Sat, 3 Jan 2015 17:00:12 +0000 (17:00 +0000)]
Volatile reads are side-effecting operations, but in the general case of access through a volatile-qualified type, we're not certain of the underlying object's side-effects on access.

Treat volatile accesses as "maybe" instead of "definite" side effects for the purposes of warning on evaluations in an unevaluated context. No longer diagnose on idiomatic code like:

int * volatile v;
(void)sizeof(*v);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225116 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove -Werror from test.
Rafael Espindola [Sat, 3 Jan 2015 00:28:47 +0000 (00:28 +0000)]
Remove -Werror from test.

It is not needed since we FileCheck for the warning and -Werror itself can end up
unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225102 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReally don't warn about -flto/fno-lto :-(
Rafael Espindola [Sat, 3 Jan 2015 00:06:04 +0000 (00:06 +0000)]
Really don't warn about -flto/fno-lto :-(

This should fix the last bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225100 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAlso avoid warning on -flto/-fno-lto on linux.
Rafael Espindola [Fri, 2 Jan 2015 23:23:52 +0000 (23:23 +0000)]
Also avoid warning on -flto/-fno-lto on linux.

On OS X a .s file is preprocessed, it is not on linux, which is why the warning was still
showing up on linux but not OS X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225095 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't warn on unused -fno-lto.
Rafael Espindola [Fri, 2 Jan 2015 22:56:15 +0000 (22:56 +0000)]
Don't warn on unused -fno-lto.

It is somewhat common for CFLAGS to be used with .s files. We were
already ignoring -flto. This patch just does the same for -fno-lto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225093 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Provide a less subtle way to set the debug location of simple ret instructions
David Blaikie [Fri, 2 Jan 2015 22:07:26 +0000 (22:07 +0000)]
DebugInfo: Provide a less subtle way to set the debug location of simple ret instructions

un-XFAILing the test XFAIL'd in r225086 after it regressed in r225083.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225090 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: honour the clang-cl behaviour on ARM as well
Saleem Abdulrasool [Fri, 2 Jan 2015 21:47:33 +0000 (21:47 +0000)]
Driver: honour the clang-cl behaviour on ARM as well

Unfortunately, MSVC does not indicate to the driver what target is being used.
This means that we cannot correctly select the target architecture for the
clang_rt component.  This breaks down when targeting windows with the clang
driver as opposed to the clang-cl driver.  This should fix the native ARM
buildbot tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225089 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: reuse getCompilerRT in place of addSanitizerRTWindows
Saleem Abdulrasool [Fri, 2 Jan 2015 20:00:55 +0000 (20:00 +0000)]
Driver: reuse getCompilerRT in place of addSanitizerRTWindows

The logic for addSanitizerRTWindows was performing the same logical operation as
getCompilerRT, which was previously fully generalised for Linux and Windows.
This avoids having a duplication of the logic for building up the name of a
clang_rt component.  This change does move the current limitation for Windows
into getArchNameForCompilerRTLib, where it is assumed that the architecture for
Windows is always i386.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225087 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTemporarily XFAIL fallout from r225083 while investigating.
David Blaikie [Fri, 2 Jan 2015 19:49:28 +0000 (19:49 +0000)]
Temporarily XFAIL fallout from r225083 while investigating.

Between this behavior and that fixed by r225083/r225000, I'll take the
latter over the former for now, but I'm immediately working on
understanding/addressing this behavior too.

(the fact that the code change in r225083 caused this change in behavior
is a bit troubling anyway - given that it looks & claims to be just a
preformance thing)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225086 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Remove some now-unnecessary location handling around function arguments.
David Blaikie [Fri, 2 Jan 2015 19:49:10 +0000 (19:49 +0000)]
DebugInfo: Remove some now-unnecessary location handling around function arguments.

r225000 generalized debug info line info handling for expressions such
that this code is no longer necessary.

This removes the last use of CGDebugInfo::getLocation, but not all the
uses of CGDebugInfo::CurLoc, which is still used internally in
CGDebugInfo. I'd like to do away with all of that & might succeed after
a few more patches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225085 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Fix cases where location failed to be updated after r225000
David Blaikie [Fri, 2 Jan 2015 19:06:25 +0000 (19:06 +0000)]
DebugInfo: Fix cases where location failed to be updated after r225000

The optimization (that appears to have been here since the earliest
implementation (r50848) & has become more complicated over the years) to
avoid recreating the debugloc if it would be the same was out of date
because ApplyDebugLocation was not re-updating the CurLoc/PrevLoc. This
optimization doesn't look terribly beneficial/necessary, so I'm removing
it - if it turns up in benchmarks, I'm happy to reconsider/reimplement
this with justification, but for now it just seems to add
complexity/problems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225083 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstantiation of a CXXMethodDecl may fail when the parameter type cannot be instantia...
Nick Lewycky [Fri, 2 Jan 2015 01:33:12 +0000 (01:33 +0000)]
Instantiation of a CXXMethodDecl may fail when the parameter type cannot be instantiated. Do not crash in this case. Fixes PR22040!

The FIXME in the test is caused by TemplateDeclInstantiator::VisitCXXRecordDecl
returning a nullptr instead of creating an invalid decl. This is a common
pattern across all of TemplateDeclInstantiator, so I'm not comfortable changing
it. The reason it's not invalid in the class template is due to support for an
MSVC extension, see r137573.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225071 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Don't crash when a lambda uses a local constexpr variable
David Majnemer [Thu, 1 Jan 2015 09:49:44 +0000 (09:49 +0000)]
CodeGen: Don't crash when a lambda uses a local constexpr variable

The DeclRefExpr might be for a variable initialized by a constant
expression which hasn't been ODR used.
Emit the initializer for the variable instead of trying to capture the
variable itself.

This fixes PR22071.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225060 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoXFAIL test on win32 due to missing __complex support
David Blaikie [Wed, 31 Dec 2014 22:30:31 +0000 (22:30 +0000)]
XFAIL test on win32 due to missing __complex support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225051 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Include a couple more comments on using xcrun to query the SDK.
Ted Kremenek [Wed, 31 Dec 2014 08:19:08 +0000 (08:19 +0000)]
[analyzer] Include a couple more comments on using xcrun to query the SDK.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225039 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Change ccc-analyzer to mimick behavior on OSX Mavericks/Yosemite to automa...
Ted Kremenek [Wed, 31 Dec 2014 07:44:51 +0000 (07:44 +0000)]
[analyzer] Change ccc-analyzer to mimick behavior on OSX Mavericks/Yosemite to automatically infer the SDK location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225038 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHandle PPC64 return type (signext i32 rather than plain i32) in test case
David Blaikie [Wed, 31 Dec 2014 00:06:08 +0000 (00:06 +0000)]
Handle PPC64 return type (signext i32 rather than plain i32) in test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225021 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: unify compiler-rt component selection
Saleem Abdulrasool [Tue, 30 Dec 2014 22:52:08 +0000 (22:52 +0000)]
Driver: unify compiler-rt component selection

Unify the component handling for compiler-rt.  The components are regularly
named, built up from:

  ${LIBRARY_PREFIX}clang_rt.${component}-${arch}[-${environment}]${LIBRARY_SUFFIX}

Unify the handling for all the various components, into a single path to link
against the various components in a number of places.  This reduces duplication
of the clang_rt library name construction logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225013 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: whitespace
Saleem Abdulrasool [Tue, 30 Dec 2014 22:52:06 +0000 (22:52 +0000)]
Driver: whitespace

Fixup some whitespace/style issues.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225012 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove a comment that appears a second time 22 lines further down.
Nico Weber [Tue, 30 Dec 2014 20:13:37 +0000 (20:13 +0000)]
Remove a comment that appears a second time 22 lines further down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225004 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply "DebugInfo: Generalize debug info location handling"
David Blaikie [Tue, 30 Dec 2014 19:39:33 +0000 (19:39 +0000)]
Reapply "DebugInfo: Generalize debug info location handling"

Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).

Recommitted in r224941 and reverted in r224970 after it caused a crash
when building compiler-rt. Looks to be due to this change zeroing out
the debug location when emitting default arguments (which were meant to
inherit their outer expression's location) thus creating call
instructions without locations - these create problems for inlining and
must not be created. That is fixed and tested in this version of the
change.

Original commit message:

This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.

This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.

I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.

Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.

I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225000 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: use the canonical library prefix on Windows
Saleem Abdulrasool [Tue, 30 Dec 2014 18:55:37 +0000 (18:55 +0000)]
Driver: use the canonical library prefix on Windows

Unlike Unices, Windows does not use a library prefix.  Use the traditional
naming scheme even for Windows itanium environments.  This makes the builtins
behave more like the sanitisers as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224996 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd non-const version getFileSystemOpts() access function.
Yaron Keren [Tue, 30 Dec 2014 18:46:42 +0000 (18:46 +0000)]
Add non-const version getFileSystemOpts() access function.
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

9 years agoAdd a public accessor for GlobalCtors in CodeGenModule
Keno Fischer [Tue, 30 Dec 2014 08:12:39 +0000 (08:12 +0000)]
Add a public accessor for GlobalCtors in CodeGenModule

Summary:
In a JIT context it is useful to be able to access the GlobalCtors
and especially clear them once they have been emitted and called.
This adds a public method to be able to access the list.

Subscribers: yaron.keren, cfe-commits

Differential Revision: http://reviews.llvm.org/D6790

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224982 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: unify addClangRT{Linux,Windows}
Saleem Abdulrasool [Tue, 30 Dec 2014 02:10:36 +0000 (02:10 +0000)]
Driver: unify addClangRT{Linux,Windows}

The differences are pretty superficial:
- .lib vs .a extensions
- whether or not to link (potentially) incorrectly against libgcc_s

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224975 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't crash on an invalid trailing return type on a function before a '...'
Nico Weber [Tue, 30 Dec 2014 02:06:40 +0000 (02:06 +0000)]
Don't crash on an invalid trailing return type on a function before a '...'

clang tries to produce a helpful diagnostic for the traiilng '...', but the
code that r216778 added for this doesn't expect an invalid trailing return type.
Add code to explicitly handle this.

Having explicit code for this but not for other things looks a bit strange, but
trailing return types are special in that they have a separate existence bit in
addition to the type (see r158348).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224974 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "DebugInfo: Generalize debug info location handling"
David Blaikie [Mon, 29 Dec 2014 23:49:00 +0000 (23:49 +0000)]
Revert "DebugInfo: Generalize debug info location handling"

Asserting when building compiler-rt when using a GCC host compiler.
Reverting while I investigate.

This reverts commit r224941.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224970 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix build breakage
David Majnemer [Mon, 29 Dec 2014 23:24:27 +0000 (23:24 +0000)]
Fix build breakage

That's what I get for last second changes...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224967 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: Recover more gracefully from extra :: tokens before a {
David Majnemer [Mon, 29 Dec 2014 23:12:23 +0000 (23:12 +0000)]
Parse: Recover more gracefully from extra :: tokens before a {

Instead of crashing, recover by eating the extra trailing scope
qualifier.  This means we will treat 'struct A:: {' as 'struct A {'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224966 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22051: Missing debug location on calls in dtor thunks in Windows.
David Blaikie [Mon, 29 Dec 2014 22:53:52 +0000 (22:53 +0000)]
PR22051: Missing debug location on calls in dtor thunks in Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224963 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse std::find_if instead of manual loop.
David Blaikie [Mon, 29 Dec 2014 22:39:45 +0000 (22:39 +0000)]
Use std::find_if instead of manual loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224960 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCrash even less on malformed attributes in an incorrect location.
Nico Weber [Mon, 29 Dec 2014 21:56:22 +0000 (21:56 +0000)]
Crash even less on malformed attributes in an incorrect location.

This is a follow-up to r224915.  This adds a bit more line noise to the tests
added in that revision to make sure the parser is ready for a toplevel decl
after each incorrect line.  Use this to move the tests up to where they belong.
This uncovered that the early return was missing a call to
ActOnTagDefinitionError(), so add that. (Also fixes at least one of the crashes
on SLi's bot.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224958 91177308-0d34-0410-b5e6-96231b3b80d8