Commit Graph

101130 Commits

Author SHA1 Message Date
Chris Lattner 50c3c1316a Inline LocalInstantiationScope::getInstantiationOf into its one
client, making room for future hacking.

llvm-svn: 125770
2011-02-17 19:47:42 +00:00
Chris Lattner 15a776fff7 remove some defensive code: LocalInstantiationScope::getInstantiationOf
and findInstantiationOf can never return null, even on invalid code.

llvm-svn: 125769
2011-02-17 19:38:27 +00:00
Chris Lattner bdc1a42aef remove some dead overloads.
llvm-svn: 125768
2011-02-17 19:37:28 +00:00
Johnny Chen 2789706059 Add EmulateTB() method to emulate "Table Branch Byte" and "Table Branch Halfword"
operations for Thumb2.

llvm-svn: 125767
2011-02-17 19:34:27 +00:00
Caroline Tice 032d2dd576 Add stubs for pseudocode functions "MemA[]" amd "MemU[]", corresponding to aligned
and unaligned memory accesses.  The new stub functions are MemARead, MemAWrite,
MemURead, and MemUWrite.  At the moment these stubs just call ReadMemoryUnsigned or
WriteMemoryUnsigned, but we can fill them out further later if we decide we need
more accurate emulation of the memory system.

Replaced all the direct calls to ReadMemoryUnsigned and WriteMemoryUnsigned in
EmulateInstructionARM.cpp with calls to the appropriate new stub function.

llvm-svn: 125766
2011-02-17 19:20:40 +00:00
David Greene 3a2b508e8f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.

llvm-svn: 125765
2011-02-17 19:18:59 +00:00
Jakob Stoklund Olesen 93c8736abb Split local live ranges.
A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

llvm-svn: 125764
2011-02-17 19:13:53 +00:00
Douglas Gregor d6f8124c9c Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful
llvm-svn: 125762
2011-02-17 19:04:40 +00:00
John McCall e6be5e1c0d Remove the "conditional save" hashtables from IR generation.
llvm-svn: 125761
2011-02-17 19:02:56 +00:00
Douglas Gregor 428d75ffd9 The internal -fdump-record-layouts flag already dumps the layout when it was computed; no need to do so again at the end of the translation unit
llvm-svn: 125760
2011-02-17 18:59:06 +00:00
Dan Gohman f0f8e14370 The labyrinthine X86 backend no longer appears to require
these patterns.

llvm-svn: 125759
2011-02-17 18:50:19 +00:00
Argyrios Kyrtzidis 9d5235d527 When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow Checkers.inc to be
included without '..', thus being compatible with build systems of *BSDs.

Patch by Joerg Sonnenberger!

llvm-svn: 125758
2011-02-17 18:40:33 +00:00
Douglas Gregor 65f57fe6ea Replace a FIXME with a comment describing why we did what we did
llvm-svn: 125757
2011-02-17 18:32:37 +00:00
Douglas Gregor e5de7013c7 Remove the last virtual member function from the Decl hierarchy,
reducing the size of all declarations by one pointer. For a 64-bit
Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of
ASTContext's memory usage for this header).

llvm-svn: 125756
2011-02-17 18:14:32 +00:00
Douglas Gregor b494173c93 Devirtualize TagDecl::completeDefinition().
llvm-svn: 125755
2011-02-17 18:06:05 +00:00
Douglas Gregor fe590dfa84 Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().
llvm-svn: 125754
2011-02-17 17:39:40 +00:00
Johnny Chen 0f60574fd7 Move Align(val, alignment) utility function to ARMUtils.h.
llvm-svn: 125753
2011-02-17 17:31:08 +00:00
Fariborz Jahanian 5fc74804a6 Improve diagnostics on missing property decl.
llvm-svn: 125752
2011-02-17 17:30:05 +00:00
Douglas Gregor a991f3a4e9 Devirtualize NamedDecl::getNameForDiagnostic().
llvm-svn: 125751
2011-02-17 17:23:19 +00:00
Douglas Gregor 0215459c37 Devirtualize RedeclarableTemplateDecl::newCommon().
llvm-svn: 125750
2011-02-17 17:10:20 +00:00
Duncan Sands c6196aa481 Fix wrong logic in promotion of signed mul-with-overflow (I pointed this out at
the time but presumably my email got lost).  Examples where the previous logic
got it wrong: (1) a signed i8 multiply of 64 by 2 overflows, but the high part is
zero; (2) a signed i8 multiple of -128 by 2 overflows, but the high part is all
ones. 

llvm-svn: 125748
2011-02-17 12:42:48 +00:00
NAKAMURA Takumi 4c14a5cc2c Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

llvm-svn: 125747
2011-02-17 12:24:17 +00:00
NAKAMURA Takumi 0544fe7287 Fix whitespace.
llvm-svn: 125746
2011-02-17 12:23:50 +00:00
Chandler Carruth 22c7a79a1d Implement a sub-group of -Wconversion: -Wliteral-conversion. This
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.

Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.

llvm-svn: 125745
2011-02-17 11:05:49 +00:00
John McCall c07a0c7e48 Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr.  This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait;  or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here.  In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some          
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.

llvm-svn: 125744
2011-02-17 10:25:35 +00:00
NAKAMURA Takumi 49ddc3646f lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.
llvm-svn: 125743
2011-02-17 08:51:47 +00:00
NAKAMURA Takumi 31ea2f14bc Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

llvm-svn: 125742
2011-02-17 08:51:38 +00:00
NAKAMURA Takumi 029d74b264 Fix whitespace.
llvm-svn: 125741
2011-02-17 08:50:50 +00:00
Douglas Gregor 133edddd82 Devirtualize Decl::getNextRedeclaration().
llvm-svn: 125740
2011-02-17 08:47:29 +00:00
Chandler Carruth 712563bba4 Implement -Wenum-compare, which warns when comparing two enums of
different types. We omit the warning when the enum types are anonymous.
Unlike GCC, this warning does not distinguish between C++ and C/ObjC for
controling whether it is on by default, it is always on by default.

Original patch contributed by Richard Trieu (@ Google), I fixed some
style issues, and cleaned it up for submission.

llvm-svn: 125739
2011-02-17 08:37:06 +00:00
Duncan Sands 491eb276a7 This has been implemented.
llvm-svn: 125738
2011-02-17 08:16:56 +00:00
Douglas Gregor 5ee06f02f9 Simple little optimization to Decl::getCanonicalDecl(), eliminating some heavyweight machinery and indirection that we don't need
llvm-svn: 125737
2011-02-17 08:14:56 +00:00
Douglas Gregor 00716e8bd3 Devirtualize Decl::getSourceRange()
llvm-svn: 125736
2011-02-17 08:12:32 +00:00
Douglas Gregor 7edc20ac24 Devirtualize Decl::getCanonicalDecl().
llvm-svn: 125735
2011-02-17 07:58:36 +00:00
Duncan Sands e522001171 Transform "A + B >= A + C" into "B >= C" if the adds do not wrap. Likewise for some
variations (some of these were already present so I unified the code).  Spotted by my
auto-simplifier as occurring a lot.

llvm-svn: 125734
2011-02-17 07:46:37 +00:00
Chris Lattner c8e630e4db Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt.  There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself.  This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.

llvm-svn: 125733
2011-02-17 07:39:24 +00:00
Douglas Gregor f7b2c93b2f Devirtualize Decl::getBody() and Decl::hasBody().
llvm-svn: 125731
2011-02-17 07:13:24 +00:00
Douglas Gregor a43942a48e De-virtualize Decl::isOutOfLine().
llvm-svn: 125730
2011-02-17 07:02:32 +00:00
Douglas Gregor b0f2ea9e9e When printing a qualified type, look through a substituted template
parameter type to see what's behind it, so that we don't end up
printing silly things like "float const *" when "const float *" would
make more sense. Also, replace the pile of "isa" tests with a simple
switch enumerating all of the cases, making a few more obvious cases
use prefix qualifiers.

llvm-svn: 125729
2011-02-17 06:52:25 +00:00
Cameron Zwarich 83f4cee199 Switch to SmallVector in SimpleRegisterCoalescing for a 3.5% speedup on 403.gcc.
llvm-svn: 125728
2011-02-17 06:52:07 +00:00
Cameron Zwarich ecd44922ab Adjust indenting of arguments.
llvm-svn: 125727
2011-02-17 06:13:46 +00:00
Cameron Zwarich 0b0cc4d75e Return Changed from SplitPHIEdges rather than always returning true.
llvm-svn: 125726
2011-02-17 06:13:43 +00:00
NAKAMURA Takumi 5850225f52 lit/TestingConfig.py: Add the environment variable PRINTF_EXPONENT_DIGITS as workaround [PR6745] for mingw's tests. Danil Malyshev suggested this.
FIXME: It does not improve MSVC's issue.

[Danil Malyshev] Defining PRINTF_EXPONENT_DIGITS env is the suggested way to make MinGW ANSI/POSIX compatible. This is not only about the case we are discussing, but in general, I'd like to have explicitly defined compatibility mode for all the tests running on MinGW.

llvm-svn: 125725
2011-02-17 05:56:41 +00:00
Chris Lattner 5a9b1ec94c simplify a bit.
llvm-svn: 125724
2011-02-17 05:38:27 +00:00
Chris Lattner e281e99f76 tidy up
llvm-svn: 125723
2011-02-17 05:19:40 +00:00
Douglas Gregor 230a7e60b1 Improve parser recovery in "for" statements, from Richard Smith!
llvm-svn: 125722
2011-02-17 03:38:46 +00:00
Alexis Hunt e2d77b8142 Add serialization for Expr* arguments for attributes to clang tablegen files.
Patch thanks to Zach Anderson.

llvm-svn: 125721
2011-02-17 03:30:09 +00:00
Douglas Gregor 0e5d72f164 I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.
I will not hold on to temporary StringRefs.

llvm-svn: 125718
2011-02-17 03:19:26 +00:00
Douglas Gregor 9c1f1bfedc When Parser::ParseExpressionList isn't given a completer, fall back to
normal "expression" completion. Fixes the most annoying
code-completion bug I've found.

llvm-svn: 125715
2011-02-17 03:09:23 +00:00
Matt Beaumont-Gay 956fc1cb81 Fix PR9025 and add a diagnostic (and sometimes a fixit) for an overloaded
function name used as the base of a member expression. Early feedback from
Chandler Carruth, and code review from Nick Lewycky.

llvm-svn: 125714
2011-02-17 02:54:17 +00:00