platform/upstream/llvm.git
11 years agoMatch MSVC's handling of commas during macro argument expansion
Reid Kleckner [Wed, 26 Jun 2013 17:16:08 +0000 (17:16 +0000)]
Match MSVC's handling of commas during macro argument expansion

This allows clang to parse the type_traits header in Visual Studio 2012,
which is included widely in practice.

This is a rework of r163022 by João Matos.  The original patch broke
preprocessing of gtest headers, which this patch addresses.

Patch by Will Wilson!

llvm-svn: 184968

11 years agoAdd a subtarget feature 'v8' to the ARM backend.
Joey Gouly [Wed, 26 Jun 2013 16:58:26 +0000 (16:58 +0000)]
Add a subtarget feature 'v8' to the ARM backend.
This allows for targeting the ARMv8 AArch32 variant.

llvm-svn: 184967

11 years agoDo not add cse-ed instructions into the visited map because we dont want to consider...
Nadav Rotem [Wed, 26 Jun 2013 16:54:53 +0000 (16:54 +0000)]
Do not add cse-ed instructions into the visited map because we dont want to consider them as a candidate for replacement of instructions to be visited.

llvm-svn: 184966

11 years agoARM: fix more cases where predication may or may not be allowed
Tim Northover [Wed, 26 Jun 2013 16:52:40 +0000 (16:52 +0000)]
ARM: fix more cases where predication may or may not be allowed

Unfortunately this addresses two issues (by the time I'd disentangled the logic
it wasn't worth putting it back to half-broken):

+ Coprocessor instructions should all be predicable in Thumb mode.
+ BKPT should never be predicable.

llvm-svn: 184965

11 years agoARM: allow predicated barriers in Thumb mode
Tim Northover [Wed, 26 Jun 2013 16:52:32 +0000 (16:52 +0000)]
ARM: allow predicated barriers in Thumb mode

The barrier instructions are only "always-execute" in ARM mode, they can quite
happily sit inside an IT block in Thumb.

llvm-svn: 184964

11 years ago[tsan] Fix build.
Sergey Matveev [Wed, 26 Jun 2013 16:49:34 +0000 (16:49 +0000)]
[tsan] Fix build.

llvm-svn: 184963

11 years agoRemove the 'generic' CPU from the ARM eabi attributes printer.
Joey Gouly [Wed, 26 Jun 2013 16:39:06 +0000 (16:39 +0000)]
Remove the 'generic' CPU from the ARM eabi attributes printer.
Make v4 the default ARM architecture attribute, to match CodeGen.

llvm-svn: 184962

11 years agoRevert "Temporarily disable building the armv7 variants of profile_ios on"
Bob Wilson [Wed, 26 Jun 2013 16:35:16 +0000 (16:35 +0000)]
Revert "Temporarily disable building the armv7 variants of profile_ios on"

This reverts commit r184816.  With Chandler's change in r184929, this should
no longer be necessary.

llvm-svn: 184961

11 years agoPathV1 is deprecated since the 18th of Dec 2010. Remove it.
Rafael Espindola [Wed, 26 Jun 2013 16:24:35 +0000 (16:24 +0000)]
PathV1 is deprecated since the 18th of Dec 2010. Remove it.

llvm-svn: 184960

11 years agoDon't use PathV1.h in IncludeExcludeTest.cpp.
Rafael Espindola [Wed, 26 Jun 2013 16:20:55 +0000 (16:20 +0000)]
Don't use PathV1.h in IncludeExcludeTest.cpp.

llvm-svn: 184959

11 years agoDon't use PathV1.h in TransformTest.cpp.
Rafael Espindola [Wed, 26 Jun 2013 15:48:36 +0000 (15:48 +0000)]
Don't use PathV1.h in TransformTest.cpp.

llvm-svn: 184958

11 years ago[tsan] Move some suppressions-related code to common.
Sergey Matveev [Wed, 26 Jun 2013 15:37:14 +0000 (15:37 +0000)]
[tsan] Move some suppressions-related code to common.

Factor out code to be reused in LSan. Also switch from linked list to vector.

llvm-svn: 184957

11 years agoDon't use PathV1.h in PerfSupport.cpp.
Rafael Espindola [Wed, 26 Jun 2013 15:22:42 +0000 (15:22 +0000)]
Don't use PathV1.h in PerfSupport.cpp.

llvm-svn: 184956

11 years agoAdd a convenience functions that don't return if the directory existed.
Rafael Espindola [Wed, 26 Jun 2013 15:21:13 +0000 (15:21 +0000)]
Add a convenience functions that don't return if the directory existed.

llvm-svn: 184955

11 years agoRemove unused include.
Rafael Espindola [Wed, 26 Jun 2013 15:12:41 +0000 (15:12 +0000)]
Remove unused include.

llvm-svn: 184954

11 years agoDon't explicitly set update version
Ed Maste [Wed, 26 Jun 2013 15:10:31 +0000 (15:10 +0000)]
Don't explicitly set update version

Host::GetOSVersion's caller already sets it to UINT32_MAX to determine
which version number components are set.

llvm-svn: 184953

11 years agoclang/test/Driver/pth.c: Fix r184942, a regexp like "\\\\" is redundant here. Should...
NAKAMURA Takumi [Wed, 26 Jun 2013 15:03:20 +0000 (15:03 +0000)]
clang/test/Driver/pth.c: Fix r184942, a regexp like "\\\\" is redundant here. Should be matched to single \ with '\\'.

llvm-svn: 184952

11 years agoRemove last use of PathV1.h from clang.
Rafael Espindola [Wed, 26 Jun 2013 15:01:50 +0000 (15:01 +0000)]
Remove last use of PathV1.h from clang.

Instead of creating a temporary directory, remember the set of temporary files
we create.

llvm-svn: 184951

11 years ago[sanitizer] readdir and readdir_r interceptors.
Evgeniy Stepanov [Wed, 26 Jun 2013 15:00:53 +0000 (15:00 +0000)]
[sanitizer] readdir and readdir_r interceptors.

llvm-svn: 184950

11 years agoWe only create one file, no need to delete a directory.
Rafael Espindola [Wed, 26 Jun 2013 14:33:23 +0000 (14:33 +0000)]
We only create one file, no need to delete a directory.

llvm-svn: 184949

11 years agoFix the lldb build.
Rafael Espindola [Wed, 26 Jun 2013 14:10:56 +0000 (14:10 +0000)]
Fix the lldb build.

llvm-svn: 184948

11 years agoRemove unused includes.
Rafael Espindola [Wed, 26 Jun 2013 13:54:34 +0000 (13:54 +0000)]
Remove unused includes.

llvm itself is now PathV1 clean.

llvm-svn: 184947

11 years ago[PowerPC] Accept 17-bit signed immediates for addis
Ulrich Weigand [Wed, 26 Jun 2013 13:49:53 +0000 (13:49 +0000)]
[PowerPC] Accept 17-bit signed immediates for addis

The assembler currently strictly verifies that immediates for
s16imm operands are in range (-32768 ... 32767).  This matches
the behaviour of the GNU assembler, with one exception: gas
allows, as a special case, operands in an extended range
(-65536 .. 65535) for the addis instruction only (and its
extended mnemonic lis).

The main reason for this seems to be to allow using unsigned
16-bit operands for lis, e.g. like lis %r1, 0xfedc.

Since this has been supported by gas for a long time, and
assembler source code seen "in the wild" actually exploits
this feature, this patch adds equivalent support to LLVM
for compatibility reasons.

llvm-svn: 184946

11 years agoRemove unused header.
Rafael Espindola [Wed, 26 Jun 2013 13:49:47 +0000 (13:49 +0000)]
Remove unused header.

llvm-svn: 184945

11 years ago[PowerPC] Support symbolic u16imm operands
Ulrich Weigand [Wed, 26 Jun 2013 13:49:15 +0000 (13:49 +0000)]
[PowerPC] Support symbolic u16imm operands

Currently, all instructions taking s16imm operands support symbolic
operands.  However, for u16imm operands, we only support actual
immediate integers.  This causes the assembler to reject code like

  ori %r5, %r5, symbol@l

This patch changes the u16imm operand definition to likewise
accept symbolic operands.  In fact, s16imm and u16imm can
share the same encoding routine, now renamed to getImm16Encoding.

llvm-svn: 184944

11 years agoARM: operands should be explicit when disassembled
Amaury de la Vieuville [Wed, 26 Jun 2013 13:39:07 +0000 (13:39 +0000)]
ARM: operands should be explicit when disassembled

llvm-svn: 184943

11 years agoTry to fix this test on the msys buildbot.
Rafael Espindola [Wed, 26 Jun 2013 13:02:16 +0000 (13:02 +0000)]
Try to fix this test on the msys buildbot.

llvm-svn: 184942

11 years agoQuieting an MSVC warning about converting negative integer constants to unsigned...
Aaron Ballman [Wed, 26 Jun 2013 12:54:49 +0000 (12:54 +0000)]
Quieting an MSVC warning about converting negative integer constants to unsigned types.

llvm-svn: 184941

11 years agoDon't use PathV1.h in CIndexCodeCompletion.cpp.
Rafael Espindola [Wed, 26 Jun 2013 12:54:23 +0000 (12:54 +0000)]
Don't use PathV1.h in CIndexCodeCompletion.cpp.

llvm-svn: 184940

11 years agoRemove dead include.
Rafael Espindola [Wed, 26 Jun 2013 12:49:58 +0000 (12:49 +0000)]
Remove dead include.

llvm-svn: 184939

11 years agoDon't use PathV1.h in cc1as_main.cpp.
Rafael Espindola [Wed, 26 Jun 2013 12:48:34 +0000 (12:48 +0000)]
Don't use PathV1.h in cc1as_main.cpp.

llvm-svn: 184938

11 years agoRemove unused header.
Rafael Espindola [Wed, 26 Jun 2013 12:46:06 +0000 (12:46 +0000)]
Remove unused header.

llvm-svn: 184937

11 years agoRemove unused include.
Rafael Espindola [Wed, 26 Jun 2013 12:44:19 +0000 (12:44 +0000)]
Remove unused include.

llvm-svn: 184936

11 years ago[Sparc]: Add memory operands for the frame references in the storeRegToStackSlot
Venkatraman Govindaraju [Wed, 26 Jun 2013 12:40:16 +0000 (12:40 +0000)]
[Sparc]: Add memory operands for the frame references in the storeRegToStackSlot
and loadRegFromStackSlot.

llvm-svn: 184935

11 years ago[asan] initialize fake_stack lazily and increase its maximal size. This makes -fsanit...
Kostya Serebryany [Wed, 26 Jun 2013 12:16:05 +0000 (12:16 +0000)]
[asan] initialize fake_stack lazily and increase its maximal size. This makes -fsanitize=address,use-after-return more robust: all SPEC tests pass now. In the default mode thread stacks become a bit smaller.

llvm-svn: 184934

11 years agoFixed a comment.
Elena Demikhovsky [Wed, 26 Jun 2013 12:15:53 +0000 (12:15 +0000)]
Fixed a comment.

llvm-svn: 184933

11 years agoSuppress llvm/test/Other/can-execute.txt on msys bash.
NAKAMURA Takumi [Wed, 26 Jun 2013 10:56:44 +0000 (10:56 +0000)]
Suppress llvm/test/Other/can-execute.txt on msys bash.

llvm-svn: 184932

11 years agoOptimized integer vector multiplication operation by replacing it with shift/xor...
Elena Demikhovsky [Wed, 26 Jun 2013 10:55:03 +0000 (10:55 +0000)]
Optimized integer vector multiplication operation by replacing it with shift/xor/sub when it is possible. Fixed a bug in SDIV, where the const operand is not a splat constant vector.

llvm-svn: 184931

11 years agoclang/test/lit.cfg: Tweak getClangBuiltinIncludeDir() not to expose dosish path separ...
NAKAMURA Takumi [Wed, 26 Jun 2013 10:45:20 +0000 (10:45 +0000)]
clang/test/lit.cfg: Tweak getClangBuiltinIncludeDir() not to expose dosish path separator on MSYS bash.exe, since r184774.

    $ bin/clang.exe -print-file-name=include
    e:/path/to/build/bin\..\lib\clang\3.4\include

llvm-svn: 184930

11 years agoRevert the Darwin half of r184805: "Remove the sysroot (or isysroot)
Chandler Carruth [Wed, 26 Jun 2013 10:05:37 +0000 (10:05 +0000)]
Revert the Darwin half of r184805: "Remove the sysroot (or isysroot)
restriction from the GCDAProfile.c"

Bill added a much more effective way of coping with the use of errno and
other system interactions for Darwin for now by disabling it on that
platform. Building against the SDK stuff is more fundamental to the
darwin build process.

llvm-svn: 184929

11 years ago[asan] workaround for PR16277: don't instrument AllocaInstr with alignment more than...
Kostya Serebryany [Wed, 26 Jun 2013 09:49:52 +0000 (09:49 +0000)]
[asan] workaround for PR16277: don't instrument AllocaInstr with alignment more than the redzone size

llvm-svn: 184928

11 years ago[asan] add option -asan-keep-uninstrumented-functions
Kostya Serebryany [Wed, 26 Jun 2013 09:18:17 +0000 (09:18 +0000)]
[asan] add option -asan-keep-uninstrumented-functions

llvm-svn: 184927

11 years ago[sanitizer] Reformat line >80 chars.
Evgeniy Stepanov [Wed, 26 Jun 2013 09:16:45 +0000 (09:16 +0000)]
[sanitizer] Reformat line >80 chars.

llvm-svn: 184926

11 years ago[sanitizer] Fix build with OSS4 kernel headers.
Evgeniy Stepanov [Wed, 26 Jun 2013 08:16:38 +0000 (08:16 +0000)]
[sanitizer] Fix build with OSS4 kernel headers.

This fixes PR16453.

llvm-svn: 184925

11 years agoProvide bootstrap support to build only llvm+clang when using cmake.
Andy Gibbs [Wed, 26 Jun 2013 08:05:08 +0000 (08:05 +0000)]
Provide bootstrap support to build only llvm+clang when using cmake.

Where a source tree is complete with lld, lldb and polly, it may not be possible to use cmake to configure build scripts if the host compiler it not capable of compiling these sub-projects.  This change makes it possible to first build a bootstrap clang compiler when can then be used to build a complete llvm toolchain.  An example bootstrap build sequence could be as follows:

$ mkdir bootstrap
$ cd bootstrap
$ cmake -G 'Unix Makefiles'
        -DCMAKE_BUILD_TYPE:STRING=Release
        -DCMAKE_PREFIX_PATH:STRING=$(pwd)
        -DLLVM_TARGETS_TO_BUILD:STRING=host
        -DLLVM_INCLUDE_TOOLS:STRING=bootstrap-only
        ../source
$ make clang  # build clang only for host

$ cd ..
$ export CC=$(realpath bootstrap/bin)/clang
$ export CXX=$(realpath bootstrap/bin)/clang++

$ mkdir final
$ cd final
$ cmake -G 'Unix Makefiles' ../source
$ make all check-all

llvm-svn: 184924

11 years agoSupport using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake.
Andy Gibbs [Wed, 26 Jun 2013 07:57:53 +0000 (07:57 +0000)]
Support using "host" as a target in LLVM_TARGETS_TO_BUILD when using cmake.

llvm-svn: 184923

11 years agoRemove unused include.
Rafael Espindola [Wed, 26 Jun 2013 06:15:57 +0000 (06:15 +0000)]
Remove unused include.

llvm-svn: 184922

11 years agoRemove more uses of llvm::sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 06:13:06 +0000 (06:13 +0000)]
Remove more uses of llvm::sys::Path.

llvm-svn: 184921

11 years agoRemove calls to Path in #ifdefs that don't seem to be used in any of the bots :-(
Rafael Espindola [Wed, 26 Jun 2013 06:10:32 +0000 (06:10 +0000)]
Remove calls to Path in #ifdefs that don't seem to be used in any of the bots :-(

llvm-svn: 184920

11 years agoAdd a simpler version of remove_all.
Rafael Espindola [Wed, 26 Jun 2013 06:06:54 +0000 (06:06 +0000)]
Add a simpler version of remove_all.

llvm-svn: 184919

11 years agoRemove PathV1.h from CompilerInvocation.cpp.
Rafael Espindola [Wed, 26 Jun 2013 05:40:30 +0000 (05:40 +0000)]
Remove PathV1.h from CompilerInvocation.cpp.

llvm-svn: 184918

11 years agoFix the build when __APPLE__ is defined.
Rafael Espindola [Wed, 26 Jun 2013 05:25:44 +0000 (05:25 +0000)]
Fix the build when __APPLE__ is defined.

llvm-svn: 184917

11 years agoRemove sys::GetMainExecutable.
Rafael Espindola [Wed, 26 Jun 2013 05:05:37 +0000 (05:05 +0000)]
Remove sys::GetMainExecutable.

llvm-svn: 184916

11 years agoUse llvm::sys::fs::getMainExecutable.
Rafael Espindola [Wed, 26 Jun 2013 05:03:40 +0000 (05:03 +0000)]
Use llvm::sys::fs::getMainExecutable.

llvm-svn: 184915

11 years agoPort GetMainExecutable over to PathV2.
Rafael Espindola [Wed, 26 Jun 2013 05:01:35 +0000 (05:01 +0000)]
Port GetMainExecutable over to PathV2.

I will remove the V1 version as soon as I change clang in the next commit.

llvm-svn: 184914

11 years agoRemove PathV1.h from CompilerInstance.cpp.
Rafael Espindola [Wed, 26 Jun 2013 04:32:59 +0000 (04:32 +0000)]
Remove PathV1.h from CompilerInstance.cpp.

llvm-svn: 184913

11 years agoDon't use PathV1.h in ASTUnit.cpp.
Rafael Espindola [Wed, 26 Jun 2013 04:26:38 +0000 (04:26 +0000)]
Don't use PathV1.h in ASTUnit.cpp.

llvm-svn: 184912

11 years agoRemove forward declarations of sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 04:23:08 +0000 (04:23 +0000)]
Remove forward declarations of sys::Path.

llvm-svn: 184911

11 years agoRemove PathWithStatus.
Rafael Espindola [Wed, 26 Jun 2013 04:15:55 +0000 (04:15 +0000)]
Remove PathWithStatus.

llvm-svn: 184910

11 years agoRemove the last use of PathWithStatus.
Rafael Espindola [Wed, 26 Jun 2013 04:12:57 +0000 (04:12 +0000)]
Remove the last use of PathWithStatus.

llvm-svn: 184909

11 years agoUse llvm::sys::fs::unique_file.
Rafael Espindola [Wed, 26 Jun 2013 04:02:37 +0000 (04:02 +0000)]
Use llvm::sys::fs::unique_file.

llvm-svn: 184908

11 years agoRemove some uses of llvm::sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 03:52:38 +0000 (03:52 +0000)]
Remove some uses of llvm::sys::Path.

llvm-svn: 184907

11 years agoRemove PathV1.h use from WindowsToolChain.cpp.
Rafael Espindola [Wed, 26 Jun 2013 03:39:10 +0000 (03:39 +0000)]
Remove PathV1.h use from WindowsToolChain.cpp.

llvm-svn: 184906

11 years agoFix a comment.
Nico Weber [Wed, 26 Jun 2013 02:42:46 +0000 (02:42 +0000)]
Fix a comment.

llvm-svn: 184905

11 years agoLazily deserialize the "first' friend declaration when deserializing a class
Richard Smith [Wed, 26 Jun 2013 02:41:25 +0000 (02:41 +0000)]
Lazily deserialize the "first' friend declaration when deserializing a class
declaration. This PCH a little lazier, and breaks a deserialization cycle that
causes crashes with modules enabled.

llvm-svn: 184904

11 years agoFix PCH bug with member templates of local classes in nontemplate functions.
Faisal Vali [Wed, 26 Jun 2013 02:34:24 +0000 (02:34 +0000)]
Fix PCH bug with member templates of local classes in nontemplate functions.

As noted by Richard in the post:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry
into PendingLocalImplicitInstantiations, since local instantiations
should only occur within the context of other instantiations:

int foo(double y) {
   struct Lambda {
      template<class T> T operator()(T t) const { return t; };
   } lambda;
   return lambda(y);
}

Hence the attached code does the following:
  1) In MarkFunctionReferenced, check if ActiveInstantiations.size()
      is non-zero before adding to PendingLocalImplicitInstantiations.
  2) In InstantiateFunctionDefinition, we swap out/in
      PendingLocalImplicitInstantiations so that only those
      pending local instantiations that are added during the instantiation
      of the current function are instantiated recursively.

llvm-svn: 184903

11 years agoRemove PathV1.h usage from ToolChains.cpp.
Rafael Espindola [Wed, 26 Jun 2013 02:13:00 +0000 (02:13 +0000)]
Remove PathV1.h usage from ToolChains.cpp.

llvm-svn: 184902

11 years agoRemove ifdef LLDB_CONFIGURATION_DEBUG directives around the formatter
Jason Molenda [Wed, 26 Jun 2013 01:51:03 +0000 (01:51 +0000)]
Remove ifdef LLDB_CONFIGURATION_DEBUG directives around the formatter
cache ivars/methods.

llvm-svn: 184901

11 years agoRemove the #define USE_CACHE since the formatters cache has been operational for...
Enrico Granata [Wed, 26 Jun 2013 01:03:38 +0000 (01:03 +0000)]
Remove the #define USE_CACHE since the formatters cache has been operational for a while now and has not caused issues that warrant disabling it
Also, print the cache hits statistics if the log is in debugging mode vs. LLDB being a debug build - this should make it easier to gather useful metrics on cache success rate for real users

llvm-svn: 184900

11 years ago<rdar://problem/14266578>
Enrico Granata [Wed, 26 Jun 2013 00:36:27 +0000 (00:36 +0000)]
<rdar://problem/14266578>

"command source" was not properly setting the stop-on-error option

llvm-svn: 184899

11 years ago<rdar://problem/14243761>
Enrico Granata [Wed, 26 Jun 2013 00:31:21 +0000 (00:31 +0000)]
<rdar://problem/14243761>

The argument to -w (--category) in type * list is a regular expression
This caused unhappiness with the gnu-libstdc++ category because of the double ++

Now we check for exact textual match as-well-as regexp matching

llvm-svn: 184898

11 years agodbgs() << Instruction doesn't print a newline on the end any more. Update these
Nick Lewycky [Wed, 26 Jun 2013 00:30:18 +0000 (00:30 +0000)]
dbgs() << Instruction doesn't print a newline on the end any more. Update these
debug statements to add a missing newline. Also canonicalize to '\n' instead of
"\n"; the latter calls a function with a loop the former does not.

llvm-svn: 184897

11 years agoRun clang-format on lib/Format code after r184894. No other changes.
Nico Weber [Wed, 26 Jun 2013 00:30:14 +0000 (00:30 +0000)]
Run clang-format on lib/Format code after r184894. No other changes.

llvm-svn: 184896

11 years agoFix a use after free I introduced and that Bill caught in code review
Chandler Carruth [Wed, 26 Jun 2013 00:26:16 +0000 (00:26 +0000)]
Fix a use after free I introduced and that Bill caught in code review
(thanks!) by deferring the free of the filename until we finish writing
the coverage data to that file.

Bill, let me know if you'd prefer a different approach!

llvm-svn: 184895

11 years agoFormatter: Don't put a space after parameter-naming block comments.
Nico Weber [Wed, 26 Jun 2013 00:15:19 +0000 (00:15 +0000)]
Formatter: Don't put a space after parameter-naming block comments.

Before: f(a, b, /*doFoo=*/ false);
Now: f(a, b, /*doFoo=*/false);

This style is a lot more common:
$ ack -H '=\*\/\w' lib | wc -l
    1281
$ ack -H '=\*\/ \w' lib | wc -l
      70

llvm-svn: 184894

11 years ago<rdar://problem/14266411>
Enrico Granata [Tue, 25 Jun 2013 23:43:28 +0000 (23:43 +0000)]
<rdar://problem/14266411>

The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened

This checkin changes that:
- SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string
- script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed

If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior

llvm-svn: 184893

11 years agos/C++0x/C++11/
Adrian Prantl [Tue, 25 Jun 2013 23:42:37 +0000 (23:42 +0000)]
s/C++0x/C++11/

llvm-svn: 184892

11 years agoMerge isReachable into isBackedge.
Jakob Stoklund Olesen [Tue, 25 Jun 2013 23:32:10 +0000 (23:32 +0000)]
Merge isReachable into isBackedge.

Prefer using RPO.lookup() instead of RPO[] which can mutate the map.

llvm-svn: 184891

11 years agoDon't check for triviality on fields of templated records. We can't know the
Nick Lewycky [Tue, 25 Jun 2013 23:22:23 +0000 (23:22 +0000)]
Don't check for triviality on fields of templated records. We can't know the
answer until after instantiation. Fixes PR16061!

llvm-svn: 184890

11 years agoImplement DR136
David Majnemer [Tue, 25 Jun 2013 23:09:30 +0000 (23:09 +0000)]
Implement DR136

Friend declarations that specify a default argument must be a definition
and the only declaration in the translation unit.

llvm-svn: 184889

11 years agoSLPVectorizer: support slp-vectorization of PHINodes between basic blocks
Nadav Rotem [Tue, 25 Jun 2013 23:04:09 +0000 (23:04 +0000)]
SLPVectorizer: support slp-vectorization of PHINodes between basic blocks

llvm-svn: 184888

11 years agoMake this test properly test both things it's trying to test.
Richard Smith [Tue, 25 Jun 2013 22:37:05 +0000 (22:37 +0000)]
Make this test properly test both things it's trying to test.

llvm-svn: 184887

11 years agoFixed a bug in ClangASTSource where we would return
Sean Callanan [Tue, 25 Jun 2013 22:36:17 +0000 (22:36 +0000)]
Fixed a bug in ClangASTSource where we would return
the target of a typedef when asked for a typedef.

llvm-svn: 184886

11 years agoMissing test update from r184884.
Richard Smith [Tue, 25 Jun 2013 22:22:42 +0000 (22:22 +0000)]
Missing test update from r184884.

llvm-svn: 184885

11 years agoPR8302: Check for shadowing a template parameter when declaring a template
Richard Smith [Tue, 25 Jun 2013 22:21:36 +0000 (22:21 +0000)]
PR8302: Check for shadowing a template parameter when declaring a template
template parameter.

llvm-svn: 184884

11 years agoDon't try to get the layout of an invalid decl in getDeclAlign.
Matt Beaumont-Gay [Tue, 25 Jun 2013 22:19:15 +0000 (22:19 +0000)]
Don't try to get the layout of an invalid decl in getDeclAlign.

When the decl that we're getting alignment for is a FieldDecl, and the field's
parent record is invalid, skip the actual field alignment calculation (and
return 1-byte alignment in the general case).

Also, assert in in getASTRecordLayout that the decl is valid. This was
inspired by PR16292; see also r184581 and r184751.

llvm-svn: 184883

11 years agoImplement DR21
David Majnemer [Tue, 25 Jun 2013 22:08:55 +0000 (22:08 +0000)]
Implement DR21

A default template-argument shall not be specified in a friend template
declaration.

Interestingly, we properly handled default template arguments on friend
class members but not on just friend classes.

llvm-svn: 184882

11 years agoPrint block frequencies in decimal form.
Jakob Stoklund Olesen [Tue, 25 Jun 2013 21:57:38 +0000 (21:57 +0000)]
Print block frequencies in decimal form.

This is easier to read than the internal fixed-point representation.

If anybody knows the correct algorithm for converting fixed-point
numbers to base 10, feel free to fix it.

llvm-svn: 184881

11 years agoR600: Use new getNamedOperandIdx function generated by TableGen
Tom Stellard [Tue, 25 Jun 2013 21:22:18 +0000 (21:22 +0000)]
R600: Use new getNamedOperandIdx function generated by TableGen

llvm-svn: 184880

11 years agoTableGen: Generate a function for getting operand indices based on their defined...
Tom Stellard [Tue, 25 Jun 2013 21:22:09 +0000 (21:22 +0000)]
TableGen: Generate a function for getting operand indices based on their defined names

This patch modifies TableGen to generate a function in
${TARGET}GenInstrInfo.inc called getNamedOperandIdx(), which can be used
to look up indices for operands based on their names.

In order to activate this feature for an instruction, you must set the
UseNamedOperandTable bit.

For example, if you have an instruction like:

def ADD : TargetInstr <(outs GPR:$dst), (ins GPR:$src0, GPR:$src1)>;

You can look up the operand indices using the new function, like this:

Target::getNamedOperandIdx(Target::ADD, Target::OpName::dst)  => 0
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src0) => 1
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src1) => 2

The operand names are case sensitive, so $dst and $DST are considered
different operands.

This change is useful for R600 which has instructions with a large number
of operands, many of which model single bit instruction configuration
values.  These configuration bits are common across most instructions,
but may have a different operand index depending on the instruction type.
It is useful to have a convenient way to look up the operand indices,
so these bits can be generically set on any instruction.

llvm-svn: 184879

11 years agoDon't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.
Bill Wendling [Tue, 25 Jun 2013 21:08:40 +0000 (21:08 +0000)]
Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.

llvm-svn: 184878

11 years agoFix undefined behaviour in data formatter test -- ensure char* null-terminated
Daniel Malea [Tue, 25 Jun 2013 20:54:24 +0000 (20:54 +0000)]
Fix undefined behaviour in data formatter test -- ensure char* null-terminated
so LLDB does not read off the end of the array.

llvm-svn: 184877

11 years agoUpdate version sscanf to match FreeBSD release info
Ed Maste [Tue, 25 Jun 2013 20:50:07 +0000 (20:50 +0000)]
Update version sscanf to match FreeBSD release info

Release strings are of the form 9.1-RELEASE-p3 or 10.0-CURRENT.

llvm-svn: 184876

11 years agoFix null pointer dereference if we redeclare an unprototyped function. Patch by
Richard Smith [Tue, 25 Jun 2013 20:34:17 +0000 (20:34 +0000)]
Fix null pointer dereference if we redeclare an unprototyped function. Patch by
WenHan Gu!

llvm-svn: 184875

11 years agoSkip dsym tests also on FreeBSD
Ed Maste [Tue, 25 Jun 2013 19:59:56 +0000 (19:59 +0000)]
Skip dsym tests also on FreeBSD

llvm-svn: 184874

11 years agoFix a comment.
Nico Weber [Tue, 25 Jun 2013 19:25:12 +0000 (19:25 +0000)]
Fix a comment.

llvm-svn: 184873

11 years agoX86 cost model: Vectorizing integer division is a bad idea
Arnold Schwaighofer [Tue, 25 Jun 2013 19:14:09 +0000 (19:14 +0000)]
X86 cost model: Vectorizing integer division is a bad idea

radar://14057959

llvm-svn: 184872

11 years agoSkip tests that hang on FreeBSD
Ed Maste [Tue, 25 Jun 2013 19:11:36 +0000 (19:11 +0000)]
Skip tests that hang on FreeBSD

There's still significant work to do in the FreeBSD port, so no point
in a pr for these yet.

llvm-svn: 184871

11 years agoFix SROA to avoid unnecessary scalar conversions for 1-element vectors.
Bob Wilson [Tue, 25 Jun 2013 19:09:50 +0000 (19:09 +0000)]
Fix SROA to avoid unnecessary scalar conversions for 1-element vectors.

When a 1-element vector alloca is promoted, a store instruction can often be
rewritten without converting the value to a scalar and using an insertelement
instruction to stuff it into the new alloca.  This patch just adds a check
to skip that conversion when it is unnecessary.  This turns out to be really
important for some ARM Neon operations where <1 x i64> is used to get around
the fact that i64 is not a legal type.

llvm-svn: 184870

11 years agocpp11-migrate: Really fixing doxygen warning
Edwin Vane [Tue, 25 Jun 2013 19:01:18 +0000 (19:01 +0000)]
cpp11-migrate: Really fixing doxygen warning

Last attempt at this fix was bogus.

llvm-svn: 184869