Commit Graph

160181 Commits

Author SHA1 Message Date
Rafael Espindola d53ffa0a70 Treat aliases as definitions.
This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

llvm-svn: 193200
2013-10-22 21:39:03 +00:00
Quentin Colombet f34568b0af [X86][FastISel] Add a comment to help understanding changes made in r192636.
<rdar://problem/15192473>

llvm-svn: 193199
2013-10-22 21:29:08 +00:00
Matt Arsenault 65864e3182 R600/SI: Don't assert on SCC usage
llvm-svn: 193198
2013-10-22 21:11:31 +00:00
Manman Ren 642a0acce2 Debug Info: code clean up.
Remove unnecessary creation of LexicalScope in collectDeadVariables.
The created LexicialScope was only used to get isAbstractScope, which
should be false from the creation:
"new LexicalScope(NULL, DIDescriptor(SP), NULL, false);".

We can also remove a DenseMap that holds the created LexicalScopes.

llvm-svn: 193196
2013-10-22 20:59:19 +00:00
Rui Ueyama 9a02765bc3 [PECOFF] Add /manifestfile command line option.
/manifestfile:<path> specifies an alternative manifest file output path.
Default is "<output-path>.manifest" where <output-path> is the executable's
path.

llvm-svn: 193195
2013-10-22 20:53:07 +00:00
David Blaikie 1e412eaa72 Whitespace
llvm-svn: 193194
2013-10-22 20:34:30 +00:00
David Blaikie 5ebc54d9ea DIEHashing: Provide an assert for unreachable functionality regarding friends.
Since (as of r190716) Clang no longer emits debug info for C++ friend
declarations (and it seems GCC never has/does, which was the motivation
for the Clang change), there's no actual reachable case for implementing
the part of DWARF 4, Section 7.27 part 5 that pertains to friends.

Leave an assert here so that if/when we do have a client producing
friends and using type units, we can fill in the gap and add appropriate
(unit and feature) tests.

llvm-svn: 193193
2013-10-22 20:28:55 +00:00
Bob Wilson 868e6e339f llvm-cov: Use uint32_t for loop variables to be more consistent.
The loop bounds here are uint32_t variables, so it makes sense for the
loop variables to have the same type.

Patch by Yuchen Wu!

llvm-svn: 193192
2013-10-22 20:02:36 +00:00
Sean Callanan 13b4ef2dba Simplified the code that materializes a variable,
obviating the need to create a new ValueObject.

llvm-svn: 193191
2013-10-22 20:01:17 +00:00
Bob Wilson 00928bcb72 llvm-cov: fix a typo and rename a variable.
Rename Size to EndPos, which makes more sense because the variable
stores the last location of the blocks.

Patch by Yuchen Wu!

llvm-svn: 193189
2013-10-22 19:54:32 +00:00
Rafael Espindola 208b5c0fa5 New fix for pr17535.
This is a fixed version of r193161. In order to handle

    void foo() __attribute__((alias("bar")));
    void bar() {}
    void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

llvm-svn: 193188
2013-10-22 19:26:13 +00:00
Manman Ren be38b9e15f _mm_extract_epi16: use "& 7" when index is out of bound.
This is in line with implementation of _mm_extract_pi16.
rdar://15250497

llvm-svn: 193187
2013-10-22 19:24:42 +00:00
Rui Ueyama 7c5bc2fc2b Factor out into a separate function. No functionality change.
llvm-svn: 193186
2013-10-22 19:01:47 +00:00
Tim Northover 08a8660260 ARM: provide diagnostics on more writeback LDM/STM instructions
The set of circumstances where the writeback register is allowed to be in the
list of registers is rather baroque, but I think this implements them all on
the assembly parsing side.

For disassembly, we still warn about an ARM-mode LDM even if the architecture
revision is < v7 (the required architecture information isn't available). It's
a silly instruction anyway, so hopefully no-one will mind.

rdar://problem/15223374

llvm-svn: 193185
2013-10-22 19:00:39 +00:00
Jordan Rose 476bbb0252 [analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.
Some of the shared compiler/linker flags start with -m, so they've been
getting passed to the compiler only since r180073. Now, the -m* wildcard
is processed after the shared flags and the ignored flags.

Found by Laszlo Nagy!

llvm-svn: 193184
2013-10-22 18:55:18 +00:00
Tom Stellard debb4cf5ea R600/SI: Use llvm_unreachable() for an always false assert
llvm-svn: 193183
2013-10-22 18:42:03 +00:00
Tom Stellard 8be4dd234a R600/SI: Fix warning on non-asserts build
llvm-svn: 193180
2013-10-22 18:31:45 +00:00
Tom Stellard 26a3b67b3b R600: Simplify handling of private address space
The AMDGPUIndirectAddressing pass was previously responsible for
lowering private loads and stores to indirect addressing instructions.
However, this pass was buggy and way too complicated.  The only
advantage it had over the new simplified code was that it saved one
instruction per direct write to private memory.  This optimization
likely has a minimal impact on performance, and we may be able
to duplicate it using some other transformation.

For the private address space, we now:
1. Lower private loads/store to Register(Load|Store) instructions
2. Reserve part of the register file as 'private memory'
3. After regalloc lower the Register(Load|Store) instructions to
   MOV instructions that use indirect addressing.

llvm-svn: 193179
2013-10-22 18:19:10 +00:00
Tom Stellard c460b0dcf1 R600: Remove unused InstrInfo::getMovImmInstr() function
llvm-svn: 193178
2013-10-22 18:19:01 +00:00
Manman Ren a1ce9891ac Simplify testing case (Thanks Rafael for the testing case).
llvm-svn: 193177
2013-10-22 18:15:50 +00:00
Timur Iskhodzhanov 827365ea8f Use GEPs correctly when adjusting this in MicrosoftCXXABI
Reviewed at http://llvm-reviews.chandlerc.com/D1977

llvm-svn: 193176
2013-10-22 18:15:24 +00:00
David Blaikie d70a055394 DWARF type hashing: pointers to members
Includes a test case/FIXME demonstrating a bug/limitation in pointer to
member hashing. To be honest I'm not sure why we don't just always use
summary hashing for referenced types... but perhaps I'm missing
something.

llvm-svn: 193175
2013-10-22 18:14:41 +00:00
Chandler Carruth b3b8ea8007 Revert r193073 and the attempt to fix it in r193170.
This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

llvm-svn: 193174
2013-10-22 18:07:04 +00:00
Rui Ueyama 23c5a3fbec [PECOFF] /manifestuac option is case insensitive.
llvm-svn: 193173
2013-10-22 17:56:55 +00:00
Bob Wilson 68bf30a8b4 Fix llvm-cov counts to be 64-bit integers to avoid overflows.
Line counts in llvm-cov are read in as 64-bit integers but were being truncated
to 32-bit in collectLineCounts(), which caused overflow for large counts.
This patch fixes all counts to be uint64_t.

Patch by Yuchen Wu!

llvm-svn: 193172
2013-10-22 17:43:47 +00:00
Rui Ueyama 28d0f60c48 [PECOFF] Fix /manifestuac handling.
uiAccess argument's type is not really boolean. It's string.

llvm-svn: 193171
2013-10-22 17:42:42 +00:00
Serge Pavlov 65d9468435 Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'
This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement
to implement their 'foreach' macro. To enable build of QT, this fix reenables
break but only in 'for' statement specifier and only in the third expression.

llvm-svn: 193170
2013-10-22 17:14:47 +00:00
Howard Hinnant 517cb27c43 Move local Db type out to namespace scope.
llvm-svn: 193169
2013-10-22 16:45:48 +00:00
Daniel Jasper b8f6168218 clang-format: Fix ObjC literal indentation in Google style.
Style guide demands a two-space indent.

Before:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

After:
  NSArray *arguments = @[
    kind == kUserTicket ? @"--user-store" : @"--system-store",
    @"--print-tickets",
    @"--productid",
    @"com.google.Chrome"
  ];

llvm-svn: 193168
2013-10-22 15:45:58 +00:00
Daniel Jasper 1db6c38687 clang-format: Improve formatting of ObjC array literals.
Before:
  NSArray *arguments =
      @[ kind == kUserTicket ? @"--user-store" : @"--system-store",
         @"--print-tickets", @"--productid", @"com.google.Chrome" ];
After:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

This fixes llvm.org/PR15231.

llvm-svn: 193167
2013-10-22 15:30:28 +00:00
Rafael Espindola 69f531065c Use early return. No functionality change.
llvm-svn: 193166
2013-10-22 15:18:22 +00:00
Benjamin Kramer 57f30bce64 Speling fixes.
llvm-svn: 193165
2013-10-22 15:18:03 +00:00
Timur Iskhodzhanov 8b14242fe5 Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
llvm-svn: 193164
2013-10-22 14:50:20 +00:00
Evgeniy Stepanov 2794c47243 [msan] Drain allocator cache when leaving thread.
llvm-svn: 193163
2013-10-22 14:31:30 +00:00
Rafael Espindola 6956d58722 Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"
This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

Looks like we have to fix pr17639 first :-(

llvm-svn: 193162
2013-10-22 14:23:09 +00:00
Rafael Espindola 0fad0d7724 This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject

void f1(void) __attribute__((alias("g1")));

This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.

llvm-svn: 193161
2013-10-22 13:51:06 +00:00
Alp Toker acf49f31b6 Fix the -Werror -Wpedantic clang selfhost build
This is a stopgap fix for cast warnings introduced in r192864.

A proper fix should be investigated by the author when possible.

llvm-svn: 193160
2013-10-22 12:30:55 +00:00
Deepak Panickal d66b50c96c Fixes to get LLDB building on Windows again.
llvm-svn: 193159
2013-10-22 12:27:43 +00:00
Evgeniy Stepanov 0229c09d43 [sanitizer] Intercept initgroups.
llvm-svn: 193158
2013-10-22 12:24:48 +00:00
Matheus Almeida eb68d9d985 [mips][msa] Direct Object Emission support for conditional branches.
These branches have a 16-bit offset (R_MIPS_PC16).

List of conditional branch instructions:
bnz.{b,h,w,d}
bnz.v
bz.{b,h,w,d}
bz.v

llvm-svn: 193157
2013-10-22 09:43:32 +00:00
Elena Demikhovsky 1f3ed4169c AVX-512: aligned / unaligned load and store for 512-bit integer vectors.
llvm-svn: 193156
2013-10-22 09:19:28 +00:00
Alp Toker fd4c66a5b0 Fix typo in variable name
llvm-svn: 193155
2013-10-22 09:11:45 +00:00
Alp Toker 5f6b8acf1d Fix comment typo
llvm-svn: 193154
2013-10-22 09:00:49 +00:00
Manuel Klimek f6fd3d3fcf Remove incorrect assert.
If we run into the second preprocessor branch chain, the first branch
chain might have already set the maximum branch count on that level to
something > 0.

Fixes PR17645.

llvm-svn: 193153
2013-10-22 08:27:19 +00:00
Bill Wendling 7855b38c0e Add testcase for PR3168. It was fixed over time.
PR3168

llvm-svn: 193152
2013-10-22 08:23:03 +00:00
Daniel Jasper 97da9178ce Allow a header to be part of multiple modules.
This patch changes two things:

a) Allow a header to be part of multiple modules. The reasoning is that
in existing codebases that have a module-like build system, the same
headers might be used in several build targets. Simple reasons might be
that they defined different classes that are declared in the same
header. Supporting a header as a part of multiple modules will make the
transistion easier for those cases. A later step in clang can then
determine whether the two modules are actually compatible and can be
merged and error out appropriately. The later check is similar to what
needs to be done for template specializations anyway.

b) Allow modules to be stored in a directory tree separate from the
headers they describe.

Review: http://llvm-reviews.chandlerc.com/D1951
llvm-svn: 193151
2013-10-22 08:09:47 +00:00
Wan Xiaofei 2f8dc08b8c Using FoldingSet in SelectionDAG::getVTList.
VTList has a long life cycle through the module and getVTList is frequently called. In current getVTList, sequential search over a std::vector is used, this is inefficient in big module.
This patch use FoldingSet to implement hashing mechanism when searching.

Reviewer: Nadav Rotem
Test    : Pass unit tests & LNT test suite

llvm-svn: 193150
2013-10-22 08:02:02 +00:00
Anders Waldenborg 47b3bd3fbb llvm-c: Add LLVMPrintTypeToString
Differential Revision: http://llvm-reviews.chandlerc.com/D1963

llvm-svn: 193149
2013-10-22 06:58:34 +00:00
Bob Wilson 3461bedbfd Change llvm-cov output formatting to be more similar to gcov.
- Replaced tabs with proper padding
- print() takes two arguments, which are the GCNO and GCDA filenames
- Files are listed at the top of output, appended by line 0
- Stripped strings of trailing \0s
- Removed last two lines of whitespace in output

Patch by Yuchen Wu!

llvm-svn: 193148
2013-10-22 05:09:41 +00:00
Andrew Trick d5990ad9b6 Clarify SCEV comments.
We handle for(i=n; i>0; i -= s) by canonicalizing within SCEV to for(i=-n; i<0; i += s).

llvm-svn: 193147
2013-10-22 05:09:40 +00:00