Chris Lattner
f74e28abfa
change an std::sort to an array_pod_sort call, shrinking CommandLine.o by 9%.
...
llvm-svn: 82363
2009-09-20 05:06:23 +00:00
Chris Lattner
e7c1e210c7
Several changes together in a murky mess:
...
1. Change some "\n" -> '\n'.
2. eliminte some std::string's by using raw_ostream::indent.
3. move a bunch of code out of the main arg parser routine into
a new static HandlePrefixedOrGroupedOption function.
4. Greatly simplify the implementation of getOptionPred, and make
it avoid splitting prefix options at = when that doesn't match
a non-prefix option.
llvm-svn: 82362
2009-09-20 05:03:30 +00:00
Nick Lewycky
9e085545f8
Clean up the usage of evaluateICmpRelation's return value.
...
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.
llvm-svn: 82361
2009-09-20 04:27:06 +00:00
Daniel Dunbar
ecbb126e34
Fix refacto, this code was expecting to stride past the argument prefix.
...
llvm-svn: 82360
2009-09-20 04:03:41 +00:00
Daniel Dunbar
6058b51f8c
Strip trailing whitespace.
...
llvm-svn: 82359
2009-09-20 04:03:34 +00:00
Daniel Dunbar
97f0970671
A few more tabs -> spaces.
...
llvm-svn: 82358
2009-09-20 04:03:25 +00:00
Nick Lewycky
2949a2398c
Remove dead store by taking a guess at what Chris meant. I wasn't able to
...
design a testcase that would tickle this behaviour.
llvm-svn: 82357
2009-09-20 03:48:46 +00:00
Bill Wendling
f878d70720
Still one more thing wrong here...
...
llvm-svn: 82356
2009-09-20 02:27:06 +00:00
Daniel Dunbar
7d6781b0fe
Tabs -> spaces, and remove trailing whitespace.
...
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Bill Wendling
0f899601f3
Here's fun! It turns out that these filter functions can be internal. If they're
...
internal, they shouldn't use the indirect pointer stuff. In the case of
throw_rethrow_test, it was marked as 'internal' and calculated its own offset to
its contents.
llvm-svn: 82354
2009-09-20 02:19:49 +00:00
Nick Lewycky
595b3dfcbe
Delete dead code. sext and zext can not turn integers into pointers. Further,
...
the optimization described in the comment is only valid with target data.
llvm-svn: 82353
2009-09-20 02:11:47 +00:00
Chris Lattner
5a3fa4ef33
convert argname to StringRef, simplifying LookupOption.
...
llvm-svn: 82352
2009-09-20 02:02:24 +00:00
Chris Lattner
0a40a975dd
convert 'Value' to StringRef which makes it easier to
...
maintain the "null is unspecified, empty is empty" semantics.
llvm-svn: 82351
2009-09-20 01:53:12 +00:00
Chris Lattner
40fef8032e
Change CommaSeparated processing to do it with StringRef instead of temporary std::strings.
...
This requires StringRef'izing ProvideOption which I also did.
llvm-svn: 82350
2009-09-20 01:49:31 +00:00
Nick Lewycky
e0332983fd
Value* were never meant to be const. Removing constness from the constant
...
folder removes a lot of const_casting and requires no changes to clang or
llvm-gcc.
llvm-svn: 82349
2009-09-20 01:35:59 +00:00
Chris Lattner
77c2724360
rewrite ParseCStringVector in terms of stringref.
...
llvm-svn: 82348
2009-09-20 01:33:46 +00:00
Chris Lattner
372a8ae403
move a couple non-trivial methods out of line, add new
...
find_first_of/find_first_of methods.
llvm-svn: 82347
2009-09-20 01:22:16 +00:00
Chris Lattner
1b88fbdaa3
coding style cleanup
...
llvm-svn: 82346
2009-09-20 01:11:23 +00:00
Chris Lattner
3b8adaf488
convert a bunch more stuff to use StringRef. The ArgName arguments are now
...
stringref because they may not be nul terminated. For options like -Lfoo
this now avoids a O(n) temporary std::strings where N is the length of
the string after -L.
llvm-svn: 82345
2009-09-20 00:40:49 +00:00
Chris Lattner
78765c36de
switch command line 'parse' methods to use StringRef for efficiency, which
...
is also required for an llvm-side change.
llvm-svn: 82344
2009-09-20 00:39:15 +00:00
Chris Lattner
2b807cb364
add size_t and a version of rfind that allows specification of where
...
to scan from.
llvm-svn: 82343
2009-09-20 00:38:28 +00:00
Dale Johannesen
a894053a9b
When computing live intervals for earlyclobber operands,
...
we pushed the beginning of the interval back 1, so the
interval would overlap with inputs that die. We were
also pushing the end of the interval back 1, though,
which means the earlyclobber didn't overlap with other
output operands. Don't do this. PR 4964.
llvm-svn: 82342
2009-09-20 00:36:41 +00:00
Chris Lattner
ca2552d9f9
avoid a bunch of malloc thrashing for PositinoalVals by eliminating
...
a std::vector and a bunch of std::string temporaries.
llvm-svn: 82341
2009-09-20 00:07:40 +00:00
Nick Lewycky
605109d151
Teach the constant folder how to handle a few simple i1 cases.
...
llvm-svn: 82340
2009-09-20 00:04:02 +00:00
Chris Lattner
fa9c6f43a0
Avoid some temporary strings.
...
llvm-svn: 82339
2009-09-19 23:59:02 +00:00
Chris Lattner
84c1527b6b
add some more overloads of StringRef::getAsInteger for
...
common and useful integer types.
llvm-svn: 82338
2009-09-19 23:58:48 +00:00
Chris Lattner
11b64b34d9
add a simple c_str() method to SmallString.
...
llvm-svn: 82337
2009-09-19 23:57:31 +00:00
Bill Wendling
85689b2065
Revert r82274. It's causing failures in the CINT2006 benchmarks.
...
llvm-svn: 82336
2009-09-19 22:02:37 +00:00
Daniel Dunbar
fe4f5c5c8f
Prefer super class constructor to explicit initialization.
...
llvm-svn: 82335
2009-09-19 20:40:28 +00:00
Daniel Dunbar
bce047da64
Tabs -> spaces (really?)
...
llvm-svn: 82334
2009-09-19 20:40:21 +00:00
Daniel Dunbar
be22ec4cfc
Fix indentation.
...
llvm-svn: 82333
2009-09-19 20:40:14 +00:00
Daniel Dunbar
c418d6b106
Strip trailing whitespace.
...
llvm-svn: 82332
2009-09-19 20:40:05 +00:00
Daniel Dunbar
86f158ccb6
RHS of assignment should be const reference.
...
llvm-svn: 82331
2009-09-19 20:39:50 +00:00
Nick Lewycky
1303c0ab86
Remove the default value for ConstantStruct::get's isPacked parameter and
...
update the code which was broken by this.
llvm-svn: 82327
2009-09-19 20:30:26 +00:00
Daniel Dunbar
9996138a80
Ok, an AssertingVH definitely doesn't work for now because we free our cache after the optimizer may have hacked on the module. Use a WeakVH instead.
...
llvm-svn: 82324
2009-09-19 20:17:48 +00:00
Nick Lewycky
41eaf0ac57
Make clang stop relying on ConstantStruct::get's default value for isPacked
...
which will be going away (ie. it's becoming a required parameter) later today.
llvm-svn: 82323
2009-09-19 20:00:52 +00:00
Chris Lattner
68ee70035e
provide a "strtoull" operation that works on StringRef's.
...
llvm-svn: 82322
2009-09-19 19:47:14 +00:00
Daniel Dunbar
1cbaae56cf
Switch CGDebugInfo type cache to using an AssertingVH.
...
llvm-svn: 82321
2009-09-19 19:27:24 +00:00
Daniel Dunbar
de870bdcf2
Factor out CGDebugInfo::CreateTypeNode method.
...
- No functionality change.
llvm-svn: 82320
2009-09-19 19:27:14 +00:00
Nick Lewycky
3b8bd05081
Add a comment explaining why you would ever want to do this.
...
llvm-svn: 82319
2009-09-19 19:00:06 +00:00
Chris Lattner
aecd74d895
convert a bunch of std::strings to use StringRef. This should eliminate
...
a massive number of temporary strings created when parsing a command line.
More still left to eliminate.
llvm-svn: 82318
2009-09-19 18:55:05 +00:00
Nick Lewycky
7e6deb1cb4
Lett users of sparse propagation do their own thing with phi nodes if they want
...
to. This can be combined with LCSSA or SSI form to store more information on a
PHINode than can be computed by looking at its incoming values.
llvm-svn: 82317
2009-09-19 18:33:36 +00:00
Duncan Sands
1636b7ef47
The flag "--dot-cfg-only" is at the moment equivalent to the flag "--dot-cfg".
...
It prints the content of all bbs, instead of printing empty bbs to make the
CFG more readable. Fix this. Patch by Tobias Grosser.
llvm-svn: 82315
2009-09-19 11:25:44 +00:00
Evan Cheng
b82b5514fe
Fix funky comments.
...
llvm-svn: 82314
2009-09-19 10:09:15 +00:00
Evan Cheng
1c69c47b23
Update comments.
...
llvm-svn: 82313
2009-09-19 10:08:51 +00:00
Benjamin Kramer
543d9b2fba
Try to speed up the slowest parts of the CommandLine library
...
- Replace std::map<std::string with StringMap
- Eliminate unnecessary std::string copies
- ~10% speed-up for clang's testsuite on my machine (debug build)
llvm-svn: 82312
2009-09-19 10:01:45 +00:00
Evan Cheng
9827ad39a7
Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
...
llvm-svn: 82311
2009-09-19 09:51:03 +00:00
Benjamin Kramer
dad401dbc1
Simplify code with a StringRef.
...
llvm-svn: 82308
2009-09-19 08:02:46 +00:00
Douglas Gregor
b5c738b434
In C++ code completion, only suggest the "template" keyword after ".",
...
"->", or "::" if we will be looking into a dependent context. It's not
wrong to use the "template" keyword, but it's to needed, either.
llvm-svn: 82307
2009-09-18 23:55:56 +00:00
Douglas Gregor
ce23bae4f8
Make the construction of the code-completion string for a function
...
template smarter, by taking into account which function template
parameters are deducible from the call arguments. For example,
template<typename RandomAccessIterator>
void sort(RandomAccessIterator first, RandomAccessIterator last);
will have a code-completion string like
sort({RandomAccessIterator first}, {RandomAccessIterator last})
since the template argument for its template parameter is
deducible. On the other hand,
template<class X, class Y>
X* dyn_cast(Y *Val);
will have a code-completion string like
dyn_cast<{class X}>({Y *Val})
since the template type parameter X is not deducible from the function
call.
llvm-svn: 82306
2009-09-18 23:21:38 +00:00