search for: smdiagnostic

Displaying 20 results from an estimated 61 matches for "smdiagnostic".

Did you mean: diagnostic
2016 Nov 20
3
uninitialized values in Attributes.cpp
...:LLParser::ParseDeclare() (LLParser.cpp:444) ==29299== by 0x1CCC15A: llvm::LLParser::ParseTopLevelEntities() (LLParser.cpp:276) ==29299== by 0x1CCBFBF: llvm::LLParser::Run() (LLParser.cpp:74) ==29299== by 0x1CC59D8: llvm::parseAssemblyInto(llvm::MemoryBufferRef, llvm::Module&, llvm::SMDiagnostic&, llvm::SlotMapping*) (Parser.cpp:31) ==29299== by 0x1CC5C16: llvm::parseAssembly(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*) (Parser.cpp:41) ==29299== by 0x158C59E: llvm::parseIR(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMC...
2016 Nov 20
3
uninitialized values in Attributes.cpp
...4) >> ==29299== by 0x1CCC15A: llvm::LLParser::ParseTopLevelEntities() >> (LLParser.cpp:276) >> ==29299== by 0x1CCBFBF: llvm::LLParser::Run() (LLParser.cpp:74) >> ==29299== by 0x1CC59D8: llvm::parseAssemblyInto(llvm::MemoryBufferRef, >> llvm::Module&, llvm::SMDiagnostic&, llvm::SlotMapping*) (Parser.cpp:31) >> ==29299== by 0x1CC5C16: llvm::parseAssembly(llvm::MemoryBufferRef, >> llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*) (Parser.cpp:41) >> ==29299== by 0x158C59E: llvm::parseIR(llvm::MemoryBufferRef, >> ll...
2013 Jul 29
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...4 llc 0x00000000014489b7 llvm::Module::MaterializeAllPermanently(std::string*) + 29 15 llc 0x00000000006c367b llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) + 93 16 llc 0x0000000000679302 llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, llvm::LLVMContext&) + 214 17 llc 0x000000000067958a llvm::ParseIRFile(std::string const&, llvm::SMDiagnostic&, llvm::LLVMContext&) + 374 18 llc 0x00000000006680f4 19 llc 0x0000000000668fed main + 199 20 libc.so.6 0x000000332fa1d994 __l...
2013 Aug 02
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...dule::MaterializeAllPermanently(std::string*) + 29 >> 15 llc 0x00000000006c367b >> llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, >> std::string*) + 93 >> 16 llc 0x0000000000679302 >> llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, >> llvm::LLVMContext&) + 214 >> 17 llc 0x000000000067958a llvm::ParseIRFile(std::string >> const&, llvm::SMDiagnostic&, llvm::LLVMContext&) + 374 >> 18 llc 0x00000000006680f4 >> 19 llc 0x0000000000668fed main +...
2011 Feb 04
1
[LLVMdev] PareAssemblyFile returning "expected top-level entity" error message
Hello all, I am trying to generate a module object using something like this: (to use for code analysis) Module *topModule; SMDiagnostic error; topModule = ParseAssemblyFile("code.s", error, getGlobalContext()); displayErrorInfo(error); void displayErrorInfo(SMDiagnostic& err) { std::string errFileName = err.getFilename(); std::string errMsg = err.getMessage(); std::string errLineContents = err.get...
2012 Oct 22
2
[LLVMdev] Reading IR from a std::ostream
Previously I had asked how to write then read back IR to/from a file. The write code looked like: LLVMContext ctx; SMDiagnostic diag; Module *m = ParseIRFile( "my_file", diag, ctx ); However, the code I'm trying to retrofit LLVM IR into passes me just a std::ostream&. How can I read IR from a std::ostream? I figured out how to use raw_os_ostream to adapt a std::ostream to a raw_ostream for writing a...
2013 Aug 02
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...4489b7 > llvm::Module::MaterializeAllPermanently(std::string*) + 29 > 15 llc 0x00000000006c367b > llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, > std::string*) + 93 > 16 llc 0x0000000000679302 > llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, > llvm::LLVMContext&) + 214 > 17 llc 0x000000000067958a llvm::ParseIRFile(std::string > const&, llvm::SMDiagnostic&, llvm::LLVMContext&) + 374 > 18 llc 0x00000000006680f4 > 19 llc 0x0000000000668fed main + 199 > 20 libc.so....
2013 Aug 09
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...Permanently(std::string*) + 29 >>> 15 llc 0x00000000006c367b >>> llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, >>> std::string*) + 93 >>> 16 llc 0x0000000000679302 >>> llvm::ParseIR(llvm::MemoryBuffer*, llvm::SMDiagnostic&, >>> llvm::LLVMContext&) + 214 >>> 17 llc 0x000000000067958a llvm::ParseIRFile(std::string >>> const&, llvm::SMDiagnostic&, llvm::LLVMContext&) + 374 >>> 18 llc 0x00000000006680f4 >>> 19 llc 0x0000...
2018 Jun 12
2
Proper method to initialize all LLVM Internal Data Structures?
Hi: I'm building a small tool on top of LLVM Core Library. ``` LLVMContext context; SMDiagnostic diag; Module *M = parseIRFile(InputIR, diag, context).get(); if (M == nullptr) { diag.print("LLVM", errs()); exit(-1); } assert(M->isMaterialized() && "Module not materialized!"); PointerType *ArrayPtrTy = M->getTypeByName("struct._Array&...
2009 Jul 20
1
[LLVMdev] Got a "corrupted double-linked list" error?
...works,however,when I do nothing on the disassembled bitcode file,everything is OK, After debugged,I found the error line is "MemoryBuffer *F = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), &ErrorStr);" in the "Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,LLVMContext &Context)" function, I don't know the reason,anyone once got the similar trouble? Thanks
2010 Aug 19
1
[LLVMdev] questions about context
Hi, I am trying to load another bytecode file in one pass. I checked the opt.cpp, it uses following to load a bytecode file: ... LLVMContext &Context = getGlobalContext(); ... SMDiagnostic Err; // Load the input module... std::auto_ptr<Module> M; M.reset(ParseIRFile(InputFilename, Err, Context)); ... My question is in the runOnModule method where I want to load another bytecode file, what context should I use? Is getGlobalContext() still OK? Thanks, Guoliang
2011 Dec 29
2
[LLVMdev] How to free memory of JIT'd function
...ne shed light on this please? Here is the code. int main(int argc, char **argv) { InitializeNativeTarget(); LLVMContext Context; Module *M = new Module("test", Context); ExecutionEngine* EE = llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); while (true) { SMDiagnostic error; ParseAssemblyString("define i32 @factorial(i32 %X) nounwind uwtable {\n" " %1 = alloca i32, align 4\n" " %2 = alloca i32, align 4\n" " store i32 %X, i32* %2, align 4\n"...
2015 Mar 20
2
[LLVMdev] LLVM Exception Handling
...includes here.... static void test() { throw 1; } int main(int, const char **) { llvm::InitializeNativeTarget(); llvm::InitializeNativeTargetAsmPrinter(); llvm::InitializeNativeTargetAsmParser(); llvm::LLVMContext &Context = llvm::getGlobalContext(); llvm::SMDiagnostic Err; std::unique_ptr<llvm::Module> Mod = llvm::parseIRFile("test.ll", Err, Context); std::string triple = llvm::sys::getProcessTriple(); Mod->setTargetTriple(triple); llvm::Function* f = Mod->getFunction("exec"); llvm::TargetOptions Opts;...
2018 Dec 09
2
Parse LLVM IR
...ing code: #include <llvm/IR/Module.h> #include <llvm/IRReader/IRReader.h> #include <llvm/IR/LLVMContext.h> #include <llvm/Support/SourceMgr.h> #include <iostream> #include <llvm/Support/raw_ostream.h> using namespace llvm; int main() { LLVMContext context; SMDiagnostic error; Module *m = parseIRFile("t.ll", error, context).get(); if(!m) { return 0; } std::cout << error.getMessage().str() << std::endl; std::cout << sizeof(m->getFunctionList()) << std::endl; auto iter1 = m->getFunctionList().begin(); std::...
2016 Mar 23
2
Help with pass manager
...module. It compiles without any problems. But program crashes when it reaches add() method of the pass manager. Can you help me figuring out what’s the problem please? here is my function int moduleToObjectFile(llvm::Module *module, std::string &srcname, llvm::LLVMContext &Context) { SMDiagnostic error; Triple moduletriple = Triple(module->getTargetTriple()); if (moduletriple.getTriple().empty()) moduletriple.setTriple(sys::getDefaultTargetTriple()); std::string lookuperror; const Target *moduletarget = TargetRegistry::lookupTarget(MArch, moduletriple, l...
2012 Jan 05
0
[LLVMdev] How to free memory of JIT'd function
...t; int main(int argc, char **argv) { >   InitializeNativeTarget(); > >   LLVMContext Context; > >   Module *M = new Module("test", Context); >   ExecutionEngine* EE = > llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); > >   while (true) { >     SMDiagnostic error; >     ParseAssemblyString("define i32 @factorial(i32 %X) nounwind uwtable {\n" >                         "  %1 = alloca i32, align 4\n" >                         "  %2 = alloca i32, align 4\n" >                         "  store i32 %X, i32* %2,...
2016 Sep 14
2
setDataLayout segfault
...an make a copy of the unique_ptr before moving it into the builder's constructor and use the copy later on. It is confusing to require a unique_ptr. Frank On 09/14/2016 12:11 PM, Frank Winter via llvm-dev wrote: > I am constructing the engine builder in the following way: > > llvm::SMDiagnostic Err; > unique_ptr<Module> Mod = getLazyIRFileModule("f.ll", Err, TheContext); > llvm::EngineBuilder engineBuilder(std::move(Mod)); > > However, after moving the pointer to the constructor it is no longer > retrievable from the unique_ptr object. > > Mod.get()-&...
2016 Sep 14
4
setDataLayout segfault
I get a segfault with this code when setting the data layout: int main(int argc, char** argv) { llvm::InitializeNativeTarget(); llvm::LLVMContext TheContext; unique_ptr<Module> Mod(new Module("A",TheContext)); llvm::EngineBuilder engineBuilder(std::move(Mod)); std::string mcjit_error; engineBuilder.setMCPU(llvm::sys::getHostCPUName());
2012 Jan 10
1
[LLVMdev] How to free memory of JIT'd function
...nitializeNativeTarget(); > > > >   LLVMContext Context; > > > >   Module *M = new Module("test", Context); > >   ExecutionEngine* EE = > > llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); > > > >   while (true) { > >     SMDiagnostic error; > >     ParseAssemblyString("define i32 @factorial(i32 %X) nounwind > >     uwtable {\n" > >                         "  %1 = alloca i32, align 4\n" > >                         "  %2 = alloca i32, align 4\n" > >                      ...
2012 Dec 27
1
[LLVMdev] Throwing an exception from JITed code, and catching in C++
.../Module.h" #include "llvm/ExecutionEngine/JIT.h" #include "llvm/Support/IRReader.h" #include "llvm/Support/TargetSelect.h" #include using namespace llvm; int main(int, char**) { LLVMContext& context = getGlobalContext(); InitializeNativeTarget(); SMDiagnostic error; Module* m = ParseIRFile("./thrower.s.bc", error, context); if (!m) { printf("could not load module\n"); return 1; } ExecutionEngine* ee = ExecutionEngine::create(m); if (!ee) { printf("could not create execution en...