platform/upstream/llvm.git
11 years agoMove -mfpmath handling to -cc1 and implement it for x86.
Rafael Espindola [Wed, 21 Aug 2013 21:59:03 +0000 (21:59 +0000)]
Move -mfpmath handling to -cc1 and implement it for x86.

The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

llvm-svn: 188939

11 years agoAnalysis: Add support for MS specific printf format specifiers
David Majnemer [Wed, 21 Aug 2013 21:54:46 +0000 (21:54 +0000)]
Analysis: Add support for MS specific printf format specifiers

Summary: Adds support for %I, %I32 and %I64.

Reviewers: hans, jordan_rose, rnk, majnemer

Reviewed By: majnemer

CC: cfe-commits, cdavis5x
Differential Revision: http://llvm-reviews.chandlerc.com/D1456

llvm-svn: 188937

11 years agoTeach BaseIndexOffset::match to identify base pointers in loops.
Juergen Ributzka [Wed, 21 Aug 2013 21:53:38 +0000 (21:53 +0000)]
Teach BaseIndexOffset::match to identify base pointers in loops.

The small utility function that pattern matches Base + Index +
Offset patterns for loads and stores fails to recognize the base
pointer for loads/stores from/into an array at offset 0 inside a
loop. As a result DAGCombiner::MergeConsecutiveStores was not able
to merge all stores.

This commit fixes the issue by adding an additional pattern match
and also a test case.

Reviewer: Nadav
llvm-svn: 188936

11 years agoADT/Triple: Helper to determine if we are targeting the Windows CRT
David Majnemer [Wed, 21 Aug 2013 21:53:33 +0000 (21:53 +0000)]
ADT/Triple: Helper to determine if we are targeting the Windows CRT

Summary:
This support will be utilized in things like clang to help check printf
format specifiers that are only valid when using the VSCRT.

Reviewers: rnk, asl, chandlerc

Reviewed By: chandlerc

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1455

llvm-svn: 188935

11 years agoRemoved unnecessary asserts.
Aaron Ballman [Wed, 21 Aug 2013 21:38:46 +0000 (21:38 +0000)]
Removed unnecessary asserts.

Patch thanks to Christian Wailes!

llvm-svn: 188934

11 years agoBasic unit tests for PointerUnion
David Blaikie [Wed, 21 Aug 2013 21:30:23 +0000 (21:30 +0000)]
Basic unit tests for PointerUnion

llvm-svn: 188933

11 years agoReorder headers according to lint.
Bill Wendling [Wed, 21 Aug 2013 21:14:19 +0000 (21:14 +0000)]
Reorder headers according to lint.

llvm-svn: 188932

11 years agoTBAA: add testing case to check typedef can alias.
Manman Ren [Wed, 21 Aug 2013 21:00:10 +0000 (21:00 +0000)]
TBAA: add testing case to check typedef can alias.

llvm-svn: 188931

11 years agoDon't use mangleCXXRTTIName in TBAA for C code.
Manman Ren [Wed, 21 Aug 2013 20:58:45 +0000 (20:58 +0000)]
Don't use mangleCXXRTTIName in TBAA for C code.

With r185721, calling mangleCXXRTTIName on C code will cause crashes.
This commit fixes crashes on C testing cases when turning on struct-path TBAA.

For C code, we simply use the Decl name without the context. This can
cause two different structs having the same name, and may cause inaccurate but
conservative alias results.

llvm-svn: 188930

11 years agoUpdate testing case to use FileCheck instead of grep.
Manman Ren [Wed, 21 Aug 2013 20:53:05 +0000 (20:53 +0000)]
Update testing case to use FileCheck instead of grep.

llvm-svn: 188929

11 years agoRemove use of forbidden 'iostream' header.
Bill Wendling [Wed, 21 Aug 2013 20:36:42 +0000 (20:36 +0000)]
Remove use of forbidden 'iostream' header.

Also obsessively reorder the headers to be in something closer to alphabetical order.

llvm-svn: 188928

11 years agoAdd missing ']'.
Bill Wendling [Wed, 21 Aug 2013 20:12:27 +0000 (20:12 +0000)]
Add missing ']'.

llvm-svn: 188927

11 years agoTeach InstCombine about address spaces
Matt Arsenault [Wed, 21 Aug 2013 19:53:10 +0000 (19:53 +0000)]
Teach InstCombine about address spaces

llvm-svn: 188926

11 years agoMC CFG: Remap enough for data too, analoguous to r188873.
Ahmed Bougacha [Wed, 21 Aug 2013 19:40:28 +0000 (19:40 +0000)]
MC CFG: Remap enough for data too, analoguous to r188873.

llvm-svn: 188925

11 years agoStyle cleanup following David's review for r188876.
Ahmed Bougacha [Wed, 21 Aug 2013 19:40:25 +0000 (19:40 +0000)]
Style cleanup following David's review for r188876.

llvm-svn: 188924

11 years agoAdd testcase for r188873: MCTextAtom boundaries.
Ahmed Bougacha [Wed, 21 Aug 2013 19:40:22 +0000 (19:40 +0000)]
Add testcase for r188873: MCTextAtom boundaries.

Check that they are correctly computed if the last instruction is
larger than 1 byte.

llvm-svn: 188923

11 years agoObjectibeC migrator. Annotate cf_consumed arguments,
Fariborz Jahanian [Wed, 21 Aug 2013 19:37:47 +0000 (19:37 +0000)]
ObjectibeC migrator. Annotate cf_consumed arguments,
as reported by static analyer API with CF_CONSUMED.

llvm-svn: 188922

11 years ago[CMake] Automatically pick up subdirectories in llvm/tools as 'external projects...
Argyrios Kyrtzidis [Wed, 21 Aug 2013 19:13:44 +0000 (19:13 +0000)]
[CMake] Automatically pick up subdirectories in llvm/tools as 'external projects' if they contain a 'CMakeLists.txt' file.

Allow CMake to pick up external projects in llvm/tools without the need to modify the "llvm/tools/CMakeLists.txt" file.
This makes it easier to work with projects that live in other repositories, without needing to specify each one in "llvm/tools/CMakeLists.txt".

llvm-svn: 188921

11 years agoFix the end sourcelocation of the call expression in a member access when
Nick Lewycky [Wed, 21 Aug 2013 19:09:44 +0000 (19:09 +0000)]
Fix the end sourcelocation of the call expression in a member access when
recovering by adding empty parenthesis. Fixes PR16676!

llvm-svn: 188920

11 years agoAdd test for bitcast array ptrs with address spaces
Matt Arsenault [Wed, 21 Aug 2013 19:09:28 +0000 (19:09 +0000)]
Add test for bitcast array ptrs with address spaces

llvm-svn: 188919

11 years agoRevert r188863 which could propose wrong fixits for multibyte character literals.
Nick Lewycky [Wed, 21 Aug 2013 18:57:51 +0000 (18:57 +0000)]
Revert r188863 which could propose wrong fixits for multibyte character literals.

llvm-svn: 188918

11 years agoAdd enforce known alignment test with address space
Matt Arsenault [Wed, 21 Aug 2013 18:54:53 +0000 (18:54 +0000)]
Add enforce known alignment test with address space

llvm-svn: 188917

11 years agoUse attribute helper function
Matt Arsenault [Wed, 21 Aug 2013 18:54:50 +0000 (18:54 +0000)]
Use attribute helper function

llvm-svn: 188916

11 years agoFix typo
Matt Arsenault [Wed, 21 Aug 2013 18:54:47 +0000 (18:54 +0000)]
Fix typo

llvm-svn: 188915

11 years agoObjectiveC migrator: until we have beter understanding of
Fariborz Jahanian [Wed, 21 Aug 2013 18:49:03 +0000 (18:49 +0000)]
ObjectiveC migrator: until we have beter understanding of
setter/getter implementations, migrate them to
nonatomic properties.

llvm-svn: 188914

11 years agoRemove dead code.
Rafael Espindola [Wed, 21 Aug 2013 18:13:43 +0000 (18:13 +0000)]
Remove dead code.

setFeatureEnabled is never called with "32" or "64". The driver never passes it
and mips' getDefaultFeatures sets the Features map directly.

llvm-svn: 188913

11 years agoClean up some documentation.
Greg Clayton [Wed, 21 Aug 2013 18:13:29 +0000 (18:13 +0000)]
Clean up some documentation.

llvm-svn: 188912

11 years agoA minor change for an obvous problem caused by r188451:
Hao Liu [Wed, 21 Aug 2013 17:47:53 +0000 (17:47 +0000)]
A minor change for an obvous problem caused by r188451:
        def imm0_63 : Operand<i32>, ImmLeaf<i32, [{ return Imm >= 0 && Imm < 63;}]>{
As it seems Imm <63 should be Imm <= 63. ImmLeaf is used in pattern match, but there is already a function check the shift amount range, so just remove ImmLeaf. Also add a test to check 63.

llvm-svn: 188911

11 years agoMove the logic for selecting the last feature in the command line to the driver.
Rafael Espindola [Wed, 21 Aug 2013 17:34:32 +0000 (17:34 +0000)]
Move the logic for selecting the last feature in the command line to the driver.

This is a partial revert of r188817 now that the driver handles -target-feature
in a single place.

llvm-svn: 188910

11 years ago[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::Initiali...
Timur Iskhodzhanov [Wed, 21 Aug 2013 17:33:16 +0000 (17:33 +0000)]
[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::InitializeVTablePointer[s]

llvm-svn: 188909

11 years agoAdd -mcpu to two X86 tests.
Joey Gouly [Wed, 21 Aug 2013 17:14:31 +0000 (17:14 +0000)]
Add -mcpu to two X86 tests.

These tests are failing on Haswell CPUs due to different instruction selection.

llvm-svn: 188908

11 years agoRemove redundant file.
Hafiz Abid Qadeer [Wed, 21 Aug 2013 17:14:25 +0000 (17:14 +0000)]
Remove redundant file.

llvm-svn: 188907

11 years agoCentralize the handling of -target-feature.
Rafael Espindola [Wed, 21 Aug 2013 16:39:20 +0000 (16:39 +0000)]
Centralize the handling of -target-feature.

No functionality change other than changing the order of -target-feature
relative to other -cc1 command line arguments.

llvm-svn: 188906

11 years agoTweak gnu-flags.c test for z, where globals have 2-byte alignment by default
Richard Sandiford [Wed, 21 Aug 2013 16:37:37 +0000 (16:37 +0000)]
Tweak gnu-flags.c test for z, where globals have 2-byte alignment by default

llvm-svn: 188905

11 years agoAdd basic YAML MC CFG testcase.
Ahmed Bougacha [Wed, 21 Aug 2013 16:13:25 +0000 (16:13 +0000)]
Add basic YAML MC CFG testcase.

Drive-by llvm-objdump cleanup (don't hardcode ToolName).

llvm-svn: 188904

11 years agoUnix/Process.inc: Revert r72332, "Work around a page size issue on Cygwin."
NAKAMURA Takumi [Wed, 21 Aug 2013 13:47:12 +0000 (13:47 +0000)]
Unix/Process.inc: Revert r72332, "Work around a page size issue on Cygwin."

Offset in mmap(3) should be aligned to gepagesize(), 64k, or mmap(3) would fail.

TODO: Invetigate places where 4096 would be required as pagesize, or 4096 would satisfy.
llvm-svn: 188903

11 years agoDon't disable SSE4A when disabling AVX.
Rafael Espindola [Wed, 21 Aug 2013 13:28:02 +0000 (13:28 +0000)]
Don't disable SSE4A when disabling AVX.

Thanks for Craig Topper for noticing it.

llvm-svn: 188902

11 years agoMake "mov" work for all Thumb2 MOV encodings
Mihai Popa [Wed, 21 Aug 2013 13:14:58 +0000 (13:14 +0000)]
Make "mov" work for all Thumb2 MOV encodings

According to the ARM specification, "mov" is a valid mnemonic for all Thumb2 MOV encodings.
To achieve this, the patch adds one instruction alias with a special range condition to avoid collision with the Thumb1 MOV.

llvm-svn: 188901

11 years agoSema: Use the right type for PredefinedExpr when it's in a lambda.
Benjamin Kramer [Wed, 21 Aug 2013 11:45:27 +0000 (11:45 +0000)]
Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

llvm-svn: 188900

11 years agoAVX-512: Added SHIFT instructions.
Elena Demikhovsky [Wed, 21 Aug 2013 09:36:02 +0000 (09:36 +0000)]
AVX-512: Added SHIFT instructions.

llvm-svn: 188899

11 years ago[SystemZ] Define remainig *MUL_LOHI patterns
Richard Sandiford [Wed, 21 Aug 2013 09:34:56 +0000 (09:34 +0000)]
[SystemZ] Define remainig *MUL_LOHI patterns

The initial port used MLG(R) for i64 UMUL_LOHI but left the other three
combinations as not-legal-or-custom.  Although 32x32->{32,32}
multiplications exist, they're not as quick as doing a normal 64-bit
multiplication, so it didn't seem like i32 SMUL_LOHI and UMUL_LOHI
would be useful.  There's also no direct instruction for i64 SMUL_LOHI,
so it needs to be implemented in terms of UMUL_LOHI.

However, not defining these patterns means that we don't convert
division by a constant into multiplication, so this patch fills
in the other cases.  The new i64 SMUL_LOHI sequence is simpler
than the one that we used previously for 64x64->128 multiplication,
so int-mul-08.ll now tests the full sequence.

llvm-svn: 188898

11 years agoMCFunction.h: Prune \returns to fix a warning in r188881. [-Wdocumentation]
NAKAMURA Takumi [Wed, 21 Aug 2013 09:34:22 +0000 (09:34 +0000)]
MCFunction.h: Prune \returns to fix a warning in r188881. [-Wdocumentation]

llvm-svn: 188897

11 years ago[mips][msa] Matheus Almeida pointed out a silly mistake in r188893. Fixed it.
Daniel Sanders [Wed, 21 Aug 2013 09:09:52 +0000 (09:09 +0000)]
[mips][msa] Matheus Almeida pointed out a silly mistake in r188893. Fixed it.

I accidentally changed the encoding of the MSA registers to zero instead of 0
to 31. This change restores the encoding the registers had prior to r188893.

This didn't show up in the existing tests because direct-object emission isn't
implemented yet for MSA.

llvm-svn: 188896

11 years ago[SystemZ] Use FI[EDX]BRA for codegen
Richard Sandiford [Wed, 21 Aug 2013 09:04:20 +0000 (09:04 +0000)]
[SystemZ] Use FI[EDX]BRA for codegen

llvm-svn: 188895

11 years ago[SystemZ] Add FI[EDX]BRA
Richard Sandiford [Wed, 21 Aug 2013 08:58:08 +0000 (08:58 +0000)]
[SystemZ] Add FI[EDX]BRA

These are extensions of the existing FI[EDX]BR instructions, but use a spare
bit to suppress inexact conditions.

llvm-svn: 188894

11 years ago[mips][msa] Define registers using foreach
Daniel Sanders [Wed, 21 Aug 2013 08:48:25 +0000 (08:48 +0000)]
[mips][msa] Define registers using foreach

No functional change

llvm-svn: 188893

11 years agoRevert the change that was done to test commit access.
Hafiz Abid Qadeer [Wed, 21 Aug 2013 08:45:54 +0000 (08:45 +0000)]
Revert the change that was done to test commit access.

llvm-svn: 188892

11 years agoclang-format: Indent relative to unary operators.
Daniel Jasper [Wed, 21 Aug 2013 08:39:01 +0000 (08:39 +0000)]
clang-format: Indent relative to unary operators.

Before:
  if (!aaaaaaaaaa(  // break
          aaaaa)) {
  }

After:
  if (!aaaaaaaaaa(  // break
           aaaaa)) {
  }

Also cleaned up formatting using clang-format.

llvm-svn: 188891

11 years agoMC CFG: Add YAML MCModule representation to enable MC CFG testing.
Ahmed Bougacha [Wed, 21 Aug 2013 07:29:02 +0000 (07:29 +0000)]
MC CFG: Add YAML MCModule representation to enable MC CFG testing.

Like yaml ObjectFiles, this will be very useful for testing the MC CFG
implementation (mostly MCObjectDisassembler), by matching the output
with YAML, and for potential users of the MC CFG, by using it as an input.

There isn't much to the actual format, it is just a serialization of the
MCModule class. Of note:
  - Basic block references (pred/succ, ..) are represented by the BB's
    start address.
  - Just as in the MC CFG, instructions are MCInsts with a size.
  - Operands have a prefix representing the type (only register and
    immediate supported here).
  - Instruction opcodes are represented by their names; enum values aren't
    stable, enum names mostly are: usually, a change to a name would need
    lots of changes in the backend anyway.
    Same with registers.

All in all, an example is better than 1000 words, here goes:

A simple binary:

  Disassembly of section __TEXT,__text:
  _main:
  100000f9c:      48 8b 46 08             movq    8(%rsi), %rax
  100000fa0:      0f be 00                movsbl  (%rax), %eax
  100000fa3:      3b 04 25 48 00 00 00    cmpl    72, %eax
  100000faa:      0f 8c 07 00 00 00       jl      7 <.Lend>
  100000fb0:      2b 04 25 48 00 00 00    subl    72, %eax
  .Lend:
  100000fb7:      c3                      ret

And the (pretty verbose) generated YAML:

  ---
  Atoms:
    - StartAddress:    0x0000000100000F9C
      Size:            20
      Type:            Text
      Content:
        - Inst:            MOV64rm
          Size:            4
          Ops:             [ RRAX, RRSI, I1, R, I8, R ]
        - Inst:            MOVSX32rm8
          Size:            3
          Ops:             [ REAX, RRAX, I1, R, I0, R ]
        - Inst:            CMP32rm
          Size:            7
          Ops:             [ REAX, R, I1, R, I72, R ]
        - Inst:            JL_4
          Size:            6
          Ops:             [ I7 ]
    - StartAddress:    0x0000000100000FB0
      Size:            7
      Type:            Text
      Content:
        - Inst:            SUB32rm
          Size:            7
          Ops:             [ REAX, REAX, R, I1, R, I72, R ]
    - StartAddress:    0x0000000100000FB7
      Size:            1
      Type:            Text
      Content:
        - Inst:            RET
          Size:            1
          Ops:             [  ]
  Functions:
    - Name:            __text
      BasicBlocks:
        - Address:         0x0000000100000F9C
          Preds:           [  ]
          Succs:           [ 0x0000000100000FB7, 0x0000000100000FB0 ]
     <snip>
  ...

llvm-svn: 188890

11 years agoMC CFG: Support disassembly at arbitrary addresses in MCObjectDisassembler.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:55 +0000 (07:28 +0000)]
MC CFG: Support disassembly at arbitrary addresses in MCObjectDisassembler.

llvm-svn: 188889

11 years agoMC CFG: Use data structures more appropriate than std::set.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:51 +0000 (07:28 +0000)]
MC CFG: Use data structures more appropriate than std::set.

llvm-svn: 188888

11 years agoMC CFG: Add an MCObjectSymbolizer in the MCObjectDisassembler.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:48 +0000 (07:28 +0000)]
MC CFG: Add an MCObjectSymbolizer in the MCObjectDisassembler.

Used to detect calls to function symbol stubs (future commit).

llvm-svn: 188887

11 years agoMC CFG: Add MCObjectDisassembler Mach-O implementation.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:44 +0000 (07:28 +0000)]
MC CFG: Add MCObjectDisassembler Mach-O implementation.

Supports:
- entrypoint, using LC_MAIN.
- static ctors/dtors, using __mod_{init,exit}_func
- translation between effective and object load address, using
  dyld's VM address slide.

llvm-svn: 188886

11 years agoAdd Mach-O entry_point_command declaration.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:40 +0000 (07:28 +0000)]
Add Mach-O entry_point_command declaration.

llvm-svn: 188885

11 years agoMC CFG: Add "dynamic disassembly" support to MCObjectDisassembler.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:37 +0000 (07:28 +0000)]
MC CFG: Add "dynamic disassembly" support to MCObjectDisassembler.

It can now disassemble code in situations where the effective load
address is different than the load address declared in the object file.
This happens for PIC, hence "dynamic".

llvm-svn: 188884

11 years agoMC CFG: When disassembly is impossible, fallback to data bytes.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:32 +0000 (07:28 +0000)]
MC CFG: When disassembly is impossible, fallback to data bytes.

This is the behavior of sequential disassemblers (llvm-objdump, ...),
when there is no instruction size hint (fixed-length, ...)

While there, also do some minor cleanup.

llvm-svn: 188883

11 years agoMC CFG: Add MCObjectDisassembler support for entrypoint + static ctors.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:29 +0000 (07:28 +0000)]
MC CFG: Add MCObjectDisassembler support for entrypoint + static ctors.

For now, this isn't implemented for any format.

llvm-svn: 188882

11 years agoMC CFG: Split MCBasicBlocks to mirror atom splitting.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:24 +0000 (07:28 +0000)]
MC CFG: Split MCBasicBlocks to mirror atom splitting.

When an MCTextAtom is split, all MCBasicBlocks backed by it are
automatically split, with a fallthrough between both blocks, and
the successors moved to the second block.

llvm-svn: 188881

11 years agoMC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:17 +0000 (07:28 +0000)]
MC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.

While there, do some minor cleanup.

llvm-svn: 188880

11 years agoMC: ObjectSymbolizer can now recognize external function stubs.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:13 +0000 (07:28 +0000)]
MC: ObjectSymbolizer can now recognize external function stubs.

Only implemented in the Mach-O ObjectSymbolizer.
The testcase sadly introduces a new binary.

llvm-svn: 188879

11 years agoMC: Refactor ObjectSymbolizer to make relocation/section info generation lazy.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:07 +0000 (07:28 +0000)]
MC: Refactor ObjectSymbolizer to make relocation/section info generation lazy.

llvm-svn: 188878

11 years agoMC CFG: Add entrypoint address to MCModule.
Ahmed Bougacha [Wed, 21 Aug 2013 07:28:02 +0000 (07:28 +0000)]
MC CFG: Add entrypoint address to MCModule.

llvm-svn: 188877

11 years agoMC CFG: Add more MCFunction container methods (find, empty).
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:59 +0000 (07:27 +0000)]
MC CFG: Add more MCFunction container methods (find, empty).

llvm-svn: 188876

11 years agoMC CFG: Keep pointer to parent MCModule in created MCFunctions.
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:55 +0000 (07:27 +0000)]
MC CFG: Keep pointer to parent MCModule in created MCFunctions.

Also, drive-by cleaning around createFunction.

llvm-svn: 188875

11 years agoMC CFG: Don't insert preds/succs again.
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:50 +0000 (07:27 +0000)]
MC CFG: Don't insert preds/succs again.

llvm-svn: 188874

11 years agoMC CFG: Remap enough for the inserted instruction.
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:47 +0000 (07:27 +0000)]
MC CFG: Remap enough for the inserted instruction.

llvm-svn: 188873

11 years agoMC CFG: uint64_t -> size_t for vector size.
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:44 +0000 (07:27 +0000)]
MC CFG: uint64_t -> size_t for vector size.

llvm-svn: 188872

11 years agoMC CFG: Add a getter for MCDataAtom's data array.
Ahmed Bougacha [Wed, 21 Aug 2013 07:27:40 +0000 (07:27 +0000)]
MC CFG: Add a getter for MCDataAtom's data array.

While there, switch to new-style documentation.

llvm-svn: 188871

11 years agoAbstract out virtual calls and virtual function prologue code generation; implement...
Timur Iskhodzhanov [Wed, 21 Aug 2013 06:25:03 +0000 (06:25 +0000)]
Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft

llvm-svn: 188870

11 years agoDebugInfo: Do not use the DWARF Version for the .debug_pubnames or .debug_pubtypes...
David Majnemer [Wed, 21 Aug 2013 06:13:34 +0000 (06:13 +0000)]
DebugInfo: Do not use the DWARF Version for the .debug_pubnames or .debug_pubtypes version field

Summary:
LLVM would generate DWARF with version 3 in the .debug_pubname and
.debug_pubtypes version fields.  This would lead SGI dwarfdump to fail
parsing the DWARF with (in the instance of .debug_pubnames) would exit
with:
dwarfdump ERROR:  dwarf_get_globals: DW_DLE_PUBNAMES_VERSION_ERROR (123)

This fixes PR16950.

Reviewers: echristo, dblaikie

Reviewed By: echristo

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1454

llvm-svn: 188869

11 years agoSynchronize VEX JIT encoding code with the MCJIT version. Fix a bug in the MCJIT...
Craig Topper [Wed, 21 Aug 2013 05:57:45 +0000 (05:57 +0000)]
Synchronize VEX JIT encoding code with the MCJIT version. Fix a bug in the MCJIT code where CurOp was being incremented even if the operand it was pointing at wasn't used. Maybe only matters if there are any EVEX_K instructions that aren't VEX_4V.

llvm-svn: 188868

11 years agoAdd avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.
Craig Topper [Wed, 21 Aug 2013 05:29:10 +0000 (05:29 +0000)]
Add avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.

llvm-svn: 188867

11 years agoIn LLVM FMA3 operands are dst, src1, src2, src3, however dst is not encoded as it...
Nadav Rotem [Wed, 21 Aug 2013 05:03:10 +0000 (05:03 +0000)]
In LLVM FMA3 operands are dst, src1, src2, src3, however dst is not encoded as it is always src1. This was causing the encoding of the operands to be off by one.

Patch by Chris Bieneman.

llvm-svn: 188866

11 years agoAdd the FMA3 feature in order to test FMA encoding using the old jit.
Nadav Rotem [Wed, 21 Aug 2013 05:02:12 +0000 (05:02 +0000)]
Add the FMA3 feature in order to test FMA encoding using the old jit.

Patch by Chris Bieneman!

llvm-svn: 188865

11 years agoFor Darwin builds, locate tools using xcrun when available.
Bob Wilson [Wed, 21 Aug 2013 04:42:56 +0000 (04:42 +0000)]
For Darwin builds, locate tools using xcrun when available.

The make/platform/darwin_bni.mk file already has similar code but we
apparently neglected to add it to the clang_darwin.mk file.

llvm-svn: 188864

11 years agoIssue fixits replacing invalid character literals with the equivalent \xNN
Nick Lewycky [Wed, 21 Aug 2013 04:10:58 +0000 (04:10 +0000)]
Issue fixits replacing invalid character literals with the equivalent \xNN
escape code.

llvm-svn: 188863

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:01:01 +0000 (04:01 +0000)]
Revert accidental commit.

llvm-svn: 188862

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:00:44 +0000 (04:00 +0000)]
Revert accidental commit.

llvm-svn: 188861

11 years agoReplace avx-512 with avx512f to match llvm side and what gcc patches appear to be...
Craig Topper [Wed, 21 Aug 2013 03:59:22 +0000 (03:59 +0000)]
Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.

llvm-svn: 188860

11 years agoRename mattr names for AVX-512 to from avx-512 -> avx512f, avx-512-pfi -> av512pf...
Craig Topper [Wed, 21 Aug 2013 03:57:57 +0000 (03:57 +0000)]
Rename mattr names for AVX-512 to from avx-512 -> avx512f, avx-512-pfi -> av512pf, avx-512-cdi -> avx512cd, avx-512-eri->avx512er. This matches better with official docs and what gcc patches appearto be using. I didn't touch the has* functions or the feature flag names to avoid change the td and lowering file while commits are still happening.

llvm-svn: 188859

11 years agoLWG 2145 - mark constructor for std::error_category as inline and constexpr. Leave...
Marshall Clow [Wed, 21 Aug 2013 02:57:19 +0000 (02:57 +0000)]
LWG 2145 - mark constructor for std::error_category as inline and constexpr. Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs)

llvm-svn: 188858

11 years agoNo functionality change. Adjust a bunch of formatting issues in this code and
Nick Lewycky [Wed, 21 Aug 2013 02:40:19 +0000 (02:40 +0000)]
No functionality change. Adjust a bunch of formatting issues in this code and
fix a typo in a comment.

llvm-svn: 188857

11 years agoX86TargetMachine.cpp: Clarify to emit GOT in i686-{cygming|win32}-elf for mcjit.
NAKAMURA Takumi [Wed, 21 Aug 2013 02:37:25 +0000 (02:37 +0000)]
X86TargetMachine.cpp: Clarify to emit GOT in i686-{cygming|win32}-elf for mcjit.

I suppose all "lli -use-mcjit i686-*" should require GOT, (and to fail.)

llvm-svn: 188856

11 years agolli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not...
NAKAMURA Takumi [Wed, 21 Aug 2013 02:37:14 +0000 (02:37 +0000)]
lli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not provided.

FIXME: Would it be responsible to provide GOT?
llvm-svn: 188855

11 years agoRemove more uses of 'index' as namespace scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 01:51:19 +0000 (01:51 +0000)]
Remove more uses of 'index' as namespace scope.

Follow up to r188850.

llvm-svn: 188854

11 years agoIf we find an error in the range expression in a range-based for loop, and the
Richard Smith [Wed, 21 Aug 2013 01:40:36 +0000 (01:40 +0000)]
If we find an error in the range expression in a range-based for loop, and the
loop variable has a type containing 'auto', set the declaration to be invalid
(because we couldn't deduce its type) to prevent follow-on errors.

llvm-svn: 188853

11 years agoMove #includes from .h to .cpp file.
Jakub Staszak [Wed, 21 Aug 2013 01:20:11 +0000 (01:20 +0000)]
Move #includes from .h to .cpp file.

llvm-svn: 188852

11 years ago[micromips] Print instruction alias "not" if the last operand of a nor is zero.
Akira Hatanaka [Wed, 21 Aug 2013 01:18:46 +0000 (01:18 +0000)]
[micromips] Print instruction alias "not" if the last operand of a nor is zero.

llvm-svn: 188851

11 years agoAvoid using the 'index' namespace as scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 00:49:25 +0000 (00:49 +0000)]
Avoid using the 'index' namespace as scope.

This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using.

llvm-svn: 188850

11 years agoMove registering the execution of a basic block to the beginning rather than the...
Bill Wendling [Tue, 20 Aug 2013 23:52:00 +0000 (23:52 +0000)]
Move registering the execution of a basic block to the beginning rather than the end.

There are situations which can affect the correctness (or at least expectation)
of the gcov output. For instance, if a call to __gcov_flush() occurs within a
block before the execution count is registered and then the program aborts in
some way, then that block will not be marked as executed. This is not normally
what the user expects.

If we move the code that's registering when a block is executed to the
beginning, we can catch these types of situations.

PR16893

llvm-svn: 188849

11 years ago[mips] Add support for mfhc1 and mthc1.
Akira Hatanaka [Tue, 20 Aug 2013 23:47:25 +0000 (23:47 +0000)]
[mips] Add support for mfhc1 and mthc1.

llvm-svn: 188848

11 years ago[mips] Add support for calling convention CC_MipsO32_FP64, which is used when the
Akira Hatanaka [Tue, 20 Aug 2013 23:38:40 +0000 (23:38 +0000)]
[mips] Add support for calling convention CC_MipsO32_FP64, which is used when the
size of floating point registers is 64-bit.

Test case will be added when support for mfhc1 and mthc1 is added.

llvm-svn: 188847

11 years agoObjectiveC migrator. make sure to embed audited
Fariborz Jahanian [Tue, 20 Aug 2013 23:35:26 +0000 (23:35 +0000)]
ObjectiveC migrator. make sure to embed audited
candidate functions in their CF_IMPLICIT_BRIDGING_ENABLED
pragma before exiting the header file.

llvm-svn: 188846

11 years ago[mips] Remove predicates that were incorrectly or unnecessarily added.
Akira Hatanaka [Tue, 20 Aug 2013 23:21:55 +0000 (23:21 +0000)]
[mips] Remove predicates that were incorrectly or unnecessarily added.

llvm-svn: 188845

11 years agoAdd some constantness.
Jakub Staszak [Tue, 20 Aug 2013 23:04:15 +0000 (23:04 +0000)]
Add some constantness.

llvm-svn: 188844

11 years agoUse -disable-output and to suppress output and don't use a temporary file unless...
Bill Wendling [Tue, 20 Aug 2013 23:00:25 +0000 (23:00 +0000)]
Use -disable-output and to suppress output and don't use a temporary file unless we need one.

llvm-svn: 188843

11 years ago[mips] Define register class FGRH32 for the high half of the 64-bit floating
Akira Hatanaka [Tue, 20 Aug 2013 22:58:56 +0000 (22:58 +0000)]
[mips] Define register class FGRH32 for the high half of the 64-bit floating
point registers. We will need this register class later when we add
definitions for instructions mfhc1 and mthc1. Also, remove sub-register indices
sub_fpeven and sub_fpodd and use sub_lo and sub_hi instead.

llvm-svn: 188842

11 years agoFix include guards.
Jakub Staszak [Tue, 20 Aug 2013 22:52:02 +0000 (22:52 +0000)]
Fix include guards.

llvm-svn: 188841

11 years agoRemove Extension warning for GNU local labels.
Eli Friedman [Tue, 20 Aug 2013 22:44:32 +0000 (22:44 +0000)]
Remove Extension warning for GNU local labels.

We generally don't warn about extensions involving keywords reserved
for the implementation, so we shouldn't warn here either: the
standard doesn't require it, and it doesn't provide useful information
to the user.

llvm-svn: 188840

11 years agoAdd more specific flags for misc GNU extensions.
Eli Friedman [Tue, 20 Aug 2013 22:44:28 +0000 (22:44 +0000)]
Add more specific flags for misc GNU extensions.

This adds the following as subgroups of -Wgnu: -Wgnu-alignof-expression,
-Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-conditional-omitted-operand,
-Wgnu-empty-initializer, -Wgnu-label-as-value, -Wgnu-local-label,
and -Wgnu-statement-expression,

Patch by Peter Lewis.

llvm-svn: 188839