aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 9f35918..354939a 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -36,7 +36,7 @@ using namespace CodeGen;
CodeGenFunction::CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext)
: CodeGenTypeCache(cgm), CGM(cgm), Target(cgm.getTarget()),
Builder(cgm.getModule().getContext(), llvm::ConstantFolder(),
- CGBuilderInserterTy(this)),
+ CGBuilderInserterTy(this)), CurFn(nullptr),
CapturedStmtInfo(nullptr), SanOpts(&CGM.getLangOpts().Sanitize),
IsSanitizerScope(false), CurFuncIsThunk(false), AutoreleaseResult(false),
SawAsmBlock(false), BlockInfo(nullptr), BlockPointer(nullptr),
@@ -565,6 +565,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
const FunctionArgList &Args,
SourceLocation Loc,
SourceLocation StartLoc) {
+ assert(!CurFn &&
+ "Do not use a CodeGenFunction object for more than one function");
+
const Decl *D = GD.getDecl();
DidCallStackSave = false;