platform/upstream/llvm.git
11 years agoclang/unittests: Fixup corresponding to Doug's r168136.
NAKAMURA Takumi [Fri, 16 Nov 2012 04:40:11 +0000 (04:40 +0000)]
clang/unittests: Fixup corresponding to Doug's r168136.

llvm-svn: 168137

11 years agoSince CreateTargetInfo is taking ownership of the target options, pass
Douglas Gregor [Fri, 16 Nov 2012 04:24:59 +0000 (04:24 +0000)]
Since CreateTargetInfo is taking ownership of the target options, pass
it as a pointer.

llvm-svn: 168136

11 years agoRemove unused diagnostics
Douglas Gregor [Fri, 16 Nov 2012 04:10:20 +0000 (04:10 +0000)]
Remove unused diagnostics

llvm-svn: 168135

11 years agoRevert r168132, "clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now." I...
NAKAMURA Takumi [Fri, 16 Nov 2012 03:50:55 +0000 (03:50 +0000)]
Revert r168132, "clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now." I missed Daniel's r168095 by my accident.

llvm-svn: 168134

11 years ago[libclang] When caching code-completion results, pass the CachedCompletionAllocator
Argyrios Kyrtzidis [Fri, 16 Nov 2012 03:34:57 +0000 (03:34 +0000)]
[libclang] When caching code-completion results, pass the CachedCompletionAllocator
to the CodeCompletionTUInfo that is going to be used to get the results.

Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator
that will go away when we reparse. That could result in a use-after-free bug when
getting the parent context name from a CodeCompletionString.

Addresses rdar://12568377.

llvm-svn: 168133

11 years agoclang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now.
NAKAMURA Takumi [Fri, 16 Nov 2012 03:28:51 +0000 (03:28 +0000)]
clang/test/lit.cfg: Suppress the feature 'dev-fd-fs' for now.

None of my buildhost (centos6 x86-64 and cygwin) is passing. Investigating.

llvm-svn: 168132

11 years ago[mips] Fix delay slot filler so that instructions with register operand $1 are
Akira Hatanaka [Fri, 16 Nov 2012 02:39:34 +0000 (02:39 +0000)]
[mips] Fix delay slot filler so that instructions with register operand $1 are
allowed in branch delay slot.

llvm-svn: 168131

11 years agoCPP Output: Do not emit an enter file marker for the main file.
Daniel Dunbar [Fri, 16 Nov 2012 01:51:11 +0000 (01:51 +0000)]
CPP Output: Do not emit an enter file marker for the main file.

 - This diverges from gcc, and confuses tools (like dtrace) which track # line
   markers as a way to determine which content is in the context of the main
   file.

llvm-svn: 168128

11 years agoTake into account the zero sign bit for positive numbers when computing the bit
Richard Trieu [Fri, 16 Nov 2012 01:32:40 +0000 (01:32 +0000)]
Take into account the zero sign bit for positive numbers when computing the bit
width of an enum with negative values in IntRange.  Include a test for
-Wtautological-constant-out-of-range-compare where this had manifested.

llvm-svn: 168126

11 years agoFix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.
Matt Beaumont-Gay [Fri, 16 Nov 2012 01:14:52 +0000 (01:14 +0000)]
Fix PR14321, a crash when Clang is built with GCC 4.7 at -O1 or greater.

GCC 4.7 reuses stack slots fairly aggressively, which exposes more temporary
lifetime bugs.

No new test, this was caught by the existing CodeGenCXX/mangle-ms-templates.cpp.

llvm-svn: 168124

11 years agoA change in how we search for saved register values unintentionally
Jason Molenda [Fri, 16 Nov 2012 01:03:31 +0000 (01:03 +0000)]
A change in how we search for saved register values unintentionally
allowed volatile registers to be returned up the stack.  That leads
to unexpected/incorrect values provided to the user and we need to
avoid that.
<rdar://problem/12714247>

llvm-svn: 168123

11 years agoRemove trailing whitespace
Michael Ilseman [Fri, 16 Nov 2012 00:58:59 +0000 (00:58 +0000)]
Remove trailing whitespace

llvm-svn: 168121

11 years agoA step towards sorting out handling of triviality of special members in C++11.
Richard Smith [Fri, 16 Nov 2012 00:53:38 +0000 (00:53 +0000)]
A step towards sorting out handling of triviality of special members in C++11.

Separate out the notions of 'has a trivial special member' and 'has a
non-trivial special member', and use them appropriately. These are not
opposites of one another (there might be no special member, or in C++11 there
might be a trivial one and a non-trivial one). The CXXRecordDecl predicates
continue to produce incorrect results, but do so in fewer cases now, and
they document the cases where they might be wrong.

No functionality changes are intended here (they will come when the predicates
start producing the right answers...).

llvm-svn: 168119

11 years agoMention the lldb formatters in the clang wiki under debugging.
Argyrios Kyrtzidis [Fri, 16 Nov 2012 00:25:28 +0000 (00:25 +0000)]
Mention the lldb formatters in the clang wiki under debugging.

llvm-svn: 168118

11 years ago[ClangDataFormat.py] Add summary for QualType.
Argyrios Kyrtzidis [Fri, 16 Nov 2012 00:25:26 +0000 (00:25 +0000)]
[ClangDataFormat.py] Add summary for QualType.

llvm-svn: 168117

11 years agoInterface changes to allow RuntimeDyld memory managers to set memory permissions...
Andrew Kaylor [Thu, 15 Nov 2012 23:50:01 +0000 (23:50 +0000)]
Interface changes to allow RuntimeDyld memory managers to set memory permissions after an object has been loaded.

llvm-svn: 168114

11 years agoAdd some tests for the FileCheck utility.
Eli Bendersky [Thu, 15 Nov 2012 23:42:51 +0000 (23:42 +0000)]
Add some tests for the FileCheck utility.

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121112/156007.html

llvm-svn: 168113

11 years agoMake sure CodeGenTypes correctly reconverts function types. Fixes PR14355, a crash...
Eli Friedman [Thu, 15 Nov 2012 23:40:48 +0000 (23:40 +0000)]
Make sure CodeGenTypes correctly reconverts function types.  Fixes PR14355, a crash in IR generation.

llvm-svn: 168112

11 years agoAdded myself as owner of LLVM Buildbot.
Galina Kistanova [Thu, 15 Nov 2012 23:16:47 +0000 (23:16 +0000)]
Added myself as owner of LLVM Buildbot.

llvm-svn: 168111

11 years agoClarify.
Eric Christopher [Thu, 15 Nov 2012 22:57:22 +0000 (22:57 +0000)]
Clarify.

llvm-svn: 168110

11 years agoClaim ownership of everyone's favorite part of the backend.
Owen Anderson [Thu, 15 Nov 2012 22:56:42 +0000 (22:56 +0000)]
Claim ownership of everyone's favorite part of the backend.

llvm-svn: 168109

11 years agoPR9903: Recover from a member functon declared with the 'typedef' specifier by
Richard Smith [Thu, 15 Nov 2012 22:54:20 +0000 (22:54 +0000)]
PR9903: Recover from a member functon declared with the 'typedef' specifier by
dropping the specifier, just like we do for non-member functions and function
templates declared 'typedef'. Patch by Brian Brooks!

llvm-svn: 168108

11 years agoMark FP_ROUND for converting NEON v2f64 to v2f32 as expand. Add a missing
Eli Friedman [Thu, 15 Nov 2012 22:44:27 +0000 (22:44 +0000)]
Mark FP_ROUND for converting NEON v2f64 to v2f32 as expand. Add a missing
case to vector legalization so this actually works.

Patch by Pete Couperus.  Fixes PR12540.

llvm-svn: 168107

11 years agoDon't lock the thread list during ThreadList::ShouldStop. That does too
Jim Ingham [Thu, 15 Nov 2012 22:44:04 +0000 (22:44 +0000)]
Don't lock the thread list during ThreadList::ShouldStop.  That does too
much work for this to make sense.  Just copy the current thread list and
operate on that.  Prevents some deadlocks.

llvm-svn: 168106

11 years ago[analyzer] CmpRuns: move the clang_version info into the run (out of
Anna Zaks [Thu, 15 Nov 2012 22:42:44 +0000 (22:42 +0000)]
[analyzer] CmpRuns: move the clang_version info into the run (out of
report)

llvm-svn: 168105

11 years agoMore ownership, no one likes these things anyways.
Eric Christopher [Thu, 15 Nov 2012 22:41:56 +0000 (22:41 +0000)]
More ownership, no one likes these things anyways.

llvm-svn: 168104

11 years agoRemove trailing whitespace
Michael Ilseman [Thu, 15 Nov 2012 22:34:00 +0000 (22:34 +0000)]
Remove trailing whitespace

llvm-svn: 168103

11 years agoUpdate the code ownership.
Nadav Rotem [Thu, 15 Nov 2012 22:26:51 +0000 (22:26 +0000)]
Update the code ownership.

llvm-svn: 168102

11 years agoComment to XML conversion test: correct filename.
Dmitri Gribenko [Thu, 15 Nov 2012 22:21:42 +0000 (22:21 +0000)]
Comment to XML conversion test: correct filename.

llvm-svn: 168101

11 years ago[analyzer] SATestBuild.py: correctly add -j option for projects using make.
Jordan Rose [Thu, 15 Nov 2012 22:03:53 +0000 (22:03 +0000)]
[analyzer] SATestBuild.py: correctly add -j option for projects using make.

llvm-svn: 168099

11 years agoSplit annotate-comments.cpp into a fragile (that uses hardcoded line numbers)
Dmitri Gribenko [Thu, 15 Nov 2012 22:03:13 +0000 (22:03 +0000)]
Split annotate-comments.cpp into a fragile (that uses hardcoded line numbers)
and a non-fragile (that uses [[@LINE]]) parts.

llvm-svn: 168098

11 years agotests: Mark the /dev/fd test as requiring Darwin until I can test on other OSes.
Daniel Dunbar [Thu, 15 Nov 2012 21:31:13 +0000 (21:31 +0000)]
tests: Mark the /dev/fd test as requiring Darwin until I can test on other OSes.

llvm-svn: 168095

11 years agoFix typo.
Jyotsna Verma [Thu, 15 Nov 2012 21:21:01 +0000 (21:21 +0000)]
Fix typo.

llvm-svn: 168091

11 years agoautoconf: isl depends on gmp include files
Sebastian Pop [Thu, 15 Nov 2012 21:20:22 +0000 (21:20 +0000)]
autoconf: isl depends on gmp include files

When libgmp header files are not installed in the default /usr/include location,
configure used to fail to find the gmp headers when testing for isl/ast.h.  This
patch adds the gmp include path to the compiler flags before testing for ISL.

llvm-svn: 168090

11 years ago[mips] Add predicate HasFPIdx for floating-point indexed load instruction
Akira Hatanaka [Thu, 15 Nov 2012 21:17:13 +0000 (21:17 +0000)]
[mips] Add predicate HasFPIdx for floating-point indexed load instruction
support and use it in place of HasMips32r2Or64.

llvm-svn: 168089

11 years agoAdd description of how to build docs
Joel Jones [Thu, 15 Nov 2012 21:15:08 +0000 (21:15 +0000)]
Add description of how to build docs

llvm-svn: 168088

11 years ago[utils/ClangDataFormat.py] For invalid source locations just return
Argyrios Kyrtzidis [Thu, 15 Nov 2012 20:59:00 +0000 (20:59 +0000)]
[utils/ClangDataFormat.py] For invalid source locations just return
"<invalid loc>" for summary.

llvm-svn: 168087

11 years agoPowerPC: Lowering floor intrinsic for Altivec
Adhemerval Zanella [Thu, 15 Nov 2012 20:56:03 +0000 (20:56 +0000)]
PowerPC: Lowering floor intrinsic for Altivec

This patch lowers the llvm.floor, llvm.ceil, llvm.trunc, and
llvm.nearbyint to Altivec instruction when using 4 single-precision
float vectors.

llvm-svn: 168086

11 years agotests: Check that we can output to /dev/fd filesystem.
Daniel Dunbar [Thu, 15 Nov 2012 20:24:58 +0000 (20:24 +0000)]
tests: Check that we can output to /dev/fd filesystem.

 - An LLVM unique_file() bug could cause us to infinite loop on the later test
   case.

llvm-svn: 168082

11 years agoPathV2: Fix a possible infinite loop.
Daniel Dunbar [Thu, 15 Nov 2012 20:24:52 +0000 (20:24 +0000)]
PathV2: Fix a possible infinite loop.

 - The code could infinite loop trying to create unique files, if the directory
   containing the unique file exists, but open() calls on non-existent files in
   the path return ENOENT. This is true on the /dev/fd filesystem, for example.

 - Will add a clang side test case for this.

llvm-svn: 168081

11 years ago[analyzer] Fix a use-after-free introduced in r168019.
Jordan Rose [Thu, 15 Nov 2012 20:10:05 +0000 (20:10 +0000)]
[analyzer] Fix a use-after-free introduced in r168019.

In code like this:

void foo() {
     bar();
     baz();
}

...the location for the call to 'bar()' was being used as a backup location
for the call to 'baz()'. This is fine unless the call to 'bar()' is deemed
uninteresting and that part of the path deleted.

(This looks like a logic error as well, but in practice the only way 'baz()'
could have an invalid location is if the entire body of 'foo()' is
synthesized, meaning the call to 'bar()' will be using the location of the
call to 'foo()' anyway. Nevertheless, the new version better matches the
intent of the code.)

Found by Matt Beaumont-Gay using ASan. Thanks, Matt!

llvm-svn: 168080

11 years agotests: Add a test for reading from named pipes.
Daniel Dunbar [Thu, 15 Nov 2012 20:06:10 +0000 (20:06 +0000)]
tests: Add a test for reading from named pipes.

 - Realized I could use the /dev/fd filesystem to make a simple portable test.

llvm-svn: 168079

11 years agoAdd assertions in MipsLongBranch which check the size of basic blocks.
Akira Hatanaka [Thu, 15 Nov 2012 20:05:11 +0000 (20:05 +0000)]
Add assertions in MipsLongBranch which check the size of basic blocks.

llvm-svn: 168078

11 years agoIf an excluded header does not exist, just ignore it
Douglas Gregor [Thu, 15 Nov 2012 19:47:16 +0000 (19:47 +0000)]
If an excluded header does not exist, just ignore it

llvm-svn: 168077

11 years agoReturn 0 instead of false.
Jakub Staszak [Thu, 15 Nov 2012 19:40:29 +0000 (19:40 +0000)]
Return 0 instead of false.

llvm-svn: 168076

11 years ago<rdar://problem/12125010>
Greg Clayton [Thu, 15 Nov 2012 19:37:18 +0000 (19:37 +0000)]
<rdar://problem/12125010>

Handle universal BSD archives correctly when parsing DWARF in .o files with debug map.

llvm-svn: 168075

11 years agoUse std::stable_sort instead of std::sort when sorting stack slots
Ulrich Weigand [Thu, 15 Nov 2012 19:33:30 +0000 (19:33 +0000)]
Use std::stable_sort instead of std::sort when sorting stack slots
to guarantee deterministic code generation.

llvm-svn: 168074

11 years agoClarify my code ownership
Evan Cheng [Thu, 15 Nov 2012 19:31:48 +0000 (19:31 +0000)]
Clarify my code ownership

llvm-svn: 168073

11 years agoAdd myself as owner of VLIW Instruction Scheduling and Packetization.
Sergei Larin [Thu, 15 Nov 2012 19:24:19 +0000 (19:24 +0000)]
Add myself as owner of VLIW Instruction Scheduling and Packetization.

llvm-svn: 168072

11 years agoExplain how to use "expr -u" as the lldb equivalent of "set unwind-on-signal 0; print".
Jim Ingham [Thu, 15 Nov 2012 19:13:33 +0000 (19:13 +0000)]
Explain how to use "expr -u" as the lldb equivalent of "set unwind-on-signal 0; print".

llvm-svn: 168071

11 years ago[analyzer] Report leaks at the closing brace of a function body.
Jordan Rose [Thu, 15 Nov 2012 19:11:43 +0000 (19:11 +0000)]
[analyzer] Report leaks at the closing brace of a function body.

This fixes a few cases where we'd emit path notes like this:

  +---+
 1|   v
  p = malloc(len);
  ^   |2
  +---+

In general this should make path notes more consistent and more correct,
especially in cases where the leak happens on the false branch of an if
that jumps directly to the end of the function. There are a couple places
where the leak is reported farther away from the cause; these are usually
cases where there are several levels of nested braces before the end of
the function. This still matches our current behavior for when there /is/
a statement after all the braces, though.

llvm-svn: 168070

11 years ago[analyzer] StreamChecker: Remove now-unnecessary check::EndPath callback.
Jordan Rose [Thu, 15 Nov 2012 19:11:38 +0000 (19:11 +0000)]
[analyzer] StreamChecker: Remove now-unnecessary check::EndPath callback.

Also, don't bother to stop tracking symbols in the return value, either.
They are now properly considered live during checkDeadSymbols.

llvm-svn: 168069

11 years ago[analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath.
Jordan Rose [Thu, 15 Nov 2012 19:11:35 +0000 (19:11 +0000)]
[analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath.

Also, don't bother to stop tracking symbols in the return value, either.
They are now properly considered live during checkDeadSymbols.

llvm-svn: 168068

11 years ago[analyzer] MallocChecker: Remove now-unnecessary check::EndPath callback.
Jordan Rose [Thu, 15 Nov 2012 19:11:33 +0000 (19:11 +0000)]
[analyzer] MallocChecker: Remove now-unnecessary check::EndPath callback.

Also, don't bother to stop tracking symbols in the return value, either.
They are now properly considered live during checkDeadSymbols.

llvm-svn: 168067

11 years ago[analyzer] Mark symbol values as dead in the environment.
Jordan Rose [Thu, 15 Nov 2012 19:11:27 +0000 (19:11 +0000)]
[analyzer] Mark symbol values as dead in the environment.

This allows us to properly remove dead bindings at the end of the top-level
stack frame, using the ReturnStmt, if there is one, to keep the return value
live. This in turn removes the need for a check::EndPath callback in leak
checkers.

This does cause some changes in the path notes for leak checkers. Previously,
a leak would be reported at the location of the closing brace in a function.
Now, it gets reported at the last statement. This matches the way leaks are
currently reported for inlined functions, but is less than ideal for both.

llvm-svn: 168066

11 years agoAdd ARM EABI to my list of responsibilities.
Anton Korobeynikov [Thu, 15 Nov 2012 19:10:23 +0000 (19:10 +0000)]
Add ARM EABI to my list of responsibilities.
Update the email address (old works too, but less reliable) while there

llvm-svn: 168065

11 years agoSimplify code.
Jakub Staszak [Thu, 15 Nov 2012 19:05:23 +0000 (19:05 +0000)]
Simplify code.

llvm-svn: 168064

11 years agoblock extended signatur option. Change previous option
Fariborz Jahanian [Thu, 15 Nov 2012 19:02:45 +0000 (19:02 +0000)]
block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031

llvm-svn: 168063

11 years ago[modules] Use a memory buffer directly as input for the module includes,
Argyrios Kyrtzidis [Thu, 15 Nov 2012 18:57:27 +0000 (18:57 +0000)]
[modules] Use a memory buffer directly as input for the module includes,
instead of messing with virtual files.

llvm-svn: 168062

11 years ago[modules] Setup the import location of a module file and use it
Argyrios Kyrtzidis [Thu, 15 Nov 2012 18:57:22 +0000 (18:57 +0000)]
[modules] Setup the import location of a module file and use it
as the include location of the main file of an imported module.

llvm-svn: 168061

11 years agotsan: remove unused parameter
Dmitry Vyukov [Thu, 15 Nov 2012 18:49:08 +0000 (18:49 +0000)]
tsan: remove unused parameter

llvm-svn: 168060

11 years agotsan: switch to 4 shadow cells by default (since that's what we use everywhere now)
Dmitry Vyukov [Thu, 15 Nov 2012 18:44:22 +0000 (18:44 +0000)]
tsan: switch to 4 shadow cells by default (since that's what we use everywhere now)

llvm-svn: 168059

11 years agomisspell
Andrew Trick [Thu, 15 Nov 2012 18:40:31 +0000 (18:40 +0000)]
misspell

llvm-svn: 168058

11 years agowhitespace
Andrew Trick [Thu, 15 Nov 2012 18:40:29 +0000 (18:40 +0000)]
whitespace

llvm-svn: 168057

11 years agoComment to XML conversion: convert some tests to use the new [[@LINE]]
Dmitri Gribenko [Thu, 15 Nov 2012 18:37:27 +0000 (18:37 +0000)]
Comment to XML conversion: convert some tests to use the new [[@LINE]]
FileCheck feature.  This will hopefully make tests less fragile.

llvm-svn: 168056

11 years agoRemove unused diagnostics from TableGen files.
Dmitri Gribenko [Thu, 15 Nov 2012 18:32:56 +0000 (18:32 +0000)]
Remove unused diagnostics from TableGen files.

llvm-svn: 168055

11 years ago[reg scavenger] Fix the isUsed/isAliasUsed functions so as to not report a false
Chad Rosier [Thu, 15 Nov 2012 18:13:20 +0000 (18:13 +0000)]
[reg scavenger] Fix the isUsed/isAliasUsed functions so as to not report a false
positive.

In this particular case, R6 was being spilled by the register scavenger when it
was in fact dead.  The isUsed function reported R6 as used because the R6_R7
alias was reserved (due to the fact that we've reserved R7 as the FP).  The
solution is to only check if the original register (i.e., R6) isReserved and
not the aliases.  The aliases are only checked to make sure they're available.

The test case is derived from one of the nightly tester benchmarks and is rather
intractable and difficult to reproduce, so I haven't included it.
rdar://12592448

llvm-svn: 168054

11 years ago<rdar://problem/11782181>
Greg Clayton [Thu, 15 Nov 2012 18:05:43 +0000 (18:05 +0000)]
<rdar://problem/11782181>

Fixed an issue where lldb was setting breakpoints on too many methods when a partial function name with namespaces or class qualifiers was used. For example setting a breakpoint of "Foo::dealloc" was accidentally settings breakpoints on all objective C functions whose selector was "dealloc"...

llvm-svn: 168053

11 years agoRemove aborts under __dynamic_cast which were under _LIBCXX_DYNAMIC_FALLBACK. Change...
Howard Hinnant [Thu, 15 Nov 2012 18:00:42 +0000 (18:00 +0000)]
Remove aborts under __dynamic_cast which were under _LIBCXX_DYNAMIC_FALLBACK.  Change all type_info comparisons to use an inlined is_equal helper.  However no change in functionality for this latter change at this time.  This is just to encapsulate the comparison and make it a little easier to switch back and forth for testing/debugging.

llvm-svn: 168052

11 years agoFix indeterminism in MI scheduler DAG construction.
Sergei Larin [Thu, 15 Nov 2012 17:45:50 +0000 (17:45 +0000)]
Fix indeterminism in MI scheduler DAG construction.
Similarly to several recent fixes throughout the code replace std::map use with the MapVector.
Add find() method to the MapVector.

llvm-svn: 168051

11 years agotsan: eevn better handling of signals
Dmitry Vyukov [Thu, 15 Nov 2012 17:40:49 +0000 (17:40 +0000)]
tsan: eevn better handling of signals
add interceptor for poll()
in addition process signals in every atomic op
in addition process signals in blocking libc functions

llvm-svn: 168050

11 years agoUse empty parens for empty function parameter list instead of '(void)'.
Dmitri Gribenko [Thu, 15 Nov 2012 16:51:49 +0000 (16:51 +0000)]
Use empty parens for empty function parameter list instead of '(void)'.

llvm-svn: 168049

11 years agoFileCheck: remove useless 'continue' at the end of a 'while(){}' loop.
Dmitri Gribenko [Thu, 15 Nov 2012 16:50:59 +0000 (16:50 +0000)]
FileCheck: remove useless 'continue' at the end of a 'while(){}' loop.

llvm-svn: 168048

11 years agoSimplify code. No functionality change.
Benjamin Kramer [Thu, 15 Nov 2012 16:40:35 +0000 (16:40 +0000)]
Simplify code. No functionality change.

llvm-svn: 168047

11 years ago[ASan] Revert r168040 and r168043 and take a cleaner solution suggested by Kostya...
Alexander Potapenko [Thu, 15 Nov 2012 15:24:42 +0000 (15:24 +0000)]
[ASan] Revert r168040 and r168043 and take a cleaner solution suggested by Kostya: return the known frame name for fake stack instead of looking it up.

llvm-svn: 168046

11 years agoDo not cache a pointer to ExprEvalContexts.back().
Benjamin Kramer [Thu, 15 Nov 2012 15:18:42 +0000 (15:18 +0000)]
Do not cache a pointer to ExprEvalContexts.back().

It may become a dangling pointer if the underlying SmallVector reallocates.
Sadly the testcase is really large and doesn't reduce well because of
SmallVector's reallocation patterns.

Fixes PR14336.

llvm-svn: 168045

11 years ago[ASan] Minor fix: return to the last byte of the fake stack if we've raced by.
Alexander Potapenko [Thu, 15 Nov 2012 14:59:19 +0000 (14:59 +0000)]
[ASan] Minor fix: return to the last byte of the fake stack if we've raced by.

llvm-svn: 168043

11 years agoDo not handle void types in DataLayout. Patch by Patrick Hägglund.
Duncan Sands [Thu, 15 Nov 2012 14:45:30 +0000 (14:45 +0000)]
Do not handle void types in DataLayout.  Patch by Patrick Hägglund.

llvm-svn: 168042

11 years agoUse empty parens for empty function parameter list instead of '(void)'.
Dmitri Gribenko [Thu, 15 Nov 2012 14:28:07 +0000 (14:28 +0000)]
Use empty parens for empty function parameter list instead of '(void)'.

llvm-svn: 168041

11 years ago[ASan] Poison the leftmost shadow byte with a special value so that we can find
Alexander Potapenko [Thu, 15 Nov 2012 13:40:44 +0000 (13:40 +0000)]
[ASan] Poison the leftmost shadow byte with a special value so that we can find
the beginning of the fake frame when reporting an use-after-return error.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=126

llvm-svn: 168040

11 years ago[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Clang...
Alexey Samsonov [Thu, 15 Nov 2012 12:40:37 +0000 (12:40 +0000)]
[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Clang part.

llvm-svn: 168039

11 years ago[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Compiler...
Alexey Samsonov [Thu, 15 Nov 2012 12:37:55 +0000 (12:37 +0000)]
[UBSan] Add support for building ubsan runtime library on Linux with 'make'. Compiler-rt part.

llvm-svn: 168038

11 years agoMake GlobalOpt be conservative with TLS variables (PR14309)
Hans Wennborg [Thu, 15 Nov 2012 11:40:00 +0000 (11:40 +0000)]
Make GlobalOpt be conservative with TLS variables (PR14309)

For global variables that get the same value stored into them
everywhere, GlobalOpt will replace them with a constant. The problem is
that a thread-local GlobalVariable looks like one value (the address of
the TLS var), but is different between threads.

This patch introduces Constant::isThreadDependent() which returns true
for thread-local variables and constants which depend on them (e.g. a GEP
into a thread-local array), and teaches GlobalOpt not to track such
values.

llvm-svn: 168037

11 years agoAdd support for SPIR64 target - the 64bit counterpart of SPIR.
Guy Benyei [Thu, 15 Nov 2012 10:35:47 +0000 (10:35 +0000)]
Add support for SPIR64 target - the 64bit counterpart of SPIR.

The new OpenCL SPIR extension spec will define separate SPIR for 32 and 64 bit architectures.

llvm-svn: 168036

11 years agoFix a crash observed by Shuxin Yang. The issue here is that LinearizeExprTree,
Duncan Sands [Thu, 15 Nov 2012 09:58:38 +0000 (09:58 +0000)]
Fix a crash observed by Shuxin Yang.  The issue here is that LinearizeExprTree,
the utility for extracting a chain of operations from the IR, thought that it
might as well combine any constants it came across (rather than just returning
them along with everything else).  On the other hand, the factorization code
would like to see the individual constants (this is quite reasonable: it is
much easier to pull a factor of 3 out of 2*3 than it is to pull it out of 6;
you may think 6/3 isn't so hard, but due to overflow it's not as easy to undo
multiplications of constants as it may at first appear).  This patch therefore
makes LinearizeExprTree stupider: it now leaves optimizing to the optimization
part of reassociate, and sticks to just analysing the IR.

llvm-svn: 168035

11 years ago[ASan] Add the "lea $imm(%rip),%rax" instruction to mach_override.c
Alexander Potapenko [Thu, 15 Nov 2012 08:32:16 +0000 (08:32 +0000)]
[ASan] Add the "lea $imm(%rip),%rax" instruction to mach_override.c
The need for this has been reported by Jack Howarth (howarth@bromo.med.uc.edu) who's porting ASan-Darwin to GCC

llvm-svn: 168032

11 years agoTeach the uninitialized field warning about anonymous structs and union members.
Nick Lewycky [Thu, 15 Nov 2012 08:19:20 +0000 (08:19 +0000)]
Teach the uninitialized field warning about anonymous structs and union members.
Fixes PR14073!

llvm-svn: 168031

11 years agoRevert changing FNEG of v4f32 to Expand. It's legal.
Craig Topper [Thu, 15 Nov 2012 08:09:46 +0000 (08:09 +0000)]
Revert changing FNEG of v4f32 to Expand. It's legal.

llvm-svn: 168030

11 years agoMake FNEG and FABS of v4f32 Expand.
Craig Topper [Thu, 15 Nov 2012 08:06:12 +0000 (08:06 +0000)]
Make FNEG and FABS of v4f32 Expand.

llvm-svn: 168029

11 years agoMake a bunch of floating point operations on vectors Expand so that instruction selec...
Craig Topper [Thu, 15 Nov 2012 08:02:19 +0000 (08:02 +0000)]
Make a bunch of floating point operations on vectors Expand so that instruction selection won't fail.

llvm-svn: 168028

11 years agoMake -ffp-contract a codegen option, rather than a laguage option. This makes
Lang Hames [Thu, 15 Nov 2012 07:51:26 +0000 (07:51 +0000)]
Make -ffp-contract a codegen option, rather than a laguage option. This makes
more sense anyway - it determines how expressions are codegen'd. It also ensures
that -ffp-contract=fast has the intended effect when compiling LLVM IR.

llvm-svn: 168027

11 years agoAdd missing documentation for llvm.exp2, llvm.log10, and llvm.log2.
Craig Topper [Thu, 15 Nov 2012 07:01:39 +0000 (07:01 +0000)]
Add missing documentation for llvm.exp2, llvm.log10, and llvm.log2.

llvm-svn: 168026

11 years agoAdd llvm.ceil, llvm.trunc, llvm.rint, llvm.nearbyint intrinsics.
Craig Topper [Thu, 15 Nov 2012 06:51:10 +0000 (06:51 +0000)]
Add llvm.ceil, llvm.trunc, llvm.rint, llvm.nearbyint intrinsics.

llvm-svn: 168025

11 years agoRevert r167567, restoring the ability of clang to run gcc in cases where it
Nick Lewycky [Thu, 15 Nov 2012 05:36:36 +0000 (05:36 +0000)]
Revert r167567, restoring the ability of clang to run gcc in cases where it
can't handle the input file type. This resulted in PR14338.

llvm-svn: 168024

11 years agoFix an off-by-one error by switching < to <= in -Wtautological-constant-out-of-range...
Richard Trieu [Thu, 15 Nov 2012 03:43:50 +0000 (03:43 +0000)]
Fix an off-by-one error by switching < to <= in -Wtautological-constant-out-of-range-compare and added test case.

llvm-svn: 168023

11 years agoDo not use data recursion in ASTMatchFinder.
Daniel Jasper [Thu, 15 Nov 2012 03:29:05 +0000 (03:29 +0000)]
Do not use data recursion in ASTMatchFinder.

The matchers rely on the complete AST being traversed as shown by the new test cases.

llvm-svn: 168022

11 years agoFix an obvious merge bug in -join-globalcopies (disabled).
Andrew Trick [Thu, 15 Nov 2012 02:32:22 +0000 (02:32 +0000)]
Fix an obvious merge bug in -join-globalcopies (disabled).

Jakub Staszak spotted this in review. I don't notice these things
until I manually rerun benchmarks. But reducing unit tests is a very
high priority.

llvm-svn: 168021

11 years ago[analyzer] Fix test case broken by previous commit.
Jordan Rose [Thu, 15 Nov 2012 02:17:09 +0000 (02:17 +0000)]
[analyzer] Fix test case broken by previous commit.

llvm-svn: 168020

11 years ago[analyzer] Make sure calls in synthesized functions have valid path locations.
Jordan Rose [Thu, 15 Nov 2012 02:07:23 +0000 (02:07 +0000)]
[analyzer] Make sure calls in synthesized functions have valid path locations.

We do this by using the "most recent" good location: if a synthesized
function 'A' calls another function 'B', the path notes for the call to 'B'
will be placed at the same location as the path note for calling 'A'.

Similarly, the call to 'A' will have a note saying "Entered call from...",
and now we just don't emit that (since the user doesn't have a body to look
at anyway).

Previously, we were doing this for the "Calling..." notes, but not for the
"Entered call from..." or "Returning to caller". This caused a crash when
the path entered and then exiting a call within a synthesized body.

<rdar://problem/12657843>

llvm-svn: 168019

11 years agoIn cases where the Objective-C ivar symbols are stripped out,
Sean Callanan [Thu, 15 Nov 2012 02:02:04 +0000 (02:02 +0000)]
In cases where the Objective-C ivar symbols are stripped out,
expressions that refer to ivars will not work because Clang
emits IR that refers to them to get the ivar offsets.
However, it is possible to search the runtime for these values.

I have added support for reading the relevant tables to the
Objective-C runtime, and extended ClangExpressionDeclMap to
query that information if and only if it doesn't find the symbols
in the binary.

Also added a testcase.

<rdar://problem/12628122>

llvm-svn: 168018