platform/upstream/llvm.git
11 years ago<rdar://problem/14496092>
Greg Clayton [Mon, 21 Oct 2013 18:40:51 +0000 (18:40 +0000)]
<rdar://problem/14496092>

Fixed an issue with reexported symbols on MacOSX by adding support for symbols re-exporting symbols. There is now a new symbol type eSymbolTypeReExported which contains a new name for the re-exported symbol and the new shared library. These symbols are only used when a symbol is re-exported as a symbol under a different name.

Modified the expression parser to be able to deal with finding the re-exported symbols and track down the actual symbol it refers to.

llvm-svn: 193101

11 years agoRefactor DynTypedMatcher into a value type class, just like Matcher<T>.
Samuel Benzaquen [Mon, 21 Oct 2013 18:40:51 +0000 (18:40 +0000)]
Refactor DynTypedMatcher into a value type class, just like Matcher<T>.

Summary:
Refactor DynTypedMatcher into a value type class, just like Matcher<T>.
This simplifies its usage and removes the virtual hierarchy from Matcher<T>.
It also enables planned changes to replace MatcherInteface<T>.
Too many instantiaions of this class hierarchy has been causing Registry.cpp.o to bloat in size and number of symbols.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1661

llvm-svn: 193100

11 years agoExtend test to show an alias can be before a definition.
Rafael Espindola [Mon, 21 Oct 2013 18:24:30 +0000 (18:24 +0000)]
Extend test to show an alias can be before a definition.

llvm-svn: 193099

11 years agoUse internal_memset to initialize this variable.
Peter Collingbourne [Mon, 21 Oct 2013 18:11:57 +0000 (18:11 +0000)]
Use internal_memset to initialize this variable.

Otherwise, the compiler may use memset in non-optimized builds, which is
forbidden in the nolibc part of the runtime.

llvm-svn: 193098

11 years agoRemove unused SCEV functions
Matt Arsenault [Mon, 21 Oct 2013 18:08:09 +0000 (18:08 +0000)]
Remove unused SCEV functions

llvm-svn: 193097

11 years agoX86 vector element shift-by-immediate instructions take i8 immediates. Make
Lang Hames [Mon, 21 Oct 2013 17:51:24 +0000 (17:51 +0000)]
X86 vector element shift-by-immediate instructions take i8 immediates. Make
the instruction defenitions and ISEL reflect this.

Prior to this patch these instructions took an i32i8imm, and the high bits were
dropped during encoding. This led to incorrect behavior for shifts by
immediates higher than 255. This patch fixes that issue by detecting large
immediate shifts and returning constant zero (for logical shifts) or capping
the shift amount at an encodable value (for arithmetic shifts).

Fixes <rdar://problem/14968098>

llvm-svn: 193096

11 years agoFix up some old review feedback.
Eric Christopher [Mon, 21 Oct 2013 17:48:51 +0000 (17:48 +0000)]
Fix up some old review feedback.

llvm-svn: 193095

11 years agoImproving MCJIT/RuntimeDyld thread safety
Andrew Kaylor [Mon, 21 Oct 2013 17:42:06 +0000 (17:42 +0000)]
Improving MCJIT/RuntimeDyld thread safety

llvm-svn: 193094

11 years agoCleanup redundant include.
Rafael Espindola [Mon, 21 Oct 2013 17:34:39 +0000 (17:34 +0000)]
Cleanup redundant include.

Patch by Daniel Marjamäki.

llvm-svn: 193093

11 years agoGet rid of the FooStructSynth, it was a testing thing I put in and forgot to remove
Enrico Granata [Mon, 21 Oct 2013 17:29:51 +0000 (17:29 +0000)]
Get rid of the FooStructSynth, it was a testing thing I put in and forgot to remove
Hopefully nobody had a struct Foo in their app:-)

llvm-svn: 193092

11 years agoDebugInfo: Put each kind of constant (form, attribute, tag, etc) into its own enum...
David Blaikie [Mon, 21 Oct 2013 17:28:37 +0000 (17:28 +0000)]
DebugInfo: Put each kind of constant (form, attribute, tag, etc) into its own enum for ease of use.

This allows various variables to be more self-documenting and easier to
debug by being of specific types without overlapping enum values.

Precommit review by Eric Christopher.

llvm-svn: 193091

11 years agoOptimize more linkonce_odr values during LTO.
Rafael Espindola [Mon, 21 Oct 2013 17:14:55 +0000 (17:14 +0000)]
Optimize more linkonce_odr values during LTO.

When a linkonce_odr value that is on the dso list is not unnamed_addr
we can still look to see if anything is actually using its address. If
not, it is safe to hide it.

This patch implements that by moving GlobalStatus to Transforms/Utils
and using it in Internalize.

llvm-svn: 193090

11 years agoDebugInfo: Hash DW_FORM_GNU_str_index as a string.
David Blaikie [Mon, 21 Oct 2013 16:37:22 +0000 (16:37 +0000)]
DebugInfo: Hash DW_FORM_GNU_str_index as a string.

Found while adding type safety to the various DWARF enumerations (form,
attribute, tag, etc) that caused Clang to warn on an incompletely
covered switch. Converting the comment to a default/unreachable
uncovered this case of an unsupported form encoding. Seems we were
skipping fission strings entirely.

llvm-svn: 193089

11 years agoPatch by GM: Turn off 'deprecated' warnings when building with MSVC, and add '-Werror...
Marshall Clow [Mon, 21 Oct 2013 15:56:35 +0000 (15:56 +0000)]
Patch by GM: Turn off 'deprecated' warnings when building with MSVC, and add '-Werror=return-type' to catch funtions that aren't returning what they should.

llvm-svn: 193088

11 years agoPatch by GM: apparently '__value' (two underscores) is a special name in Visual Studi...
Marshall Clow [Mon, 21 Oct 2013 15:43:25 +0000 (15:43 +0000)]
Patch by GM: apparently '__value' (two underscores) is a special name in Visual Studio, so rename the private method in <regex> with that name. GM's patch used  '___value' (three underscores), but I changed that to '__regex_traits_value' because I've been burned in the past by identifiers that appear identical but are not.

llvm-svn: 193087

11 years agoPatch from GM: locale.cpp; make implicit conversions to bool explicit, fix some ...
Marshall Clow [Mon, 21 Oct 2013 15:07:28 +0000 (15:07 +0000)]
Patch from GM: locale.cpp; make implicit conversions to bool explicit, fix some 'unknown pragma' warnings when compiling under MSVC, and don't use the __sso_allocator under windows, b/c MSVC doesn't support aligned-by value parameters

llvm-svn: 193086

11 years agoPatch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>
Marshall Clow [Mon, 21 Oct 2013 14:41:05 +0000 (14:41 +0000)]
Patch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>

llvm-svn: 193085

11 years agoPatch by GM: Adding MSVC support to __bit_reference
Marshall Clow [Mon, 21 Oct 2013 14:29:37 +0000 (14:29 +0000)]
Patch by GM: Adding MSVC support to __bit_reference

llvm-svn: 193084

11 years agoAVX-512: MUL operation lowering for v8i64
Elena Demikhovsky [Mon, 21 Oct 2013 13:27:34 +0000 (13:27 +0000)]
AVX-512: MUL operation lowering for v8i64

llvm-svn: 193083

11 years ago[mips][msa] Direct Object Emission support for LD/ST instructions.
Matheus Almeida [Mon, 21 Oct 2013 13:07:13 +0000 (13:07 +0000)]
[mips][msa] Direct Object Emission support for LD/ST instructions.

llvm-svn: 193082

11 years ago[mips][msa] Direct Object Emission support for LDI instructions.
Matheus Almeida [Mon, 21 Oct 2013 12:56:20 +0000 (12:56 +0000)]
[mips][msa] Direct Object Emission support for LDI instructions.

llvm-svn: 193081

11 years ago[mips][msa] Direct Object Emission support for MOVE.v.
Matheus Almeida [Mon, 21 Oct 2013 12:43:54 +0000 (12:43 +0000)]
[mips][msa] Direct Object Emission support for MOVE.v.

llvm-svn: 193080

11 years agoDriver: Various string-related cleanups.
Benjamin Kramer [Mon, 21 Oct 2013 12:33:55 +0000 (12:33 +0000)]
Driver: Various string-related cleanups.

Also fixes some funky formatting.

llvm-svn: 193079

11 years ago[mips][msa] Direct Object Emission support for CTCMSA and CFCMSA.
Matheus Almeida [Mon, 21 Oct 2013 12:26:50 +0000 (12:26 +0000)]
[mips][msa] Direct Object Emission support for CTCMSA and CFCMSA.

These instructions are logically related as they allow read/write of MSA control registers.
Currently MSA control registers are emitted by number but hopefully that will change as soon
as GAS starts accepting them by name as that would make the assembly easier to read.

llvm-svn: 193078

11 years ago[mips][msa] Direct Object Emission of SPLAT instruction.
Matheus Almeida [Mon, 21 Oct 2013 12:07:26 +0000 (12:07 +0000)]
[mips][msa] Direct Object Emission of SPLAT instruction.

llvm-svn: 193077

11 years ago[mips][msa] Fix definition of SLD instruction.
Matheus Almeida [Mon, 21 Oct 2013 11:47:56 +0000 (11:47 +0000)]
[mips][msa] Fix definition of SLD instruction.

The second parameter of the SLD intrinsic is the number of columns (GPR) to
slide left the source array.

llvm-svn: 193076

11 years agoSet the default hardware division features for ARM cpus. Also set it as default for...
Silviu Baranga [Mon, 21 Oct 2013 10:59:33 +0000 (10:59 +0000)]
Set the default hardware division features for ARM cpus. Also set it as default for A32 armv8.

llvm-svn: 193075

11 years agoAdd the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware divide...
Silviu Baranga [Mon, 21 Oct 2013 10:54:53 +0000 (10:54 +0000)]
Add the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware divide in the mode that we are compiling in (depending on the target features), not defined if we don't. Should be compatible with the GCC conterpart. Also adding a -hwdiv option to overide the default behavior.

llvm-svn: 193074

11 years agoFix to PR8880 (clang dies processing a for loop).
Serge Pavlov [Mon, 21 Oct 2013 09:34:44 +0000 (09:34 +0000)]
Fix to PR8880 (clang dies processing a for loop).

Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:

    for ( ; ({ if (first) { first = 0; continue; } 0; }); )

Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.

Differential Revision: http://llvm-reviews.chandlerc.com/D1762

llvm-svn: 193073

11 years ago[asan] count the size of QuarantineBatch in the total Quarantine size; make Quarantin...
Kostya Serebryany [Mon, 21 Oct 2013 08:36:10 +0000 (08:36 +0000)]
[asan] count the size of QuarantineBatch in the total Quarantine size; make QuarantineBatch fit into 8K, fix a MSVC compile warning

llvm-svn: 193072

11 years agoFixes PR17617: Crash on joining short if statements.
Manuel Klimek [Mon, 21 Oct 2013 08:11:15 +0000 (08:11 +0000)]
Fixes PR17617: Crash on joining short if statements.

Now that we iterate on the formatting multiple times when we
have chains of preprocessor branches, we need to correctly reset
the token's previous and next pointer for the first / last token.

llvm-svn: 193071

11 years agotsan: fix strerror interceptor (eliminate false positives)
Dmitry Vyukov [Mon, 21 Oct 2013 07:40:19 +0000 (07:40 +0000)]
tsan: fix strerror interceptor (eliminate false positives)

llvm-svn: 193070

11 years agoExpose -fmodule-name and -fmodule-map-file as driver options.
Daniel Jasper [Mon, 21 Oct 2013 06:34:34 +0000 (06:34 +0000)]
Expose -fmodule-name and -fmodule-map-file as driver options.

Review: http://llvm-reviews.chandlerc.com/D1974
llvm-svn: 193069

11 years agoFix the predecessor removal logic in r193045.
Michael Gottesman [Mon, 21 Oct 2013 05:20:11 +0000 (05:20 +0000)]
Fix the predecessor removal logic in r193045.

Additionally some small comment/stylistic fixes are included as well.

llvm-svn: 193068

11 years agoLex: Don't restrict legal UCNs when preprocessing assembly
Justin Bogner [Mon, 21 Oct 2013 05:02:28 +0000 (05:02 +0000)]
Lex: Don't restrict legal UCNs when preprocessing assembly

The C and C++ standards disallow using universal character names to
refer to some characters, such as basic ascii and control characters,
so we reject these sequences in the lexer. However, when the
preprocessor isn't being used on C or C++, it doesn't make sense to
apply these restrictions.

Notably, accepting these characters avoids issues with unicode escapes
when GHC uses the compiler as a preprocessor on haskell sources.

Fixes rdar://problem/14742289

llvm-svn: 193067

11 years agoAvoid using the name 'bzero' for an enumerator in global scope. <strings.h> might...
Richard Smith [Mon, 21 Oct 2013 04:59:37 +0000 (04:59 +0000)]
Avoid using the name 'bzero' for an enumerator in global scope. <strings.h> might declare this as a function.

llvm-svn: 193066

11 years ago[-fms-extensions] __is_interface_class was miscategorized
David Majnemer [Mon, 21 Oct 2013 04:55:56 +0000 (04:55 +0000)]
[-fms-extensions] __is_interface_class was miscategorized

We claimed that the __is_interface_class keyword was KEYCXX even though
the __interface keyword was KEYMS.

llvm-svn: 193065

11 years agoDon't eliminate a partially redundant load if it's in a landing pad.
Bill Wendling [Mon, 21 Oct 2013 04:09:17 +0000 (04:09 +0000)]
Don't eliminate a partially redundant load if it's in a landing pad.

A landing pad can be jumped to only by the unwind edge of an invoke
instruction. If we eliminate a partially redundant load in a landing pad, it
will create a basic block that violates this constraint. It then leads to other
problems down the line if it tries to merge that basic block with the landing
pad. Avoid this by not eliminating the load in a landing pad.

PR17621

llvm-svn: 193064

11 years agoFix typo in test's XFAIL line. Patch by Dimitry Andric!
Nick Lewycky [Mon, 21 Oct 2013 00:46:21 +0000 (00:46 +0000)]
Fix typo in test's XFAIL line. Patch by Dimitry Andric!

llvm-svn: 193063

11 years agoSema: Explain our deviation from the standard by referencing the, now open, LWG issue.
David Majnemer [Mon, 21 Oct 2013 00:25:32 +0000 (00:25 +0000)]
Sema: Explain our deviation from the standard by referencing the, now open, LWG issue.

llvm-svn: 193062

11 years agoBe more precise when diagnosing 'inline' on global replacement functions
David Majnemer [Mon, 21 Oct 2013 00:22:03 +0000 (00:22 +0000)]
Be more precise when diagnosing 'inline' on global replacement functions

llvm-svn: 193061

11 years agoRuntime support for the indirect function call checker.
Peter Collingbourne [Sun, 20 Oct 2013 21:29:46 +0000 (21:29 +0000)]
Runtime support for the indirect function call checker.

Differential Revision: http://llvm-reviews.chandlerc.com/D1339

llvm-svn: 193060

11 years ago[ubsan] Introduce %clangxx substitution for all C++ tests.
Peter Collingbourne [Sun, 20 Oct 2013 21:29:32 +0000 (21:29 +0000)]
[ubsan] Introduce %clangxx substitution for all C++ tests.

llvm-svn: 193059

11 years agoImplement function type checker for the undefined behavior sanitizer.
Peter Collingbourne [Sun, 20 Oct 2013 21:29:19 +0000 (21:29 +0000)]
Implement function type checker for the undefined behavior sanitizer.

This uses function prefix data to store function type information at the
function pointer.

Differential Revision: http://llvm-reviews.chandlerc.com/D1338

llvm-svn: 193058

11 years agoRevert r193022 and r193048. They broke the ubsan test suite.
Peter Collingbourne [Sun, 20 Oct 2013 21:29:13 +0000 (21:29 +0000)]
Revert r193022 and r193048.  They broke the ubsan test suite.

llvm-svn: 193057

11 years agoSwitch attribute test line endings from CRLF
Alp Toker [Sun, 20 Oct 2013 19:04:19 +0000 (19:04 +0000)]
Switch attribute test line endings from CRLF

The convention is LF unless specifically testing line endings.

llvm-svn: 193056

11 years agoFix crash in cleanup attr handling
Alp Toker [Sun, 20 Oct 2013 18:48:56 +0000 (18:48 +0000)]
Fix crash in cleanup attr handling

ResolveSingleFunctionTemplateSpecialization() returns 0 and doesn't emit diags
unless the expression has template-ids, so we must null check the result.

Also add a better diag noting which overloads are causing the problem.

Reviewed by Aaron Ballman.

llvm-svn: 193055

11 years agoclang-format: Better understand Lambda poarameters.
Daniel Jasper [Sun, 20 Oct 2013 18:15:30 +0000 (18:15 +0000)]
clang-format: Better understand Lambda poarameters.

Before:
  auto PointerBinding = [](const char * S) {};

After:
  auto PointerBinding = [](const char *S) {};

This fixes llvm.org/PR17618.

llvm-svn: 193054

11 years agoFix python-free build.
Joerg Sonnenberger [Sun, 20 Oct 2013 17:36:05 +0000 (17:36 +0000)]
Fix python-free build.

llvm-svn: 193053

11 years agoMake sure switch covers all values.
Joerg Sonnenberger [Sun, 20 Oct 2013 17:35:46 +0000 (17:35 +0000)]
Make sure switch covers all values.

llvm-svn: 193052

11 years agoclang-format: Fix formatting of nested blocks after comment.
Daniel Jasper [Sun, 20 Oct 2013 17:28:32 +0000 (17:28 +0000)]
clang-format: Fix formatting of nested blocks after comment.

Before:
  DEBUG({ // Comment that used to confuse clang-format.
  fdafas();
  });
Before:
  DEBUG({ // Comments are now fine.
    fdafas();
  });

This fixed llvm.org/PR17619.

llvm-svn: 193051

11 years agoclang-format: Support case ranges.
Daniel Jasper [Sun, 20 Oct 2013 16:56:16 +0000 (16:56 +0000)]
clang-format: Support case ranges.

Before (note the missing space before "..." which can lead to compile
errors):
  switch (x) {
    case 'A'... 'Z':
    case 1... 5:
        break;
  }

After:
  switch (x) {
    case 'A' ... 'Z':
    case 1 ... 5:
        break;
  }

llvm-svn: 193050

11 years agoclang-format: Improve formatting of ObjC dict literals.
Daniel Jasper [Sun, 20 Oct 2013 16:45:46 +0000 (16:45 +0000)]
clang-format: Improve formatting of ObjC dict literals.

Before:
  NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date],
                       @"processInfo" : [NSProcessInfo processInfo]
  };

After:
  NSDictionary *d = @{
    @"nam" : NSUserNam(),
    @"dte" : [NSDate date],
    @"processInfo" : [NSProcessInfo processInfo]
  };

llvm-svn: 193049

11 years agoDriver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some...
Benjamin Kramer [Sun, 20 Oct 2013 12:34:18 +0000 (12:34 +0000)]
Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some linkers depend on it.

llvm-svn: 193048

11 years agoForgot some references to misspelled enums.
Benjamin Kramer [Sun, 20 Oct 2013 11:53:20 +0000 (11:53 +0000)]
Forgot some references to misspelled enums.

llvm-svn: 193047

11 years agoMiscellaneous speling fixes.
Benjamin Kramer [Sun, 20 Oct 2013 11:47:15 +0000 (11:47 +0000)]
Miscellaneous speling fixes.

llvm-svn: 193046

11 years agoTeach simplify-cfg how to correctly create covered lookup tables for switches on...
Michael Gottesman [Sun, 20 Oct 2013 07:04:37 +0000 (07:04 +0000)]
Teach simplify-cfg how to correctly create covered lookup tables for switches on iN with N >= 3.

One optimization simplify-cfg performs is the converting of switches to
lookup tables if the switch has > 4 cases. This is done by:

1. Finding the max/min case value and calculating the switch case range.
2. Create a lookup table basic block.
3. Perform a check in the switch's BB to see if the input value is in
the switch's case range. If the input value satisfies said predicate
branch to the lookup table BB, otherwise branch to the switch's default
destination BB using the default value as the result.

The conditional check consists of subtracting the min case value of the
table from any input iN value and then ensuring that said value is
unsigned less than the size of the lookup table represented as an iN
value.

If the lookup table is a covered lookup table, the size of the table will be N
which is 0 as an iN value. Thus the comparison will be an `icmp ult` of an iN
value against 0 which is always false yielding the incorrect result.

This patch fixes this problem by recognizing if we have a covered lookup table
and if we do, unconditionally jumps to the lookup table BB since the covering
property of the lookup table implies no input values could not be handled by
said BB.

rdar://15268442

llvm-svn: 193045

11 years agoSema: Diagnose global replacement functions declared as inline
David Majnemer [Sun, 20 Oct 2013 05:40:29 +0000 (05:40 +0000)]
Sema: Diagnose global replacement functions declared as inline

This fixes PR17591.

N.B. This actually goes beyond what the standard mandates by requiring
the restriction to hold for declarations instead of definitions.  This
is believed to be a defect in the standard and an LWG issue has been
submitted.

llvm-svn: 193044

11 years agoTypo.
Peter Collingbourne [Sun, 20 Oct 2013 03:19:25 +0000 (03:19 +0000)]
Typo.

llvm-svn: 193043

11 years agoEmit prefix data after debug and EH directives.
Peter Collingbourne [Sun, 20 Oct 2013 02:16:21 +0000 (02:16 +0000)]
Emit prefix data after debug and EH directives.

This ensures that the prefix data is treated as part of the function for
the purpose of debug info.  This provides a better debugging experience,
among other things by allowing a debug info client to correctly look up
a function in debug info given a function pointer.

llvm-svn: 193042

11 years agoEmit DWARF line entries for all data in the instruction stream.
Peter Collingbourne [Sun, 20 Oct 2013 02:16:18 +0000 (02:16 +0000)]
Emit DWARF line entries for all data in the instruction stream.

r182712 attempted to do this, but it failed to handle data emitted via
EmitBytes.

llvm-svn: 193041

11 years agoAdd a missing getMostRecentDecl to ClassTemplateDecl.
Rafael Espindola [Sat, 19 Oct 2013 21:06:31 +0000 (21:06 +0000)]
Add a missing getMostRecentDecl to ClassTemplateDecl.

llvm-svn: 193040

11 years agoSimplify some implementations of get*Decl.
Rafael Espindola [Sat, 19 Oct 2013 16:55:03 +0000 (16:55 +0000)]
Simplify some implementations of get*Decl.

* NamedDecl and CXXMethodDecl were missing getMostRecentDecl.
* The const version can just forward to the non const.
* getMostRecentDecl can use cast instead of cast_or_null.

This then removes some casts from the callers.

llvm-svn: 193039

11 years agoRemove unused variable.
Benjamin Kramer [Sat, 19 Oct 2013 16:32:15 +0000 (16:32 +0000)]
Remove unused variable.

llvm-svn: 193038

11 years agoThis should use the possessive adjective.
Rafael Espindola [Sat, 19 Oct 2013 16:14:07 +0000 (16:14 +0000)]
This should use the possessive adjective.

Thanks to David Blaikie for noticing it.

llvm-svn: 193037

11 years agoComment improvement.
Rafael Espindola [Sat, 19 Oct 2013 13:08:51 +0000 (13:08 +0000)]
Comment improvement.

Thanks to Sean Silva for the suggestion.

llvm-svn: 193036

11 years agoPerform an intelligent splice of the predecessor with the single successor.
Bill Wendling [Sat, 19 Oct 2013 11:27:12 +0000 (11:27 +0000)]
Perform an intelligent splice of the predecessor with the single successor.

If the predecessor's being spliced into a landing pad, then we need the PHIs to
come first and the rest of the predecessor's code to come *after* the landing
pad instruction.

llvm-svn: 193035

11 years agoAvoid duplicate search by reusing the iterator.
Yaron Keren [Sat, 19 Oct 2013 09:04:26 +0000 (09:04 +0000)]
Avoid duplicate search by reusing the iterator.

llvm-svn: 193034

11 years agoAdded comments from Andrew Kaylor.
Yaron Keren [Sat, 19 Oct 2013 09:03:20 +0000 (09:03 +0000)]
Added comments from Andrew Kaylor.

llvm-svn: 193033

11 years agoAdd irreader to the component list, because ParseIR is called.
Bill Wendling [Sat, 19 Oct 2013 08:33:11 +0000 (08:33 +0000)]
Add irreader to the component list, because ParseIR is called.

llvm-svn: 193032

11 years agoRemove NDBEUG from all release types compile flags.
Yaron Keren [Sat, 19 Oct 2013 07:30:37 +0000 (07:30 +0000)]
Remove NDBEUG from all release types compile flags.

llvm-svn: 193031

11 years agoSimplify WinLinkDriver. No functionality change.
Rui Ueyama [Sat, 19 Oct 2013 03:34:00 +0000 (03:34 +0000)]
Simplify WinLinkDriver. No functionality change.

llvm-svn: 193030

11 years agoFix bug that CompareAtoms::compare is not transitive.
Rui Ueyama [Sat, 19 Oct 2013 03:18:18 +0000 (03:18 +0000)]
Fix bug that CompareAtoms::compare is not transitive.

This patch fixes a bug in r190608. The results of a comparison function
passed to std::sort must be transitive, which is, if a < b and b < c, and if
a != b, a < c must be also true. CompareAtoms::compare did not actually
guarantee the transitivity. As a result the sort results were sometimes just
wrong.

Consider there are three atoms, X, Y, and Z, whose file ordinals are 1, 2, 3,
respectively. Z has a property "layout-after X". In this case, all the
following conditionals become true:

  X < Y because X's ordinal is less than Y's
  Y < Z because Y's ordinal is less than Z's
  Z < X because of the layout-after relationship

This is not of course transitive. The reason why this happened is because
we used follow-on relationships for comparison if two atoms falls in the same
follow-on chain, but we used each atom's properties if they did not. This patch
fixes the issue by using follow-on root atoms for comparison to get consistent
results.

Differential Revision: http://llvm-reviews.chandlerc.com/D1980

llvm-svn: 193029

11 years agoReduce indentation with an early exit.
Rafael Espindola [Sat, 19 Oct 2013 02:28:17 +0000 (02:28 +0000)]
Reduce indentation with an early exit.

llvm-svn: 193028

11 years agoAdd isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.
Rafael Espindola [Sat, 19 Oct 2013 02:13:21 +0000 (02:13 +0000)]
Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.

Redeclarable already had a isFirstDecl, but it was missing from DeclBase.

llvm-svn: 193027

11 years agoFix typo.
Rafael Espindola [Sat, 19 Oct 2013 02:06:23 +0000 (02:06 +0000)]
Fix typo.

llvm-svn: 193026

11 years agoSimplify FunctionDecl::getBody.
Rafael Espindola [Sat, 19 Oct 2013 01:37:17 +0000 (01:37 +0000)]
Simplify FunctionDecl::getBody.

llvm-svn: 193025

11 years agoReformat.
Eric Christopher [Sat, 19 Oct 2013 01:04:47 +0000 (01:04 +0000)]
Reformat.

llvm-svn: 193024

11 years agoFix up a few minor performance problems spotted in code review.
Eric Christopher [Sat, 19 Oct 2013 01:04:42 +0000 (01:04 +0000)]
Fix up a few minor performance problems spotted in code review.

llvm-svn: 193023

11 years agoWhen building ubsan, link in ubsan parts first and sanitizer-common second, to
Nick Lewycky [Sat, 19 Oct 2013 00:27:23 +0000 (00:27 +0000)]
When building ubsan, link in ubsan parts first and sanitizer-common second, to
pick up the common bits ubsan actually needs. Also remove whole-archive when we
aren't trying to re-export the symbols.

llvm-svn: 193022

11 years agoUpdate PPC loop tests after SCEV non-unit-stride checkin r193015.
Andrew Trick [Sat, 19 Oct 2013 00:14:04 +0000 (00:14 +0000)]
Update PPC loop tests after SCEV non-unit-stride checkin r193015.

llvm-svn: 193021

11 years agoAllow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.
Kaelyn Uhrain [Sat, 19 Oct 2013 00:05:00 +0000 (00:05 +0000)]
Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.

Now that CorrectTypo knows how to correctly search classes for typo
correction candidates, there is no good reason to only replace an
existing CXXScopeSpecifier if it refers to a namespace. While the actual
enablement was a matter of changing a single comparison, the fallout
from enabling the functionality required a lot more code changes
(including my two previous commits).

llvm-svn: 193020

11 years agoBe smarter about deciding to add a leading '::' to a
Kaelyn Uhrain [Sat, 19 Oct 2013 00:04:52 +0000 (00:04 +0000)]
Be smarter about deciding to add a leading '::' to a
NestedNameSpecifier that replaces an existing specifier.

llvm-svn: 193019

11 years agoMerge NamespaceSpecifierSet's AddNamespace and AddRecord as they are
Kaelyn Uhrain [Sat, 19 Oct 2013 00:04:49 +0000 (00:04 +0000)]
Merge NamespaceSpecifierSet's AddNamespace and AddRecord as they are
essentially the same.

llvm-svn: 193018

11 years ago[PECOFF] Only COMDAT symbols are allowed to be dead-stripped.
Rui Ueyama [Fri, 18 Oct 2013 23:54:55 +0000 (23:54 +0000)]
[PECOFF] Only COMDAT symbols are allowed to be dead-stripped.

We should dead-strip atoms only if they are created for COMDAT symbols. If we
remove non-COMDAT atoms from a binary, it will no longer be guaranteed that
the binary will work correctly.

In COFF, you can manipulate the order of section contents in the resulting
binary by section name. For example, if you have four sections
.data$unique_prefix_{a,b,c,d}, it's guaranteed that the contents of A, B, C,
and D will be consecutive in the resulting .data section in that order.
Thus, you can access B's and C's contents by incrementing a pointer pointing
to A until it reached to D. That's why we cannot dead-strip B or C even if
no one is directly referencing to them.

Some object files in the standard library actually use that technique.

llvm-svn: 193017

11 years agoValueObject and SBValue's GetChildMemberWithName should look through anonymous structs
Jim Ingham [Fri, 18 Oct 2013 23:53:55 +0000 (23:53 +0000)]
ValueObject and SBValue's GetChildMemberWithName should look through anonymous structs
and unions the same way that C would.

<rdar://problem/11987906>

llvm-svn: 193016

11 years agoSCEV should use NSW to get trip count for positive nonunit stride loops.
Andrew Trick [Fri, 18 Oct 2013 23:43:53 +0000 (23:43 +0000)]
SCEV should use NSW to get trip count for positive nonunit stride loops.

SCEV currently fails to compute loop counts for nonunit stride
loops. This comes up frequently. It prevents loop optimization and
forces vectorization to insert extra loop checks.

For example:
void foo(int n, int *x) {
 for (int i = 0; i < n; i += 3) {
   x[i] = i;
   x[i+1] = i+1;
   x[i+2] = i+2;
 }
}

We need to properly handle the case in which limit > INT_MAX-stride. In
the above case: n > INT_MAX-3. In this case the loop counter will step
beyond the limit and overflow at the same time. However, knowing that
signed integer overlow in undefined, we can assume the loop test
behavior is arbitrary after overflow. This obeys both C undefined
behavior rules, and the more strict LLVM poison value rules.

I'm finally fixing this in response to Hal Finkel's persistence.
The most probable reason that we never optimized this before is that
we were being careful to handle case where the developer expected a
side-effect free infinite loop relying on overflow:

for (int i = 0; i < n; i += s) {
  ++j;
}
return j;

If INT_MAX+1 is a multiple of s and n > INT_MAX-s, then we might
expect an infinite loop. However there are plenty of ways to achieve
this effect without relying on undefined behavior of signed overflow.

llvm-svn: 193015

11 years agoWrite a simple description of the 'target triple' directive. This should be expanded...
Bill Wendling [Fri, 18 Oct 2013 23:41:25 +0000 (23:41 +0000)]
Write a simple description of the 'target triple' directive. This should be expanded. PR8976.

llvm-svn: 193014

11 years agoMark some command line flags as hidden
Nadav Rotem [Fri, 18 Oct 2013 23:38:13 +0000 (23:38 +0000)]
Mark some command line flags as hidden

llvm-svn: 193013

11 years agoClarify that an alignment of 0 or 1 on a mem* intrinsic means 'no alignment'.
Bill Wendling [Fri, 18 Oct 2013 23:26:55 +0000 (23:26 +0000)]
Clarify that an alignment of 0 or 1 on a mem* intrinsic means 'no alignment'.

llvm-svn: 193012

11 years agoYAMLBench.cpp: Use llvm_move instead of std::move also here.
NAKAMURA Takumi [Fri, 18 Oct 2013 23:25:39 +0000 (23:25 +0000)]
YAMLBench.cpp: Use llvm_move instead of std::move also here.

llvm-svn: 193011

11 years agoConsumed analysis: fix assert failure.
DeLesley Hutchins [Fri, 18 Oct 2013 23:11:49 +0000 (23:11 +0000)]
Consumed analysis: fix assert failure.

llvm-svn: 193010

11 years agoRemove reference to obsolete arguments.
Bill Wendling [Fri, 18 Oct 2013 23:11:25 +0000 (23:11 +0000)]
Remove reference to obsolete arguments.

llvm-svn: 193009

11 years agoUpdate to reflect current GC APIs and usage. The example code is taken from the Erlan...
Bill Wendling [Fri, 18 Oct 2013 23:09:06 +0000 (23:09 +0000)]
Update to reflect current GC APIs and usage. The example code is taken from the Erlang GC implementation.

llvm-svn: 193008

11 years agoCan we move to C++11 already?
Michael J. Spencer [Fri, 18 Oct 2013 23:07:01 +0000 (23:07 +0000)]
Can we move to C++11 already?

llvm-svn: 193007

11 years agoclang-cl: diagnose setting asm listing filename with multiple inputs
Hans Wennborg [Fri, 18 Oct 2013 22:49:04 +0000 (22:49 +0000)]
clang-cl: diagnose setting asm listing filename with multiple inputs

llvm-svn: 193006

11 years agoFix crash if a submodule @imports another submodule from the same module. The
Richard Smith [Fri, 18 Oct 2013 22:48:20 +0000 (22:48 +0000)]
Fix crash if a submodule @imports another submodule from the same module. The
test also adds FIXMEs for a number of places where imports and includes of
submodules don't work very well.

llvm-svn: 193005

11 years ago[Support][YAML] Add support for accessing tags and tag handle substitution.
Michael J. Spencer [Fri, 18 Oct 2013 22:38:04 +0000 (22:38 +0000)]
[Support][YAML] Add support for accessing tags and tag handle substitution.

llvm-svn: 193004

11 years agoObjectiveC. Added support for methods annotated with format_arg
Fariborz Jahanian [Fri, 18 Oct 2013 21:20:34 +0000 (21:20 +0000)]
ObjectiveC. Added support for methods annotated with format_arg
attributes when such methods are actually envoked in message
expression. // rdar://15242010

llvm-svn: 193003

11 years agoDebug Info: add a newly-created DIE to a parent in the same function.
Manman Ren [Fri, 18 Oct 2013 21:14:19 +0000 (21:14 +0000)]
Debug Info: add a newly-created DIE to a parent in the same function.

With this commit, all DIEs created in CompileUnit will be added to parents
inside the same function. Also make getOrCreateTemplateType|Value functions
private.

No functionality change.

llvm-svn: 193002