summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix a use-after-free bug found by ASan. You can't assign a temporaryChandler Carruth2012-12-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::string to a StringRef. Moreover, the method being called accepts a Twine to simplify these patterns. Fixes this ASan failure: ==6312== ERROR: AddressSanitizer: heap-use-after-free on address 0x7fd558b1af58 at pc 0xcb7529 bp 0x7fffff572080 sp 0x7fffff572078 READ of size 1 at 0x7fd558b1af58 thread T0 #0 0xcb7528 .../llvm/include/llvm/ADT/StringRef.h:192 llvm::StringRef::operator[]() #1 0x1d53c0a .../llvm/include/llvm/ADT/StringExtras.h:128 llvm::HashString() #2 0x1d53878 .../llvm/lib/Support/StringMap.cpp:64 llvm::StringMapImpl::LookupBucketFor() #3 0x1b6872f .../llvm/include/llvm/ADT/StringMap.h:352 llvm::StringMap<>::GetOrCreateValue<>() #4 0x1b61836 .../llvm/lib/MC/MCContext.cpp:109 llvm::MCContext::GetOrCreateSymbol() #5 0xe9fd47 .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:154 (anonymous namespace)::ARMELFStreamer::EmitMappingSymbol() #6 0xea01dd .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:133 (anonymous namespace)::ARMELFStreamer::EmitDataMappingSymbol() #7 0xe9f78b .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:91 (anonymous namespace)::ARMELFStreamer::EmitBytes() #8 0x1b15d82 .../llvm/lib/MC/MCStreamer.cpp:89 llvm::MCStreamer::EmitIntValue() #9 0xcc0f9b .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:713 llvm::ARMAsmPrinter::emitAttributes() #10 0xcc0d44 .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:632 llvm::ARMAsmPrinter::EmitStartOfAsmFile() #11 0x14692ad .../llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:162 llvm::AsmPrinter::doInitialization() #12 0x1bc4677 .../llvm/lib/VMCore/PassManager.cpp:1561 llvm::FPPassManager::doInitialization() #13 0x1bc4990 .../llvm/lib/VMCore/PassManager.cpp:1595 llvm::MPPassManager::runOnModule() #14 0x1bc55e5 .../llvm/lib/VMCore/PassManager.cpp:1705 llvm::PassManagerImpl::run() #15 0x1bc5878 .../llvm/lib/VMCore/PassManager.cpp:1740 llvm::PassManager::run() #16 0xc3954d .../llvm/tools/llc/llc.cpp:378 compileModule() #17 0xc38001 .../llvm/tools/llc/llc.cpp:194 main #18 0x7fd557d6a11c __libc_start_main 0x7fd558b1af58 is located 24 bytes inside of 29-byte region [0x7fd558b1af40,0x7fd558b1af5d) freed by thread T0 here: #0 0xc337da .../llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:56 operator delete() #1 0x1ee9cef .../libstdc++-v3/include/bits/basic_string.h:535 std::string::~string() #2 0xea01dd .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:133 (anonymous namespace)::ARMELFStreamer::EmitDataMappingSymbol() #3 0xe9f78b .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:91 (anonymous namespace)::ARMELFStreamer::EmitBytes() #4 0x1b15d82 .../llvm/lib/MC/MCStreamer.cpp:89 llvm::MCStreamer::EmitIntValue() #5 0xcc0f9b .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:713 llvm::ARMAsmPrinter::emitAttributes() #6 0xcc0d44 .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:632 llvm::ARMAsmPrinter::EmitStartOfAsmFile() #7 0x14692ad .../llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:162 llvm::AsmPrinter::doInitialization() #8 0x1bc4677 .../llvm/lib/VMCore/PassManager.cpp:1561 llvm::FPPassManager::doInitialization() #9 0x1bc4990 .../llvm/lib/VMCore/PassManager.cpp:1595 llvm::MPPassManager::runOnModule() #10 0x1bc55e5 .../llvm/lib/VMCore/PassManager.cpp:1705 llvm::PassManagerImpl::run() #11 0x1bc5878 .../llvm/lib/VMCore/PassManager.cpp:1740 llvm::PassManager::run() #12 0xc3954d .../llvm/tools/llc/llc.cpp:378 compileModule() #13 0xc38001 .../llvm/tools/llc/llc.cpp:194 main #14 0x7fd557d6a11c __libc_start_main llvm-svn: 169668
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-0821-441/+978
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndefArgyrios Kyrtzidis2012-12-083-2/+47
| | | | | | | | | | directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. llvm-svn: 169666
* [Preprocessor] Enhance Ifdef/Ifndef/Defined preprocessor callbacks to also passArgyrios Kyrtzidis2012-12-085-21/+38
| | | | | | a MacroInfo object if the identifier was a macro name. llvm-svn: 169665
* Add a FIXME.Richard Smith2012-12-081-0/+1
| | | | llvm-svn: 169664
* Even when we aren’t going to init all the lldb.frame, etc, globals, init ↵Jim Ingham2012-12-081-0/+7
| | | | | | lldb.debugger, since each script interpreter is tied to just one debugger. llvm-svn: 169663
* Implement C++03 [dcl.init]p5's checking for value-initialization of referencesRichard Smith2012-12-089-16/+143
| | | | | | | | properly, rather than faking it up by pretending that a reference member makes the default constructor non-trivial. That leads to rejects-valids when putting such types inside unions. llvm-svn: 169662
* Get LLDB-Info.plist up to date with r169081.Filipe Cabecinhas2012-12-081-1/+1
| | | | llvm-svn: 169661
* ASan: fix interface-symbols test on Mac by explicitly listing all weak functionsAlexey Samsonov2012-12-081-1/+6
| | | | llvm-svn: 169660
* Add the core architecture for the lld driver.Michael J. Spencer2012-12-0816-5/+1020
| | | | | | | | | | | | | This includes selecting which driver to emulate, option parsing, invocation building, and running the link. This currently only supports a very basic subset of ld for x86_64-linux. lld -flavor ld obj.o -o obj or symlink lld as (ld , link, ld64, core) to get the desired behavior without -flavor. llvm-svn: 169659
* Make sure to check for DW_AT_linkage_name to get the mangled name in the ↵Greg Clayton2012-12-084-0/+12
| | | | | | DWARF along with the older DW_AT_MIPS_linkage_name attribute. llvm-svn: 169657
* Add the `lto_codegen_set_export_dynamic' function.Bill Wendling2012-12-085-3/+21
| | | | | | | | | | | | | | | | | | | | | This function sets the `_exportDynamic' ivar. When that's set, we export all symbols (e.g. we don't run the internalize pass). This is equivalent to the `--export-dynamic' linker flag in GNU land: --export-dynamic When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use this option, the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use dlopen to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. The Darwin linker will support this via the `-export_dynamic' flag. We should modify clang to support this via the `-rdynamic' flag. llvm-svn: 169656
* Added GetCanonicalType() to SBType:Greg Clayton2012-12-083-0/+17
| | | | | | | lldb::SBType SBType::GetCanonicalType(); llvm-svn: 169655
* Currently when AST record layouts are dumped with -fdump-record-layouts, theEli Bendersky2012-12-081-3/+11
| | | | | | | | | | | | | | following: sizeof=132, dsize=132, align=4 nvsize=132, nvalign=4 Is not indented, so when classes are nested there is no way to know to which class it belongs. Fix this problem by indenting the size summary properly for each class. llvm-svn: 169654
* Add C API for specifying CPU to the disassembler.Jim Grosbach2012-12-073-10/+31
| | | | | | | | | It was a nasty oversight that we didn't include this when we added this API in the first place. Blech. rdar://12839439 llvm-svn: 169653
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-074-11/+11
| | | | | | in the near future. llvm-svn: 169652
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-0738-214/+214
| | | | | | in the near future. llvm-svn: 169651
* Fix analysis based warnings so that all warnings are emitted when compilingDeLesley Hutchins2012-12-075-2/+19
| | | | | | | | | with -Werror. Previously, compiling with -Werror would emit only the first warning in a compilation unit, because clang assumes that once an error occurs, further analysis is unlikely to return valid results. However, warnings that have been upgraded to errors should not be treated as "errors" in this sense. llvm-svn: 169649
* Appease -Wnon-virtual-dtorMatt Beaumont-Gay2012-12-071-0/+2
| | | | llvm-svn: 169648
* [libclang] Declarations inside anonymous namespaces have internal linkage soArgyrios Kyrtzidis2012-12-072-10/+4
| | | | | | | | | their USR should contain a location. This uniques them from other declarations with the same name but in different translation units. rdar://10546541 llvm-svn: 169647
* ASan: use new option -fsanitize-blacklist in output testsAlexey Samsonov2012-12-072-14/+14
| | | | llvm-svn: 169646
* Fix a few more clang (3.2) warnings on Linux:Daniel Malea2012-12-0722-37/+46
| | | | | | | | | | | | | | | | | - remove unused members - add NO_PEDANTIC to selected Makefiles - fix return values (removed NULL as needed) - disable warning about four-char-constants - remove unneeded const from operator*() declaration - add missing lambda function return types - fix printf() with no format string - change sizeof to use a type name instead of variable name - fix Linux ProcessMonitor.cpp to be 32/64 bit friendly - disable warnings emitted by swig-generated C++ code Patch by Matt Kopec! llvm-svn: 169645
* Make the contents of encoded sections SmallVector<char, N> instead ofEli Bendersky2012-12-074-17/+23
| | | | | | | | | | | SmallString. This makes it possible to use the length-erased SmallVectorImpl in the interface without imposing buffer size. Thus, the size of MCInstFragment is back down since a preallocated 8-byte contents buffer is enough. It would be generally a good idea to rid all the fragments of SmallString as contents, because a vector just makes more sense. llvm-svn: 169644
* ASan: change the strategy we use for installing malloc/free/symbolization ↵Alexey Samsonov2012-12-078-40/+66
| | | | | | hooks on Linux: don't provide a default no-op implementations for hooks in runtime, and optionally call hooks if they are provided by the user. Don't force weak interface functions into runtime. llvm-svn: 169641
* [analyzer] Rename the option help to reflect better what it does.Anna Zaks2012-12-071-2/+2
| | | | llvm-svn: 169640
* [analyzer] Optimization heuristic: do not reanalyze every ObjC method asAnna Zaks2012-12-075-22/+82
| | | | | | | | | | | | | | | | | | top level. This heuristic is already turned on for non-ObjC methods (inlining-mode=noredundancy). If a method has been previously analyzed, while being inlined inside of another method, do not reanalyze it as top level. This commit applies it to ObjCMethods as well. The main caveat here is that to catch the retain release errors, we are still going to reanalyze all the ObjC methods but without inlining turned on. Gives 21% performance increase on one heavy ObjC benchmark, which suffered large performance regressions due to ObjC inlining. llvm-svn: 169639
* When we use the BLEND instruction that uses the MSB as a mask, we can removeNadav Rotem2012-12-073-3/+8
| | | | | | | | the VSRI instruction before it since it does not affect the MSB. Thanks Craig Topper for suggesting this. llvm-svn: 169638
* Remove trailing whitespaceMichael Ilseman2012-12-071-22/+22
| | | | llvm-svn: 169637
* Unbreak the C++98 build.David Blaikie2012-12-071-1/+1
| | | | llvm-svn: 169636
* In hexagon convertToHardwareLoop, don't deref end() iteratorMatthew Curtis2012-12-072-8/+15
| | | | | | | | | | In particular, check if MachineBasicBlock::iterator is end() before using it to call getDebugLoc(); See also this thread on llvm-commits: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121112/155914.html llvm-svn: 169634
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-0731-162/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* AST matcher tutorial (Part I)Daniel Jasper2012-12-071-0/+533
| | | | | | | | | | This an AST matcher tutorial based on Sam Panzer's document (https://docs.google.com/a/google.com/document/d/1oTkVLhCdRJUEH1_LDaQdXqe8-aOqT5GLDL9e4MhoFF8/edit). Checking in now although some parts might be a bit rough so others can help improving it. llvm-svn: 169632
* [analyzer] Fix r168019 to work with unpruned paths as well.Jordan Rose2012-12-073-26/+310
| | | | | | | | | | | | | This is the case where the analyzer tries to print out source locations for code within a synthesized function body, which of course does not have a valid source location. The previous fix attempted to do this during diagnostic path pruning, but some diagnostics have pruning disabled, and so any diagnostic with a path that goes through a synthesized body will either hit an assertion or emit invalid output. <rdar://problem/12657843> (again) llvm-svn: 169631
* Reduce conversions between Store <-> ImmutableMapRef in RegionStore.Ted Kremenek2012-12-071-147/+151
| | | | | | | This reduces canonicalization of ImmutableMaps. This reduces analysis time of one heavy Objective-C file by another 1%. llvm-svn: 169630
* Mark ImmutableMap::remove/add() const.Ted Kremenek2012-12-071-2/+2
| | | | llvm-svn: 169629
* tsan: even more fd interceptors + fixesDmitry Vyukov2012-12-074-15/+140
| | | | llvm-svn: 169628
* Fixed some grammar and punctuation error.John Criswell2012-12-071-5/+5
| | | | | | No content changes. llvm-svn: 169627
* Refactor MCInstFragment and MCDataFragment to adhere to a common interface,Eli Bendersky2012-12-077-99/+102
| | | | | | | | | which removes code duplication and prepares the ground for future additions. Full discussion: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/158233.html llvm-svn: 169626
* Now that we set ThreadPlanCallFunction to private in the constructor, it is ↵Jim Ingham2012-12-073-7/+2
| | | | | | | | confusing that we set it again in client code after creating the plans. So remove those unnecessary calls. llvm-svn: 169625
* X86: Prefer using VPSHUFD over VPERMIL because it has better throughput.Nadav Rotem2012-12-074-8/+9
| | | | llvm-svn: 169624
* <rdar://problem/10903854>Greg Clayton2012-12-071-4/+9
| | | | | | log enable now resolves the "--file" option in case it contains ~. llvm-svn: 169623
* Add helper method to convert from a RegionStoreRefBindings to a Store.Ted Kremenek2012-12-071-8/+13
| | | | llvm-svn: 169622
* tsan: more fd interceptors + bug fixes + testsDmitry Vyukov2012-12-077-22/+235
| | | | llvm-svn: 169621
* [asan] fix lint, remove debug prints Kostya Serebryany2012-12-072-2/+0
| | | | llvm-svn: 169620
* Add separate statistics for Data and Inst fragments emitted during relaxation.Eli Bendersky2012-12-072-5/+6
| | | | | | | Also fixes a test that was overly-sensitive to the exact order of statistics emitted. llvm-svn: 169619
* Set ThreadPlanCallFunction to private in ConstructorSetup. This fixes a ↵Andrew Kaylor2012-12-071-0/+1
| | | | | | problem on Linux where 'continue' was misfiring after an expression evaluation when stopped at a breakpoint. The problem was that InferiorCallMmap was not setting its ThreadPlanCallFunction to private and so the completion of that thread plan appeared to be the stop reason and therefore the 'continue' operation failed to step over the breakpoint. The SetPrivate call is being put in ThreadPlanCallFunction rather than InferiorCallMmap to make the solution more general. llvm-svn: 169618
* Some common functionality from WinCOFFStreamer::EmitAssignment can be nowEli Bendersky2012-12-071-3/+1
| | | | | | delegated to MCObjectStreamer. llvm-svn: 169617
* ASan: intercept prctl on Linux onlyAlexey Samsonov2012-12-072-3/+9
| | | | llvm-svn: 169616
* Fix Test11588.py on Linux. The test was failing because the synthetic type ↵Andrew Kaylor2012-12-071-2/+2
| | | | | | fields were resolving to int instead of long. A similar change was made in r155144 to eliminate the type specification for an earlier check in this test, so it seemed appropriate here too. llvm-svn: 169615
* Separate initing the stdout/stderr for running the Python Script interpreter ↵Jim Ingham2012-12-073-34/+43
| | | | | | | | | | from initing the lldb.target/frame/etc globals, and only do the latter when it makes sense to. <rdar://problem/12554049> llvm-svn: 169614
OpenPOWER on IntegriCloud