Commit Graph

56274 Commits

Author SHA1 Message Date
Brad Smith a2e3e368e7 Use the integrated assembler by default on 32-bit PowerPC and SPARC
llvm-svn: 225212
2015-01-05 21:44:15 +00:00
Francisco Lopes da Silva 37e8f2d6a7 Fix lit for builds under /opt
llvm-svn: 225196
2015-01-05 19:59:24 +00:00
Rafael Espindola 58d4c5a9c0 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).

llvm-svn: 225191
2015-01-05 18:48:18 +00:00
Rafael Espindola 6f39d8525c Disable warnings in this test.
This makes it a lot easier to read the output from FileCheck when it fails.

llvm-svn: 225190
2015-01-05 18:19:35 +00:00
Samuel Antao 4ae1f67ccf 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.

llvm-svn: 225182
2015-01-05 17:07:42 +00:00
Samuel Benzaquen 45ed4f9542 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

llvm-svn: 225180
2015-01-05 15:26:42 +00:00
NAKAMURA Takumi b0f54e7909 clang/CMakeLists.txt: Introduce LLVM_SHLIB_OUTPUT_INTDIR also here, or plugins tests might fail.
llvm-svn: 225170
2015-01-05 14:06:14 +00:00
Rafael Espindola 7a45e8794f Fix formatting. NFC.
llvm-svn: 225168
2015-01-05 13:44:59 +00:00
Daniel Jasper 77ef2be2e4 clang-format: [Java] Fix incorrect detection of cast.
After:
  return (a instanceof List<?>) ? aaaaaaaaaaaaaaaaaaaaaaa(
                                      aaaaaaaaaaaaaaaaaaaaa)
                                : aaaaaaaaaaaaaaaaaaaaaaa;

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

llvm-svn: 225161
2015-01-05 10:33:39 +00:00
Daniel Jasper 5f1fa85e5b 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);
    }
  });

llvm-svn: 225142
2015-01-04 20:40:51 +00:00
Daniel Jasper fd4ed18402 clang-format: [Java] Change a few flags for Google's Java style.
No tests added as all of these are already tested separately.

llvm-svn: 225141
2015-01-04 20:40:45 +00:00
Nico Weber 49e6bc024d 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.

llvm-svn: 225140
2015-01-04 20:32:12 +00:00
Yaron Keren 7c91552cd9 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.

llvm-svn: 225134
2015-01-04 13:48:30 +00:00
Daniel Jasper 428f0b1430 clang-format: Re-enable comment re-indentation for Java/JS.
This was broken by r224120.

llvm-svn: 225130
2015-01-04 09:11:17 +00:00
Nico Weber 3ce01c34c0 Fix indentation. No behavior change.
llvm-svn: 225129
2015-01-04 08:07:54 +00:00
Nico Weber 05c680adb1 Wrap to 80 columns, no behavior change.
llvm-svn: 225128
2015-01-04 07:59:35 +00:00
Nico Weber 227822e116 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.

llvm-svn: 225125
2015-01-04 05:29:21 +00:00
Nico Weber 3632e034ba 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.

llvm-svn: 225124
2015-01-04 04:53:10 +00:00
Nico Weber 744cc5b5dd Wrap to 80 columns, no behavior change.
llvm-svn: 225122
2015-01-04 00:47:22 +00:00
David Majnemer 99b98f07d4 AST: Remove overzealous assertion from IsModifiable
It's reasonable to ask if an l-value with class type is modifiable.

llvm-svn: 225121
2015-01-04 00:44:32 +00:00
David Majnemer 22fe771f78 Parse: __attribute__((keyword)) shouldn't error
Weird constructs like __attribute__((inline)) or
__attibute__((typename)) should result in warnings, not errors.

llvm-svn: 225118
2015-01-03 19:41:00 +00:00
Aaron Ballman 409af50858 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);

llvm-svn: 225116
2015-01-03 17:00:12 +00:00
Rafael Espindola f733b422d0 Remove -Werror from test.
It is not needed since we FileCheck for the warning and -Werror itself can end up
unused.

llvm-svn: 225102
2015-01-03 00:28:47 +00:00
Rafael Espindola 577637a6af Really don't warn about -flto/fno-lto :-(
This should fix the last bots.

llvm-svn: 225100
2015-01-03 00:06:04 +00:00
Rafael Espindola 16042fc2b9 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.

llvm-svn: 225095
2015-01-02 23:23:52 +00:00
Rafael Espindola 5640ae48db 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.

llvm-svn: 225093
2015-01-02 22:56:15 +00:00
David Blaikie b9a23c9155 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.

llvm-svn: 225090
2015-01-02 22:07:26 +00:00
Saleem Abdulrasool 61770ab26f 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.

llvm-svn: 225089
2015-01-02 21:47:33 +00:00
Saleem Abdulrasool 1d59f49f9c 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.

llvm-svn: 225087
2015-01-02 20:00:55 +00:00
David Blaikie 5e9e13f54a 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)

llvm-svn: 225086
2015-01-02 19:49:28 +00:00
David Blaikie fcee870c17 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.

llvm-svn: 225085
2015-01-02 19:49:10 +00:00
David Blaikie ba90b04b7b 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.

llvm-svn: 225083
2015-01-02 19:06:25 +00:00
Nick Lewycky 0b72773c8a 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.

llvm-svn: 225071
2015-01-02 01:33:12 +00:00
David Majnemer 602cfe7d62 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.

llvm-svn: 225060
2015-01-01 09:49:44 +00:00
David Blaikie 508d29d5b7 XFAIL test on win32 due to missing __complex support
llvm-svn: 225051
2014-12-31 22:30:31 +00:00
Ted Kremenek 67978556a5 [analyzer] Include a couple more comments on using xcrun to query the SDK.
llvm-svn: 225039
2014-12-31 08:19:08 +00:00
Ted Kremenek 398f46f8f2 [analyzer] Change ccc-analyzer to mimick behavior on OSX Mavericks/Yosemite to automatically infer the SDK location.
llvm-svn: 225038
2014-12-31 07:44:51 +00:00
David Blaikie f936984e33 Handle PPC64 return type (signext i32 rather than plain i32) in test case
llvm-svn: 225021
2014-12-31 00:06:08 +00:00
Saleem Abdulrasool 6815094f9b 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.

llvm-svn: 225013
2014-12-30 22:52:08 +00:00
Saleem Abdulrasool 2e46ebe56f Driver: whitespace
Fixup some whitespace/style issues.  NFC.

llvm-svn: 225012
2014-12-30 22:52:06 +00:00
Nico Weber 0db59733b5 Remove a comment that appears a second time 22 lines further down.
llvm-svn: 225004
2014-12-30 20:13:37 +00:00
David Blaikie 84fe79cfc3 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.

llvm-svn: 225000
2014-12-30 19:39:33 +00:00
Saleem Abdulrasool c787e4eb1e 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.

llvm-svn: 224996
2014-12-30 18:55:37 +00:00
Yaron Keren b14b0cefe2 Add non-const version getFileSystemOpts() access function.
All the other get*Opts have both versions.

llvm-svn: 224995
2014-12-30 18:46:42 +00:00
Keno Fischer 76f4ab067d 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

llvm-svn: 224982
2014-12-30 08:12:39 +00:00
Saleem Abdulrasool 8d7ade7062 Driver: unify addClangRT{Linux,Windows}
The differences are pretty superficial:
- .lib vs .a extensions
- whether or not to link (potentially) incorrectly against libgcc_s

llvm-svn: 224975
2014-12-30 02:10:36 +00:00
Nico Weber 8d26b72aca 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).

llvm-svn: 224974
2014-12-30 02:06:40 +00:00
David Blaikie 608a24501c 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.

llvm-svn: 224970
2014-12-29 23:49:00 +00:00
David Majnemer ec3f49dfdf Fix build breakage
That's what I get for last second changes...

llvm-svn: 224967
2014-12-29 23:24:27 +00:00
David Majnemer f58efd9514 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 {'.

llvm-svn: 224966
2014-12-29 23:12:23 +00:00
David Blaikie 4d5c7288cc PR22051: Missing debug location on calls in dtor thunks in Windows.
llvm-svn: 224963
2014-12-29 22:53:52 +00:00
David Blaikie a629c0f658 Use std::find_if instead of manual loop.
llvm-svn: 224960
2014-12-29 22:39:45 +00:00
Nico Weber 36de3a25c2 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.)

llvm-svn: 224958
2014-12-29 21:56:22 +00:00
Alexey Samsonov 6465d4f7a3 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.

llvm-svn: 224956
2014-12-29 21:28:15 +00:00
Saleem Abdulrasool da3f4e5f35 Driver: convert a couple more instances to range based loops
More conversion to range based for loops rather than direct iterators with
dereferencing.  NFC.

llvm-svn: 224954
2014-12-29 21:02:47 +00:00
David Majnemer e8fb28fa0b 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.

llvm-svn: 224945
2014-12-29 19:19:18 +00:00
Saleem Abdulrasool 688b6bc2f4 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.

llvm-svn: 224944
2014-12-29 19:01:36 +00:00
David Blaikie 550d900048 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.

llvm-svn: 224943
2014-12-29 18:37:03 +00:00
David Blaikie 3945d1bd99 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.

llvm-svn: 224941
2014-12-29 18:18:45 +00:00
Chandler Carruth 032d422d2e 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.

llvm-svn: 224934
2014-12-29 13:29:38 +00:00
Chandler Carruth f3cabbd424 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

llvm-svn: 224933
2014-12-29 13:29:36 +00:00
Chandler Carruth fd3cc70ed4 [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.

llvm-svn: 224924
2014-12-29 12:09:08 +00:00
Chandler Carruth 91663e55f6 [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.

llvm-svn: 224923
2014-12-29 12:09:03 +00:00
David Majnemer 04b78412ad 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.

llvm-svn: 224918
2014-12-29 10:29:53 +00:00
David Majnemer 0f4d641005 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.

llvm-svn: 224916
2014-12-29 09:30:33 +00:00
Nico Weber 4b4be84a2f 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.

llvm-svn: 224915
2014-12-29 06:56:50 +00:00
Craig Topper 939111ac51 [x86] Fix an accidental commit of a change from Ii to iC on __builtin_ia32_cmpps512_mask.
llvm-svn: 224914
2014-12-29 06:55:01 +00:00
Craig Topper 6c0d9edbc7 [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.
llvm-svn: 224913
2014-12-29 06:41:12 +00:00
David Majnemer be4c437f8a 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.

llvm-svn: 224912
2014-12-29 05:17:46 +00:00
David Majnemer c63fa612e4 Sema: Forbid inconsistent constraint alternatives
Verify that asm constraints have the same number of alternatives

llvm-svn: 224911
2014-12-29 04:09:59 +00:00
David Majnemer 86330afd35 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.

llvm-svn: 224909
2014-12-29 02:14:26 +00:00
David Majnemer 90d854489f 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'.

llvm-svn: 224908
2014-12-28 23:46:59 +00:00
Nico Weber c29c4835df 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.

llvm-svn: 224906
2014-12-28 23:24:02 +00:00
David Majnemer 380443a2ac Sema: Variable templates cannot be static bitfield members
We correctly forbid variables but not variable templates.  Diagnose this
case instead of crashing.

llvm-svn: 224905
2014-12-28 22:51:45 +00:00
David Majnemer 06039218f5 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.

llvm-svn: 224903
2014-12-28 22:28:32 +00:00
David Majnemer 3087a2b949 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.

llvm-svn: 224902
2014-12-28 21:47:31 +00:00
David Majnemer 738e58799c 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.

llvm-svn: 224898
2014-12-28 09:18:54 +00:00
David Majnemer f2d3bc0474 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.

llvm-svn: 224896
2014-12-28 07:42:49 +00:00
Nico Weber a894e9e070 Fix markup from r224894.
llvm-svn: 224895
2014-12-28 02:12:59 +00:00
Nico Weber 933607f10e 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.)

llvm-svn: 224894
2014-12-28 02:07:26 +00:00
Nico Weber 3fc6a28c34 Remove unneeded include of DeclCXX.h from libParse.
llvm-svn: 224893
2014-12-28 01:52:28 +00:00
Nico Weber ff4b35e6e7 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.

llvm-svn: 224892
2014-12-27 22:14:15 +00:00
Chandler Carruth 28daca211c [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.

llvm-svn: 224883
2014-12-27 11:50:51 +00:00
Craig Topper ab70789199 [x86] Add missing typecast to __v4si to sha intrinsic header file.
llvm-svn: 224882
2014-12-27 07:19:25 +00:00
Nico Weber e3b11043d0 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.

llvm-svn: 224881
2014-12-27 07:09:37 +00:00
Craig Topper dd84ec5fd9 [x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.
llvm-svn: 224880
2014-12-27 07:00:08 +00:00
Craig Topper 2094d8fe88 [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.

llvm-svn: 224879
2014-12-27 06:59:57 +00:00
Craig Topper 2d85a4c537 Add more feature flags to the x86 instrinsic test.
llvm-svn: 224878
2014-12-27 06:59:44 +00:00
Craig Topper a31a5da904 Fix formatting. NFC.
llvm-svn: 224877
2014-12-27 06:59:37 +00:00
Nico Weber 2e0c8f79d9 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.

llvm-svn: 224876
2014-12-27 03:58:08 +00:00
Nico Weber c33b2fd0ad Make the test from r224873 actually pass.
The behavior looks incorrect to me, but the test is supposed to document
current behavior for now.

llvm-svn: 224875
2014-12-27 03:38:18 +00:00
Craig Topper 1c161a35b7 Mark __builtin_ia32_cmppd256 and __builtin_ia32_cmpps256 as taking an ICE for the constant parameter.
llvm-svn: 224874
2014-12-27 01:20:16 +00:00
Nico Weber 1813ec797d 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.

llvm-svn: 224873
2014-12-27 01:05:55 +00:00
David Majnemer fd4f63ad4b Adjust the rest of the tests due to r224849.
llvm-svn: 224865
2014-12-26 18:45:57 +00:00
David Majnemer ca7e485c3f Update tests due to r224849
Inferring nuw caused some clang tests to change their output.

llvm-svn: 224851
2014-12-26 10:29:40 +00:00
David Majnemer e60488a4ae 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.

llvm-svn: 224844
2014-12-26 06:06:56 +00:00
David Majnemer 3e7743ed2c WIP
llvm-svn: 224843
2014-12-26 06:06:53 +00:00
Yaron Keren 2f5ec2f2ba Initialize BackendConsumer::Context in constructor.
llvm-svn: 224836
2014-12-25 12:21:56 +00:00
Yaron Keren 5fb94242bb Initialize CodeGeneratorImpl::Ctx in constructor.
llvm-svn: 224835
2014-12-25 11:38:15 +00:00
Anton Yartsev df7a5b14c2 [analyzer] Updated progress for memory.ZeroAlloc
llvm-svn: 224797
2014-12-24 01:04:38 +00:00
Anton Yartsev 50a91cca17 [analyzer] +memory.ZeroAlloc
llvm-svn: 224796
2014-12-24 00:46:56 +00:00
Nico Weber ca18fe1d1a clang-cl: Various changes to /Zc: handling.
* /Zc:trigraphs and /Zc:trigraphs- are now honored
* /Zc:strictStrings is now honored
* /Zc:auto is now honored/ignored (clang does the Right Thing for this already)

Also add a dedicated test for the various /Zc: flags.
clang-cl doesn't always agree with cl.exe on the default values for /Zc flags.
For example, I think clang always behaves as if /Zc:inline is passed, and
warns if the user explicitly passes /Zc:inline-

Fixes PR21974.

llvm-svn: 224791
2014-12-23 22:55:34 +00:00
Nico Weber 007215044b Add driver flags -ftrigraphs, -fno-trigraphs.
-trigraphs is now an alias for -ftrigraphs.  -fno-trigraphs makes it possible
to explicitly disable trigraphs, which couldn't be done before.

  clang -std=c++11 -fno-trigraphs

now builds without GNU extensions, but with trigraphs disabled.  Previously,
trigraphs were only disabled in GNU modes or with -std=c++1z.

Make the new -f flags the cc1 interface too.  This requires changing -trigraphs
to -ftrigraphs in a few cc1 tests.

Related to PR21974.

llvm-svn: 224790
2014-12-23 22:32:37 +00:00
Nico Weber 1b8dc9efc5 Remove unused test input.
llvm-svn: 224784
2014-12-23 19:30:13 +00:00
Adrian Prantl ee24e14bdc Debug Info: Pass the pointer size into createMemberPointerType().
Paired commit with LLVM.

llvm-svn: 224781
2014-12-23 19:11:54 +00:00
Rafael Espindola 43eba818cd This reverts commit r224668 and r224667.
r224667 broke bootstrap on Fedora 20 X86_64 (at least).

See pr22006 for the details.

r224668 depends on r224667.

llvm-svn: 224770
2014-12-23 15:57:12 +00:00
Nico Weber 4f477fbe57 Add a triple to try and get this test passing on the ARM bots.
llvm-svn: 224747
2014-12-23 01:07:10 +00:00
Nico Weber b62ba516e7 Disable trigraphs in microsoft mode by default. Matches cl.exe.
The default value of Opts.Trigraphs now no longer depends solely on the
language input kind, so move the code out of setLangDefaults().  Also make
sure that Opts.MSVCCompat is set before the Trigraph code runs.

Related to PR21974.

llvm-svn: 224719
2014-12-22 18:35:03 +00:00
Nico Weber 08ef80f4b8 Rename test.cc files to test.cpp.
The lit.cfg files only add .cpp to suffixes, so these tests used to never run,
oops.  (Also tweak to of these tests in minor ways to make the actually pass.)

llvm-svn: 224718
2014-12-22 18:13:07 +00:00
Nico Weber 4f371b031b Add test coverage for cc1's trigraph option handling.
llvm-svn: 224714
2014-12-22 17:56:50 +00:00
Fariborz Jahanian c362aedffb Simplify test for rdar://19256338
(from patch r224549).

llvm-svn: 224713
2014-12-22 17:54:25 +00:00
David Majnemer 07bc611fb3 MS ABI: Make the string mangling code more concise
No functional change intended.

llvm-svn: 224696
2014-12-22 06:24:49 +00:00
Nico Weber 4701ffda95 Wrap to 80 columns. NfC.
llvm-svn: 224695
2014-12-22 05:21:03 +00:00
Bob Wilson 23a55f1eee Reapply "Change -save-temps to emit unoptimized bitcode files."
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.

Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.

This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.

Based in part on a patch by Steven Wu.
rdar://problem/18909437

llvm-svn: 224688
2014-12-21 07:00:00 +00:00
Logan Chien 968a21de24 Frontend: Fix typo in comments.
llvm-svn: 224680
2014-12-20 08:51:22 +00:00
Richard Trieu 2cb463ed08 Fix a bunch of integer template argument problems in template type diffing.
Reverts most of the changes from r168005.  Since template arguments have proper
conversions now, no extending of integers is needed.  Further, since the
integers are the correct size now, use APSInt::operator== instead of
APSInt::hasSameValue since operator== will check the size and signness match.

Prior to one comparison of APSInt's, check that both are valid.  Previous, one
could be uninitialized.  Also changed APInt to APSInt in GetInt.  This
occassionally produced a sign flip, which will now be caught by operator==.

llvm-svn: 224668
2014-12-20 03:03:32 +00:00
Richard Trieu d787e8dc9d Fix for PR21758
When a non-type template argument expression needs a conversion to change it
into the argument type, preserve that information by remaking the
TemplateArgument with an expression that has those conversions.  Also a small
fix to template type diffing to handle the extra conversions in some cases.

llvm-svn: 224667
2014-12-20 02:42:08 +00:00
Aaron Ballman a7a715698a Removing an outdated FIXME; try block attributes are parsed with the rest of the statement attributes (as per the standard), and function-try-blocks may not have attributes. NFC.
llvm-svn: 224662
2014-12-20 01:54:07 +00:00
Saleem Abdulrasool 9a215461f1 Driver: hoist an assertion
Remove an unnecessary conditional, hoisting the assertion.  Minor style
tweaks/reflowing.  NFC.

llvm-svn: 224654
2014-12-19 23:56:31 +00:00
Saleem Abdulrasool 21b1876dd2 Driver: refactor a local variable
Pull out a getToolChain() into a local variable to share the call across to all
the uses.  NFC.

llvm-svn: 224653
2014-12-19 23:56:28 +00:00
Nico Weber e497438c9c Don't drop attributes when checking explicit specializations.
Consider a template class with attributes on a method, and an explicit
specialization of that method:

    template <int>
    struct A {
      void foo() final;
    };

    template <>
    void A<0>::foo() {}

In this example, the attribute is `final`, but it might also be an
__attribute__((visibility("foo"))), noreturn, inline, etc. clang's current
behavior is to strip all attributes, which for some attributes is wrong
(the snippet above allows a subclass of A<0> to override the final method, for
example) and for others disagrees with gcc.

So stop dropping attributes. r95845 added this code without a test case, and
r176728 added the code for dropping attributes on parameters (with tests, but
they still pass).

As an additional wrinkle, do drop dllimport and dllexport, since that's how
these two attributes work. (This is covered by existing tests.)

Fixes PR21942.

The approach is by Richard Smith, initial analysis and typing was done by me.

With this, clang also matches GCC and EDG on all attributes Richard tested.

llvm-svn: 224651
2014-12-19 23:52:45 +00:00
Hans Wennborg 0c0a8c868c Tweak the assert in ModuleBuilder from r224533 (PR21989)
Turns out there will be left-over deferred inline methods if there have
been errors, because in that case HandleTopLevelDecl bails out early.

llvm-svn: 224649
2014-12-19 23:35:11 +00:00
Richard Smith 5a0e50cd87 DR1048: drop top-level cv-qualifiers when deducing the return type of a
lambda-expression in C++11, to match the C++14 rules.

llvm-svn: 224620
2014-12-19 22:10:51 +00:00
Alexey Samsonov abd5bead3f Allow to disable all sanitizers with "-fno-sanitize=all" option.
Summary:
This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all"
can be used to disable all sanitizers for a given source file.

"-fsanitize=all" option makes no sense, and will produce an error.

This group can also be useful when we add "-fsanitize-recover=<list>"
options (patch in http://reviews.llvm.org/D6302), as it would allow
to conveniently enable/disable recovery for all specified sanitizers.

Test Plan: regression test suite

Reviewers: kcc, rsmith

Subscribers: cfe-commits

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

llvm-svn: 224596
2014-12-19 18:41:43 +00:00
Aaron Ballman 9b7cee666b Added a fixit to remove empty parens from a C++11 attribute argument list when we diagnose this as an error.
llvm-svn: 224595
2014-12-19 18:37:22 +00:00
Pekka Jaaskelainen e94b0e1870 Fix an address space id reset with array decay's
implicit conversion. 

The issue was produced with OpenCL C code that 
called a function with a constant string literal
argument.

llvm-svn: 224592
2014-12-19 18:04:27 +00:00
Fariborz Jahanian 049ae4878d Use ObjCMultipleMethodNames to match the option.
llvm-svn: 224585
2014-12-19 16:55:51 +00:00
Aaron Ballman 55ef151502 Attributes accepting an EnumArgument are allowed to pass a string literal, or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal.
This change affects the only attribute accepting a variadic enumeration: callable_when.

llvm-svn: 224582
2014-12-19 16:42:04 +00:00
Aaron Ballman 5d7bfe4c7d Putting unevaluated expression warnings, and evaluated typeid warnings, under their own warning flags. Amends r224465.
llvm-svn: 224578
2014-12-19 14:56:49 +00:00
Alexey Samsonov 799f79337f [Sanitizer] Get rid of parseArgument helper function. NFC.
llvm-svn: 224564
2014-12-19 02:35:16 +00:00
David Majnemer ce1d30142c Fix layering violation, Lex shouldn't know about Decl
llvm-svn: 224562
2014-12-19 02:13:56 +00:00
Richard Smith a865a1683a PR21969: Improve diagnostics for a conversion function that has any pieces of a
declared return type (including a trailing-return-type in C++14).

llvm-svn: 224561
2014-12-19 02:07:47 +00:00
Kaelyn Takata 9112607400 Correct delayed typos in the operand to typeof expressions.
Fixes PR21947.

llvm-svn: 224558
2014-12-19 01:28:40 +00:00
Adrian Prantl 97f7685516 Fix a typo.
llvm-svn: 224557
2014-12-19 01:02:11 +00:00
Fariborz Jahanian 0fc95ad758 [c Sema]. Patch fixes pointer-bool-conversion warning on C code
when source range is incorrect causing the warning to be
issued when it should not because expression is in a macro.
rdar://19256338

llvm-svn: 224549
2014-12-18 23:14:51 +00:00
Reid Kleckner da0acc816c Revert "Change -save-temps to emit unoptimized bitcode files."
This reverts commit r224503.

It broke compilation of fortran through the Clang driver. Previously
`clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it
tries to call `clang -cc1 t.f` which fails for obvious reasons.

llvm-svn: 224546
2014-12-18 23:07:04 +00:00
Alexey Samsonov 021de66be6 [CMake] Add check-asan-dynamic command to external compiler-rt setup.
llvm-svn: 224545
2014-12-18 21:40:39 +00:00
Fariborz Jahanian c10fe600a2 Objective-C. Provide group name for warning
on multiple selector names found during lookup.
rdar://19265296

llvm-svn: 224536
2014-12-18 19:41:11 +00:00
Hans Wennborg 2b0d014834 ModuleBuilder: assert that all deferred inline method defs get handled
While we're here, also move the declaration of DeferredInlineMethodDefinitions
closer to the other member vars and make it a SmallVector. NFC.

llvm-svn: 224533
2014-12-18 19:19:00 +00:00
Reid Kleckner 034531d7af Revert "Don't build invalid AST nodes during recovery"
This reverts commit r224451. It caused us to reject some valid existing
code.

This code appears to run in non-error cases as well as error cases. If
the scope of a DependentScopeDeclRefExpr is still incomplete it probably
means we still have more instantiation to do.

llvm-svn: 224526
2014-12-18 18:17:42 +00:00
Fariborz Jahanian 661a97bede [Objective-C]. Patch to unify code generation for ObjCMsgSend and ObjCBoxedExpr.
Patch by Alex Denisov. NFC.

llvm-svn: 224525
2014-12-18 17:13:56 +00:00
Richard Barton 2c5a89728d Correction to -mfu=neon-vfpv4 to pass the correct backend feature name
Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca
llvm-svn: 224523
2014-12-18 16:31:18 +00:00
Yaron Keren 3a03797241 Enabling this test again on mingw. The problem seems to happen when
two identical module.modulemap are available on the include path and
so should be fixed in the mingw driver include dies, when we'll have it.

llvm-svn: 224515
2014-12-18 12:13:14 +00:00
Daniel Jasper 3a623dbd2a clang-format: Fix incorrect detection of ObjC "in" keyword.
Before:
  for (auto v : in [1]) { ..

After:
  for (auto v : in[1]) { ..

llvm-svn: 224513
2014-12-18 12:11:01 +00:00
Serge Pavlov 07c0f04e08 Fixed warnings on redefine keywords and reserved ids.
Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro.
The warning -Wkeyword-macro now is not issued in patterns that are used
in configuration scripts:

    #define inline

also for 'const', 'extern' and 'static'. If macro repalcement is identical
to macro name, the warning also is not issued:

    #define volatile volatile

And finally if macro replacement is also a keyword identical to the replaced
one but decorated with leading/trailing underscores:

    #define inline __inline
    #define inline __inline__
    #define inline _inline // in MSVC compatibility mode

Warning -Wreserved-id-macro is off by default, it could help catching
things like:

    #undef __cplusplus

llvm-svn: 224512
2014-12-18 11:14:21 +00:00
David Majnemer 2d3663e559 Parse: Don't parse after the eof has been consumed
ParseCXXNonStaticMemberInitializer stashes away all the tokens for the
initializer and an additional EOF token to denote where the initializer
ends.  However, it is possible for ParseLexedMemberInitializer to get
its hands on the "real" EOF token; since the two tokens are
indistinguishable, we end up consuming the EOF and descend into madness.

Instead, make it possible to tell which EOF token we are looking at.

This fixes PR21872.

llvm-svn: 224505
2014-12-18 09:57:31 +00:00
Alexey Bataev 7cb1789011 Fix for PR21915: assert on multidimensional VLA in function arguments.
Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA
Differential Revision: http://reviews.llvm.org/D6655

llvm-svn: 224504
2014-12-18 06:54:53 +00:00
Bob Wilson f5ba8288ad Change -save-temps to emit unoptimized bitcode files.
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.

This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.

Based in part on a patch by Steven Wu.
rdar://problem/18909437

llvm-svn: 224503
2014-12-18 06:08:26 +00:00
Eric Christopher 526ca20011 Update for llvm front end change and use the TargetOptions struct
for ABI.

llvm-svn: 224493
2014-12-18 02:23:27 +00:00
Eric Christopher 560cc4fb44 Make sure that arm-linux-gnu is still the apcs-gnu ABI when we
use clang -cc1 matching the front end and backend. Fix up a couple
of tests that were testing aapcs for arm-linux-gnu.

The test that removes the aapcs abi calling convention removes
them because the default triple matches what the backend uses
for the calling convention there and so it doesn't need to be
explicitly stated - see the code in TargetInfo.cpp.

llvm-svn: 224491
2014-12-18 02:08:55 +00:00