summaryrefslogtreecommitdiffstats
path: root/clang/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-02 06:27:33 +0000
committerChris Lattner <sabre@nondot.org>2007-12-02 06:27:33 +0000
commit41af8182d80e26c5c1f302b89c8de0007ea7df1d (patch)
treee033f055edac4a55d58c67bf614dde04e0995fc8 /clang/CodeGen/CodeGenModule.cpp
parentc5b3aab66bc3a08acc4c00aeeebc5799ad9e8e4f (diff)
downloadbcm5719-llvm-41af8182d80e26c5c1f302b89c8de0007ea7df1d.tar.gz
bcm5719-llvm-41af8182d80e26c5c1f302b89c8de0007ea7df1d.zip
implement codegen for functions whose function body type don't match
their prototype. llvm-svn: 44506
Diffstat (limited to 'clang/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/CodeGen/CodeGenModule.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenModule.cpp b/clang/CodeGen/CodeGenModule.cpp
index b76d5e35eef..51f758c5422 100644
--- a/clang/CodeGen/CodeGenModule.cpp
+++ b/clang/CodeGen/CodeGenModule.cpp
@@ -31,6 +31,18 @@ CodeGenModule::CodeGenModule(ASTContext &C, const LangOptions &LO,
: Context(C), Features(LO), TheModule(M), TheTargetData(TD), Diags(diags),
Types(C, M, TD), MemCpyFn(0), CFConstantStringClassRef(0) {}
+
+/// ReplaceMapValuesWith - This is a really slow and bad function that
+/// searches for any entries in GlobalDeclMap that point to OldVal, changing
+/// them to point to NewVal. This is badbadbad, FIXME!
+void CodeGenModule::ReplaceMapValuesWith(llvm::Constant *OldVal,
+ llvm::Constant *NewVal) {
+ for (llvm::DenseMap<const Decl*, llvm::Constant*>::iterator
+ I = GlobalDeclMap.begin(), E = GlobalDeclMap.end(); I != E; ++I)
+ if (I->second == OldVal) I->second = NewVal;
+}
+
+
llvm::Constant *CodeGenModule::GetAddrOfGlobalDecl(const ValueDecl *D) {
// See if it is already in the map.
llvm::Constant *&Entry = GlobalDeclMap[D];
OpenPOWER on IntegriCloud