search for: stringref

Displaying 20 results from an estimated 1039 matches for "stringref".

2016 Sep 25
8
Is it time to allow StringRef to be constructed from nullptr?
While porting LLDB over to StringRef, I am continuously running into difficulties caused by the fact that StringRef cannot be constructed from nullptr. So I wanted to see peoples' thoughts on removing this restriction from StringRef. To be clear, I'm only using LLDB as a motivating example, but I'm not requesting that it...
2020 Apr 16
4
ORC Assertion failure
...c::RTDyldObjectLinkingLayer::onObjLoad(unsigned __int64 K, llvm::orc::MaterializationResponsibility & R, llvm::object::ObjectFile & Obj, std::unique_ptr<llvm::RuntimeDyld::LoadedObjectInfo,std::default_delete<llvm::RuntimeDyld::LoadedObjectInfo>> LoadedObjInfo, std::map<llvm::StringRef,llvm::JITEvaluatedSymbol,std::less<llvm::StringRef>,std::allocator<std::pair<llvm::StringRef const ,llvm::JITEvaluatedSymbol>>> Resolved, std::set<llvm::StringRef,std::less<llvm::StringRef>,std::allocator<llvm::StringRef>> & InternalSymbols) Line 232 C+...
2016 Sep 25
3
Is it time to allow StringRef to be constructed from nullptr?
...5, 2016, at 1:49 PM, Mehdi Amini via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >> >> On Sep 25, 2016, at 9:10 AM, Zachary Turner via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >> >> While porting LLDB over to StringRef, I am continuously running into difficulties caused by the fact that StringRef cannot be constructed from nullptr. So I wanted to see peoples' thoughts on removing this restriction from StringRef. To be clear, I'm only using LLDB as a motivating example, but I'm not requesting that it...
2016 Sep 26
2
Is it time to allow StringRef to be constructed from nullptr?
...o a microoptimization. -Chris > On Sep 25, 2016, at 10:49 AM, Mehdi Amini via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > >> On Sep 25, 2016, at 9:10 AM, Zachary Turner via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> While porting LLDB over to StringRef, I am continuously running into difficulties caused by the fact that StringRef cannot be constructed from nullptr. So I wanted to see peoples' thoughts on removing this restriction from StringRef. To be clear, I'm only using LLDB as a motivating example, but I'm not requesting that it...
2016 Nov 28
3
RFC: Constructing StringRefs at compile time
The fact that the templatized constructor falls down because of the possibility of initializing StringRef with a stack-allocated char array kills that idea in my mind. I feel like the only two reasonable solutions are 1) allow UDL for this case, document that this is an exception and that UDLs are still not permitted anywhere else, and require (by policy, since I don't know of a way to have the c...
2016 Apr 18
2
Redundant Twine->StringRef->Twine conversions in llvm::sys::fs::make_absolute?
llvm::sys::fs::make_absolute converts its first parameter (const Twine &current_directory) to StringRef p(path.data(), path.size()), and then passes that StringRef to several functions (path::has_root_directory, path::has_root_name, and path::append) that accept Twines as parameters. Since llvm::StringRef can implicitly convert to an llvm::Twine, p converts to a bunch of Twine temporaries. In a few...
2017 Jun 14
2
Using LLD to create a .lib from a .def
I'm copying some LLD code into my codebase like this: // workaround for LLD not exposing ability to convert .def to .lib #include <set> namespace lld { namespace coff { class SymbolBody; class StringChunk; struct Symbol; struct Export { StringRef Name; // N in /export:N or /export:E=N StringRef ExtName; // E in /export:E=N SymbolBody *Sym = nullptr; uint16_t Ordinal = 0; bool Noname = false; bool Data = false; bool Private = false; // If an export is a form of /export:foo=dllname.bar, that means // that foo should...
2012 Nov 06
2
[LLVMdev] [PATCH] basic reading reloc visitor for x86_64 ELF
...Context.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -15,6 +15,7 @@ #ifndef LLVM_DEBUGINFO_DICONTEXT_H #define LLVM_DEBUGINFO_DICONTEXT_H +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" @@ -89,6 +90,8 @@ public: } }; +typedef DenseMap<uint64_t, std::pair<uint8_t, int64_t> > RelocAddrMap; + class DIContext { public: virtual ~DIContext(); @@ -100,7 +103,8 @@ public: StringRef aRangeSection = StringRef(),...
2010 Mar 01
1
[LLVMdev] Clang build problem
Just got clang from head and getting: ExprConstant.cpp: In function Obool TryEvaluateBuiltinNaN(clang::ASTContext&, clang::QualType, const clang::Expr*, bool, llvm::APFloat&)¹: ExprConstant.cpp:1578: error: no matching function for call to Ollvm::StringRef::getAsInteger(int, llvm::APInt&)¹ /home/neale/LLVM/llvm/include/llvm/ADT/StringRef.h:269: note: candidates are: bool llvm::StringRef::getAsInteger(unsigned int, long long int&) const /home/neale/LLVM/llvm/include/llvm/ADT/StringRef.h:270: note: bool llvm::StringRef::getAsInteger(unsigned in...
2013 Jul 05
0
[LLVMdev] Any suggestion for "Unknown instruction type encountered" error?
hacker cling wrote: > Hello all, > I was playing with LLVM pass. I changed the > lib/Transforms/Hello/Hello.cpp 's content to be my own pass. Then I make > install the pass and use an example test1.c to see whether it works or > not. When I run example using the following command: > clang -emit-llvm test1.c -c -o test1.bc > opt -load
2016 Nov 24
3
RFC: Constructing StringRefs at compile time
Hi all, There is a desire to be able to create constexpr StringRefs to avoid static initializers for global tables of/containing StringRefs. Creating constexpr StringRefs isn't trivial as strlen isn't portably constexpr and std::char_traits<char>::length is only constexpr in C++17. Alp Toker tried to create constexpr StringRefs for strings literals...
2017 Jun 15
2
Using LLD to create a .lib from a .def
...// workaround for LLD not exposing ability to convert .def to .lib >> >> #include <set> >> >> namespace lld { >> namespace coff { >> >> class SymbolBody; >> class StringChunk; >> struct Symbol; >> >> struct Export { >> StringRef Name; // N in /export:N or /export:E=N >> StringRef ExtName; // E in /export:E=N >> SymbolBody *Sym = nullptr; >> uint16_t Ordinal = 0; >> bool Noname = false; >> bool Data = false; >> bool Private = false; >> >> // If an export...
2013 Jul 05
2
[LLVMdev] Any suggestion for "Unknown instruction type encountered" error?
Hello all, I was playing with LLVM pass. I changed the lib/Transforms/Hello/Hello.cpp 's content to be my own pass. Then I make install the pass and use an example test1.c to see whether it works or not. When I run example using the following command: clang -emit-llvm test1.c -c -o test1.bc opt -load ../build_llvm/Debug+Asserts/lib/LLVMHello.so -hello < test1.bc > /dev/null It
2016 Nov 25
5
RFC: Constructing StringRefs at compile time
On 24 November 2016 at 15:04, Hal Finkel <hfinkel at anl.gov> wrote: >> Creating constexpr StringRefs isn't trivial as strlen isn't portably >> constexpr and std::char_traits<char>::length is only constexpr in >> C++17. > > Why don't we just create our own traits class that has a constexpr length, and then we can switch over to the standard one when we switch to...
2018 Nov 11
3
A stage2 build causes changes to libllvm impacting program using it (exemple: rustc)
...now happening when the systems saw their libllvm upgraded to the stage2 bootstrap one. The beginning of the backtrace is the following (generating debug info): Thread 1 "rustc" received signal SIGSEGV, Segmentation fault. 0x00007ffff1e273bc in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1 (gdb) bt #0 0x00007ffff1e273bc in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1 #1 0x00007ffff1f654c9 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1 #2 0x00007ffff1f65491 in llvm::M...
2011 Jul 26
1
[LLVMdev] Correct use of StringRef and Twine
...very least, again, if we did do >>> better, we could go back & remove TwineString & again fix all the >>> places that fail to compile with whatever new hotness we invent) >> >> This definitely seems like a step forward. While it is kinda gross, a subclass of StringRef is probably the lowest friction path to do this. > > Come to think of it - is there any use for StringRef other than as > function arguments? StringRef is useful for other things, for example the parsing logic in ReadCheckFile in utils/FileCheck.cpp uses it effectively. It really wants...
2016 Mar 23
4
UBSan, StringRef and Allocator.h
Hi all (No idea if I have the correct audience. Please CC more people as needed). I have an UBSan failure in BumpPtrAllocatorImpl.Allocate. The problem is that lld requests that we StringRef::copy an empty string. This passes a length of 0 to a BumpPtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore re...
2017 Apr 28
4
How to pass a StringRef to a function call inserted as instrumentation?
I am wriitng an LLVM pass to insert instrumentation at certain points of the program. I want to pass the `StringRef` obtained from `getName()` as a parameter to a function `func(char* s)`. I can allocate some space on stack using `AllocaInst` to generate an `alloca` instruction. But, how can I copy the `StringRef` to the stack space? -- Thanks & Regards, Dipanjan -------------- next part -------------- An...
2011 Jul 18
3
[LLVMdev] Correct use of StringRef and Twine
I'm attempting to do some amount of mass migration from const std::string& (& const char*) to StringRef. In doing so I stumbled across the fact that while StringRef has no op+ to speak of (well, it has += and I added a manual StringRef+std::string and std::string+StringRef for now - though I'm thinking perhaps they can be skipped in favor of Twine operations), Twine does provide a variety of hand...
2011 Feb 24
2
[LLVMdev] Valgrind memcheck errors in llvm
.../usr/lib/libstdc++.so.6.0.14) ==24227== by 0x40D5C50: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned int, std::allocator<char> const&) (in /usr/lib/libstdc++.so.6.0.14) ==24227== by 0x97074CE: llvm::StringRef::str() const (StringRef.h:159) ==24227== by 0x970750E: llvm::StringRef::operator std::string() const (StringRef.h:176) ==24227== by 0x9D22519: llvm::Module::Module(llvm::StringRef, llvm::LLVMContext&) (Module.cpp:61) ==24227== by 0x99FCD1D: llvm::getLazyBitcodeModule(llvm::Memory...