Commit Graph

35583 Commits

Author SHA1 Message Date
Joerg Sonnenberger 1ea6647838 Drop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.
Don't bother with keeping the old support for x86_64 in 6.99.23+, just
use a single range. Update test cases for the always-on --eh-frame-hdr.

llvm-svn: 208170
2014-05-07 08:45:26 +00:00
Joerg Sonnenberger 3a6c28ad1c Also recognize Big Endian ARM variants.
llvm-svn: 208169
2014-05-07 08:24:23 +00:00
Daniel Jasper 7a2d60e328 clang-format: Fix bad space before braced initializer.
Before:
  new int {1};

After:
  new int{1};

llvm-svn: 208168
2014-05-07 07:59:03 +00:00
Craig Topper dcfc60ff41 Fix up indentation and fix an 80 column violation.
llvm-svn: 208164
2014-05-07 06:57:44 +00:00
Craig Topper 8ae1203992 [C++11] Use 'nullptr'.
llvm-svn: 208163
2014-05-07 06:21:57 +00:00
Alexey Bataev 15007ba94a [OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma omp parallel'
llvm-svn: 208162
2014-05-07 06:18:01 +00:00
David Blaikie 5944d9ce3e PR19562: Fix memory leak when ObjC interface types cause the creation of further interfaces.
llvm-svn: 208161
2014-05-07 06:18:00 +00:00
Jordan Rose 49afeb072f [analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.
Follow-up to Nico's leak-stopping patch in r208110.

llvm-svn: 208155
2014-05-07 03:30:04 +00:00
Jordan Rose 2741654b89 [analyzer] Functions marked __attribute__((const)) don't modify any memory.
This applies to __attribute__((pure)) as well, but 'const' is more interesting
because many of our builtins are marked 'const'.

PR19661

llvm-svn: 208154
2014-05-07 03:29:56 +00:00
Richard Smith 3d23c42029 If an instantiation of a template is required to be a complete type, check
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.

llvm-svn: 208150
2014-05-07 02:25:43 +00:00
Kaelyn Takata 50c4ffcca7 Try harder to ensure a strict weak ordering of overload candidates that
have arity mismatches.

llvm-svn: 208146
2014-05-07 00:43:38 +00:00
David Majnemer 3b3bdb5169 AST: Update reference temporary mangling
Summary:
Update our mangling to match the discussion on cxx-abi-dev.

This involves using a seq-id instead of an optional number.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 208140
2014-05-06 22:49:16 +00:00
Nico Weber bdc969839a Include translation unit filename in global ctor symbol names.
This makes it easier to see where a global ctor comes from, and it also makes
ASan's init order analyzer output easier to understand.  gcc does this too,
but only in -fPIC mode for some reason.  Don't do this for constructors with
explicit init priority.

Also prepend "sub_" before the 'I', that way regular constructors stay
lexicographically after symbols with init priority (because
ord('s') > ord('I')).  gold seems to ignore the name of constructor symbols,
and ld only looks at the symbol if it includes an init priority, which this
patch doesn't change.

Before: __GLOBAL_I_a
Now: __GLOBAL_sub_I_myfile.cc
llvm-svn: 208128
2014-05-06 20:32:45 +00:00
David Blaikie 483a9da598 Reapply: DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.
Reverting r208106 to reapply r208065 with a fix for the regression. The
issue was that the enum tried to be built even if the declaration hadn't
been constructed for debug info - presenting problems for enum templates
and typedefs of enums with names for linkage purposes.

Original commit message:

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

llvm-svn: 208114
2014-05-06 18:35:21 +00:00
Nico Weber 7ce830bb67 Fix leak in ObjCSelfInitChecker, found by LSan.
BugReport doesn't take ownership of the bug type, so let the checker own the
the bug type.  (Requires making the bug type mutable, which is icky, but which
is also what other checkers do.)

llvm-svn: 208110
2014-05-06 17:33:42 +00:00
David Blaikie 29020cc571 Revert "DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use."
This is breaking the compiler-rt build. Reverting while I
investigate/fix.

This reverts commit r208065.

llvm-svn: 208106
2014-05-06 17:02:15 +00:00
Tilmann Scheller e914bc8d46 Add driver support for AArch64 Fedora.
Reviewed by Eric Christopher.

llvm-svn: 208105
2014-05-06 16:58:14 +00:00
Daniel Jasper 484033b188 clang-format: [JS] Keep space after closure style comments.
Before:
  var x = /** @type {foo} */ (bar);

After:
  var x = /** @type {foo} */(bar);

llvm-svn: 208093
2014-05-06 14:41:29 +00:00
Daniel Jasper 166c19bd37 clang-format: [JS] Keep space between 'return' and '['.
llvm-svn: 208090
2014-05-06 14:12:21 +00:00
Daniel Jasper 4a39c84c91 clang-format: [JS] Don't indent in goog.scope blocks.
Before:
  goog.scope(function() {
    var x = a.b;
    var y = c.d;
  });  // goog.scope

After:
  goog.scope(function() {
  var x = a.b;
  var y = c.d;
  });  // goog.scope

llvm-svn: 208088
2014-05-06 13:54:10 +00:00
Dinesh Dwivedi 2e92e66f66 Fixed one issue with casting
Before:
(void) SimplifyICmpOperands(Cond, LHS, RHS);

After:
(void)SimplifyICmpOperands(Cond, LHS, RHS);

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

llvm-svn: 208080
2014-05-06 11:46:49 +00:00
Alexey Bataev 9959db5fa9 [OPENMP] Initial codegen for '#pragma omp parallel'
llvm-svn: 208077
2014-05-06 10:08:46 +00:00
Kevin Qin e5cee260ce [PATCH] [ARM64] Enable alignment control option in front-end for ARM64.
This patch is to get "-mno-unaligned-access" and "-munaligned-access"
work in front-end for ARM64 target.

llvm-svn: 208075
2014-05-06 09:51:32 +00:00
Robert Lytton d263f14a0f XCore target: fix initialization bug found by MSan Bot.
llvm-svn: 208072
2014-05-06 09:38:54 +00:00
Dinesh Dwivedi 13b9b7e0e8 Pulled out cast detection in TokenAnnotator into its own function
This is to remove FIXME added in r207964.

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

llvm-svn: 208071
2014-05-06 09:08:34 +00:00
David Blaikie 57407525fd DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.
This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

llvm-svn: 208065
2014-05-06 07:33:30 +00:00
Nick Lewycky aa7168a215 Fix crash when one overload candidate is a template instead of a function. Patch by Kaelyn Takata.
Testcase coming out of creduce will land in a separate commit shortly.

Also, it appears that this callback is used even in a SFINAE context where the results are never displayed.

llvm-svn: 208062
2014-05-06 06:35:27 +00:00
Alexey Bataev bcbadb65ab [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'
llvm-svn: 208060
2014-05-06 06:04:14 +00:00
David Blaikie f427b00b9a PR19598: Ensure temporary metadata nodes used in debug info are destroyed.
CGDebugInfo and DIBuilder were lax in their handling of temporary
MDNodes. All temporary nodes need to be deleted, which means they need
to be RAUW'd with a permanent node. This was not happening.

To ensure this, leverage DIBuilder's new ability to create both
permanent and temporary declarations. Ensure all temporary declarations
are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where
it is replaced with itself and creates a new, duplicate permanent node
to replace itself with)

This means that all temporary declarations must be added to the
ReplacementMap even if they're never upgraded to definitions - so move
the point of insertion into the map to the point of creation of the
declarations.

llvm-svn: 208055
2014-05-06 03:42:01 +00:00
Nico Weber 9ef9ca470f Support field references to struct names and c++11 aliases from inline asm.
This is in addition to the existing support for typedefs.

llvm-svn: 208053
2014-05-06 03:13:27 +00:00
David Blaikie ef8a951882 Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.
This takes a different approach than the
completedType/requiresCompleteType work which relies on AST callbacks to
upgrade the type declaration to a definition. Instead, just defer
constructing the definition to the end of the translation unit.

This works because the definition is never needed by other debug info
(so far as I know), whereas the definition of a struct may be needed by
other debug info before the end of the translation unit (such as
emitting the definition of a member function which must refer to that
member function's declaration).

If we had a callback for whenever an IVar was added to an ObjC interface
we could use that, and remove the need for the ObjCInterfaceCache, which
might be nice. (also would need a callback for when it was more than
just a declaration so we could get properties, etc).

A side benefit is that we also don't need the CompletedTypeCache
anymore. Just rely on the declaration-ness of a type to decide whether
its definition is yet to be emitted.

There's still the PR19562 memory leak, but this should hopefully make
that a bit easier to approach.

llvm-svn: 208015
2014-05-05 23:23:53 +00:00
Richard Trieu 2664dc184e During parsing, update the range of the Declarator to include the identifier.
llvm-svn: 208011
2014-05-05 22:06:50 +00:00
Argyrios Kyrtzidis 26d56393c6 [Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.
Needs llvm r208007.

llvm-svn: 208008
2014-05-05 21:57:46 +00:00
Ben Langmuir 71e1a64f91 Add -Wnon-modular-include* options
Warn on non-modular includes in various contexts.

-Wnon-modular-include
 -Wnon-modular-include-in-module
  -Wnon-modular-include-in-framework-module

Where each group is a subgroup of those above it.

llvm-svn: 208004
2014-05-05 21:44:13 +00:00
David Blaikie b8149044e0 Simplify replacement map by avoiding duplicate values and ensuring the values it does contain are necessary.
Items were being redundantly added to the replacement map (both when the
declaration was created, and then again when its definition was
constructed) which caused extra handling to be required when walking the
map (as elements may've already been replaced due to prior entries). By
avoiding adding the duplicates, the checks in the replacement handling
can be replaced with assertions.

llvm-svn: 208000
2014-05-05 21:21:39 +00:00
Reid Kleckner a82b5d840f MS ABI: Emit an error during IRgen on C++ exception handling
Currently, users get error messages about RTTI descriptor mangling with
no useful source location.  This addresses that.

Another approach would be to disable C++ exceptions by default in the
driver when using the Microsoft C++ ABI.  However, this makes it
impossible to parse system headers that use exception handling
constructs.  By delaying the error to IRgen, we can figure out if we
actually need to emit code for this construct.  Additionally, users who
are only interested in building refactoring tools on Windows still get a
correct AST without having to add flags.  Finally, this is consistent
with what we do for SEH.

llvm-svn: 207999
2014-05-05 21:12:12 +00:00
Rafael Espindola 502f65ae54 Fix pr19653.
Warn if an alias requests a section other than the aliasee section.

llvm-svn: 207997
2014-05-05 20:21:03 +00:00
Alp Toker 08f6e9ec15 Fix some typos
llvm-svn: 207994
2014-05-05 19:53:42 +00:00
Rafael Espindola c67b815217 Small refactoring, no functionality change.
llvm-svn: 207991
2014-05-05 19:33:09 +00:00
David Majnemer ceaaa8d09e CodeGen: Assign linkage to thread-wrappers correctly
We would sometimes incorrectly give a thread-wrapper external linkage
instead of internal linkage if we had only CodeGen'd it's declaration,
not it's definition.

This fixes PR19655.

llvm-svn: 207988
2014-05-05 18:54:23 +00:00
Manuel Klimek 75f34c1386 Fix handling of condition variables in the face of temp dtors.
The assignment needs to be before the destruction of the temporary.
This patch calls out to addStmt, which invokes VisitDeclStmt, which has
all the correct logic for handling temporaries.

llvm-svn: 207985
2014-05-05 18:21:06 +00:00
Duncan P. N. Exon Smith 48bc268290 CodeGen: Cleanup visibility in RTTIBuilder
No functionality change.

llvm-svn: 207978
2014-05-05 17:38:39 +00:00
Ben Langmuir 1ecf750ec8 Add -Wmodule-build to make it easy to see when modules are (re)built
Warning is default ignore, and not in -Wall.

llvm-svn: 207975
2014-05-05 16:58:47 +00:00
Daniel Jasper f10a28d705 clang-format: Understand functions with decltype return type.
Before:
  decltype(long_name_forcing_break)
      f() {}

After:
  decltype(long_name_forcing_break)
  f() {}

llvm-svn: 207965
2014-05-05 13:48:09 +00:00
Dinesh Dwivedi 76f98f8047 Added some heuristics to identify c style casting
Before:
void f() { my_int a = (my_int) * b; }
void f() { return P ? (my_int) * P : (my_int)0; }

After:
void f() { my_int a = (my_int)*b; }
void f() { return P ? (my_int)*P : (my_int)0; }

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

llvm-svn: 207964
2014-05-05 13:14:35 +00:00
Benjamin Kramer 6af073b636 Driver: Recognize CentOS 6 as RHEL 6.
Patch by Dimitry Andric!

llvm-svn: 207963
2014-05-05 12:39:32 +00:00
Alp Toker a030cd0558 StringRefize and take out an old FIXME
llvm-svn: 207962
2014-05-05 12:38:48 +00:00
Daniel Jasper 0e6c51c889 clang-format: Improve understanding of decltype.
Before:
  SomeFunction([](decltype(x), A * a) {});

After:
  SomeFunction([](decltype(x), A *a) {});

llvm-svn: 207961
2014-05-05 12:36:29 +00:00
Dinesh Dwivedi afe6fb6f05 Fix bug in clang-format while merging short function
Before:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif { return i; }

After:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif
    {
    	return i;
    }

llvm-svn: 207958
2014-05-05 11:36:35 +00:00
Manuel Klimek 264f963114 Fix crash when resolving branch conditions for temporary destructor condition blocks.
Document and simplify ResolveCondition.

1. Introduce a temporary special case for temporary desctructors when resolving
the branch condition - in an upcoming patch, alexmc will change temporary
destructor conditions to not run through this logic, in which case we can remove
this (marked as FIXME); this currently fixes a crash.

2. Simplify ResolveCondition; while documenting the function, I noticed that it
always returns the last statement - either that statement is the condition
itself (in which case the condition was returned anyway), or the rightmost
leaf is returned; for correctness, the rightmost leaf must be evaluated anyway
(which the CFG does in the last statement), thus we can just return the last
statement in that case, too. Added an assert to verify the invariant.

llvm-svn: 207957
2014-05-05 09:58:03 +00:00