summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in ↵Benjamin Kramer2013-05-242-1/+15
| | | | | | | | it, don't assert on those cases. Fixes PR16139. llvm-svn: 182656
* fix insertion of values in BBMapSebastian Pop2013-05-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In GDB when "step" through generateScalarLoad and "finish" the call, the returned value is non NULL, however when printing the value contained in BBMap[Load] after this stmt: BBMap[Load] = generateScalarLoad(...); the value in BBMap[Load] is NULL, and the BBMap.count(Load) is 1. The only intuitive idea that I have to explain this behavior is that we are playing with the undefined behavior of eval order of the params for the function standing for "BBMap[Load] = generateScalarLoad()". "BBMap[Load] = " may be executed before generateScalarLoad is called. Here are some other possible explanations from Will Dietz <w@wdtz.org>: The error is likely due to BBMap[Load] being evaluated first (creating a {Load -> uninitialized } entry in the DenseMap), then generateScalarLoad eventually accesses the same element and finds it to be NULL (DenseMap[Old]).. Offhand I'm not sure if this is guaranteed to be NULL or if it's uninitialized and happens to be NULL. The same issue can also go wrong in an even worse way: the second DenseMap access can trigger a rehash and *invalidate* the an earlier evaluated expression (for example LHS of the assignment), leading to a crash when performing the assignment store. llvm-svn: 182655
* Do not reserve space for the ColdEdges and NormalEdges vectors.Diego Novillo2013-05-241-2/+0
| | | | | | | Discussion and rationale at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130520/175698.html llvm-svn: 182653
* Fix printing CXXTemporaryObjectExpr with default args.Rafael Espindola2013-05-242-0/+7
| | | | | | Patch by Will Wilson. llvm-svn: 182651
* Added a parameter for relocation info to keep lldb in step with llvm due to ↵Ashok Thirumurthi2013-05-241-4/+13
| | | | | | | | r182625, which takes a first step towards symbolization of disassembled instructions. llvm-svn: 182650
* [lsan] Minor adjustments to LSan messages.Sergey Matveev2013-05-242-13/+13
| | | | llvm-svn: 182648
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-244-6/+22
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* [lsan] Prettify LSan reports and add a summary.Sergey Matveev2013-05-242-4/+22
| | | | llvm-svn: 182646
* Add -lrt to sanitizer link arguments.Evgeniy Stepanov2013-05-242-0/+5
| | | | | | | | Sanitizer runtime intercepts functions from librt. Not doing this will fail if the librt dependency is not present at program startup (ex. comes from a dlopen()ed library). llvm-svn: 182645
* [SystemZ] Improve AsmParser handling of invalid instructionsRichard Sandiford2013-05-243-81/+180
| | | | | | | | | | | | | | | | | | | | | | | Previously, an invalid instruction like: foo %r1, %r0 would generate the rather odd error message: ....: error: unknown token in expression foo %r1, %r0 ^ We now get the more informative: ....: error: invalid instruction foo %r1, %r0 ^ The same would happen if an address were used where a register was expected. We now get "invalid operand for instruction" instead. llvm-svn: 182644
* [SystemZ] Improve AsmParser register parsingRichard Sandiford2013-05-243-547/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to make sure that: (1) "register expected" is restricted to cases where ParseRegister() is called and the token obviously isn't a register. (2) "invalid register" is restricted to cases where a register-like "%..." sequence is found, but the "..." makes no sense. (3) the generic "invalid operand for instruction" is used in cases where the wrong register type is used (GPR instead of FPR, etc.). (4) the new "invalid register pair" is used if the register has the right type, but is not a valid register pair. Testing of (1)-(3) is now restricted to regs-bad.s. It uses a representative instruction for each register class to make sure that only registers from that class are accepted. (4) is tested by both regs-bad.s (which checks all invalid register pairs) and insn-bad.s (which tests one invalid pair for each instruction that requires a pair). While there, I changed "Number" to "Num" for consistency with the operand class. llvm-svn: 182643
* Fix comment typo pointed out by maslen on IRC.Duncan Sands2013-05-241-1/+1
| | | | llvm-svn: 182642
* [lsan] Add exitcode flag. Kill the process if leaks are found.Sergey Matveev2013-05-242-10/+28
| | | | llvm-svn: 182641
* Run clang-format over the scalarizePHI function.Joey Gouly2013-05-241-12/+8
| | | | llvm-svn: 182640
* scalarizePHI needs to insert the next ExtractElement in the same blockJoey Gouly2013-05-242-2/+29
| | | | | | | | as the BinaryOperator, *not* in the block where the IRBuilder is currently inserting into. Fixes a bug where scalarizePHI would create instructions that would not dominate all uses. llvm-svn: 182639
* Add a new function attribute 'cold' to functions.Diego Novillo2013-05-2413-1/+200
| | | | | | | | | | | Other than recognizing the attribute, the patch does little else. It changes the branch probability analyzer so that edges into blocks postdominated by a cold function are given low weight. Added analysis and code generation tests. Added documentation for the new attribute. llvm-svn: 182638
* Disable init-order checking before destructors are run.Alexey Samsonov2013-05-246-0/+89
| | | | | | | | | | We don't want to report initialization-order bugs when a destructor of a global variable accesses dynamically initialized global from another (not necessarily initialized) module. We do this by intercepting __cxa_atexit and registrering our own callback that unpoisons shadow for all dynamically initialized global variables. llvm-svn: 182637
* Remove the Copied parameter from MemoryObject::readBytes.Benjamin Kramer2013-05-2414-61/+35
| | | | | | | | | | There was exactly one caller using this API right, the others were relying on specific behavior of the default implementation. Since it's too hard to use it right just remove it and standardize on the default behavior. Defines away PR16132. llvm-svn: 182636
* Fix unused warning in opt builds.Daniel Jasper2013-05-241-4/+3
| | | | | | | | In these builds, the asserts() are completely compiled out of the code leaving "End" unused. Directly accessing it, should not have a performance impact, as it is just a data member. llvm-svn: 182634
* User correct case for 'FileCheck'.Argyrios Kyrtzidis2013-05-241-1/+1
| | | | llvm-svn: 182632
* [modules] If we hit a failure while loading a PCH/module, abort parsing ↵Argyrios Kyrtzidis2013-05-2413-4/+84
| | | | | | | | | | instead of trying to continue in an invalid state. Also don't let libclang create a PCH with such an error. Fixes rdar://13953768 llvm-svn: 182629
* MC: Disassembled CFG reconstruction.Ahmed Bougacha2013-05-2422-683/+1047
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch builds on some existing code to do CFG reconstruction from a disassembled binary: - MCModule represents the binary, and has a list of MCAtoms. - MCAtom represents either disassembled instructions (MCTextAtom), or contiguous data (MCDataAtom), and covers a specific range of addresses. - MCBasicBlock and MCFunction form the reconstructed CFG. An MCBB is backed by an MCTextAtom, and has the usual successors/predecessors. - MCObjectDisassembler creates a module from an ObjectFile using a disassembler. It first builds an atom for each section. It can also construct the CFG, and this splits the text atoms into basic blocks. MCModule and MCAtom were only sketched out; MCFunction and MCBB were implemented under the experimental "-cfg" llvm-objdump -macho option. This cleans them up for further use; llvm-objdump -d -cfg now generates graphviz files for each function found in the binary. In the future, MCObjectDisassembler may be the right place to do "intelligent" disassembly: for example, handling constant islands is just a matter of splitting the atom, using information that may be available in the ObjectFile. Also, better initial atom formation than just using sections is possible using symbols (and things like Mach-O's function_starts load command). This brings two minor regressions in llvm-objdump -macho -cfg: - The printing of a relocation's referenced symbol. - An annotation on loop BBs, i.e., which are their own successor. Relocation printing is replaced by the MCSymbolizer; the basic CFG annotation will be superseded by more related functionality. llvm-svn: 182628
* <rdar://problem/13643315> Greg Clayton2013-05-243-11/+39
| | | | | | Fixed performance issues that arose after changing SBTarget, SBProcess, SBThread and SBFrame over to using a std::shared_ptr to a ExecutionContextRef. The ExecutionContextRef doesn't store a std::weak_ptr to a stack frame because stack frames often get replaced with new version, so it held onto a StackID object that would allow us to ask the thread each time for the frame for the StackID. The linear function was too slow for large recursive stacks. We also fixed an issue where anytime the std::shared_ptr<ExecutionContextRef> in any SBTarget, SBProcess, SBThread objects was turned into an ExecutionContext object, it would try to resolve all items in the ExecutionContext which are shared pointers. Even if the StackID in the ExecutionContextRef was invalid, it was looking through all frames in every thread. This causes a lot of unnecessary frame accesses. llvm-svn: 182627
* Update static analyzer build to checker-275.Ted Kremenek2013-05-242-1/+13
| | | | llvm-svn: 182626
* Add MCSymbolizer for symbolic/annotated disassembly.Ahmed Bougacha2013-05-2427-252/+1185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a basic first step towards symbolization of disassembled instructions. This used to be done using externally provided (C API) callbacks. This patch introduces: - the MCSymbolizer class, that mimics the same functions that were used in the X86 and ARM disassemblers to symbolize immediate operands and to annotate loads based off PC (for things like c string literals). - the MCExternalSymbolizer class, which implements the old C API. - the MCRelocationInfo class, which provides a way for targets to translate relocations (either object::RelocationRef, or disassembler C API VariantKinds) to MCExprs. - the MCObjectSymbolizer class, which does symbolization using what it finds in an object::ObjectFile. This makes simple symbolization (with no fancy relocation stuff) work for all object formats! - x86-64 Mach-O and ELF MCRelocationInfos. - A basic ARM Mach-O MCRelocationInfo, that provides just enough to support the C API VariantKinds. Most of what works in otool (the only user of the old symbolization API that I know of) for x86-64 symbolic disassembly (-tvV) works, namely: - symbol references: call _foo; jmp 15 <_foo+50> - relocations: call _foo-_bar; call _foo-4 - __cf?string: leaq 193(%rip), %rax ## literal pool for "hello" Stub support is the main missing part (because libObject doesn't know, among other things, about mach-o indirect symbols). As for the MCSymbolizer API, instead of relying on the disassemblers to call the tryAdding* methods, maybe this could be done automagically using InstrInfo? For instance, even though PC-relative LEAs are used to get the address of string literals in a typical Mach-O file, a MOV would be used in an ELF file. And right now, the explicit symbolization only recognizes PC-relative LEAs. InstrInfo should have already have most of what is needed to know what to symbolize, so this can definitely be improved. I'd also like to remove object::RelocationRef::getValueString (it seems only used by relocation printing in objdump), as simply printing the created MCExpr is definitely enough (and cleaner than string concats). llvm-svn: 182625
* Fix crash-on-invalid if list-initialization works, but we bail out whenRichard Smith2013-05-232-1/+12
| | | | | | building the resulting expression because it invokes a deleted constructor. llvm-svn: 182624
* Constify the 'dump' method so that it can be called by a const object.Bill Wendling2013-05-232-4/+3
| | | | llvm-svn: 182620
* Adds PT_TLS and PT_GNU_EH_FRAME names to DumpELFProgramHeadersFilipe Cabecinhas2013-05-231-10/+12
| | | | llvm-svn: 182619
* [PowerPC] Remove symbolLo/symbolHi instruction operand typesUlrich Weigand2013-05-232-37/+19
| | | | | | | | | | | | | | Now that there is no longer any distinction between symbolLo and symbolHi operands in either printing, encoding, or parsing, the operand types can be removed in favor of simply using s16imm. This completes the patch series to decouple lo/hi operand part processing from the particular instruction whose operand it is. No change in code generation expected from this patch. llvm-svn: 182618
* Re-implement DebugIR in a way that does not subclass AssemblyWriter:Daniel Malea2013-05-234-125/+193
| | | | | | | | | | | - move AsmWriter.h from public headers into lib - marked all AssemblyWriter functions as non-virtual; no need to override them - DebugIR now "plugs into" AssemblyWriter with an AssemblyAnnotationWriter helper - exposed flags to control hiding of a) debug metadata b) debug intrinsic calls C/R: Paul Redmond llvm-svn: 182617
* [PowerPC] Clean up generation of ha16() / lo16() markersUlrich Weigand2013-05-2312-112/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When targeting the Darwin assembler, we need to generate markers ha16() and lo16() to designate the high and low parts of a (symbolic) immediate. This is necessary not just for plain symbols, but also for certain symbolic expression, typically along the lines of ha16(A - B). The latter doesn't work when simply using VariantKind flags on the symbol reference. This is why the current back-end uses hacks (explicitly called out as such via multiple FIXMEs) in the symbolLo/symbolHi print methods. This patch uses target-defined MCExpr codes to represent the Darwin ha16/lo16 constructs, following along the lines of the equivalent solution used by the ARM back end to handle their :upper16: / :lower16: markers. This allows us to get rid of special handling both in the symbolLo/symbolHi print method and in the common code MCExpr::print routine. Instead, the ha16 / lo16 markers are printed simply in a custom print routine for the target MCExpr types. (As a result, the symbolLo/symbolHi print methods can now replaced by a single printS16ImmOperand routine that also handles symbolic operands.) The patch also provides a EvaluateAsRelocatableImpl routine to handle ha16/lo16 constructs. This is not actually used at the moment by any in-tree code, but is provided as it makes merging into David Fang's out-of-tree Mach-O object writer simpler. Since there is no longer any need to treat VK_PPC_GAS_HA16 and VK_PPC_DARWIN_HA16 differently, they are merged into a single VK_PPC_ADDR16_HA (and likewise for the _LO16 types). llvm-svn: 182616
* Fix assert on temporary std::initializer_list.Richard Smith2013-05-232-1/+12
| | | | llvm-svn: 182615
* More tests and a fix for braced init lists.Daniel Jasper2013-05-232-2/+6
| | | | | | Before: f(new vector<int> { 1, 2, 3 }); After: f(new vector<int>{ 1, 2, 3 }); llvm-svn: 182614
* Improve vim-lldb expression commands for objective-c and implement ↵Daniel Malea2013-05-232-3/+23
| | | | | | | | | | | | | | | evaluate-under-cursor: 1. Added new :Lpo command 2. :Lpo and :Lprint can be invoked without parameters. In that case cursor word will be used 3. Added :LpO command in that case instead of <cword> will be used stripped <cWORD>. This command is useful for printing objective-c properties (for ex.: self.tableView). Patch by Arthur Evstifeev!! llvm-svn: 182613
* [analyzer; alternate edges] Add a new test case file to regression test the ↵Ted Kremenek2013-05-231-0/+9280
| | | | | | | | new arrows algorithm. This essentially combines the tests in plist-output.m and plist-alternate-output.m. llvm-svn: 182612
* The command line options need to be processed before we create the ↵Bill Wendling2013-05-231-9/+8
| | | | | | | | | | TargetMachine. Move the processing of the command line options to right before we create the TargetMachine instead of after. <rdar://problem/13468287> llvm-svn: 182611
* ObjectFileELF::GetModuleSpecifications on Linux should work now.Michael Sartain2013-05-236-42/+168
| | | | | | | Which means "platform process list" should work and list the architecture. We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next). llvm-svn: 182610
* Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors ↵Michael Sartain2013-05-2310-226/+170
| | | | | | | | | | command line options. settings set use-color [false|true] settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} " also "--no-use-colors" on the command prompt llvm-svn: 182609
* Fix aligning of comments.Manuel Klimek2013-05-232-4/+25
| | | | | | | | | | | | | | | | | Previously we started sequences to align for single line comments when the previous line had a trailing comment, but the sequence was broken for other reasons. Now we re-format: // a // b f(); // c to: // a // b f(); // c llvm-svn: 182608
* <rdar://problem/13966084>Greg Clayton2013-05-231-1/+1
| | | | | | Make sure to not call "regexec" from <regex.h> with a NULL C string, otherwise we can crash. llvm-svn: 182607
* Adding .arcconfig file to LLDB to allow using Phabricator for reviewsDaniel Malea2013-05-231-0/+4
| | | | llvm-svn: 182606
* Fix aligning of comments that are at the start of the line.Manuel Klimek2013-05-232-3/+11
| | | | | | | | | | Now correctly leaves: f(); // comment // comment g(); // comment ... alone if the middle comment was aligned with g() before formatting. llvm-svn: 182605
* Add caveat to __builtin_readcyclecounter documentation.Tim Northover2013-05-231-1/+3
| | | | | | | The ARM cycle-counter can be restricted by the operating system; it's worth warning potential users of this issue. llvm-svn: 182604
* ARM: implement @llvm.readcyclecounter intrinsicTim Northover2013-05-233-1/+70
| | | | | | | | | | | | | This implements the @llvm.readcyclecounter intrinsic as the specific MRC instruction specified in the ARM manuals for CPUs with the Power Management extensions. Older CPUs had slightly different methods which may also have to be implemented eventually, but this should cover all v7 cases. rdar://problem/13939186 llvm-svn: 182603
* ARM: Add Performance Monitor Extensions featureTim Northover2013-05-233-1/+10
| | | | | | | | | | Performance monitors, including a basic cycle counter, are an official extension in the ARMv7 specification. This adds support for enabling and disabling them, orthogonally from CPU selection. rdar://problem/13939186 llvm-svn: 182602
* Increase test coverage for braced init lists.Daniel Jasper2013-05-232-1/+14
| | | | | | Also fix a minor bug for constructor initializers with braced init lists. llvm-svn: 182601
* R600: Fix R600ControlFlowFinalizer not considering VTX_READ 128 bit dst regTom Stellard2013-05-232-2/+31
| | | | | | | | | Patch by: Vincent Lejeune https://bugs.freedesktop.org/show_bug.cgi?id=64877 NOTE: This is a candidate for the 3.3 branch. llvm-svn: 182600
* Don't override 'mode' and cleanup some variable names.Bill Wendling2013-05-231-22/+21
| | | | llvm-svn: 182599
* Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing ↵Bill Wendling2013-05-231-2/+3
| | | | | | this out. llvm-svn: 182598
* Improve formatting of braced lists.Daniel Jasper2013-05-233-8/+6
| | | | | | Before: vector<int> v{ -1}; After: vector<int> v{-1}; llvm-svn: 182597
OpenPOWER on IntegriCloud