search for: getasinteg

Displaying 20 results from an estimated 24 matches for "getasinteg".

Did you mean: getasinteger
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 int, long long...
2013 Sep 24
2
[LLVMdev] LLD: Returning true on success
...to indicate success, not sure how widespread this is. Personally I think that { if (doSomething()) } means if doSomething succeeded, and thus agree with you. However, I think this is something that needs to be consistent across all of LLVM and should be in the coding standard. > > StringRef::getAsInteger() is an example documented to return true if there was an error parsing the string. > > I think it makes a lot of sense in this case. The idea is that you increase indentation in the "error" case. Consider parsing 2 numbers and returning their sum: > > if (S1.getAsIntege...
2013 Sep 24
3
[LLVMdev] LLD: Returning true on success
...use false to indicate success, not sure how widespread this is. Personally I think that { if (doSomething()) } means if doSomething succeeded, and thus agree with you. However, I think this is something that needs to be consistent across all of LLVM and should be in the coding standard. StringRef::getAsInteger() is an example documented to return true if there was an error parsing the string. Mapping success/error onto a bool will always be ambiguous. Is there some better pattern? -Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipe...
2013 Sep 24
0
[LLVMdev] LLD: Returning true on success
...sure how > widespread this is. Personally I think that { if (doSomething()) } means if > doSomething succeeded, and thus agree with you. However, I think this is > something that needs to be consistent across all of LLVM and should be in > the coding standard. > > > StringRef::getAsInteger() is an example documented to return true if there > was an error parsing the string. > I think it makes a lot of sense in this case. The idea is that you increase indentation in the "error" case. Consider parsing 2 numbers and returning their sum: if (S1.getAsInteger(16, Result...
2013 May 02
4
[LLVMdev] int to StringRed conversion
Hello everyone, I have an integer and I want to convert it to StringRef in order to set metadata. setMetadata->(StringRef, MDNode*); It is there a native LLVM way to do it? 1. In the llvm::APSInt Class is toString() method, which seems it is not for this purpose 2. itoa and string are not part of LLVM 3. stringstream is not part of LLVM 4. to_string is not part of LLVM 5. any casting method?
2013 Sep 25
0
[LLVMdev] LLD: Returning true on success
...d this is. Personally I think that { if (doSomething()) } means if >> doSomething succeeded, and thus agree with you. However, I think this is >> something that needs to be consistent across all of LLVM and should be in >> the coding standard. >> >> >> StringRef::getAsInteger() is an example documented to return true if >> there was an error parsing the string. >> > > I think it makes a lot of sense in this case. The idea is that you > increase indentation in the "error" case. Consider parsing 2 numbers and > returning their sum: >...
2013 May 02
0
[LLVMdev] int to StringRed conversion
Hi, I think you may try to use llvm::Twine(int). For example, to convert 30 to string, you can use: Twine(30).str() To convert the string back to integer, you can try the StringRef::getAsInteger(unsigned, APInt &). For example: APInt i; str.getAsInteger(/*radix=*/ 10, /*output=*/ i); Sincerely, Logan On Thu, May 2, 2013 at 9:53 PM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Hello everyone, > > I have an integer and I want to con...
2016 Dec 19
2
[lld] RFC: Finding shared libraries on OpenBSD
...ement(EC)) { + StringRef FilePath = LI->path(); + StringRef FileName = path::filename(FilePath); + if (!(FileName.startswith(LibName))) + continue; + std::pair<StringRef, StringRef> MajMin = + FileName.substr(LibName.size()).split('.'); + int Maj, Min; + if (MajMin.first.getAsInteger(10, Maj) || Maj < 0) + continue; + if (MajMin.second.getAsInteger(10, Min) || Min < 0) + continue; + if (Maj > MaxMaj) + MaxMaj = Maj, MaxMin = Min; + if (MaxMaj == Maj && Min > MaxMin) + MaxMin = Min; + } + if (MaxMaj >= 0) + return findFile(Dir, LibName...
2013 May 02
2
[LLVMdev] int to StringRed conversion
...>>>> I think you may try to use llvm::Twine(int). For example, to convert >>>> 30 to string, you can use: >>>> >>>> Twine(30).str() >>>> >>>> To convert the string back to integer, you can try the >>>> StringRef::getAsInteger(unsigned, APInt &). For example: >>>> >>>> APInt i; >>>> str.getAsInteger(/*radix=*/ 10, /*output=*/ i); >>>> >>>> Sincerely, >>>> Logan >>>> >>>> >>>> >>>> On Thu, May 2,...
2017 Jul 19
2
error:Ran out of lanemask bits to represent subregisterr
...t; kparzysz at codeaurora.org> wrote: > It is possible that you have more than 64 lanes. In such case you would > need to reimplement LaneBitmask with a larger underlying type. Most of the > functionality is already localized to the header file, the only exception > may be the "getAsInteger" function. It shouldn't be too hard to fix up the > uses to deal with a different underlying type. > > -Krzysztof > > > On 7/19/2017 2:56 PM, hameeza ahmed wrote: > >> As you mentioned i changed 32 to 64 but now some new errors come which >> require to ch...
2017 Jul 19
2
error:Ran out of lanemask bits to represent subregisterr
...gt;>> If you have a large number of lanes, you will need to replace it with a >>> type that can contain as many independent bits as you need (BitVector would >>> be an ultimate solution). You may run into some problems with the uses of >>> the member function "getAsInteger", but you can change those to something >>> equivalent according to the type you use. >>> >>> -Krzysztof >>> >>> >>> On 7/19/2017 3:51 AM, hameeza ahmed wrote: >>> >>>> Hello, >>>> Mr. krzysztof I have see...
2016 Dec 20
0
[lld] RFC: Finding shared libraries on OpenBSD
...Ref FileName = path::filename(FilePath); > + if (!(FileName.startswith(LibName))) > + continue; > + std::pair<StringRef, StringRef> MajMin = > + FileName.substr(LibName.size()).split('.'); > + int Maj, Min; > + if (MajMin.first.getAsInteger(10, Maj) || Maj < 0) > + continue; > + if (MajMin.second.getAsInteger(10, Min) || Min < 0) > + continue; > + if (Maj > MaxMaj) > + MaxMaj = Maj, MaxMin = Min; > + if (MaxMaj == Maj && Min > MaxMin) > + MaxM...
2013 May 02
0
[LLVMdev] int to StringRed conversion
...t;>> Hi, >>> >>> I think you may try to use llvm::Twine(int). For example, to convert >>> 30 to string, you can use: >>> >>> Twine(30).str() >>> >>> To convert the string back to integer, you can try the >>> StringRef::getAsInteger(unsigned, APInt &). For example: >>> >>> APInt i; >>> str.getAsInteger(/*radix=*/ 10, /*output=*/ i); >>> >>> Sincerely, >>> Logan >>> >>> >>> >>> On Thu, May 2, 2013 at 9:53 PM, Alexandru Ionut Diacon...
2013 May 02
0
[LLVMdev] int to StringRed conversion
...nk you may try to use llvm::Twine(int). For example, to >>>>> convert 30 to string, you can use: >>>>> >>>>> Twine(30).str() >>>>> >>>>> To convert the string back to integer, you can try the >>>>> StringRef::getAsInteger(unsigned, APInt &). For example: >>>>> >>>>> APInt i; >>>>> str.getAsInteger(/*radix=*/ 10, /*output=*/ i); >>>>> >>>>> Sincerely, >>>>> Logan >>>>> >>>>> >>>>&...
2017 Jul 19
2
error:Ran out of lanemask bits to represent subregisterr
...e associated member functions. > If you have a large number of lanes, you will need to replace it with a > type that can contain as many independent bits as you need (BitVector would > be an ultimate solution). You may run into some problems with the uses of > the member function "getAsInteger", but you can change those to something > equivalent according to the type you use. > > -Krzysztof > > > On 7/19/2017 3:51 AM, hameeza ahmed wrote: > >> Hello, >> Mr. krzysztof I have seen similar question asked by you on llvm group. >> Could you please...
2017 Jul 19
2
error:Ran out of lanemask bits to represent subregisterr
Hello, Mr. krzysztof I have seen similar question asked by you on llvm group. Could you please help me here to address this issue. i am trying to construct a register of size 65536 bit by combining 2 registers of 32768 bits. both the 32768 bit registers are different so i have to use the following method let SubRegIndices = [sub_32768bit, sub_32768bit_hi], CoveredBySubRegs = 1 in but i am
2017 Jul 19
2
error:Ran out of lanemask bits to represent subregisterr
...> > > It is possible that you have more than 64 lanes. In such case you > > would need to reimplement LaneBitmask with a larger underlying type. > > Most of the functionality is already localized to the header file, > > the only exception may be the "getAsInteger" function. It shouldn't > > be too hard to fix up the uses to deal with a different underlying > type. > > > > -Krzysztof > > > > > > On 7/19/2017 2:56 PM, hameeza ahmed wrote: > > > > As you mentioned i changed 32 to...
2013 Nov 15
5
[LLVMdev] [PATCH] Prevent clang from throwing the diagnostics twice.
Hi All, Clang pop up with the "error: invalid integral value" diagnostics twice ,when you enable the optimization through -O with a non-integer value i.e -O<non integer> as show below $ clang -Of -S test.c error: invalid integral value 'f' in '-Of' error: invalid integral value 'f' in '-Of' Attached patch fix the issue as $ clang -Of -S
2013 Sep 24
0
[LLVMdev] LLD: Returning true on success
On Tue, Sep 24, 2013 at 12:33 PM, Rui Ueyama <ruiu at google.com> wrote: > Hi LLD developers, > > I'm about to make a change to invert the return value of Driver::parse() > to return true on success. Currently it returns false on success. > > In many other functions, we return true to indicate success and false to > indicate failure. The inconsistency is confusing,
2013 Sep 24
5
[LLVMdev] LLD: Returning true on success
Hi LLD developers, I'm about to make a change to invert the return value of Driver::parse() to return true on success. Currently it returns false on success. In many other functions, we return true to indicate success and false to indicate failure. The inconsistency is confusing, and fixing it should improve code readability. -------------- next part -------------- An HTML attachment was