]> granicus.if.org Git - clang/log
clang
9 years agoRemove unused method canInferFrameworkModule
Ben Langmuir [Tue, 13 Jan 2015 17:47:29 +0000 (17:47 +0000)]
Remove unused method canInferFrameworkModule

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

9 years ago[mips] Fix va_arg() for pointer types on big-endian N32.
Daniel Sanders [Tue, 13 Jan 2015 10:47:00 +0000 (10:47 +0000)]
[mips] Fix va_arg() for pointer types on big-endian N32.

Summary:
The Mips ABI's treat pointers in the same way as integers. They are
sign-extended to 32-bit for O32, and 64-bit for N32/N64. This doesn't matter
for O32 and N64 where pointers are already the correct width but it does matter
for big-endian N32, where pointers are 32-bit and need promoting.

The caller side is already passing pointers correctly. This patch corrects the
callee.

Reviewers: vmedic, atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

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

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

9 years agoRevert "Sema: An extern declaration can't be a redeclaration of a parameter"
David Majnemer [Tue, 13 Jan 2015 10:14:57 +0000 (10:14 +0000)]
Revert "Sema: An extern declaration can't be a redeclaration of a parameter"

This reverts commit r225780, we can't compile line 181 in
sanitizer_platform_limits_posix.cc with this commit.

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

9 years agoSema: An extern declaration can't be a redeclaration of a parameter
David Majnemer [Tue, 13 Jan 2015 09:55:56 +0000 (09:55 +0000)]
Sema: An extern declaration can't be a redeclaration of a parameter

In the following:
void f(int x) { extern int x; }

The second declaration of 'x' shouldn't be considered a redeclaration of
the parameter.

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

9 years agoUpdate clang-format.el to use xml output and patch in the returned chunks.
Manuel Klimek [Tue, 13 Jan 2015 08:35:34 +0000 (08:35 +0000)]
Update clang-format.el to use xml output and patch in the returned chunks.

This leads to better undo behavior and avoids window content jumping
around.

Patch by Johann Klähn.

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

9 years agoParse: Switch to using EOF tokens for late parsed attributes
David Majnemer [Tue, 13 Jan 2015 08:35:24 +0000 (08:35 +0000)]
Parse: Switch to using EOF tokens for late parsed attributes

The EOF token injection technique is preferable to using
isBeforeInTranslationUnit to determine whether or not additional cleanup
is needed.  I don't have an example off-hand that requires it but it is
nicer nonetheless.

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

9 years agoParse: Don't crash when default argument in typedef consists of sole '='
David Majnemer [Tue, 13 Jan 2015 07:42:33 +0000 (07:42 +0000)]
Parse: Don't crash when default argument in typedef consists of sole '='

We'd crash trying to make the SourceRange for the tokens we'd like to
highlight.  Don't assume there is more than one token makes up the
default argument.

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

9 years agoParse: Don't crash if missing an initializer expression
David Majnemer [Tue, 13 Jan 2015 05:28:24 +0000 (05:28 +0000)]
Parse: Don't crash if missing an initializer expression

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

9 years agoParse: use the EOF token method to lex inline method bodies
David Majnemer [Tue, 13 Jan 2015 05:06:20 +0000 (05:06 +0000)]
Parse: use the EOF token method to lex inline method bodies

Mark the end of the method body with an EOF token, collect it once we
expect to be done with method body parsing.  No functionality change
intended.

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

9 years agoParse: Further simplify ParseLexedMethodDeclaration
David Majnemer [Tue, 13 Jan 2015 04:20:57 +0000 (04:20 +0000)]
Parse: Further simplify ParseLexedMethodDeclaration

No functionality change intended, just moving code around to make it
simpler.

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

9 years agoMark vtable used on explicit destructor definitions.
Nico Weber [Tue, 13 Jan 2015 03:52:11 +0000 (03:52 +0000)]
Mark vtable used on explicit destructor definitions.

There are two things in a C++ program that need to read the vtable pointer:
Constructors and destructors.  (A few other operations -- virtual calls,
dynamic cast, rtti -- read the vtable pointer off a this pointer, but for
this they don't need the vtable symbol.)  Implicit constructors and destructors
and explicit constructors already marked the vtable as used, but explicit
destructors didn't.

Note that the only thing sema's "mark a class's vtable used" does is to mark all
final overriders of the class as referenced, it does _not_ cause emission of
the vtable itself.  This is done on demand by codegen, independent of sema,
since sema might emit functions that are not referenced.  (The exception are
vtables that are forced via key functions -- these are forced onto codegen
by sema.)

This bug went unnoticed for years because it doesn't have observable effects
(yet -- I want to change this in PR20337, which is why I noticed this).

r213109 made it so that _calls_ to constructors don't mark the vtable used.
Currently, _calls_ to destructors still mark the vtable used.  If that
wasn't the case, this program would tickle the problem:

  test.h:
    template <typename T>
    struct B {
      int* p;
      virtual ~B() { delete p; }
      virtual void f() {}
    };

    struct __attribute__((visibility("default"))) C {
      C();
      B<int> m;
    };

  test2.cc:
    #include "test.h"
    int main() {
      C* c = new C;
      delete c;
    }

  test3.cc:
    #include "test.h"
    C::C() {}

  # This bin/clang++ binary doesn't MarkVTableUsed() for virtual dtor calls:
  $ bin/clang++ -shared test3.cc -std=c++11 -O2  -fvisibility=hidden \
        -fvisibility-inlines-hidden  -o libtest3.dylib
  $ bin/clang++ test2.cc -std=c++11 -O2  -fvisibility=hidden \
        -fvisibility-inlines-hidden  libtest3.dylib
  Undefined symbols for architecture x86_64:
    "B<int>::f()", referenced from:
        vtable for B<int> in test2-af8f4f.o
  ld: symbol(s) not found for architecture x86_64

What's happening here is that there's a copy of B's vtable hidden in
libtest3.dylib, because C's constructor caused an implicit instantiation of that
(and implicit constructors generate vtables).
test2.cc calls C's destructDr, which destroys the B<int> member,
which wants to overwrite the vtable back to B (think of B as the base of a class
hierarchy, and of hierarchical destruction -- maybe we shouldn't do the vtable
writing in destructors of final classes), but there's nothing in test2.cc that
marks B's vtable used.  So codegen writes out the vtable, but since it wasn't
marked used, sema didn't mark all the virtual functions (in particular f())
as used.

Note that this change makes us reject programs we didn't reject before (see
the included Sema test case), but both gcc and cl also reject this code, and
clang used to reject it before r213109.

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

9 years ago[OPENMP] Consider global named register variables as threadprivate by default.
Alexey Bataev [Tue, 13 Jan 2015 03:35:30 +0000 (03:35 +0000)]
[OPENMP] Consider global named register variables as threadprivate by default.
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

9 years agoExtend the self move warning to record types.
Richard Trieu [Tue, 13 Jan 2015 02:32:02 +0000 (02:32 +0000)]
Extend the self move warning to record types.

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

9 years agoIf we don't find a matching ) for a ( in an exception specification, keep the tokens...
Richard Smith [Tue, 13 Jan 2015 02:24:58 +0000 (02:24 +0000)]
If we don't find a matching ) for a ( in an exception specification, keep the tokens around so we can diagnose an error rather than silently discarding them.

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

9 years agoPR22208: On FreeBSD systems, __STDC_MB_MIGHT_NEQ_WC__ is expected to be defined
Richard Smith [Tue, 13 Jan 2015 01:47:45 +0000 (01:47 +0000)]
PR22208: On FreeBSD systems, __STDC_MB_MIGHT_NEQ_WC__ is expected to be defined
even though every basic source character literal has the same numerical value
as a narrow or wide character literal.

It appears that the FreeBSD folks are trying to use this macro to mean
something other than what the relevant standards say it means, but their usage
is conforming, so put up with it.

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

9 years agoSimplify a test. No behavior change.
Nico Weber [Tue, 13 Jan 2015 00:24:46 +0000 (00:24 +0000)]
Simplify a test. No behavior change.

Templates don't have key functions (cf computeKeyFunction() in
RecordLayoutBuilder.cpp), so don't have something that looks like one.

Also, instead of a vcall to force generation of the vtable, just construct
the object.  This is how the repro on PR5557 (what the test is for) worked too.

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

9 years agoReimplement -fsanitize-recover family of flags.
Alexey Samsonov [Mon, 12 Jan 2015 22:39:12 +0000 (22:39 +0000)]
Reimplement -fsanitize-recover family of flags.

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

9 years ago[patch][pr19848] Produce explicit comdats in clang.
Rafael Espindola [Mon, 12 Jan 2015 22:13:53 +0000 (22:13 +0000)]
[patch][pr19848] Produce explicit comdats in clang.

The llvm IR until recently had no support for comdats. This was a problem when
targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of
dead bits to remain on the executable (unless -ffunction-sections,
-fdata-sections and --gc-sections were used).

To fix the problem, llvm's codegen will just assume that any weak or linkonce
that is not in an explicit comdat should be output in one with the same name as
the global.

This unfortunately breaks cases like pr19848 where a weak symbol is not
xpected to be part of any comdat.

Now that we have explicit comdats in the IR, we can finally get both cases
right.

This first patch just makes clang give explicit comdats to GlobalValues where
t is allowed to.

A followup patch to llvm will then stop implicitly producing comdats.

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

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 12 Jan 2015 21:24:10 +0000 (21:24 +0000)]
Wrap to 80 columns. No behavior change.

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

9 years agoDon't use a doc comment in a function body.
Nico Weber [Mon, 12 Jan 2015 21:22:27 +0000 (21:22 +0000)]
Don't use a doc comment in a function body.

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

9 years agoreverting due to build bot failure
Nathan Sidwell [Mon, 12 Jan 2015 20:13:20 +0000 (20:13 +0000)]
reverting due to build bot failure

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

9 years agoFix typo Block.h vs Blocks.h
Ben Langmuir [Mon, 12 Jan 2015 19:42:27 +0000 (19:42 +0000)]
Fix typo Block.h vs Blocks.h

Thanks for Jeremy for noticing!

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

9 years ago[PowerPC]To provide better compatibility with gcc I added the __bool keyword to the...
Bill Seurer [Mon, 12 Jan 2015 19:35:51 +0000 (19:35 +0000)]
[PowerPC]To provide better compatibility with gcc I added the __bool keyword 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

9 years agoFix bogus 'method is unavailable' errors with modules
Ben Langmuir [Mon, 12 Jan 2015 19:27:00 +0000 (19:27 +0000)]
Fix bogus 'method is unavailable' errors with modules

This just tweaks the fix from r224892 (which handled PCHs) to work with
modules, where we will serialize each method individually and hence the
hasMoreThanOneDecl bit needs to be updated as we add the methods.

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

9 years ago[mips] Explain why we need to always clobber for MIPS inline asm. NFC.
Toma Tabacu [Mon, 12 Jan 2015 14:41:30 +0000 (14:41 +0000)]
[mips] Explain why we need to always clobber  for MIPS inline asm. NFC.

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

9 years agoFix assertion in BreakableBlockComment (http://llvm.org/PR21916).
Alexander Kornienko [Mon, 12 Jan 2015 13:11:12 +0000 (13:11 +0000)]
Fix assertion in BreakableBlockComment (http://llvm.org/PR21916).

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

9 years agoSuppress clang/test/Driver/rewrite-map-in-diagnostics.c on win32 for now. This doesn...
NAKAMURA Takumi [Mon, 12 Jan 2015 11:39:04 +0000 (11:39 +0000)]
Suppress clang/test/Driver/rewrite-map-in-diagnostics.c on win32 for now. This doesn't fail on "env clang". Investigating.

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

9 years agoclang-format: Improve format of lambdas in ctor initializers.
Daniel Jasper [Mon, 12 Jan 2015 10:23:24 +0000 (10:23 +0000)]
clang-format: Improve format of lambdas in ctor initializers.

Before:
  Constructor()
      : Constructor([] { // comment
        int i;
      }) {}

After:
  Constructor()
      : Constructor([] { // comment
          int i;
        }) {}

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

9 years agoRename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFC
Alexey Bataev [Mon, 12 Jan 2015 10:17:46 +0000 (10:17 +0000)]
Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFC

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

9 years agoclang-format: Fix formatting of inline asm.
Daniel Jasper [Mon, 12 Jan 2015 10:14:56 +0000 (10:14 +0000)]
clang-format: Fix formatting of inline asm.

Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.

This fixes llvm.org/PR22190.

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

9 years agoParse: Get rid of cxx_exceptspec_end, use EOF instead
David Majnemer [Mon, 12 Jan 2015 09:16:57 +0000 (09:16 +0000)]
Parse: Get rid of cxx_exceptspec_end, use EOF instead

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

9 years agoParse: Just a small tidy-up in ParseLexedMethodDeclaration
David Majnemer [Mon, 12 Jan 2015 06:51:15 +0000 (06:51 +0000)]
Parse: Just a small tidy-up in ParseLexedMethodDeclaration

No functional change intended, just tidy up the parse flow.

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

9 years agoParse: Get rid of tok::cxx_defaultarg_end, use EOF instead
David Majnemer [Mon, 12 Jan 2015 05:17:40 +0000 (05:17 +0000)]
Parse: Get rid of tok::cxx_defaultarg_end, use EOF instead

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

9 years agoParse: It's cleaner to handle cxx_defaultarg_end in SkipUntil directly
David Majnemer [Mon, 12 Jan 2015 03:36:37 +0000 (03:36 +0000)]
Parse: It's cleaner to handle cxx_defaultarg_end in SkipUntil directly

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

9 years agoParse: Don't let BalancedDelimiterTracker consume cxx_defaultarg_end
David Majnemer [Mon, 12 Jan 2015 03:14:18 +0000 (03:14 +0000)]
Parse: Don't let BalancedDelimiterTracker consume cxx_defaultarg_end

It is not correct to let it consume the cxx_defaultarg_end token.  I'm
starting to wonder if it makes more sense to stop SkipUntil from
consuming such tokens.

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

9 years agoDriver: include rewrite maps in the diagnostics
Saleem Abdulrasool [Mon, 12 Jan 2015 02:33:09 +0000 (02:33 +0000)]
Driver: include rewrite maps in the diagnostics

The rewrite map files are not copied, and so cannot be tracked as temporary
files.  Add them explicitly to the list of files that we request from the user
to be attached to bug reports.

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

9 years agoParse: Don't parse beyond the end of the synthetic default argument tok
David Majnemer [Mon, 12 Jan 2015 02:28:16 +0000 (02:28 +0000)]
Parse: Don't parse beyond the end of the synthetic default argument tok

Recovery from malformed lambda introducers would find us consuming the
synthetic default argument token, which is bad.  Instead, stop right
before that token.

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

9 years agoBasic: Numeric constraints are multidigit
David Majnemer [Sun, 11 Jan 2015 10:22:41 +0000 (10:22 +0000)]
Basic: Numeric constraints are multidigit

Clang would treat the digits in an "11m" input constraint separately as
if it was handling constraint 1 twice instead of constraint 11.

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

9 years agoBasic: [asmSymbolicName] follows the same rule as numbers in asm inputs
David Majnemer [Sun, 11 Jan 2015 09:57:13 +0000 (09:57 +0000)]
Basic: [asmSymbolicName] follows the same rule as numbers in asm inputs

Input constraints like "0" and "[foo]" should be treated the same when
it comes to their corresponding output constraint.

This fixes PR21850.

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

9 years agoBasic: The asm constraint '#m' isn't valid, reject it
David Majnemer [Sun, 11 Jan 2015 09:39:03 +0000 (09:39 +0000)]
Basic: The asm constraint '#m' isn't valid, reject it

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

9 years agoCodeGen: Simplify consecutive '%' modifiers
David Majnemer [Sun, 11 Jan 2015 09:13:56 +0000 (09:13 +0000)]
CodeGen: Simplify consecutive '%' modifiers

LLVM the consecutive '%' modifiers are redundant, skip them.

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

9 years agoCodeGen: Simplify consecutive '&' modifiers
David Majnemer [Sun, 11 Jan 2015 09:09:01 +0000 (09:09 +0000)]
CodeGen: Simplify consecutive '&' modifiers

LLVM the consecutive '&' modifiers are redundant, skip them.

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

9 years agoBasic: The asm constraint '+#r' isn't valid, reject it
David Majnemer [Sun, 11 Jan 2015 08:52:38 +0000 (08:52 +0000)]
Basic: The asm constraint '+#r' isn't valid, reject it

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

9 years agoDon't rely on the default constructor default constructing a begin and
Chandler Carruth [Sun, 11 Jan 2015 01:43:06 +0000 (01:43 +0000)]
Don't rely on the default constructor default constructing a begin and
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

9 years agofix pr18645. Correct logic concerning 'T &&' deduction against lvalues.
Nathan Sidwell [Sat, 10 Jan 2015 18:16:25 +0000 (18:16 +0000)]
fix pr18645. Correct logic concerning 'T &&' deduction against lvalues.

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

9 years agoSema: The asm constraint '+&m' isn't valid, reject it
David Majnemer [Sat, 10 Jan 2015 10:43:19 +0000 (10:43 +0000)]
Sema: The asm constraint '+&m' isn't valid, reject it

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

9 years agoAdd a new warning, -Wself-move, to Clang.
Richard Trieu [Sat, 10 Jan 2015 06:04:18 +0000 (06:04 +0000)]
Add a new warning, -Wself-move, to Clang.

-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

9 years agoFix temporary lifetime extension from an initializer using braced "functional"
Richard Smith [Sat, 10 Jan 2015 01:28:13 +0000 (01:28 +0000)]
Fix temporary lifetime extension from an initializer using braced "functional"
cast notation T{...} when T is a reference type.

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

9 years agoDon't emit implicit template instantiations eagerly (PR21718)
Hans Wennborg [Sat, 10 Jan 2015 01:19:48 +0000 (01:19 +0000)]
Don't emit implicit template instantiations eagerly (PR21718)

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

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

9 years agoRemove unnecessary/incorrect XFAIL after the revert of 225000
David Blaikie [Fri, 9 Jan 2015 23:38:45 +0000 (23:38 +0000)]
Remove unnecessary/incorrect XFAIL after the revert of 225000

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

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