Commit Graph

71764 Commits

Author SHA1 Message Date
Ted Kremenek 0b61a805b9 Add FIXIT hint for -Wsemicolon-before-method-body
llvm-svn: 86746
2009-11-10 22:55:49 +00:00
Eli Friedman d76f438369 Revert r86741; it doesn't handle virtual bases correctly.
llvm-svn: 86745
2009-11-10 22:48:10 +00:00
Eli Friedman 0960059c0c Minor optimization to skip null check in generated code where it isn't
necessary.

llvm-svn: 86741
2009-11-10 22:42:26 +00:00
Chris Lattner 9518fbb54e implement a TODO by teaching jump threading about "xor x, 1".
llvm-svn: 86739
2009-11-10 22:39:16 +00:00
Eli Friedman 3ad2645430 Fix for PR5454: make sure to use the right block as the predecessor in the
generated PHI node for the null check of a new operator.

llvm-svn: 86738
2009-11-10 22:39:09 +00:00
Chris Lattner 852d6d64ff move some generally useful functions out of jump threading
into libanalysis and transformutils.

llvm-svn: 86735
2009-11-10 22:26:15 +00:00
Ted Kremenek 42855f2043 Shuffle order of warning declarations (alphabetize).
llvm-svn: 86733
2009-11-10 22:22:50 +00:00
Dan Gohman de8d418ac3 Don't mark conditional branch instructions as control barriers.
llvm-svn: 86732
2009-11-10 22:16:57 +00:00
Ted Kremenek f9a28abe8d Make -Wsemicolon-before-method-body opt-in (and part of -Wextra). Addresses <rdar://problem/7381735>.
llvm-svn: 86731
2009-11-10 22:16:29 +00:00
Bill Wendling fc9469f311 Modify how the prologue encoded the "move" information for the FDE. GCC
generates a sequence similar to this:

__Z4funci:
LFB2:
        mflr r0
LCFI0:
        stmw r30,-8(r1)
LCFI1:
        stw r0,8(r1)
LCFI2:
        stwu r1,-80(r1)
LCFI3:
        mr r30,r1
LCFI4:

where LCFI3 and LCFI4 are used by the FDE to indicate what the FP, LR, and other
things are. We generated something more like this:

Leh_func_begin1:
        mflr r0
        stw r31, 20(r1)
        stw r0, 8(r1)
Llabel1:
        stwu r1, -80(r1)
Llabel2:
        mr r31, r1

Note that we are missing the "mr" instruction. This patch makes it more like the
GCC output.

llvm-svn: 86729
2009-11-10 22:14:04 +00:00
Daniel Dunbar 47ea8628a5 Decouple more of clang-cc by moving ImplicitP[CT]H options into
PreprocessorOptions.

Global variables used as [in] [out] parameters considered harmful.

llvm-svn: 86728
2009-11-10 22:09:38 +00:00
Devang Patel 42c1d17dd1 Process InlinedAt location info.
Update InsertDeclare to return newly inserted llvm.dbg.declare intrinsic.

llvm-svn: 86727
2009-11-10 22:05:35 +00:00
Chris Lattner 02e2cee7dc fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter!

llvm-svn: 86726
2009-11-10 22:02:09 +00:00
Jakob Stoklund Olesen 4453dc976b Teach PHIElimination to split critical edges when -split-phi-edges is enabled.
Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.

llvm-svn: 86725
2009-11-10 22:01:05 +00:00
Jakob Stoklund Olesen 19f235e455 Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

llvm-svn: 86724
2009-11-10 22:00:56 +00:00
Chris Lattner 40b15f220d improve comment.
llvm-svn: 86723
2009-11-10 21:45:09 +00:00
Chris Lattner 80e7e5a429 Make jump threading eliminate blocks that just contain phi nodes,
debug intrinsics, and an unconditional branch when possible.  This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.

llvm-svn: 86722
2009-11-10 21:40:01 +00:00
Ted Kremenek 4a720a363c Update CMake file.
llvm-svn: 86721
2009-11-10 21:38:41 +00:00
Benjamin Kramer aed9a1aadb Add newline at EOF.
llvm-svn: 86720
2009-11-10 21:33:20 +00:00
Benjamin Kramer 2c9a91c290 Silence warning.
llvm-svn: 86719
2009-11-10 21:29:56 +00:00
Dan Gohman ad5ef3d70f Use #include <stdio.h> when using fprintf and stderr.
llvm-svn: 86717
2009-11-10 21:21:27 +00:00
Evan Cheng 87fe40b32d Generalize lsr code that optimize loop to count down towards zero.
llvm-svn: 86715
2009-11-10 21:14:05 +00:00
Dan Gohman 1f31f6e265 Optimize test more.
llvm-svn: 86714
2009-11-10 21:02:18 +00:00
Victor Hernandez bb336a1987 make this handle redefinition of malloc function with different prototype correctly
llvm-svn: 86712
2009-11-10 19:53:28 +00:00
Daniel Dunbar f89a32ac45 clang-cc: Start moving "pure" option handling to Options.cpp, to separate it
from the logic part of clang-cc, and to enforce limited scoping.

llvm-svn: 86711
2009-11-10 19:51:53 +00:00
Daniel Dunbar d96cd43f13 clang-cc: Sink more options inside codegenopts namespace.
llvm-svn: 86710
2009-11-10 19:51:46 +00:00
Daniel Dunbar a35a2cb56b Change LangOpts initialization to directly test the code generation options,
instead of reproducing their logic.

llvm-svn: 86709
2009-11-10 19:51:33 +00:00
Douglas Gregor b53edfb8dc Improve parsing of template arguments to lay the foundation for
handling template template parameters properly. This refactoring:

  - Parses template template arguments as id-expressions, representing
    the result of the parse as a template name (Action::TemplateTy)
    rather than as an expression (lame!).

  - Represents all parsed template arguments via a new parser-specific
    type, ParsedTemplateArgument, which stores the kind of template
    argument (type, non-type, template) along with all of the source
    information about the template argument. This replaces an ad hoc
    set of 3 vectors (one for a void*, which was either a type or an
    expression; one for a bit telling whether the first was a type or
    an expression; and one for a single source location pointing at
    the template argument).

  - Moves TemplateIdAnnotation into the new Parse/Template.h. It never
    belonged in the Basic library anyway.

llvm-svn: 86708
2009-11-10 19:49:08 +00:00
Evan Cheng e034867587 Change Thumb1 address mode printing, instead of
[r0, #2 * 4]
Now
[r0, #8]

This makes Thumb2 assembly more uniform and frankly the scale doesn't add much.

llvm-svn: 86707
2009-11-10 19:48:13 +00:00
Evan Cheng e6548f4106 Add a comment.
llvm-svn: 86706
2009-11-10 19:44:56 +00:00
Duncan Sands 23344095de Add defensive break.
llvm-svn: 86705
2009-11-10 19:36:40 +00:00
Fariborz Jahanian dc21610419 Changed a variable name to match what it represents
(Ted's feedback).

llvm-svn: 86702
2009-11-10 19:31:09 +00:00
Fariborz Jahanian 1254a0978c This patch implements Code gen. for destruction of
global array of objects.

llvm-svn: 86701
2009-11-10 19:24:06 +00:00
Ted Kremenek ba64574c9a CIndex: Only display diagnostics to llvm::errs() when the client has set the 'displayDiagnostics' option to 1 in clang_createIndex(). This fixes <rdar://problem/7370691>.
llvm-svn: 86700
2009-11-10 19:18:52 +00:00
Mike Stump b47222144b Only generate a VTT for classes that need a VTT.
llvm-svn: 86699
2009-11-10 19:13:04 +00:00
Daniel Dunbar f76c9d270a Driver: Run 'clang' in C++ mode based on the name it was invoked by. We match
anything that ends with ++ or ++-FOO (e.g., c++, clang++, clang++-1.1) as being
a "C++ compiler".

This allows easy testing of the C++ compiler by 'ln -s clang clang++', or by 'cp
clang clang++'.

Based on patch by Roman Divacky.

llvm-svn: 86697
2009-11-10 18:47:41 +00:00
Daniel Dunbar ef2919f1fa Factor out parts of InitializeCompileOptions that depend on the LangOptions.
llvm-svn: 86696
2009-11-10 18:47:35 +00:00
Daniel Dunbar b9415c7d9a Add a monstrous hack to improve X86ISelDAGToDAG compile time.
- Force NDEBUG on in any Release build. This drops the compile time to ~100s
   from ~600s, in Release mode.

 - This may just be a temporary workaround, I don't know the true nature of the
   gcc-4.2 compile time performance problem.

llvm-svn: 86695
2009-11-10 18:24:37 +00:00
Duncan Sands 8d4cde2b55 Fix obvious typo.
llvm-svn: 86694
2009-11-10 18:21:37 +00:00
Daniel Dunbar be50f5ab9d Localize -disable-llvm-optzns handling to BackendConsumer::CreatePasses.
- This is conceptually better since the only thing we want this option to do is
   preserve the internal module as constructed by IRgen, before running any
   passes.

 - This also fixes bugs in -disable-llvm-optzns handling with regards to debug
   info.

llvm-svn: 86691
2009-11-10 17:50:53 +00:00
Daniel Dunbar ede182ef05 clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope.
llvm-svn: 86690
2009-11-10 17:50:42 +00:00
Chris Lattner b8f79ba10e clarify logic.
llvm-svn: 86689
2009-11-10 17:00:47 +00:00
Daniel Dunbar 68ac06142b Cleanup some clang-cc FIXMEs
llvm-svn: 86686
2009-11-10 16:23:44 +00:00
Daniel Dunbar 754c11ec48 Add CompileOptions to CompilerInvocation.
llvm-svn: 86685
2009-11-10 16:19:45 +00:00
Douglas Gregor 66df54f92c CMake: Add Darwin-specific linker flags for building loadable modules
llvm-svn: 86684
2009-11-10 15:30:33 +00:00
Duncan Sands 1925d3a1d1 Teach DSE to eliminate useless trampolines.
llvm-svn: 86683
2009-11-10 13:49:50 +00:00
Duncan Sands 04e0c95248 Add brackets to make gcc-4.4 happy.
llvm-svn: 86681
2009-11-10 09:32:10 +00:00
John McCall b8be78b753 Fix a similar problem with qualified lookup through using directives,
although in this case we probably just run a risk of duplicating work;
I can't think of how this could cause a bug.

llvm-svn: 86680
2009-11-10 09:25:37 +00:00
John McCall 9757d0363d Make a somewhat more convincing test case for unqualified lookup through
using directives, and fix a bug thereby exposed:  since we're playing
tricks with pointers, we need to make certain we're always using the same 
pointers for things.
Also tweak an existing error message.

llvm-svn: 86679
2009-11-10 09:20:04 +00:00
Duncan Sands dca0c28452 Codegen support for the llvm.invariant/lifetime.start/end intrinsics:
just throw them away.

llvm-svn: 86678
2009-11-10 09:08:09 +00:00