summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Mangler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* move the mangler into libtarget from vmcore.Chris Lattner2010-01-161-104/+0
| | | | llvm-svn: 93664
* reapply the mangler gutting patch.Chris Lattner2010-01-161-183/+4
| | | | llvm-svn: 93656
* Revert 93648.Rafael Espindola2010-01-161-4/+183
| | | | | | | | Mangler::getMangledName is used from lto Mangler::setUseQuotes is used in the AsmPrinter Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter llvm-svn: 93652
* Mangler::getMangledName is now dead, remove it and all the other stuff in ↵Chris Lattner2010-01-161-183/+4
| | | | | | Mangler that is now transitively dead. woo. llvm-svn: 93648
* add an inefficient version of getNameWithPrefix that returns an std::string.Chris Lattner2010-01-161-0/+10
| | | | llvm-svn: 93641
* Introduce Twine::toStringRef, a variant of toVector which avoids the copy if theBenjamin Kramer2010-01-131-9/+2
| | | | | | | twine can be represented as a single StringRef. Use the new methode to simplify some twine users. llvm-svn: 93317
* don't add the \1 to the name.Chris Lattner2010-01-131-1/+1
| | | | llvm-svn: 93304
* add new isSingleStringRef()/getSingleStringRef() methods to twine, Chris Lattner2010-01-131-2/+7
| | | | | | | | and use them to avoid a copy of a string in getNameWithPrefix in the common case. It seems like Value::setName and other places should use this as well? llvm-svn: 93301
* ugh, my last patch just sped up a method and changed all the clientsChris Lattner2010-01-131-19/+51
| | | | | | | | that I want to completely eliminate. Add fixme's so I remember this in the future, and add the missing helper that they should be upgraded to use instead. llvm-svn: 93300
* change Mangler::makeNameProper to return its result in a SmallVectorChris Lattner2010-01-131-53/+66
| | | | | | | | | | | | instead of returning it in an std::string. Based on this change: 1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef 2. Change a bunch of targets to call makeNameProper with a smallstring, making several of them *much* more efficient. 3. Rewrite Mangler::makeNameProper to not build names and then prepend prefixes, not use temporary std::strings, and to avoid other crimes. llvm-svn: 93298
* my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!Chris Lattner2010-01-131-2/+5
| | | | llvm-svn: 93296
* change makeNameProper to take a stringref instead of std::string.Chris Lattner2010-01-131-8/+8
| | | | llvm-svn: 93295
* initialize SymbolsCanStartWithDigit to false by defaultNuno Lopes2009-09-211-1/+1
| | | | llvm-svn: 82454
* Allow symbols to start from the digit if target requests it. This allows, ↵Anton Korobeynikov2009-09-181-2/+3
| | | | | | | | | e.g. pinning variables to specified absolute address. Make use of this feature for MSP430. This unbreaks PR4776. llvm-svn: 82227
* Make the MC symbol printer and llvm::Mangler exactly agree on manglingChris Lattner2009-09-131-0/+1
| | | | | | for systems that don't support quoting (PR4966). llvm-svn: 81682
* fix prefix ordering, it's L_foo not _LfooChris Lattner2009-09-111-2/+1
| | | | llvm-svn: 81506
* add a new Mangler::getNameWithPrefix API which returns theChris Lattner2009-09-111-2/+48
| | | | | | | | (uniqued if unnamed) global variable name with the prefix that it is supposed to get. It doesn't do "mangling" in the sense of adding quotes and hacking on bad characters. llvm-svn: 81505
* Add prefix only if it is needed.Devang Patel2009-08-171-2/+3
| | | | llvm-svn: 79289
* Switch some clients to Value::getName(), and other getName() userDaniel Dunbar2009-07-221-1/+1
| | | | | | | simplification. - NFC llvm-svn: 76789
* Rename Mangler linkage enums to something less gross.Bill Wendling2009-07-201-8/+8
| | | | llvm-svn: 76456
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-201-11/+27
| | | | | | | | | "private" symbols which the assember shouldn't strip, but which the linker may remove after evaluation. This is mostly useful for Objective-C metadata. This is plumbing, so we don't have a use of it yet. More to come, etc. llvm-svn: 76385
* eliminate the Mangler::PreserveAsmNames bit, the sole client of thisChris Lattner2009-07-151-5/+1
| | | | | | can do it perfectly well itself. llvm-svn: 75743
* Reapply my previous asmprinter changes now with more testing and two Chris Lattner2009-07-141-11/+26
| | | | | | | | | | | | | | | | | | | | additional bug fixes: 1. The bug that everyone hit was a problem in the asmprinter where it would remove $stub but keep the L prefix on a name when emitting the indirect symbol. This is easy to fix by keeping the name of the stub and the name of the symbol in a StringMap instead of just keeping a StringSet and trying to reconstruct it late. 2. There was a problem printing the personality function. The current logic to print out the personality function from the DWARF information is a bit of a cesspool right now that duplicates a bunch of other logic in the asm printer. The short version of it is that it depends on emitting both the L and _ prefix for symbols (at least on darwin) and until I can untangle it, it is best to switch the mangler back to emitting both prefixes. llvm-svn: 75646
* Revert r75610 (and r75620, which was blocking the revert), in the hopes ofDaniel Dunbar2009-07-141-11/+3
| | | | | | | | | | | | | | unbreaking llvm-gcc (on Darwin). --- Reverse-merging r75620 into '.': U include/llvm/Support/Mangler.h --- Reverse-merging r75610 into '.': U test/CodeGen/X86/loop-hoist.ll G include/llvm/Support/Mangler.h U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/VMCore/Mangler.cpp llvm-svn: 75636
* Change the X86 asmprinter to use the mangler to apply suffixes like ↵Chris Lattner2009-07-141-3/+11
| | | | | | | | | | | | | | | | "$non_lazy_ptr" to symbols instead of doing it with "printSuffixedName". This gets us to the point where there is a real separation between computing a symbol name and printing it, something I need for MC printer stuff. This patch also fixes a corner case bug where unnamed private globals wouldn't get the private label prefix. Next up, rename all uses of getValueName -> getMangledName for better greppability, and then tackle the ppc/arm backends to eliminate "printSuffixedName". llvm-svn: 75610
* Change the internal interface to makeNameProper to take a bool thatChris Lattner2009-07-141-32/+17
| | | | | | | | | | | | indicates whether the label is private or not, instead of taking prefix stuff. One effect of this is that symbols will be generated with *just* the private prefix, instead of both the private prefix *and* the user-label-prefix, but this doesn't matter as long as it is consistent. For example we'll now get "Lfoo" instead of "L_foo". These are just assembler temporary labels anyway, so they never even make it into the .o file. llvm-svn: 75607
* the mangler can never mangle intrinsics, don't allow this.Chris Lattner2009-07-141-4/+2
| | | | llvm-svn: 75564
* rename Memo/Count to AnonGlobalIDs/NextAnonGlobalID to be more Chris Lattner2009-07-141-20/+17
| | | | | | | | | | descriptive. Thange them to keep track of the ID of a global that is assigned, not the first mangled name returned for it. Without doing this, we are required to always use the same suffix for a global that gets mangled. This means that we can mangle the same global once with $stub and another time with $non_lazy_ptr or whatever. llvm-svn: 75561
* remove Mangler::getTypeID and related data, it was only used for manglingChris Lattner2009-07-131-9/+1
| | | | | | local symbols and we haven't had type planes since llvm 1.9. llvm-svn: 75558
* remove mangler support for mangling local names. Mangler should only be Chris Lattner2009-07-131-14/+0
| | | | | | used with globals. llvm-svn: 75557
* the mangler should put suffixes on unnamed global's mangled names as well Chris Lattner2009-07-131-1/+1
| | | | | | if present. llvm-svn: 75547
* Two changes:Chris Lattner2009-07-131-9/+2
| | | | | | | | | | | 1) unique globals with the existing "Count" local in Mangler, not with atomic nonsense. Using atomics will give us nondeterminstic output from the compiler when using multiple threads, which is bad. 2) Do not mangle an unknown global name with a type suffix. We don't need this anymore now that llvm ir doesn't have type planes. llvm-svn: 75541
* Revert my last series of commits related to Timer and 64-bit atomics. Not ↵Owen Anderson2009-06-231-3/+3
| | | | | | | | all the targets we care about are capable of supporting it. llvm-svn: 73993
* Atomic ops that do arithmetic use signed arithmetic.Owen Anderson2009-06-231-2/+2
| | | | llvm-svn: 73980
* Label the existing atomic functions as 32-bit specific, and add a 64-bit one ↵Owen Anderson2009-06-231-1/+1
| | | | | | | | that will be useful in the near future. llvm-svn: 73971
* Use atomic increment here.Owen Anderson2009-06-171-2/+7
| | | | llvm-svn: 73643
* Quotes should be printed before private prefix; some code clean up.Evan Cheng2009-05-051-50/+68
| | | | llvm-svn: 71032
* Add the private linkage.Rafael Espindola2009-01-151-3/+9
| | | | llvm-svn: 62279
* Remove some dead code from the days llvm had type planes.Rafael Espindola2009-01-121-46/+1
| | | | | | There might be more dead code, but with llvm-gcc bootstrap broken on linux x86-64 it is had to test :-( llvm-svn: 62088
* - Replace use of std::map<std::string, ..> with StringMap. Replace use of ↵Evan Cheng2008-07-101-27/+28
| | | | | | | | std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up. - Some code clean up. llvm-svn: 53379
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-2/+5
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Remove uses of llvm/System/IncludeFile.h that are no longer needed.Dan Gohman2008-05-061-3/+0
| | | | llvm-svn: 50695
* targets that support quotes for mangled names still need to escape newlinesChris Lattner2008-02-151-0/+2
| | | | | | when they occur in the name, just like " is escaped. llvm-svn: 47169
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-1/+1
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Add support for appending a suffix to the end of a mangled name.Bill Wendling2007-09-171-2/+2
| | | | llvm-svn: 42071
* Add lengthof and endof templates that hide a lot of sizeof computations.Owen Anderson2007-09-071-3/+2
| | | | | | Patch by Sterling Stein! llvm-svn: 41758
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-2/+2
| | | | | | confusion with external linkage types. llvm-svn: 33663
* Adding dllimport, dllexport and external weak linkage types.Anton Korobeynikov2006-09-141-3/+8
| | | | | | | | | DLL* linkages got full (I hope) codegeneration support in C & both x86 assembler backends. External weak linkage added for future use, we don't provide any codegeneration, etc. support for it. llvm-svn: 30374
* Add new option to leave asm names aloneChris Lattner2006-09-071-1/+6
| | | | llvm-svn: 30149
OpenPOWER on IntegriCloud