]> granicus.if.org Git - clang/log
clang
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

9 years agoFix use-after-destruction introduced in r224924.
Alexey Samsonov [Mon, 29 Dec 2014 21:28:15 +0000 (21:28 +0000)]
Fix use-after-destruction introduced in r224924.

getMainExecutable() returns a std::string, assigning its result
to StringRef immediately creates a dangling pointer. This was
detected by half-broken fast-MSan-bootstrap bot.

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

9 years agoDriver: convert a couple more instances to range based loops
Saleem Abdulrasool [Mon, 29 Dec 2014 21:02:47 +0000 (21:02 +0000)]
Driver: convert a couple more instances to range based loops

More conversion to range based for loops rather than direct iterators with
dereferencing.  NFC.

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

9 years agoParse: Ignore '::' in 'struct :: {'
David Majnemer [Mon, 29 Dec 2014 19:19:18 +0000 (19:19 +0000)]
Parse: Ignore '::' in 'struct :: {'

Let's pretend that we didn't see the '::' instead of go on believing
that we've got some anonymous, but globally qualified, struct.

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

9 years agoDriver: convert a number of loops to range based
Saleem Abdulrasool [Mon, 29 Dec 2014 19:01:36 +0000 (19:01 +0000)]
Driver: convert a number of loops to range based

Iterate over the arguments via range based for loops rather than iterators and
explicitly dereferencing them.  NFC.

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

9 years agoAdd an assertion to verify a container is non-empty before calling 'back()'
David Blaikie [Mon, 29 Dec 2014 18:37:03 +0000 (18:37 +0000)]
Add an assertion to verify a container is non-empty before calling 'back()'

This would've helped stabilize/deflake some failures that were seen
after some recent changes.

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

9 years agoReapply "DebugInfo: Generalize debug info location handling"
David Blaikie [Mon, 29 Dec 2014 18:18:45 +0000 (18:18 +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).

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@224941 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoEffectively revert r151058 which caused Clang's unwind.h to defer to
Chandler Carruth [Mon, 29 Dec 2014 13:29:38 +0000 (13:29 +0000)]
Effectively revert r151058 which caused Clang's unwind.h to defer to
libunwind in all cases when installed.

At the time, Clang's unwind.h didn't provide huge chunks of the
LSB-specified unwind interface, and was generally too aenemic to use for
real software. However, it has since then become a strict superset of
the APIs provided by libunwind on Linux. Notably, you cannot compile
llgo's libgo library against libunwind, but you can against Clang's
unwind.h. So let's just use our header. =] I've checked pretty
thoroughly for any incompatibilities, and I am not aware of any.

An open question is whether or not we should continue to munge
GNU_SOURCE here. I didn't touch that as it potentially has compatibility
implications on systems I cannot easily test -- Darwin. If a Darwin
maintainer can verify that this is in fact unnecessary and remove it,
cool. Until then, leaving it in makes this change a no-op there, and
only really relevant on Linux systems where it is pretty clearly the
right way to go.

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

9 years agoAdd a missing declaration to our unwind.h implementation. This is
Chandler Carruth [Mon, 29 Dec 2014 13:29:36 +0000 (13:29 +0000)]
Add a missing declaration to our unwind.h implementation. This is
necessary to be fully compatible with existing software that calls into
the linux unwind code. You can find documentation of this API and why it
exists in the discussion abot NPTL here:
https://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html

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

9 years ago[multilib] Teach Clang's code about multilib by threading
Chandler Carruth [Mon, 29 Dec 2014 12:09:08 +0000 (12:09 +0000)]
[multilib] Teach Clang's code about multilib by threading
a CLANG_LIBDIR_SUFFIX down from the build system and using that as part
of the default resource dir computation.

Without this, essentially nothing that uses the clang driver works when
building clang with a libdir suffix. This is probably the single biggest
missing piece of support for multilib as without this people could hack
clang to end up installed in the correct location, but it would then
fail to find its own basic resources. I know of at least one distro that
has some variation on this patch to hack around this; hopefully they'll
be able to use the libdir suffix functionality directly as the rest of
these bits land.

This required fixing a copy of the code to compute Clang's resource
directory that is buried inside of the frontend (!!!). It had bitrotted
significantly relative to the driver code. I've made it essentially
a clone of the driver code in order to keep tests (which use cc1
heavily) passing. This copy should probably just be removed and the
frontend taught to always rely on an explicit resource directory from
the driver, but that is a much more invasive change for another day.

I've also updated one test which actually encoded the resource directory
in its checked output to tolerate multilib suffixes.

Note that this relies on a prior LLVM commit to add a stub to the
autoconf build system for this variable.

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

9 years ago[cmake] Teach the Clang CMake build to use LLVM_LIBDIR_SUFFIX for its
Chandler Carruth [Mon, 29 Dec 2014 12:09:03 +0000 (12:09 +0000)]
[cmake] Teach the Clang CMake build to use LLVM_LIBDIR_SUFFIX for its
'lib' directories in the build. This variable is available now both as
part of the normal LLVM build an as part of a standalone build as I've
added it to the LLVMConfig.cmake output.

With this change we should at least put libraries into the multilib
directory correctly. It is the first step in getting Clang to be
reasonably multilib aware.

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

9 years agoSema: Permit array l-values in asm output operands
David Majnemer [Mon, 29 Dec 2014 10:29:53 +0000 (10:29 +0000)]
Sema: Permit array l-values in asm output operands

GCC permits array l-values in asm output operands even though they
aren't modifiable l-values.  We used to permit it but this behavior
regressed in r224916.

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

9 years agoSema: Only permit permit modifiable l-values as asm output params
David Majnemer [Mon, 29 Dec 2014 09:30:33 +0000 (09:30 +0000)]
Sema: Only permit permit modifiable l-values as asm output params

Functions are l-values in C++ but shouldn't be available as output
parameters in inline assembly.  Neither should overloaded function
l-values.

This fixes PR21949.

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

9 years agoDon't crash on malformed attributes in an incorrect location.
Nico Weber [Mon, 29 Dec 2014 06:56:50 +0000 (06:56 +0000)]
Don't crash on malformed attributes in an incorrect location.

r168626 added nicer diagnostics for attributes in the wrong places, such as
after the `final` on a class.  To do this, it added code that did high-level
pattern matching for e.g. 'final' 'alignas' '(' and then skipped until the
closing ')'.  If it saw that, it then went down the regular class parsing
path and then called MaybeParseCXX11Attributes() to parse the attribute after
the 'final' using real attribute parsing code.  On invalid attributes, the
real attribute parsing code could eat more tokens than the pattern matching
code and for example skip past the '{' starting the class, which would then
lead to an assert.  To prevent this, check for a good state after calling
MaybeParseCXX11Attributes() (which morphed into CheckMisplacedCXX11Attribute()
in r175575) and bail out if things look bleak.

Found by SLi's afl bot.

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

9 years ago[x86] Fix an accidental commit of a change from Ii to iC on __builtin_ia32_cmpps512_mask.
Craig Topper [Mon, 29 Dec 2014 06:55:01 +0000 (06:55 +0000)]
[x86] Fix an accidental commit of a change from Ii to iC on __builtin_ia32_cmpps512_mask.

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

9 years ago[x86] Put 'C' after 'i' on all the AVX-512 intrisics that take const ints. 'C' is...
Craig Topper [Mon, 29 Dec 2014 06:41:12 +0000 (06:41 +0000)]
[x86] Put 'C' after 'i' on all the AVX-512 intrisics that take const ints. 'C' is a suffix modifier not a prefix modififier. Also put 'C' on the pointers in all of the gather instrinsics. I think they previously had one due to the misordering. I'm still thinking the 'iC' actually need to be a 'Ii' since they really require an ICE.

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

9 years agoSema: Don't crash when solitary :: token appears before { in struct def
David Majnemer [Mon, 29 Dec 2014 05:17:46 +0000 (05:17 +0000)]
Sema: Don't crash when solitary :: token appears before { in struct def

hasDeclaratorForAnonDecl, getDeclaratorForAnonDecl and
getTypedefNameForAnonDecl are expected to handle the case where
NamedDeclOrQualifier holds the wrong type or nothing at all.

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

9 years agoSema: Forbid inconsistent constraint alternatives
David Majnemer [Mon, 29 Dec 2014 04:09:59 +0000 (04:09 +0000)]
Sema: Forbid inconsistent constraint alternatives

Verify that asm constraints have the same number of alternatives

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

9 years agoSemaCXX: Don't crash when annotation tokens show up before the tag name
David Majnemer [Mon, 29 Dec 2014 02:14:26 +0000 (02:14 +0000)]
SemaCXX: Don't crash when annotation tokens show up before the tag name

Clang has a hack to accept definitions of structs with tag names which
have the same name as intrinsics.  However, this hack didn't guard
against annotation tokens showing up in the token stream.

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

9 years agoCodeGen: Optimize emssion of zeroinitialzied arrays
David Majnemer [Sun, 28 Dec 2014 23:46:59 +0000 (23:46 +0000)]
CodeGen: Optimize emssion of zeroinitialzied arrays

Create an ConstantAggregateZero upfront if we see that it is viable.
This saves us from having to manually push_back each and every
initializer and then looping back over them to determine if they are
'null'.

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

9 years agoDon't crash on surprising tokens in default parameter template lists.
Nico Weber [Sun, 28 Dec 2014 23:24:02 +0000 (23:24 +0000)]
Don't crash on surprising tokens in default parameter template lists.

Fixes this snippet from SLi's afl fuzzer output:

  class {
      i (x = <, enum

This parsed i as a function, x as a paramter, and the stuff after < as a
template list.  This then called TryConsumeDeclarationSpecifier() which
called TryAnnotateCXXScopeToken() without checking the preconditions of
this function.  Check them before calling, like all other callers of
TryAnnotateCXXScopeToken() do.

A more readable reproducer that causes the same crash is

  class {
      void i(int x = MyTemplateClass<int, union int>::foo());
  };

The reduced version used an eof token as surprising token, but kw_int works
just as well to repro and is easier to insert into a test file.

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

9 years agoSema: Variable templates cannot be static bitfield members
David Majnemer [Sun, 28 Dec 2014 22:51:45 +0000 (22:51 +0000)]
Sema: Variable templates cannot be static bitfield members

We correctly forbid variables but not variable templates.  Diagnose this
case instead of crashing.

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

9 years agoParse: Don't crash when 'typename' shows up in an attribute
David Majnemer [Sun, 28 Dec 2014 22:28:32 +0000 (22:28 +0000)]
Parse: Don't crash when 'typename' shows up in an attribute

isDeclarationSpecifier performs error recovers which jostles the token
stream.  Specifically, TryAnnotateTypeOrScopeToken will end up consuming
a typename token which will confuse the attribute parsing machinery as
we no-longer have something identifier-like.

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

9 years agoSema: Permit an atomic type to be initialized by the same atomic type
David Majnemer [Sun, 28 Dec 2014 21:47:31 +0000 (21:47 +0000)]
Sema: Permit an atomic type to be initialized by the same atomic type

We forgot a conversion step when initializing an atomic type with an
rvalue of the same type.

This fixes PR22043.

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

9 years agoSema: Don't crash when an inject class name has a nested redefinition
David Majnemer [Sun, 28 Dec 2014 09:18:54 +0000 (09:18 +0000)]
Sema: Don't crash when an inject class name has a nested redefinition

We expected the type of a TagDecl to be a TagType, not an
InjectedClassNameType.  Introduced a helper method, Type::getAsTagDecl,
to abstract away the difference; redefine Type::getAsCXXRecordDecl to be
in terms of it.

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

9 years agoLex: Don't let annotation tokens get into macro expansion
David Majnemer [Sun, 28 Dec 2014 07:42:49 +0000 (07:42 +0000)]
Lex: Don't let annotation tokens get into macro expansion

We'd let annotation tokens from '#pragma pack' and the like get inside a
function-like macro.  This would lead to terror and mayhem; stop the
madness early.

This fixes PR22037.

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

9 years agoFix markup from r224894.
Nico Weber [Sun, 28 Dec 2014 02:12:59 +0000 (02:12 +0000)]
Fix markup from r224894.

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

9 years agoAdd stub sections about Parse, Sema, CodeGen to the internals manual.
Nico Weber [Sun, 28 Dec 2014 02:07:26 +0000 (02:07 +0000)]
Add stub sections about Parse, Sema, CodeGen to the internals manual.

I'd be interested if the paragraph on Parse not knowing much about AST is
something folks agree with.  I think this used to be true after rjmccall removed
the Action interface in r112244 and I believe it's still true, but I'm not sure.
(For example, ParseOpenMP.cpp does include AST/StmtOpenMP.h.  Other than that,
Parse not using AST nodes much seems to be still true, though.)

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

9 years agoRemove unneeded include of DeclCXX.h from libParse.
Nico Weber [Sun, 28 Dec 2014 01:52:28 +0000 (01:52 +0000)]
Remove unneeded include of DeclCXX.h from libParse.

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

9 years agoObjective-C: Serialize "more than one decl" state of ObjCMethodList.
Nico Weber [Sat, 27 Dec 2014 22:14:15 +0000 (22:14 +0000)]
Objective-C: Serialize "more than one decl" state of ObjCMethodList.

This fixes PR21587, what r221933 fixed for regular programs is now also
fixed for decls coming from PCH files.

Use another bit from the count/bits uint16_t for storing the "more than one
decl" bit.  This reduces the number of bits for the count from 14 to 13.
The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits
should still be plenty.  Since this changes the meaning of a serialized bit
pattern, also increase clang::serialization::VERSION_MAJOR.

Storing the "more than one decl" state of only the first overload isn't quite
correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at
the state of the first overload so it's good enough for now.

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

9 years ago[x86] Also add the missing type casts on the returns in the sha
Chandler Carruth [Sat, 27 Dec 2014 11:50:51 +0000 (11:50 +0000)]
[x86] Also add the missing type casts on the returns in the sha
intrinsic header file. Along with r224822, this should restore the build
bots to passing.

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

9 years ago[x86] Add missing typecast to __v4si to sha intrinsic header file.
Craig Topper [Sat, 27 Dec 2014 07:19:25 +0000 (07:19 +0000)]
[x86] Add missing typecast to __v4si to sha intrinsic header file.

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

9 years agoObjective-C: Tweak unavailability warning.
Nico Weber [Sat, 27 Dec 2014 07:09:37 +0000 (07:09 +0000)]
Objective-C: Tweak unavailability warning.

Don't warn when a selector has an unavailable and an available variant,
and the first also has an implementation.

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

9 years ago[x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.
Craig Topper [Sat, 27 Dec 2014 07:00:08 +0000 (07:00 +0000)]
[x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.

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

9 years ago[x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic...
Craig Topper [Sat, 27 Dec 2014 06:59:57 +0000 (06:59 +0000)]
[x86] Add the (v)cmpps/pd/ss/sd builtins to match gcc. Use them in the sse intrinsic files.

This still lower to the same intrinsics as before.

This is preparation for bounds checking the immediate on the avx version of the builtin so we don't pass illegal immediates into the backend. Since SSE uses a smaller size immediate its not possible to bounds check when using a shared builtin. Rather than creating a clang specific builtin for the different immediate, I decided (after consulting with Chandler) that it was better to match gcc.

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

9 years agoAdd more feature flags to the x86 instrinsic test.
Craig Topper [Sat, 27 Dec 2014 06:59:44 +0000 (06:59 +0000)]
Add more feature flags to the x86 instrinsic test.

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

9 years agoFix formatting. NFC.
Craig Topper [Sat, 27 Dec 2014 06:59:37 +0000 (06:59 +0000)]
Fix formatting. NFC.

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

9 years agoAddress review feedback on r221933.
Nico Weber [Sat, 27 Dec 2014 03:58:08 +0000 (03:58 +0000)]
Address review feedback on r221933.

Remove ObjCMethodList::Count, instead store a "has more than one decl" bit in
the low bit of the ObjCMethodDecl pointer, using a PointerIntPair.

Most of this patch is replacing ".Method" with ".getMethod()".

No intended behavior change.

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

9 years agoMake the test from r224873 actually pass.
Nico Weber [Sat, 27 Dec 2014 03:38:18 +0000 (03:38 +0000)]
Make the test from r224873 actually pass.

The behavior looks incorrect to me, but the test is supposed to document
current behavior for now.

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

9 years agoMark __builtin_ia32_cmppd256 and __builtin_ia32_cmpps256 as taking an ICE for the...
Craig Topper [Sat, 27 Dec 2014 01:20:16 +0000 (01:20 +0000)]
Mark __builtin_ia32_cmppd256 and __builtin_ia32_cmpps256 as taking an ICE for the constant parameter.

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

9 years agoAdd more test coverage for the Objective-C deprected selector warning.
Nico Weber [Sat, 27 Dec 2014 01:05:55 +0000 (01:05 +0000)]
Add more test coverage for the Objective-C deprected selector warning.

I broke this case in a local patch I'm writing, and there was no test to stop
me.  Now there is.

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

9 years agoAdjust the rest of the tests due to r224849.
David Majnemer [Fri, 26 Dec 2014 18:45:57 +0000 (18:45 +0000)]
Adjust the rest of the tests due to r224849.

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

9 years agoUpdate tests due to r224849
David Majnemer [Fri, 26 Dec 2014 10:29:40 +0000 (10:29 +0000)]
Update tests due to r224849

Inferring nuw caused some clang tests to change their output.

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

9 years agoSema: Qualify getPrintable's Expr argument
David Majnemer [Fri, 26 Dec 2014 06:06:56 +0000 (06:06 +0000)]
Sema: Qualify getPrintable's Expr argument

getPrintable has an overload which takes a bool.  This means that const
qualified Exprs would get forwarded to the bool overload instead of the
Expr overload.

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

9 years agoWIP
David Majnemer [Fri, 26 Dec 2014 06:06:53 +0000 (06:06 +0000)]
WIP

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

9 years agoInitialize BackendConsumer::Context in constructor.
Yaron Keren [Thu, 25 Dec 2014 12:21:56 +0000 (12:21 +0000)]
Initialize BackendConsumer::Context in constructor.

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