search for: isexternal

Displaying 20 results from an estimated 37 matches for "isexternal".

2005 Feb 20
0
[LLVMdev] HowToUseJIT: failed assertion on PPC/Mac OS X
On Feb 20, 2005, at 11:12, Evan Jones wrote: > I can "fix" it by changing JITResolver::getFunctionStub to use > F->isExternal() instead of F->hasExternalLinkage(). However, this then > breaks when calling *real* external functions (native code). I obviously should not post to mailing lists before I've eaten. With my "fix" I get an assertion when taking an address of a function, not with native code...
2007 Mar 07
1
[LLVMdev] Function::isExternal()
There used to be a method in Function called isExternal() that you could call to check if a function is external. That method seems to be removed. What method should now be called to check if a function isExternal? Regards, Ryan -- Ryan M. Lefever [http://www.ews.uiuc.edu/~lefever]
2005 Feb 20
3
[LLVMdev] HowToUseJIT: failed assertion on PPC/Mac OS X
...ot;, and it is marked as "Linkage = ExternalLinkage". The code uses F->hasExternalLinkage() to decide if the function is external or not. This returns true, so instead of emitting a stub, it calls TheJIT->getPointerToFunction. In TheJIT->getPointerToFunction, it uses F->isExternal() to decide if it should run the JIT or not. This returns false, so it decides to run the JIT, which causes the assertion. I can "fix" it by changing JITResolver::getFunctionStub to use F->isExternal() instead of F->hasExternalLinkage(). However, this then breaks when calli...
2007 Mar 07
0
[LLVMdev] Function::isExternal()
Hello, Ryan. > There used to be a method in Function called isExternal() that you could > call to check if a function is external. That method seems to be > removed. What method should now be called to check if a function > isExternal? It's now isDeclaration(). -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint...
2005 Jan 06
1
[LLVMdev] Folding cast of a global address to boolean
...of external symbols should not happen, but I don't understand the rationale for this. // FIXME: When we support 'external weak' references, we have to prevent // this transformation from happening. In the meantime we avoid folding // any cast of an external symbol. if (!GV->isExternal()) return ConstantBool::True; This particular transformation is quite important for me because I have some symbols which are either ConstantPointerNull or a GlovalVariable depending on which context the program is compiled in. This is used to implement a kind of conditional compilation,...
2004 Jun 17
2
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
...thod, which returns GlobalValue*. Wouldn'it it be better is MO_GlobalAddress be called MO_GlobalValue, for consistency? Second, MO_ExternalSymbol is used for storing name of external variable/function, right? Why it's not possible to use MO_GlobalAddress, where returned GlobalValue* has isExternal set to true? The GlobalValue::getName would return the name of the symbol. - Volodya
2005 Jul 03
4
[LLVMdev] How do you determine whether a function is definedexternally to a module ?
> Something like this should work: > > for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F) > if (F->isExternal()) > ... Function* F is external! ... This is not working. For some reason there is a BasicBlock present on undefined functions ! I am compiling the examples from llvm/test/feature, about 28 out of 34 assemble fine. Just cannot seem to get the externals listed, been trying for several h...
2018 Jun 07
2
[lld] ObjFile::createRegular is oblivious of PendingComdat
...s an illegal pointer dereference). The following patch fixes the crash: diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp index 9e2345b0a..f47d612df 100644 --- a/COFF/InputFiles.cpp +++ b/COFF/InputFiles.cpp @@ -229,11 +229,11 @@ Symbol *ObjFile::createRegular(COFFSymbolRef Sym) { if (Sym.isExternal()) { StringRef Name; COFFObj->getSymbolName(Sym, Name); - if (SC) + if (SC && SC != PendingComdat) return Symtab->addRegular(this, Name, Sym.getGeneric(), SC); return Symtab->addUndefined(Name, this, false); } - if (SC) + if (SC && SC != Pen...
2004 Jun 17
0
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
...to a simpler interface. In this particular case I don't think it's super important to make the change. > Second, MO_ExternalSymbol is used for storing name of external > variable/function, right? Why it's not possible to use MO_GlobalAddress, > where returned GlobalValue* has isExternal set to true? The > GlobalValue::getName would return the name of the symbol. Using the GlobalValue is certainly the preferred way if you have it. MO_ExternalSymbol should only be used for functions that might not actually exist in the LLVM module for the function. In particular, this would inc...
2004 Jun 24
3
[LLVMdev] Pass vs. FunctionPass
...takes PassManger and addPassesToJITCompile takes FunctionPassManager. Another question is about FunctionPassManager::run(Function&) and FunctionPass(Function&). The former calls the later, which is fine, but the latter looks like this: bool FunctionPass::run(Function &F) { if (F.isExternal()) return false;// Passes are not run on external functions! return doInitialization(*F.getParent()) | runOnFunction(F) | doFinalization(*F.getParent()); } So, with FunctionPassManager, doInitializaton will be called once for each function, which is strange, given that that method take...
2018 Jun 07
2
[lld] ObjFile::createRegular is oblivious of PendingComdat
...the crash: >> >> diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp >> index 9e2345b0a..f47d612df 100644 >> --- a/COFF/InputFiles.cpp >> +++ b/COFF/InputFiles.cpp >> @@ -229,11 +229,11 @@ Symbol *ObjFile::createRegular(COFFSymbolRef Sym) { >> if (Sym.isExternal()) { >> StringRef Name; >> COFFObj->getSymbolName(Sym, Name); >> - if (SC) >> + if (SC && SC != PendingComdat) >> return Symtab->addRegular(this, Name, Sym.getGeneric(), SC); >> return Symtab->addUndefined(Name, this,...
2004 Jun 18
3
[LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
Chris Lattner wrote: > > Second, MO_ExternalSymbol is used for storing name of external > > variable/function, right? Why it's not possible to use MO_GlobalAddress, > > where returned GlobalValue* has isExternal set to true? The > > GlobalValue::getName would return the name of the symbol. > > Using the GlobalValue is certainly the preferred way if you have it. > MO_ExternalSymbol should only be used for functions that might not > actually exist in the LLVM module for the function. In pa...
2002 Oct 06
0
[LLVMdev] Follow-up on global variable change
...ccepts both "uninitialized" and "external" global variables, they both mean the exact same thing. 2. The LLVM writer now emits "external" instead of "uninitialized". 3. The "feature" tests now test for both forms. 4. I added a new GlobalVariable::isExternal() method to mirror the semantics of the Function::isExternal() method The old "uninitialized" modifier can officially be considered deprecated, but it is unlikely to go away any time soon. It requires very little code (one line) to support, and we probably have a bunch of testcases t...
2005 Jul 03
2
[LLVMdev] How do you determine whether a function is defined externally to a module ?
How do you determine whether a function is defined externally ? Basically I want a list of external functions but cannot seem to get one. e.g. I want to create the following list for a module EXTERN _printf : NEAR EXTERN _malloc : NEAR EXTERN _an_external_fn : NEAR I have tried all the obvious permutations but cannot seem to get only the extrnally defined symbols. Help, Aaron --------------
2005 Jul 03
0
[LLVMdev] How do you determine whether a function is defined externally to a module ?
...: NEAR > EXTERN _malloc : NEAR > EXTERN _an_external_fn : NEAR > > I have tried all the obvious permutations but cannot seem to get only the extrnally defined symbols. Something like this should work: for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F) if (F->isExternal()) ... Function* F is external! ... If you take a look at the PowerPC asm printer, it has to do some special things for external functions as well, it might give you some ideas. -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
2005 Jul 03
1
[LLVMdev] How do you determine whether a functionisdefinedexternally to a module ?
...e::iterator I = M.begin(), E = M.end(); I != E; ++I) if ( !I->getIntrinsicID() && I->getEntryBlock().empty()) O << "EXTERN " << Mang->getValueName(I) << " : NEAR" << "\n"; Based upon :- virtual bool Function::isExternal() const { return BasicBlocks.empty(); } But it does not work either. Which means there must be a BasicBlock occuring on undefined/external functions. Anyway no hurry I am off to do other tasks for a day or so. Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL:...
2005 Jul 05
0
[LLVMdev] How do you determine whether a function is definedexternally to a module ?
On Sun, 3 Jul 2005, Aaron Gray wrote: >> Something like this should work: >> >> for (Module::iterator F = M->begin(), E = M->end(); F != E; ++F) >> if (F->isExternal()) >> ... Function* F is external! ... > > This is not working. For some reason there is a BasicBlock present on > undefined functions ! Which functions in particular are you not seeing? > I am compiling the examples from llvm/test/feature, about 28 out of 34 > assemble...
2007 Jan 22
0
[LLVMdev] addPassesToEmit(Whole)File changes?
...seless, so remove it now. sys::Path(OutputFilename).eraseFromDisk(); return 1; } Passes.doInitialization(); // Run our queue of passes all at once now, efficiently. for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I) if (!I->isExternal()) Passes.run(*I); Passes.doFinalization(); The doInitialization/doFinalization methods handle the global data. -Chris > This is my current code: > > -(void)dumpAssemblerToFile:(NSString*)filename > { > TargetMachine::CodeGenFileType FileType = TargetMachine::A...
2006 Dec 01
1
[LLVMdev] DSGraph::computeCalleeCallerMapping failing
...ted (core dumped) My code looks something like this: TDDataStructures &TDD = getAnalysis<TDDataStructures>(); for(unsigned int i=0;i<SCC.size();i++) // Go through the functions in the SCC { Function *fun = SCC[i]->getFunction(); if( fun == NULL || fun->isExternal() ) { MYWARN( true, "Encountered a null function pointer or external function\n" ); continue; } // Iterate over the instructions in the function for( inst_iterator instIt = inst_begin(fun); instIt!=inst_end(fun); instIt++ ) { if( CallInst *CI = dyn_c...
2004 Jun 24
0
[LLVMdev] Pass vs. FunctionPass
...allel on different threads at the same time. > Another question is about FunctionPassManager::run(Function&) and > FunctionPass(Function&). The former calls the later, which is fine, but the > latter looks like this: > > bool FunctionPass::run(Function &F) { > if (F.isExternal()) return false;// Passes are not run on external > functions! > > return doInitialization(*F.getParent()) | runOnFunction(F) > | doFinalization(*F.getParent()); > } > > So, with FunctionPassManager, doInitializaton will be called once for > each function, which is...