platform/upstream/llvm.git
12 years ago[MachO] Fix use after free.
Michael J. Spencer [Thu, 1 Nov 2012 19:46:06 +0000 (19:46 +0000)]
[MachO] Fix use after free.

llvm-svn: 167245

12 years ago[MachO] Fix uninitialized variables.
Michael J. Spencer [Thu, 1 Nov 2012 19:45:53 +0000 (19:45 +0000)]
[MachO] Fix uninitialized variables.

llvm-svn: 167244

12 years agoUse the relationship models infrastructure to add two relations - getPredOpcode
Pranav Bhandarkar [Thu, 1 Nov 2012 19:13:23 +0000 (19:13 +0000)]
Use the relationship models infrastructure to add two relations - getPredOpcode
and getPredNewOpcode. The first relates non predicated instructions with their
predicated forms and the second relates predicated instructions with their
predicate-new forms.

Patch by Jyotsna Verma!

llvm-svn: 167243

12 years agoMakefile patches from Charles Davis and Daniel Malea (+ one or two tweaks).
Filipe Cabecinhas [Thu, 1 Nov 2012 18:55:16 +0000 (18:55 +0000)]
Makefile patches from Charles Davis and Daniel Malea (+ one or two tweaks).

llvm-svn: 167242

12 years agoobjective-C block meta-data. This patch completes meta-data
Fariborz Jahanian [Thu, 1 Nov 2012 18:32:55 +0000 (18:32 +0000)]
objective-C block meta-data. This patch completes meta-data
generation for captured block variables in arc mode. This includes
inlined version of the meta-data when it can be done. It also includes
severat tests. This is wip. // rdar://12184410.

llvm-svn: 167241

12 years agoMake the FilenameRange of the InclusionDirective callback more accurate,
Argyrios Kyrtzidis [Thu, 1 Nov 2012 17:52:58 +0000 (17:52 +0000)]
Make the FilenameRange of the InclusionDirective callback more accurate,
preserve the macro location of the range end if the filename came from a macro.

Patch by Kim Gräsman!

llvm-svn: 167239

12 years agopeek should set eofbit if sgetc() returns eof.
Howard Hinnant [Thu, 1 Nov 2012 17:32:07 +0000 (17:32 +0000)]
peek should set eofbit if sgetc() returns eof.

llvm-svn: 167238

12 years agoAdd support for generating dwarf debugging info with assembly files
Kevin Enderby [Thu, 1 Nov 2012 17:31:35 +0000 (17:31 +0000)]
Add support for generating dwarf debugging info with assembly files
run through the 'C' preprocessor.  That is pick up the file name
and line numbers from the cpp hash file line comments for the
dwarf file and line numbers tables.

rdar://9275556

llvm-svn: 167237

12 years agoAvoid a crash when trying to parse a line table in the DWARF parser.
Greg Clayton [Thu, 1 Nov 2012 17:28:37 +0000 (17:28 +0000)]
Avoid a crash when trying to parse a line table in the DWARF parser.

llvm-svn: 167236

12 years agoScopDetection: Print line numbers of detected scops
Tobias Grosser [Thu, 1 Nov 2012 16:45:20 +0000 (16:45 +0000)]
ScopDetection: Print line numbers of detected scops

If the flags '-polly-report -g' are given, we print file name and line numbers
for the beginning and end of all detected scops.

  linear-algebra/kernels/gemm/gemm.c:23: Scop start
  linear-algebra/kernels/gemm/gemm.c:42: Scop end
  linear-algebra/kernels/gemm/gemm.c:77: Scop start
  linear-algebra/kernels/gemm/gemm.c:82: Scop end

llvm-svn: 167235

12 years agoRevert multiple adress space changes in Polly
Tobias Grosser [Thu, 1 Nov 2012 16:45:18 +0000 (16:45 +0000)]
Revert multiple adress space changes in Polly

llvm-svn: 167234

12 years agoRichard Smith: This fixes a problem in std::is_constructible for incomplete types...
Howard Hinnant [Thu, 1 Nov 2012 16:32:14 +0000 (16:32 +0000)]
Richard Smith:  This fixes a problem in std::is_constructible for incomplete types, and those types with a user-defined operator,().

llvm-svn: 167233

12 years agoFix an incorrect assert, the LHS can be an LValue.
Rafael Espindola [Thu, 1 Nov 2012 14:32:20 +0000 (14:32 +0000)]
Fix an incorrect assert, the LHS can be an LValue.

llvm-svn: 167232

12 years agollvm/test/lit.cfg: Don't use mcjit to ppc32 yet, not ready.
NAKAMURA Takumi [Thu, 1 Nov 2012 14:28:51 +0000 (14:28 +0000)]
llvm/test/lit.cfg: Don't use mcjit to ppc32 yet, not ready.

Unsupported CPU type!
UNREACHABLE executed at llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:553!

llvm-svn: 167231

12 years ago[asan] don't instrument globals that we've created ourselves (reduces the binary...
Kostya Serebryany [Thu, 1 Nov 2012 13:42:40 +0000 (13:42 +0000)]
[asan] don't instrument globals that we've created ourselves (reduces the binary size a bit)

llvm-svn: 167230

12 years agoAdd a getAddressSpace method to the GEP instruction to mirror that of
Chandler Carruth [Thu, 1 Nov 2012 11:25:55 +0000 (11:25 +0000)]
Add a getAddressSpace method to the GEP instruction to mirror that of
the inttoptr instruction. The conceptual model here is that
'getAddressSpace' refers to the address space of this instruction's
type. It just happens that for GEPs, that is always the same as the
pointer operand's address space. We want both names so that access
patterns can be consistent between different instruction types.

llvm-svn: 167229

12 years agoAdd some consistent doxygen comments for the address space helpers.
Chandler Carruth [Thu, 1 Nov 2012 11:25:28 +0000 (11:25 +0000)]
Add some consistent doxygen comments for the address space helpers.
These clarify that the methods called 'getPointerAddressSpace' apply to
the pointer *operand* of the instruction.

llvm-svn: 167228

12 years agoNormalize the API and doxygen comments for the ptrtoint instruction.
Chandler Carruth [Thu, 1 Nov 2012 11:16:47 +0000 (11:16 +0000)]
Normalize the API and doxygen comments for the ptrtoint instruction.

llvm-svn: 167227

12 years agoRemove a weird static helper from the GEP instruction and just directly
Chandler Carruth [Thu, 1 Nov 2012 10:59:30 +0000 (10:59 +0000)]
Remove a weird static helper from the GEP instruction and just directly
compute the address space in the one place it was used.

Also write the getPointerAddressSpace member in terms of the
getPointerOperandType member.

llvm-svn: 167226

12 years agoAs I'm going to be touching several comments in this file, update the
Chandler Carruth [Thu, 1 Nov 2012 10:46:54 +0000 (10:46 +0000)]
As I'm going to be touching several comments in this file, update the
'@brief' doxygen markup to the now standard '\brief' markup form, in
conformance with the coding standards. This will let me continue to
write new comments in this form without making things inconsistent.

llvm-svn: 167225

12 years agoAdd a test case for PR14233.
Chandler Carruth [Thu, 1 Nov 2012 10:26:36 +0000 (10:26 +0000)]
Add a test case for PR14233.

llvm-svn: 167224

12 years agoTeach Type::getPointerAddressSpace to look through pointer vectors
Chandler Carruth [Thu, 1 Nov 2012 09:37:49 +0000 (09:37 +0000)]
Teach Type::getPointerAddressSpace to look through pointer vectors
politely and document this feature.

This simple API extension then allows us to write all of the
Instructions' address space query methods much more simply. No
functionality change intended here.

llvm-svn: 167223

12 years agoRevert the majority of the next patch in the address space series:
Chandler Carruth [Thu, 1 Nov 2012 09:14:31 +0000 (09:14 +0000)]
Revert the majority of the next patch in the address space series:

r165941: Resubmit the changes to llvm core to update the functions to
         support different pointer sizes on a per address space basis.

Despite this commit log, this change primarily changed stuff outside of
VMCore, and those changes do not carry any tests for correctness (or
even plausibility), and we have consistently found questionable or flat
out incorrect cases in these changes. Most of them are probably correct,
but we need to devise a system that makes it more clear when we have
handled the address space concerns correctly, and ideally each pass that
gets updated would receive an accompanying test case that exercises that
pass specificaly w.r.t. alternate address spaces.

However, from this commit, I have retained the new C API entry points.
Those were an orthogonal change that probably should have been split
apart, but they seem entirely good.

In several places the changes were very obvious cleanups with no actual
multiple address space code added; these I have not reverted when
I spotted them.

In a few other places there were merge conflicts due to a cleaner
solution being implemented later, often not using address spaces at all.
In those cases, I've preserved the new code which isn't address space
dependent.

This is part of my ongoing effort to clean out the partial address space
code which carries high risk and low test coverage, and not likely to be
finished before the 3.2 release looms closer. Duncan and I would both
like to see the above issues addressed before we return to these
changes.

llvm-svn: 167222

12 years agoRevert the series of commits starting with r166578 which introduced the
Chandler Carruth [Thu, 1 Nov 2012 08:07:29 +0000 (08:07 +0000)]
Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
         Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
         since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
         on the address space.
llvm-svn: 167221

12 years ago-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
Richard Smith [Thu, 1 Nov 2012 07:22:08 +0000 (07:22 +0000)]
-fcatch-undefined-behavior: Start checking loads and stores for null pointers.
We want the diagnostic, and if the load is optimized away, we still want to
trap it. Stop checking non-default address spaces; that doesn't work in
general.

llvm-svn: 167219

12 years agoBBVectorize: Account for internal shuffle costs
Hal Finkel [Thu, 1 Nov 2012 06:26:34 +0000 (06:26 +0000)]
BBVectorize: Account for internal shuffle costs

When target costs are available, use them to account for the costs of
shuffles on internal edges of the DAG of candidate pairs.

Because the shuffle costs here are currently for only the internal edges,
the current target cost model is trivial, and the chain depth requirement
is still in place, I don't yet have an easy test
case. Nevertheless, by looking at the debug output, it does seem to do the right
think to the effective "size" of each DAG of candidate pairs.

llvm-svn: 167217

12 years ago[clang.py] Add Cursor.get_arguments()
Gregory Szorc [Thu, 1 Nov 2012 05:46:30 +0000 (05:46 +0000)]
[clang.py] Add Cursor.get_arguments()

Patch provided by Matthias Kleine <matthias_kleine@gmx.de>

llvm-svn: 167216

12 years agoCodegen: Selectively copy in array addresses for OpenMP code
Tobias Grosser [Thu, 1 Nov 2012 05:34:55 +0000 (05:34 +0000)]
Codegen: Selectively copy in array addresses for OpenMP code

The detection of values that need to be copied in to the generated OpenMP
subfunction also detects the array base addresses needed in the SCoP. Hence, it
is not necessary to unconditionally copy all the base addresses to the generated
function.

Test cases are modified to reflect this change. Arrays which are global
variables do not occur in the struct passed to the subfunction anymore. A test
case for base address copy-in is added in copy_in_array.{c,ll}.

Committed with slight modifications

Contributed by:  Armin Groesslinger <armin.groesslinger@uni-passau.de>

llvm-svn: 167215

12 years agoCodeGen: Add scop-parameters to the OpenMP context
Tobias Grosser [Thu, 1 Nov 2012 05:34:48 +0000 (05:34 +0000)]
CodeGen: Add scop-parameters to the OpenMP context

In addition to the arrays and clast variables a SCoP statement may also refer to
values defined before the SCoP or to function arguments. Detect these values and
add them to the set of values passed to the function generated for OpenMP
parallel execution of a clast.

Committed with additional test cases and some refactoring.

Contributed by:  Armin Groesslinger  <armin.groesslinger@uni-passau.de>

llvm-svn: 167214

12 years agoCodegen: Copy and restore the ValueMap and ClastVars explicitly
Tobias Grosser [Thu, 1 Nov 2012 05:34:35 +0000 (05:34 +0000)]
Codegen: Copy and restore the ValueMap and ClastVars explicitly

When generating OpenMP or GPGPU code the original ValueMap and ClastVars must be
kept. We already recovered the original ClastVars by reverting the changes, but
we did not keep the content of the ValueMap. This patch keeps now an explicit
copy of both maps and restores them after generating OpenMP or GPGPU code.

This is an adapted version of a patch contributed by:
Armin Groesslinger  <armin.groesslinger@uni-passau.de>

llvm-svn: 167213

12 years agoRemove first argument from Arg::getValue; it's been unused since r105760.
Richard Smith [Thu, 1 Nov 2012 04:30:05 +0000 (04:30 +0000)]
Remove first argument from Arg::getValue; it's been unused since r105760.

llvm-svn: 167211

12 years agoRemove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
Richard Smith [Thu, 1 Nov 2012 03:48:49 +0000 (03:48 +0000)]
Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

llvm-svn: 167210

12 years agoCleanup another place redundant SP maintained
Michael Liao [Thu, 1 Nov 2012 03:47:50 +0000 (03:47 +0000)]
Cleanup another place redundant SP maintained

llvm-svn: 167209

12 years ago[CMake] Add llvm-mcmarkup to check-llvm.
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:50 +0000 (02:13 +0000)]
[CMake] Add llvm-mcmarkup to check-llvm.

llvm-svn: 167208

12 years agotest/CodeGen/X86/fp-fast.ll: Add +avx.
NAKAMURA Takumi [Thu, 1 Nov 2012 02:13:45 +0000 (02:13 +0000)]
test/CodeGen/X86/fp-fast.ll: Add +avx.

llvm-svn: 167207

12 years agoFix an error message in debugserver so it doesn't print "Unable to
Jason Molenda [Thu, 1 Nov 2012 02:02:59 +0000 (02:02 +0000)]
Fix an error message in debugserver so it doesn't print "Unable to
launch process (null)" because we changed argv while doing argument
parsing.

llvm-svn: 167202

12 years ago[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
Argyrios Kyrtzidis [Thu, 1 Nov 2012 02:01:34 +0000 (02:01 +0000)]
[libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

llvm-svn: 167201

12 years agoAdd a few more simple fast-math constant propagations and cancellations.
Owen Anderson [Thu, 1 Nov 2012 02:00:53 +0000 (02:00 +0000)]
Add a few more simple fast-math constant propagations and cancellations.

llvm-svn: 167200

12 years agoclang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease...
NAKAMURA Takumi [Thu, 1 Nov 2012 01:47:02 +0000 (01:47 +0000)]
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h: Appease msvc.

llvm-svn: 167199

12 years agoExploit the new identity composition in composeSubRegIndices().
Jakob Stoklund Olesen [Thu, 1 Nov 2012 01:15:43 +0000 (01:15 +0000)]
Exploit the new identity composition in composeSubRegIndices().

The static compose() function in RegisterCoalescer was doing the exact
same thing.

llvm-svn: 167198

12 years agoThere seems to be some odd corner case where we shut down the ProcessGDBRemote, but...
Jim Ingham [Thu, 1 Nov 2012 01:15:33 +0000 (01:15 +0000)]
There seems to be some odd corner case where we shut down the ProcessGDBRemote, but we haven't managed to shut down the async thread.  That causes the ProcessGDBRemote::AsyncThread to crash when it wakes up.  So I changed StartAsyncThread and StopAsyncThread to be callable multiple times (only the first one does anything) so that we can just shut it down unequivocally in the ProcessGDBRemote destructor.

<rdar://problem/12602981>

llvm-svn: 167197

12 years agoDon't insert and erase load instruction. Simply create (new) and delete it.
Jakub Staszak [Thu, 1 Nov 2012 01:10:43 +0000 (01:10 +0000)]
Don't insert and erase load instruction. Simply create (new) and delete it.

llvm-svn: 167196

12 years ago[analyzer] Optimize assumeDual by assuming constraint managers are consistent.
Jordan Rose [Thu, 1 Nov 2012 01:05:39 +0000 (01:05 +0000)]
[analyzer] Optimize assumeDual by assuming constraint managers are consistent.

Specifically, if adding a constraint makes the current system infeasible,
assume the constraint is false, instead of attempting to add its negation.

In +Asserts builds we will still assert that at least one state is feasible.

Patch by Ryan Govostes!

llvm-svn: 167195

12 years agoSwitch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidp...
Jim Ingham [Thu, 1 Nov 2012 01:04:46 +0000 (01:04 +0000)]
Switch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidpath.  The former was flakey, and the whole point of libproc is to protect us from potential flakiness at that level...

<rdar://problem/12594781>

llvm-svn: 167194

12 years ago[lit] For the "case-insensitive-filesystem" make sure to create the test temporary...
Argyrios Kyrtzidis [Thu, 1 Nov 2012 00:59:15 +0000 (00:59 +0000)]
[lit] For the "case-insensitive-filesystem" make sure to create the test temporary file
in the test output directory.

llvm-svn: 167193

12 years agoStreamlined memory manager hierarchy for MCJIT and RuntimeDyld.
Andrew Kaylor [Thu, 1 Nov 2012 00:46:04 +0000 (00:46 +0000)]
Streamlined memory manager hierarchy for MCJIT and RuntimeDyld.

Patch by Ashok Thirumurthi

llvm-svn: 167192

12 years ago[Support] Fix StrError on Windows to actually return the error string...
Michael J. Spencer [Thu, 1 Nov 2012 00:34:09 +0000 (00:34 +0000)]
[Support] Fix StrError on Windows to actually return the error string...

llvm-svn: 167191

12 years agoGenerate a table-driven version of TRI::composeSubRegIndices().
Jakob Stoklund Olesen [Thu, 1 Nov 2012 00:32:10 +0000 (00:32 +0000)]
Generate a table-driven version of TRI::composeSubRegIndices().

Explicitly allow composition of null sub-register indices, and handle
that common case in an inlinable stub.

Use a compressed table implementation instead of the previous nested
switches which generated pretty bad code.

llvm-svn: 167190

12 years ago[analyzer] Fix typo in r167186.
Jordan Rose [Thu, 1 Nov 2012 00:25:15 +0000 (00:25 +0000)]
[analyzer] Fix typo in r167186.

llvm-svn: 167189

12 years agoclang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.
NAKAMURA Takumi [Thu, 1 Nov 2012 00:20:00 +0000 (00:20 +0000)]
clang/test/Index/code-completion-skip-bodies.cpp: Add XFAIL while investigating.

llvm-svn: 167188

12 years ago[analyzer] Minor cleanup in SimpleStreamChecker's class definition.
Jordan Rose [Thu, 1 Nov 2012 00:18:41 +0000 (00:18 +0000)]
[analyzer] Minor cleanup in SimpleStreamChecker's class definition.

No functionality change.

llvm-svn: 167187

12 years ago[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.
Jordan Rose [Thu, 1 Nov 2012 00:18:27 +0000 (00:18 +0000)]
[analyzer] Rename ConditionTruthVal::isTrue to isConstrainedTrue.

(and the same for isFalse)

No functionality change.

llvm-svn: 167186

12 years agoFixed format strings to avoid pointer truncation during 64-bit debugging.
Andrew Kaylor [Thu, 1 Nov 2012 00:17:11 +0000 (00:17 +0000)]
Fixed format strings to avoid pointer truncation during 64-bit debugging.

llvm-svn: 167185

12 years agoCorrectly reject gotos in function-level try blocks. PR14225.
Eli Friedman [Wed, 31 Oct 2012 23:55:28 +0000 (23:55 +0000)]
Correctly reject gotos in function-level try blocks.  PR14225.

llvm-svn: 167184

12 years agoAdded the plists to the debugserver project and fixed the labels for the new plists.
Greg Clayton [Wed, 31 Oct 2012 23:49:14 +0000 (23:49 +0000)]
Added the plists to the debugserver project and fixed the labels for the new plists.

llvm-svn: 167183

12 years agoMore launchd style plists.
Greg Clayton [Wed, 31 Oct 2012 23:43:37 +0000 (23:43 +0000)]
More launchd style plists.

llvm-svn: 167182

12 years agoMC: Simple example parser for MC assembly markup.
Jim Grosbach [Wed, 31 Oct 2012 23:24:13 +0000 (23:24 +0000)]
MC: Simple example parser for MC assembly markup.

Nothing fancy, just a simple demonstration parser.

llvm-svn: 167181

12 years ago(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.
Shuxin Yang [Wed, 31 Oct 2012 23:11:48 +0000 (23:11 +0000)]
(For X86) Enhancement to add-carray/sub-borrow (adc/sbb) optimization.

  The adc/sbb optimization is to able to convert following expression
into a single adc/sbb instruction:
  (ult) ... = x + 1 // where the ult is unsigned-less-than comparison
  (ult) ... = x - 1

  This change is to flip the "x >u y" (i.e. ugt comparison) in order
to expose the adc/sbb opportunity.

llvm-svn: 167180

12 years agoUse libxml2 on Mac OS X.
Filipe Cabecinhas [Wed, 31 Oct 2012 23:02:00 +0000 (23:02 +0000)]
Use libxml2 on Mac OS X.

llvm-svn: 167179

12 years ago[analyzer] Fix a bug in SimpleStreamChecker - return after sink.
Anna Zaks [Wed, 31 Oct 2012 22:17:48 +0000 (22:17 +0000)]
[analyzer] Fix a bug in SimpleStreamChecker - return after sink.

Thanks Ted.

llvm-svn: 167176

12 years agoResolve any bundle paths we are given when the specified executable is a bundle.
Greg Clayton [Wed, 31 Oct 2012 21:44:39 +0000 (21:44 +0000)]
Resolve any bundle paths we are given when the specified executable is a bundle.

llvm-svn: 167175

12 years agoLoopVectorize: Preserve NSW, NUW and IsExact flags.
Nadav Rotem [Wed, 31 Oct 2012 21:40:39 +0000 (21:40 +0000)]
LoopVectorize: Preserve NSW, NUW and IsExact flags.

llvm-svn: 167174

12 years ago[driver] Remove an extra space with the -iprefix option, so that
Chad Rosier [Wed, 31 Oct 2012 21:08:30 +0000 (21:08 +0000)]
[driver] Remove an extra space with the -iprefix option, so that
matching works correctly.
Part of rdar://12329974

llvm-svn: 167173

12 years ago[PCH] Remove the stat cache from the PCH file.
Argyrios Kyrtzidis [Wed, 31 Oct 2012 20:59:50 +0000 (20:59 +0000)]
[PCH] Remove the stat cache from the PCH file.

The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
  -The same header is referenced in an #include with different filename cases.
  -In the PCH, of course, we record only one file entry for the header file
  -But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
 its size and modification time are the same but its inode changes

-When using the PCH:
  -We validate the headers, we check that header file and we create a file entry with its current inode
  -There's another #include with a filename with different case than the previously created file entry
  -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
  -because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

llvm-svn: 167172

12 years agoMore fixes from MSVC warnings found by Carlo Kok.
Greg Clayton [Wed, 31 Oct 2012 20:56:43 +0000 (20:56 +0000)]
More fixes from MSVC warnings found by Carlo Kok.

llvm-svn: 167171

12 years agoFix a bug in the cost calculation of vector casts. Detect situations where bitcasts...
Nadav Rotem [Wed, 31 Oct 2012 20:52:26 +0000 (20:52 +0000)]
Fix a bug in the cost calculation of vector casts. Detect situations where bitcasts cost zero.

llvm-svn: 167170

12 years agoCarlo Kok was compiling with MSVC, caught some more issues.
Greg Clayton [Wed, 31 Oct 2012 20:51:31 +0000 (20:51 +0000)]
Carlo Kok was compiling with MSVC, caught some more issues.

llvm-svn: 167168

12 years agoCarlo Kok found an issue where default parameters were causing the wrong argument...
Greg Clayton [Wed, 31 Oct 2012 20:49:04 +0000 (20:49 +0000)]
Carlo Kok found an issue where default parameters were causing the wrong argument to be passed. I got rid of the default args so we don't run into this.

llvm-svn: 167167

12 years agoFix cl brokeness.
Michael J. Spencer [Wed, 31 Oct 2012 20:47:30 +0000 (20:47 +0000)]
Fix cl brokeness.

cl is not attempting to complete a templated class when used in this
context. The conversion forces this to happen.

Thanks to Richard Smith for figuring this out.

llvm-svn: 167166

12 years agoAdd missing include.
Michael J. Spencer [Wed, 31 Oct 2012 20:47:11 +0000 (20:47 +0000)]
Add missing include.

llvm-svn: 167165

12 years agoMark code, not data, as executable in lli RemoteTarget simulator.
Andrew Kaylor [Wed, 31 Oct 2012 20:37:14 +0000 (20:37 +0000)]
Mark code, not data, as executable in lli RemoteTarget simulator.

llvm-svn: 167164

12 years ago[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to...
Michael Gottesman [Wed, 31 Oct 2012 20:20:04 +0000 (20:20 +0000)]
[clang tests] Added require ppc64-registered-target to Headers/altivec-header.c to ensure it only runs on ppc64.

llvm-svn: 167162

12 years ago[driver] Remove an extra space with the -internal-externc-isystem option, so
Chad Rosier [Wed, 31 Oct 2012 19:28:55 +0000 (19:28 +0000)]
[driver] Remove an extra space with the -internal-externc-isystem option, so
that matching works correctly.
Part of rdar://12329974

llvm-svn: 167161

12 years agoPatch for issue found by Carlo Kok. Fixed a type issue where an ';' was incorrectly...
Greg Clayton [Wed, 31 Oct 2012 19:05:35 +0000 (19:05 +0000)]
Patch for issue found by Carlo Kok. Fixed a type issue where an ';' was incorrectly following an if statement. There actually isn't a need for the if statement, so it was removed.

llvm-svn: 167160

12 years agoARM AAPCS-VFP: fix tracking of allocated VFP registers.
Manman Ren [Wed, 31 Oct 2012 19:02:26 +0000 (19:02 +0000)]
ARM AAPCS-VFP: fix tracking of allocated VFP registers.

According to the spec, we can backfill VFP registers that were skipped due
to alignment constraints.

llvm-svn: 167159

12 years ago[driver] Remove the -ccc-host-triple alias. This has been replaced by the
Chad Rosier [Wed, 31 Oct 2012 18:59:38 +0000 (18:59 +0000)]
[driver] Remove the -ccc-host-triple alias.  This has been replaced by the
-target option.
rdar://10692880

llvm-svn: 167158

12 years agoRemove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.
Rafael Espindola [Wed, 31 Oct 2012 18:52:25 +0000 (18:52 +0000)]
Remove Triple::getArchTypeForDarwinArchName. I lives on the clang driver now.

llvm-svn: 167157

12 years agogetArchTypeForDarwinArchName is only used in the clang driver, copy it there.
Rafael Espindola [Wed, 31 Oct 2012 18:51:07 +0000 (18:51 +0000)]
getArchTypeForDarwinArchName is only used in the clang driver, copy it there.
I will remove it from llvm in the next commit.

llvm-svn: 167156

12 years agoFix for -ast-dump-filter
Alexander Kornienko [Wed, 31 Oct 2012 18:46:31 +0000 (18:46 +0000)]
Fix for -ast-dump-filter

Summary:
-ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node.

Added test and fixed.

Reviewers: djasper, klimek, rsmith

Reviewed By: djasper

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

llvm-svn: 167155

12 years ago[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
Akira Hatanaka [Wed, 31 Oct 2012 18:37:55 +0000 (18:37 +0000)]
[mips] Set isAsCheapAsAMove flag on ADDiu and DADDiu, which enables
re-materialization of immediate loads.

llvm-svn: 167153

12 years ago[driver] Completely rework how superfluous options are stripped out of the crash
Chad Rosier [Wed, 31 Oct 2012 18:31:33 +0000 (18:31 +0000)]
[driver] Completely rework how superfluous options are stripped out of the crash
diagnostics script.

This addresses the FIXME pertaining to quoted arguments.  We also delineate
between those flags that have an argument (e.g., -D macro, -MF file) and
those that do not (e.g., -M, -MM, -MG).  Finally, we add the -dwarf-debug-flags
to the list of flags to be removed.
rdar://12329974

llvm-svn: 167152

12 years agoAdd "static" to some functions in altivec.c where it was missing.
Ulrich Weigand [Wed, 31 Oct 2012 18:17:07 +0000 (18:17 +0000)]
Add "static" to some functions in altivec.c where it was missing.

llvm-svn: 167148

12 years agoMCJIT unit test: add calls to ensure that instruction caches are properly invalidated...
Amara Emerson [Wed, 31 Oct 2012 17:44:16 +0000 (17:44 +0000)]
MCJIT unit test: add calls to ensure that instruction caches are properly invalidated before code execution.

llvm-svn: 167146

12 years agoPort lli bug fix from r166920 to MCJIT unit test.
Amara Emerson [Wed, 31 Oct 2012 17:41:51 +0000 (17:41 +0000)]
Port lli bug fix from r166920 to MCJIT unit test.

llvm-svn: 167145

12 years agoCommit access test.
Amara Emerson [Wed, 31 Oct 2012 17:35:12 +0000 (17:35 +0000)]
Commit access test.

llvm-svn: 167144

12 years agoThis patch removes the XFAIL for powerpc for
Bill Schmidt [Wed, 31 Oct 2012 17:31:46 +0000 (17:31 +0000)]
This patch removes the XFAIL for powerpc for
test/CodeGenCXX/member-alignment.cpp.  The test succeeds for
powerpc64-unknown-linux-gnu.  If other flavors of powerpc are
shown by buildbots to still be broken, we can adjust the test
at that time.

llvm-svn: 167143

12 years agoIf skipping bodies is enabled outside code-completion, just skip the body directly
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:28 +0000 (17:29 +0000)]
If skipping bodies is enabled outside code-completion, just skip the body directly
without using tentative parsing.

llvm-svn: 167142

12 years agoDecouple code-completion for the SkipFunctionBodies frontend option and
Argyrios Kyrtzidis [Wed, 31 Oct 2012 17:29:22 +0000 (17:29 +0000)]
Decouple code-completion for the SkipFunctionBodies frontend option and
add a test to make sure code-completion skips bodies.

llvm-svn: 167141

12 years agoRemove stale documentation about tail duplicaton IR pass
Arnold Schwaighofer [Wed, 31 Oct 2012 17:25:31 +0000 (17:25 +0000)]
Remove stale documentation about tail duplicaton IR pass

We no longer have a tail duplication pass that runs on LLVM IR. It was removed
in 3.0.

llvm-svn: 167140

12 years agoTest case for r167039. Check that tail-call optimization is disabled for
Akira Hatanaka [Wed, 31 Oct 2012 17:25:23 +0000 (17:25 +0000)]
Test case for r167039. Check that tail-call optimization is disabled for
mips16.

llvm-svn: 167139

12 years ago[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.
Jordan Rose [Wed, 31 Oct 2012 16:44:55 +0000 (16:44 +0000)]
[analyzer] Let ConstraintManager subclasses provide a more efficient checkNull.

Previously, every call to a ConstraintManager's isNull would do a full
assumeDual to test feasibility. Now, ConstraintManagers can override
checkNull if they have a cheaper way to do the same thing.
RangeConstraintManager can do this in less than half the work.

<rdar://problem/12608209>

llvm-svn: 167138

12 years agoFix typo in CodeGenerator doc
Eli Bendersky [Wed, 31 Oct 2012 16:41:07 +0000 (16:41 +0000)]
Fix typo in CodeGenerator doc

llvm-svn: 167137

12 years agoLCSSA: Try to recover compile time regressions due to SCEV updates.
Benjamin Kramer [Wed, 31 Oct 2012 16:30:03 +0000 (16:30 +0000)]
LCSSA: Try to recover compile time regressions due to SCEV updates.

- Use value handle tricks to communicate use replacements instead of forgetLoop, this is a lot faster.
- Move the "big hammer" out of the main loop so it's not called for every instruction.

This should recover most (if not all) compile time regressions introduced by this code.

llvm-svn: 167136

12 years agoPut the threshold magic number in a variable.
Nadav Rotem [Wed, 31 Oct 2012 16:22:16 +0000 (16:22 +0000)]
Put the threshold magic number in a variable.

llvm-svn: 167134

12 years agoDisable all old-JIT unit tests on PowerPC.
Ulrich Weigand [Wed, 31 Oct 2012 16:18:02 +0000 (16:18 +0000)]
Disable all old-JIT unit tests on PowerPC.

These tests were all failing since the old JIT doesn't work
for PowerPC (any more), and there are no plans to attempt to
fix it again (instead, work focuses on MCJIT).

llvm-svn: 167133

12 years agoRemove fixme about unreachable cases from SwitchToLookupTable
Hans Wennborg [Wed, 31 Oct 2012 16:15:25 +0000 (16:15 +0000)]
Remove fixme about unreachable cases from SwitchToLookupTable

SimplifyCFG will have removed those cases for us.

llvm-svn: 167132

12 years agoRemove enum values since they are not used anymore.
Nadav Rotem [Wed, 31 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Remove enum values since they are not used anymore.

llvm-svn: 167131

12 years agoAddress Duncan's comments on r167121.
Hans Wennborg [Wed, 31 Oct 2012 15:31:09 +0000 (15:31 +0000)]
Address Duncan's comments on r167121.

llvm-svn: 167130

12 years agoBBVectorize: Choose pair ordering to minimize shuffles
Hal Finkel [Wed, 31 Oct 2012 15:17:07 +0000 (15:17 +0000)]
BBVectorize: Choose pair ordering to minimize shuffles

BBVectorize would, except for loads and stores, always fuse instructions
so that the first instruction (in the current source order) would always
represent the low part of the input vectors and the second instruction
would always represent the high part. This lead to too many shuffles
being produced because sometimes the opposite order produces fewer of them.

With this change, BBVectorize tracks the kind of pair connections that form
the DAG of candidate pairs, and uses that information to reorder the pairs to
avoid excess shuffles. Using this information, a future commit will be able
to add VTTI-based shuffle costs to the pair selection procedure. Importantly,
the number of remaining shuffles can now be estimated during pair selection.

There are some trivial instruction reorderings in the test cases, and one
simple additional test where we certainly want to do a reordering to
avoid an unnecessary shuffle.

llvm-svn: 167122

12 years agoAddress Duncan's comments on r167115
Hans Wennborg [Wed, 31 Oct 2012 15:14:39 +0000 (15:14 +0000)]
Address Duncan's comments on r167115

 - Use 0 instead of NULL
 - Helper function for "dyn_cast, else lookup in the constant pool".

llvm-svn: 167121