| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
are formed. In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a
ton of random stuff. This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.
In addition to introducing DiagnosticInfo, this also substantially changes how
Diagnostic::Report works. Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and
ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator. When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information. This is a somewhat tricky dance, but it means that the
accumulated DiagnosticInfo is allowed to keep pointers to other expression
temporaries without those pointers getting invalidated.
This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema. For example, instead of calling:
Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
SourceRange(BuiltinLoc, RParenLoc));
We will soon be able to just do:
Diag(BuiltinLoc, diag::err_overload_no_match)
<< typeNames << SourceRange(BuiltinLoc, RParenLoc));
This scales better to support arbitrary types being passed in (not just
strings) in a type-safe way. Go operator overloading?!
llvm-svn: 59502
|
| |
|
|
|
|
|
|
| |
strings instead of array of strings. This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.
llvm-svn: 59494
|
| |
|
|
|
|
|
|
| |
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
llvm-svn: 59441
|
| |
|
|
|
|
| |
moment.
llvm-svn: 59435
|
| |
|
|
| |
llvm-svn: 59433
|
| |
|
|
| |
llvm-svn: 59426
|
| |
|
|
| |
llvm-svn: 59405
|
| |
|
|
| |
llvm-svn: 59404
|
| |
|
|
|
|
| |
Patch by Fariborz!
llvm-svn: 59377
|
| |
|
|
| |
llvm-svn: 59375
|
| |
|
|
| |
llvm-svn: 59372
|
| |
|
|
| |
llvm-svn: 59371
|
| |
|
|
| |
llvm-svn: 59358
|
| |
|
|
| |
llvm-svn: 59345
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function call created in response to the use of operator syntax that
resolves to an overloaded operator in C++, e.g., "str1 +
str2" that resolves to std::operator+(str1, str2)". We now build a
CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
only for binary operators, where we actually implement overloading)
I decided *not* to refactor the current CallExpr to make it abstract
(with FunctionCallExpr and CXXOperatorCallExpr as derived
classes). Doing so would allow us to make CXXOperatorCallExpr a little
bit smaller, at the cost of making the argument and callee accessors
virtual. We won't know if this is going to be a win until we can parse
lots of C++ code to determine how much memory we'll save by making
this change vs. the performance penalty due to the extra virtual
calls.
llvm-svn: 59306
|
| |
|
|
|
|
|
| |
- Logic such as this quite possibly should be optional builder
behavior.
llvm-svn: 59213
|
| |
|
|
|
|
|
|
|
|
| |
landing pads.
- Primarily a cleanliness issue instead of a performance issue (this
eliminates all blocks w/o predecessors on 176.gcc/expr.c), but this
also allows subsequent code to recognize it is unreachable and
potentially avoid IRgen.
llvm-svn: 59211
|
| |
|
|
|
|
|
|
|
|
| |
- Use dotted notation for blocks related to a particular statement
type.
- Use .end for landing pads.
No functionality change in NDEBUG mode. :)
llvm-svn: 59210
|
| |
|
|
|
|
|
|
|
|
| |
- Indicates that caller is done with the block and it can be dropped
if it has no predecessors. Useful for callers who need to make
landing pads but which may not be reached.
No functionality change.
llvm-svn: 59207
|
| |
|
|
|
|
|
|
| |
more confusing ifelse.
Use dotted names for if blocks (if.then vs ifthen).
llvm-svn: 59201
|
| |
|
|
|
|
|
|
|
| |
something that is not an int.
- Ignore these cases for now, added FIXME that we should also boolize
them.
llvm-svn: 59184
|
| |
|
|
| |
llvm-svn: 59130
|
| |
|
|
| |
llvm-svn: 59129
|
| |
|
|
|
|
| |
what "cond.?" means, and this avoids quoting).
llvm-svn: 59128
|
| |
|
|
| |
llvm-svn: 59127
|
| |
|
|
|
|
| |
This cuts another 200 lines off expr.ll, forming 23 selects.
llvm-svn: 59124
|
| |
|
|
|
|
|
|
| |
This happens for stuff like this:
x = cond1 || cond2 || cond3 || cond4;
llvm-svn: 59123
|
| |
|
|
|
|
| |
constant folding.
llvm-svn: 59121
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Split out "simple" statements which can easily handle IR generation
when there is no insert point. These are generally statements which
start by emitting a new block or are only containers for other
statements.
- This fixes a regression in emitting dummy blocks, notably for case
statements.
- This also fixes spurious emission of a number of debug stoppoint
intrinsic instructions.
Remove unneeded sw.body block, just clear the insertion point.
Lift out CodeGenFunction::EmitStopPoint which calls into the
CGDebugInfo class when generating debug info.
Normalize definitions of Emit{Break,Continue}Stmt and usage of
ErrorUnsupported.
llvm-svn: 59118
|
| |
|
|
|
|
| |
codegen stuff like "if (!(X && Y))"
llvm-svn: 59115
|
| |
|
|
|
|
| |
shrinks code yet again by a bit.
llvm-svn: 59114
|
| |
|
|
|
|
|
|
|
|
| |
CodeGenFunction.cpp. Change VisitConditionalOperator to use
constant fold instead of codegen'ing a constant conditional.
Change ForStmt to use EmitBranchOnBoolExpr, this shrinks
expr.c very slightly to 40239 lines.
llvm-svn: 59113
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
have a condition that is an &&/||. Before we used to compile things like this:
int test() {
if (x && y) foo(); else bar();
}
into:
%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_rhs, label %land_cont
land_rhs: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br label %land_cont
land_cont: ; preds = %land_rhs, %entry
%4 = phi i1 [ false, %entry ], [ %3, %land_rhs ] ; <i1> [#uses=1]
br i1 %4, label %ifthen, label %ifelse
ifthen: ; preds = %land_cont
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend
ifelse: ; preds = %land_cont
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend
ifend: ; preds = %ifelse, %ifthen
Now we turn it into the much more svelte code:
%0 = load i32* @x ; <i32> [#uses=1]
%1 = icmp ne i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %land_lhs_true, label %ifelse
land_lhs_true: ; preds = %entry
%2 = load i32* @y ; <i32> [#uses=1]
%3 = icmp ne i32 %2, 0 ; <i1> [#uses=1]
br i1 %3, label %ifthen, label %ifelse
ifthen: ; preds = %land_lhs_true
%call = call i32 (...)* @foo() ; <i32> [#uses=0]
br label %ifend
ifelse: ; preds = %land_lhs_true, %entry
%call1 = call i32 (...)* @bar() ; <i32> [#uses=0]
br label %ifend
ifend: ; preds = %ifelse, %ifthen
Note the lack of a phi node.
This shrinks the -O0 .ll file for 176.gcc/expr.c from 43176 to 40267 lines.
llvm-svn: 59111
|
| |
|
|
| |
llvm-svn: 59103
|
| |
|
|
| |
llvm-svn: 59095
|
| |
|
|
|
|
|
| |
Revert to enabling generation of instruction names when not in NDEBUG
mode.
llvm-svn: 59094
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- EmitStmt is no longer required to finish with a current insertion
point defined (i.e. it does not need to make dummy
blocks). Instead, it can clear the insertion point in the builder
which indicates that the current insertion point is unreachable.
- CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
which respectively test if there is an insert point and ensure an
insertion point exists (by making a dummy block).
- Clearly mark functions in CodeGenFunction which can be called with
no insertion point defined. Currently this is a limited set, and
EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.
Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.
Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.
The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto.
Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!
llvm-svn: 59089
|
| |
|
|
|
|
| |
invariants.
llvm-svn: 59085
|
| |
|
|
| |
llvm-svn: 59081
|
| |
|
|
|
|
| |
Patch by Ilya Okonsky!
llvm-svn: 59080
|
| |
|
|
| |
llvm-svn: 59061
|
| |
|
|
|
|
| |
expressions, both of values and types.
llvm-svn: 59057
|
| |
|
|
|
|
|
| |
- Emits an unconditional branch, with extra logic to avoid generating
spurious branches out of dummy blocks.
llvm-svn: 59037
|
| |
|
|
|
|
|
|
| |
the size of the -O0 output on some cases. For example, on expr.c from
176.gcc, it shrinks the .ll file from 43164 to 42835 lines, and removed
references to two external symbols.
llvm-svn: 59034
|
| |
|
|
|
|
|
| |
condition is a constant. This shrinks -O0 codegen by quite a bit
on some cases.
llvm-svn: 59033
|
| |
|
|
| |
llvm-svn: 59032
|
| |
|
|
|
|
|
| |
"dummy" blocks (blocks just used to make sure we have a place to dump
code to).
llvm-svn: 59022
|
| |
|
|
|
|
| |
- Was confusing and only used in one small part of the code.
llvm-svn: 59020
|
| |
|
|
|
|
| |
- No functionality change.
llvm-svn: 59017
|
| |
|
|
|
|
| |
speeds up the compiler by ~8% at -emit-llvm -O0.
llvm-svn: 58977
|